![]() |
Skylicht Engine
|
A particle group that spawns particles from the positions of particles in a parent group. More...
#include <ParticleSystem/Particles/CSubGroup.h>
Public Member Functions | |
| CSubGroup (CGroup *group) | |
| void | initParticles () |
| Initializes internal born data for all emitters based on current parent particles. | |
| virtual void | OnParticleBorn (CParticle &p) |
| Callback when a parent particle is born. | |
| virtual void | OnParticleDead (CParticle &p) |
| Callback when a parent particle dies. | |
| virtual void | OnSwapParticleData (CParticle &p1, CParticle &p2) |
| Callback when parent particle data is swapped in the array. | |
| virtual void | OnGroupDestroy () |
| Callback when the parent group is destroyed. | |
| virtual void | updateLaunchEmitter () |
| Internal: updates launch emitters based on parent particles. | |
| virtual void | bornParticle () |
| Internal: spawns new particles at parent positions. | |
| virtual core::vector3df | getTransformPosition (const core::vector3df &pos) |
| Transforms position from parent local space to world space. | |
| virtual core::vector3df | getTransformVector (const core::vector3df &vec) |
| Transforms vector from parent local space to world space. | |
| void | setFollowParentTransform (bool b) |
| Enables/disables following the parent's movement. | |
| void | setEmitterWorldOrientation (bool b) |
| Sets emitter orientation mode. | |
| void | syncParentParams (bool life, bool color) |
| Configures synchronization of life and color from parent. | |
| CGroup * | getParentGroup () |
| Gets the parent group. | |
| virtual CObjectSerializable * | createSerializable () |
| Creates a serializable object for property editing or saving. | |
| virtual void | loadSerializable (CObjectSerializable *object) |
| Loads properties from a serializable object. | |
| Public Member Functions inherited from Skylicht::Particle::CGroup | |
| void | clearParticles () |
| Clears all active particles. | |
| void | clearImmortalParticles () |
| Clears only immortal particles. | |
| void | update () |
| Main update loop for particle physics and lifecycle. | |
| void | updateForRenderer () |
| Updates buffers for rendering. | |
| void | setGravityRotation (const core::vector3df &euler) |
| Sets gravity direction using euler rotation. | |
| void | setParticleRotation (const core::vector3df &euler) |
| Sets particle orientation using euler rotation. | |
| void | setParentWorldMatrix (const core::matrix4 &m) |
| Sets the parent entity's world matrix. | |
| void | setWorldMatrix (const core::matrix4 &m) |
| Sets the local-to-world transform of this group. | |
| const core::matrix4 & | getWorld () |
| Gets the world matrix of this group. | |
| const core::aabbox3df & | getBBox () |
| Gets the bounding box of all active particles. | |
| u32 | getNumParticles () |
| Gets current particle count. | |
| CParticle * | getParticlePointer () |
| Gets raw pointer to particle array. | |
| CEmitter * | addEmitter (CEmitter *e) |
| Adds an emitter to the group. | |
| std::vector< CEmitter * > & | getEmitters () |
| Gets all emitters. | |
| void | removeEmitter (CEmitter *e) |
| Removes an emitter. | |
| void | addCallback (IParticleCallback *cb) |
| Adds a lifecycle callback. | |
| void | removeCallback (IParticleCallback *cb) |
| Removes a lifecycle callback. | |
| std::vector< IParticleCallback * > & | getCallback () |
| Gets all callbacks. | |
| void | addSystem (ISystem *s) |
| Adds a custom system to process particles. | |
| std::vector< ISystem * > & | getSystems () |
| Gets all systems. | |
| void | removeSystem (ISystem *s) |
| Removes a system. | |
| int | addParticle (u32 emiterID, const core::vector3df &position, const core::vector3df &subEmitterDirection) |
| Manually spawns a particle using an emitter index. | |
| int | addParticleVelocity (u32 emiterID, const core::vector3df &position, const core::vector3df &velocity) |
| Manually spawns a particle with initial velocity using an emitter index. | |
| int | addParticleByEmitter (CEmitter *emitter, const core::vector3df &position, const core::vector3df &subEmitterDirection) |
| Manually spawns a particle using a pointer to an emitter. | |
| int | addParticleVelocityByEmitter (CEmitter *emitter, const core::vector3df &position, const core::vector3df &velocity) |
| Manually spawns a particle with initial velocity using a pointer to an emitter. | |
| IRenderer * | setRenderer (IRenderer *r) |
| Assigns a renderer to this group. | |
| IRenderer * | getRenderer () |
| Gets the current renderer. | |
| CParticleInstancing * | getIntancing () |
| Internal: gets instancing buffer. | |
| CParticleCPUBuffer * | getParticleBuffer () |
| Internal: gets CPU mesh buffer. | |
| u32 | getCurrentParticleCount () |
| Gets current particle count. | |
| CModel * | createModel (const std::wstring &attributeName) |
| Creates or retrieves a model for a specific parameter name. | |
| CModel * | createModel (EParticleParams param) |
| Creates or retrieves a model for a specific parameter type. | |
| CModel * | getModel (EParticleParams param) |
| Finds a model for a parameter type. | |
| void | deleteModel (EParticleParams param) |
| Deletes a model. | |
| std::vector< CModel * > & | getModels () |
| Gets all models. | |
| CInterpolator * | createInterpolator () |
| Creates a new interpolator. | |
| void | deleteInterpolator (CInterpolator *interpolator) |
| Deletes an interpolator. | |
| std::vector< CInterpolator * > & | getInterpolators () |
| Gets all interpolators. | |
| core::array< CParticle > & | getParticles () |
| Gets raw access to particle list. | |
| int | getFrameUpdate () |
| Gets last frame index update. | |
| void | updateFrame (int frame) |
| Syncs frame count. | |
| Public Member Functions inherited from Skylicht::Particle::IParticleCallback | |
| virtual void | OnParticleUpdate (CParticle *particles, int num, CGroup *group, float dt) |
Protected Attributes | |
| CGroup * | m_parentGroup |
| Pointer to the parent particle group. | |
| ISystem * | m_parentSystem |
| System that syncs this group's particles to parent particles. | |
| core::vector3df | m_position |
| Spawn position (derived from parent particle). | |
| core::vector3df | m_direction |
| Spawn direction (derived from parent velocity). | |
| core::quaternion | m_rotate |
| Spawn rotation (derived from parent orientation). | |
| bool | m_followParentTransform |
| Whether particles should follow the parent's current position every frame. | |
| bool | m_emitterWorldOrientation |
| Whether emitter orientation should be in world space or relative to parent. | |
| bool | m_syncLife |
| Whether to sync child age/life with parent. | |
| bool | m_syncColor |
| Whether to sync child color with parent. | |
| Protected Attributes inherited from Skylicht::Particle::CGroup | |
| core::array< CParticle > | m_particles |
| Active particles in this group. | |
| core::array< SLaunchParticle > | m_launch |
| Buffer of particles to be launched in the current frame. | |
| std::vector< CEmitter * > | m_emitters |
| List of emitters assigned to this group. | |
| std::vector< ISystem * > | m_systems |
| Custom update systems affecting this group's particles. | |
| std::vector< CModel * > | m_models |
| Models defining parameter animation (e.g. ColorA over life). | |
| std::vector< CInterpolator * > | m_interpolators |
| Interpolators shared by models. | |
| CParticleSystem * | m_particleSystem |
| Core particle movement and lifecycle system. | |
| CParticleInstancingSystem * | m_instancingSystem |
| Internal system for GPU instancing updates. | |
| CParticleCPUBufferSystem * | m_cpuBufferSystem |
| Internal system for CPU buffer updates. | |
| IRenderer * | m_renderer |
| The renderer used to draw this group. | |
| CParticleInstancing * | m_instancing |
| Buffer for GPU instancing data. | |
| CParticleCPUBuffer * | m_cpuBuffer |
| Buffer for CPU rendering data. | |
| std::vector< IParticleCallback * > | m_callback |
| Callbacks for particle lifecycle events. | |
| core::matrix4 | m_parentWorld |
| core::matrix4 | m_world |
| core::aabbox3df | m_bbox |
| int | m_frameUpdate |
Additional Inherited Members | |
| Public Attributes inherited from Skylicht::Particle::CGroup | |
| float | Friction |
| Global friction for all particles in this group. | |
| float | LifeMin |
| Minimum life time for newly born particles. | |
| float | LifeMax |
| Maximum life time for newly born particles. | |
| bool | Immortal |
| If true, particles do not die from age. | |
| float | GravityValue |
| Gravity magnitude. | |
| core::vector3df | GravityRotation |
| Gravity rotation (euler angles). | |
| core::vector3df | ParticleRotation |
| Global rotation for all particles. | |
| core::vector3df | Gravity |
| Calculated gravity vector. | |
| core::vector3df | OrientationNormal |
| Custom orientation normal for fixed billboarding. | |
| core::vector3df | OrientationUp |
| Custom orientation up vector for fixed billboarding. | |
| bool | UseOrientationAsBillboard |
| Whether to use custom orientation instead of camera billboard. | |
| std::wstring | Name |
| Friendly name of the group. | |
| bool | Visible |
| Visibility flag. | |
| bool | Optimized |
| If true, uses optimized particle swap on deletion (may affect sorting). | |
| Protected Member Functions inherited from Skylicht::Particle::CGroup | |
| virtual bool | launchParticle (CParticle &p, SLaunchParticle &launch) |
| void | initParticleModel (CParticle &p) |
| void | initParticleLifeTime (CParticle &p) |
| CParticle * | create (u32 num) |
| void | remove (u32 i) |
A particle group that spawns particles from the positions of particles in a parent group.
Useful for sub-emitter effects like trails, explosions upon death, or complex multi-stage particles.
|
virtual |
Internal: spawns new particles at parent positions.
Reimplemented from Skylicht::Particle::CGroup.
|
virtual |
Creates a serializable object for property editing or saving.
Reimplemented from Skylicht::Particle::CGroup.
|
virtual |
Transforms position from parent local space to world space.
Reimplemented from Skylicht::Particle::CGroup.
|
virtual |
Transforms vector from parent local space to world space.
Reimplemented from Skylicht::Particle::CGroup.
|
virtual |
Loads properties from a serializable object.
| object | The serializable data to load. |
Reimplemented from Skylicht::Particle::CGroup.
|
virtual |
Callback when the parent group is destroyed.
Reimplemented from Skylicht::Particle::IParticleCallback.
|
virtual |
Callback when a parent particle is born.
Reimplemented from Skylicht::Particle::IParticleCallback.
|
virtual |
Callback when a parent particle dies.
Reimplemented from Skylicht::Particle::IParticleCallback.
|
virtual |
Callback when parent particle data is swapped in the array.
Reimplemented from Skylicht::Particle::IParticleCallback.
|
virtual |
Internal: updates launch emitters based on parent particles.
Reimplemented from Skylicht::Particle::CGroup.