Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::Particle::CRandomEmitter Class Reference

Emitter that shoots particles in random directions. More...

#include <ParticleSystem/Particles/Emitters/CRandomEmitter.h>

Inheritance diagram for Skylicht::Particle::CRandomEmitter:
Skylicht::Particle::CEmitter Skylicht::Particle::CParticleSerializable

Public Member Functions

virtual void generateVelocity (CParticle &particle, float speed, CZone *zone, CGroup *group)
 Implementation: generates a random unit vector for velocity.
Public Member Functions inherited from Skylicht::Particle::CEmitter
 CEmitter (EEmitter type)
virtual CObjectSerializablecreateSerializable ()
 Creates a serializable object for property editing or saving.
virtual void loadSerializable (CObjectSerializable *object)
 Loads properties from a serializable object.
virtual bool haveDirection ()
 Returns true if this emitter has a primary direction.
CZonesetZone (CZone *z)
 Sets the spawn zone.
CZonegetZone ()
 Gets the current spawn zone.
void stop ()
 Stops the emitter immediately.
void setTank (int tank)
 Sets the tank capacity and current value.
void resetTank ()
 Resets the tank and flow logic.
int getTank ()
 Gets current tank value.
int getLastTank ()
 Gets last set tank value.
void setTankValue (int tank)
 Updates the persistent tank value without immediate reset.
int getDefaultTank ()
 Gets default tank from serializable data.
float getDefaultFlow ()
 Gets default flow from serializable data.
void setFlow (float flow)
 Sets continuous birth rate (particles per second).
float getFlow ()
 Gets current flow rate.
void setActive (bool b)
 Enables or disables the emitter.
bool isActive ()
 Checks if emitter is active.
void setDelay (float timeSecond)
 Sets start delay in seconds.
void setForce (float min, float max)
 Sets initial velocity force range.
float getForceMin ()
 Gets min force.
float getForceMax ()
 Gets max force.
void setResetTankInterval (float min, float max)
 Sets interval for automatic tank resets.
void setEmitFullZone (bool b)
 Sets volume spawn mode.
bool isEmitFullZone ()
 Checks volume spawn mode.
EEmitter getType ()
 Gets emitter type.
const wchar_t * getName ()
 Gets display name.
virtual u32 updateNumber (float deltaTime)
 Calculates how many particles should be born this frame.
virtual void setBornData (SBornData &data)
 Initializes birth data for sub-emitters.
u32 updateBornData (u32 index, float deltaTime)
 Internal: updates birth calculation for a specific sub-group particle index.
virtual u32 updateBornData (SBornData &data, float deltaTime)
 Internal: core logic for sub-emitter birth calculation.
void clearBornData ()
 Clears sub-emitter birth records.
void generateVelocity (CParticle &particle, CZone *zone, CGroup *group)
 Generates initial velocity for a particle.
void emitParticle (CParticle &particle, CZone *zone, CGroup *group)
 Full emission logic: generates position and velocity.
u32 addBornData ()
 Adds a new sub-emitter record.
void swapBornData (int index1, int index2)
 Swaps sub-emitter records (for array reordering).
void deleteBornData ()
 Removes a sub-emitter record.

Additional Inherited Members

Protected Attributes inherited from Skylicht::Particle::CEmitter
int m_lastTank
int m_defaultTank
int m_tank
 Current particles remaining in the tank.
float m_flow
 Current birth rate (particles per second).
float m_lastFlow
float m_defaultFlow
float m_flowLifeTime
 Duration of the flow logic before it stops.
float m_forceMin
 Minimum magnitude of initial velocity.
float m_forceMax
 Maximum magnitude of initial velocity.
float m_fraction
bool m_active
 Active status.
bool m_emitFullZone
 Whether to spawn particles randomly within the zone volume.
float m_delay
 Configured delay.
float m_waitDelay
 Current waiting time for delay.
float m_lifeTime
 Total time elapsed since start.
float m_reset
 Current reset timer.
float m_resetIntervalMin
 Min interval for auto-resetting the tank.
float m_resetIntervalMax
 Max interval for auto-resetting the tank.
CZonem_zone
 The spawn zone assigned to this emitter.
EEmitter m_type
 Type of the emitter.
core::array< SBornDatam_bornData
 Internal: birth data for sub-emitters.

Detailed Description

Emitter that shoots particles in random directions.

Distributes initial velocity uniformly across a sphere.

Member Function Documentation

◆ generateVelocity()

virtual void Skylicht::Particle::CRandomEmitter::generateVelocity ( CParticle & particle,
float speed,
CZone * zone,
CGroup * group )
virtual

Implementation: generates a random unit vector for velocity.

Implements Skylicht::Particle::CEmitter.


The documentation for this class was generated from the following file: