Torque3D Documentation / _generateds / ParticleEmitter

ParticleEmitter

Engine/source/T3D/fx/particleEmitter.h

More...

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, const U32 age_offset)

Adds a particle.

setupBillboard(Particle * part, Point3F * basePts, const MatrixF & camView, const LinearColorF & ambientColor, ParticleVertexType * lVerts)
setupOriented(Particle * part, const Point3F & camPos, const LinearColorF & ambientColor, ParticleVertexType * lVerts)
setupRibbon(Particle * part, Particle * next, Particle * prev, const Point3F & camPos, const LinearColorF & 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.

Public Functions

By default, a particle renderer will wait for it's owner to delete it.

emitParticlesExt(const MatrixF & xfm, const Point3F & point, const Point3F & velocity, const U32 numMilliseconds)
bool
onNewDataBlock(GameBaseData * dptr, bool reload)

Called when a new datablock is set.

setColors(LinearColorF * colorList)

Sets colors for particles based on color list provided.

setSizes(F32 * sizeList)

Sets sizes of particles based on sizelist provided.

Public Static Functions

Protected Functions

Advances simulation time for animations.

copyToVB(const Point3F & camPos, const LinearColorF & ambientColor)
bool

Called when the object is added to the sim.

Called when the object is removed from the sim.

Called when the SceneManager is ready for the registration of render instances.

Processes a move event and updates object state once every 32 milliseconds.

Private Functions

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, const U32 age_offset)

Adds a particle.

Parameters:

pos

Initial position of particle

axis

vel

Initial velocity

axisx

setupBillboard(Particle * part, Point3F * basePts, const MatrixF & camView, const LinearColorF & ambientColor, ParticleVertexType * lVerts)

setupOriented(Particle * part, const Point3F & camPos, const LinearColorF & ambientColor, ParticleVertexType * lVerts)

setupAligned(const Particle * part, const LinearColorF & ambientColor, ParticleVertexType * lVerts)

setupRibbon(Particle * part, Particle * next, Particle * prev, const Point3F & camPos, const LinearColorF & 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

LinearColorF colors [ParticleData::PDC_NUM_KEYS]
MatrixF mBBObjToWorld 
S32 mCurBuffSize 
ParticleEmitterData * mDataBlock 
bool mDeleteOnTick 
bool mDeleteWhenEmpty 
GFXVertexBufferHandle< ParticleVertexType > mVertBuff 
F32 sizes [ParticleData::PDC_NUM_KEYS]

Protected Attributes

bool db_temp_clone 
F32 fade_amt 
bool forced_bbox 
S32 mElapsedTimeMS 
bool mHasLastPosition 
U32 mInternalClock 
Point3F mLastPosition 
S32 mLifetimeMS 
U32 mNextParticleTime 
F32 mPhiOld 
F32 mThetaOld 
S32 n_part_capacity 
S32 n_parts 
Particle * part_freelist 
Particle part_list_head 
Vector< Particle * > part_store 
Point3F pos_pe 
S8 sort_priority 

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.

emitParticlesExt(const MatrixF & xfm, const Point3F & point, const Point3F & velocity, const U32 numMilliseconds)

Reimplemented by: afxParticleEmitter

getCollectiveColor()

getDataBlock()

onNewDataBlock(GameBaseData * dptr, bool reload)

Reimplemented from: GameBase

setColors(LinearColorF * colorList)

Sets colors for particles based on color list provided.

Parameters:

colorList

List of colors

setFadeAmount(F32 amt)

setForcedObjBox(Box3F & box)

setSizes(F32 * sizeList)

Sets sizes of particles based on sizelist provided.

Parameters:

sizeList

List of sizes

setSortPriority(S8 priority)

Public Static Functions

setWindVelocity(const Point3F & vel)

Protected Functions

advanceTime(F32 dt)

Reimplemented from: ProcessObject

copyToVB(const Point3F & camPos, const LinearColorF & ambientColor)

onAdd()

Reimplemented from: SceneObject

onRemove()

Reimplemented from: SceneObject

prepRenderImage(SceneRenderState * state)

Reimplemented from: SceneObject

processTick(const Move * move)

Reimplemented from: ProcessObject

sub_particleUpdate(Particle * )

Reimplemented by: afxParticleEmitter

updateKeyData(Particle * part)

Private Functions

update(U32 ms)