ParticleEmitter
Engine/source/T3D/fx/particleEmitter.h
Particle Emission
Main interface for creating particles.
The emitter does not track changes in axis or velocity over the course of a single update, so this should be called at a fairly fine grain. The emitter will potentially track the last particle to be created into the next call to this function in order to create a uniformly random time distribution of the particles. If the object to which the emitter is attached is in motion, it should try to ensure that for call (n+1) to this function, start is equal to the end from call (n). This will ensure a uniform spatial distribution.
Internal interface
setupBillboard(Particle * part, Point3F * basePts, const MatrixF & camView, const ColorF & ambientColor, ParticleVertexType * lVerts)
setupOriented(Particle * part, const Point3F & camPos, const ColorF & ambientColor, ParticleVertexType * lVerts)
setupAligned(const Particle * part, const ColorF & ambientColor, ParticleVertexType * lVerts)
Updates the bounding box for the particle system.
Private Types
Parent
Public Types
GFXVertexPCT
ParticleVertexType
Public Static Attributes
Public Attributes
bool
Private Static Attributes
Constant used to calculate particle rotation from spin and age.
Private Attributes
bool
bool
bool
Public Functions
By default, a particle renderer will wait for it's owner to delete it.
bool
onNewDataBlock(GameBaseData * dptr, bool reload)
Called when a new datablock is set.
Public Static Functions
setWindVelocity(const Point3F & vel)
Protected Functions
advanceTime(F32 dt)
Advances simulation time for animations.
bool
onAdd()
Called when the object is added to the sim.
prepRenderImage(SceneRenderState * state)
Called when the SceneManager is ready for the registration of render instances.
processTick(const Move * move)
Processes a move event and updates object state once every 32 milliseconds.
Detailed Description
Particle Emission
Main interface for creating particles.
The emitter does not track changes in axis or velocity over the course of a single update, so this should be called at a fairly fine grain. The emitter will potentially track the last particle to be created into the next call to this function in order to create a uniformly random time distribution of the particles. If the object to which the emitter is attached is in motion, it should try to ensure that for call (n+1) to this function, start is equal to the end from call (n). This will ensure a uniform spatial distribution.
emitParticles(const Point3F & start, const Point3F & end, const Point3F & axis, const Point3F & velocity, const U32 numMilliseconds)
emitParticles(const Point3F & point, const bool useLastPosition, const Point3F & axis, const Point3F & velocity, const U32 numMilliseconds)
emitParticles(const Point3F & rCenter, const Point3F & rNormal, const F32 radius, const Point3F & velocity, S32 count)
Internal interface
addParticle(const Point3F & pos, const Point3F & axis, const Point3F & vel, const Point3F & axisx)
Adds a particle.
Parameters:
| pos | Initial position of particle |
| axis | |
| vel | Initial velocity |
| axisx |
setupBillboard(Particle * part, Point3F * basePts, const MatrixF & camView, const ColorF & ambientColor, ParticleVertexType * lVerts)
setupOriented(Particle * part, const Point3F & camPos, const ColorF & ambientColor, ParticleVertexType * lVerts)
setupAligned(const Particle * part, const ColorF & ambientColor, ParticleVertexType * lVerts)
updateBBox()
Updates the bounding box for the particle system.
Private Types
typedef GameBase Parent
Public Types
typedef GFXVertexPCT ParticleVertexType
Public Static Attributes
Point3F mWindVelocity
Public Attributes
bool mDead
Private Static Attributes
const F32 AgedSpinToRadians
Constant used to calculate particle rotation from spin and age.
Private Attributes
ColorF colors [ParticleData::PDC_NUM_KEYS]
MatrixF mBBObjToWorld
S32 mCurBuffSize
ParticleEmitterData * mDataBlock
bool mDeleteOnTick
bool mDeleteWhenEmpty
S32 mElapsedTimeMS
bool mHasLastPosition
U32 mInternalClock
Point3F mLastPosition
S32 mLifetimeMS
U32 mNextParticleTime
GFXVertexBufferHandle< ParticleVertexType > mVertBuff
S32 n_part_capacity
S32 n_parts
Particle * part_freelist
Particle part_list_head
Vector< Particle * > part_store
F32 sizes [ParticleData::PDC_NUM_KEYS]
Public Functions
ParticleEmitter()
~ParticleEmitter()
DECLARE_CONOBJECT(ParticleEmitter )
deleteWhenEmpty()
By default, a particle renderer will wait for it's owner to delete it.
When this is turned on, it will delete itself as soon as it's particle count drops to zero.
getCollectiveColor()
getDataBlock()
onNewDataBlock(GameBaseData * dptr, bool reload)
Reimplemented from: GameBase
setColors(ColorF * colorList)
Sets colors for particles based on color list provided.
Parameters:
| colorList | List of colors |
setSizes(F32 * sizeList)
Sets sizes of particles based on sizelist provided.
Parameters:
| sizeList | List of sizes |
Public Static Functions
setWindVelocity(const Point3F & vel)
Protected Functions
advanceTime(F32 dt)
Reimplemented from: ProcessObject
copyToVB(const Point3F & camPos, const ColorF & ambientColor)
onAdd()
Reimplemented from: SceneObject
onRemove()
Reimplemented from: SceneObject
prepRenderImage(SceneRenderState * state)
Reimplemented from: SceneObject
processTick(const Move * move)
Reimplemented from: ProcessObject
