27#include "Components/CComponentSystem.h"
28#include "Particles/CFactory.h"
29#include "CParticleBufferData.h"
65 class COMPONENT_API CParticleComponent :
public CComponentSystem
91 virtual ~CParticleComponent();
162 return m_data->Groups.size();
256 DECLARE_GETTYPENAME(CParticleComponent)
Definition CObjectSerializable.h:36
Base class for particle emitters.
Definition CEmitter.h:88
Factory class for creating emitters, zones, and renderers.
Definition CFactory.h:61
Represents a group of particles with shared settings, emitters, and a renderer.
Definition CGroup.h:132
ECS data structure holding particle groups for an entity.
Definition CParticleBufferData.h:43
void setGroupTransform(const core::matrix4 &world)
Updates the transform of all particle groups.
void setSourcePath(const char *path)
Sets the .particle file path.
Definition CParticleComponent.h:221
void clearParticles()
Immediately removes all active particles across all groups.
CGroup * getGroup(int i)
Retrieves a specific group by index.
Definition CParticleComponent.h:168
void loadGroup(Particle::CGroup *group, CObjectSerializable *object)
Internal serialization loading helper for a specific group.
bool load()
Loads the particle system configuration from m_sourcePath.
void Stop()
Stops all emitters and clears immortal particles.
CFactory * getParticleFactory()
Gets the internal particle factory.
Definition CParticleComponent.h:124
CGroup * duplicateGroup(CGroup *group)
Clones a particle group.
virtual void loadSerializable(CObjectSerializable *object)
Loads properties from a serializable object.
void Play()
Resets all emitters and starts playback.
virtual void updateComponent()
Updates the internal frame counter.
bool save()
Saves the current particle system configuration to m_sourcePath.
u32 getNumOfGroup()
Gets the number of top-level groups.
Definition CParticleComponent.h:160
CGroup * createParticleGroup()
Creates a new top-level particle group managed by this component.
CFactory m_factory
Internal factory for creating particle objects.
Definition CParticleComponent.h:76
int getFrameUpdated()
Gets the current frame update count.
Definition CParticleComponent.h:241
CSubGroup * createParticleSubGroup(CGroup *group)
Creates a sub-group attached to a parent group.
void loadEmitters(Particle::CGroup *group, io::IXMLReader *reader)
Internal XML loading helper for emitters.
virtual void initComponent()
Initializes component data and required ECS systems.
void loadGroup(Particle::CGroup *group, io::IXMLReader *reader)
Internal XML loading helper for a specific group.
bool IsPlaying()
Checks if any particle is currently alive.
virtual CObjectSerializable * createSerializable()
Creates a serializable object for property editing.
u32 getTotalParticle()
Gets the total count of active particles in all groups.
CParticleBufferData * m_data
Cached pointer to the ECS entity data.
Definition CParticleComponent.h:71
void updateParticleCountByPercentage(float f, bool includeSubGroup=false)
Dynamically adjusts the emission rate of all emitters.
CEmitter * duplicateEmitter(CGroup *group, CEmitter *emitter)
Clones an emitter within a group.
virtual void startComponent()
Starts the component, loading the particle source if set.
void removeParticleGroup(CGroup *group)
Removes a specific group from the component.
void loadSubGroups(Particle::CGroup *group, io::IXMLReader *reader)
Internal XML loading helper for sub-groups.
int m_frameUpdate
Frame counter for update synchronization.
Definition CParticleComponent.h:86
void saveGroup(Particle::CGroup *group, CObjectSerializable *object)
Internal serialization helper for a specific group.
void loadRenderer(Particle::CGroup *group, io::IXMLReader *reader)
Internal XML loading helper for renderers.
std::string m_sourcePath
Path to the .particle source file.
Definition CParticleComponent.h:81
const char * getSourcePath()
Gets the current .particle file path.
Definition CParticleComponent.h:213
CParticleBufferData * getData()
Gets the ECS entity data holding particle groups.
Definition CParticleComponent.h:133
void saveGroups(CObjectSerializable *groups)
Internal serialization helper.
void loadModels(Particle::CGroup *group, io::IXMLReader *reader)
Internal XML loading helper for models.
A particle group that spawns particles from the positions of particles in a parent group.
Definition CSubGroup.h:50
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition matrix4.h:2241
IIrrXMLReader< wchar_t, IReferenceCounted > IXMLReader
An xml reader for wide characters, derived from IReferenceCounted.
Definition IXMLReader.h:19
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58