TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
List of all members
iParticleSystem Struct Referenceabstract
Inheritance diagram for iParticleSystem:
iUnknown

Detailed Description

Particle System interface.

General

virtual void Reset ()=0
 Reset the group. More...
 
virtual void Seed (tU32 anSeed)=0
 Set the random number generator seed. More...
 
virtual void SetMaxNumParticles (tU32 anNum)=0
 Set the maximum number of particles. {Property}. More...
 
virtual tU32 GetMaxNumParticles () const =0
 Get the maximum number of particles. {Property}. More...
 
virtual tU32 GetNumParticles () const =0
 Get the number of particles currently in the group. (aka active particles) {Property}. More...
 
virtual void SetTimeStep (tF32 afTimeStep)=0
 Set the timestep. {Property} {Property}. More...
 
virtual tF32 GetTimeStep () const =0
 Get the timestep. {Property}. More...
 
virtual void SetTextureAnimationGrid (const sVec2i &avGridSize)=0
 Set the 'grid' size for the animated textures. {Property}. More...
 
virtual sVec2i GetTextureAnimationGrid () const =0
 Get the 'grid' size for the animated textures. {Property}. More...
 
virtual tBool GetData (sParticleSystemData *apData) const =0
 Get the particles data pointers. More...
 

Domain

virtual tBool SetDomainType (eParticleDomain aType)=0
 Set the domain's type. {Property}. More...
 
virtual eParticleDomain GetDomainType () const =0
 Get the domain's type. {Property}. More...
 
virtual void SetDomainA (const sVec3f &aV)=0
 Set the domain's A vector. {Property}. More...
 
virtual sVec3f GetDomainA () const =0
 Get the domain's A vector. {Property}. More...
 
virtual void SetDomainB (const sVec3f &aV)=0
 Set the domain's B vector. {Property}. More...
 
virtual sVec3f GetDomainB () const =0
 Get the domain's B vector. {Property}. More...
 
virtual void SetDomainC (const sVec3f &aV)=0
 Set the domain's C vector. {Property}. More...
 
virtual sVec3f GetDomainC () const =0
 Get the domain's C vector. {Property}. More...
 
virtual tBool SetDomainPoint (sVec3f avPoint)=0
 Set the domain to a point. More...
 
virtual tBool SetDomainLine (sVec3f avStart, sVec3f avEnd)=0
 Set the domain to a line. More...
 
virtual tBool SetDomainTriangle (sVec3f avA, sVec3f avB, sVec3f avC)=0
 Set the domain to a triangle. More...
 
virtual tBool SetDomainPlane (sPlanef aPlane)=0
 Set the domain to a plane. More...
 
virtual tBool SetDomainAABB (sVec3f avMin, sVec3f avMax)=0
 Set the domain to a box. More...
 
virtual tBool SetDomainSphere (sVec3f avCenter, tF32 afRadius1, tF32 afRadius2)=0
 Set the domain to a sphere. More...
 
virtual tBool SetDomainCylinder (sVec3f avStart, sVec3f avEnd, tF32 afRadius1, tF32 afRadius2)=0
 Set the domain to a cylinder. More...
 
virtual tBool SetDomainCone (sVec3f avStart, sVec3f avEnd, tF32 afRadius1, tF32 afRadius2)=0
 Set the domain to a cone. More...
 
virtual tBool SetDomainBlob (sVec3f avPosition, tF32 afStdDev)=0
 Set the domain to a blob. More...
 
virtual tBool SetDomainDisk (sVec3f avPosition, sVec3f avNormal, tF32 afRadius1, tF32 afRadius2)=0
 Set the domain to a disk. More...
 
virtual tBool SetDomainRect (sVec3f avPoint, sVec3f avUBasis, sVec3f avVBasis)=0
 Set the domain to a rectangle. More...
 

States

virtual void Color (sColor4f aColor)=0
 Define the color. More...
 
virtual void ColorDomain ()=0
 Define the color in the current domain. More...
 
virtual void AlphaDomain ()=0
 Define the alpha in the current domain. More...
 
virtual void Size (sVec3f avSize)=0
 Define the size. More...
 
virtual void SizeDomain ()=0
 Define the size in the current domain. More...
 
virtual void Mass (tF32 afMass)=0
 Define the mass. More...
 
virtual void StartingAge (tF32 afAge, tF32 afSigma)=0
 Define the starting age. More...
 
virtual void UpVector (sVec3f avUp)=0
 Define the up vector. More...
 
virtual void UpVectorDomain ()=0
 Define the up vector in the current domain. More...
 
virtual void Velocity (sVec3f avUp)=0
 Define the velocity. More...
 
virtual void VelocityDomain ()=0
 Define the velocity in the current domain. More...
 
virtual void RotationVector (sVec3f avUp)=0
 Define the rotation vector. More...
 
virtual void RotationVectorDomain ()=0
 Define the rotation vector in the current domain. More...
 
virtual void PositionB (sVec3f avPos)=0
 Define the secondary position. More...
 
virtual void PositionBDomain ()=0
 Define the secondary position in the current domain. More...
 
virtual void PositionBTracks (tBool abDoCopy)=0
 Specify how the secondary position of each new particle is chosen. Specify how the positionB of each new particle emitted will be chosen. The positionB is the destination position or initial position of particles. See ActionRestore for a use of positionB. If abDoCopy is true then when a particle is created its positionB will be the same as its initial particle position (the default). If abDoCopy is false then when a particle is created its positionB will be chosen from the PositionB domain. More...
 

Actions

virtual void ActionAvoidDomain (tF32 afMagnitude, tF32 afEpsilon, tF32 afLookAhead)=0
 Steer particles away from a domain of space. Particles are tested to see whether they will pass from being outside the specified domain to being inside it within look_ahead time units from now if the next pMove action were to occur now. magnitude tells how drastically the particle velocities are modified to avoid the obstacle at each time step. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. The specific direction and amount of turn is dependent on the kind of domain being avoided. More...
 
virtual void ActionBounceDomain (tF32 afFriction, tF32 afResilience, tF32 afCutoff)=0
 Bounce particles off a domain of space. Particles are tested to see whether they will pass from being outside the specified domain to being inside it if the next pMove action were to occur now. If they would pass through the surface of the domain, they are instead bounced off it. That is, their velocity vector is decomposed into components normal to the surface and tangent to the surface. The direction of the normal component is reversed, and the components are recomposed into a new velocity heading away from the surface. The normal component is multiplied by the resilience parameter and the tangential component, if its magnitude is greater than cutoff, is multiplied by (1 - the friction parameter) when being composed into the new velocity vector. The cutoff parameter can allow particles to glide smoothly along a surface without sticking. More...
 
virtual void ActionCopyVertexB (tBool abCopyPos=eTrue, tBool abCopyVel=eFalse)=0
 Set the secondary position from current position. If copy_pos is true, sets the positionB of each particle in the current particle group to be equal to the current position of that particle. This makes each particle "remember" this position so it can later return to it using pRestore. If copy_vel is true, sets the velocityB of each particle in the current particle group to be equal to the current velocity of that particle. This is useful for computing the orientation of the particle when rendering it using pDrawGroupl. More...
 
virtual void ActionDamping (sVec3f avDamping, tF32 afVLow=0.0f, tF32 afVHigh=kfParticlesMax)=0
 Simulate air by slowing down particle velocities. If a particle's velocity magnitude is within vlow and vhigh, then multiply each component of the velocity by the respective damping constant. Typically, the three components of damping will have the same value. More...
 
virtual void ActionRotationDamping (sVec3f avDamping, tF32 afVLow=0.0f, tF32 afVHigh=kfParticlesMax)=0
 Rotation damping. More...
 
virtual void ActionExplosion (sVec3f avCenter, tF32 afVelocity, tF32 afMagnitude, tF32 afStdev, tF32 afEpsilon=kfParticlesEpsilon, tF32 afAge=0.0f)=0
 An Explosion. Causes an explosion by accelerating all particles away from the center. Particles are accelerated away from the center by an amount proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. The shock wave of the explosion has a gaussian magnitude. The center of the gaussian travels outward from the center at the specified velocity. So at a given time step, particles at a distance (velocity * age) from center will receive the most acceleration, and particles not at the peak of the shock wave will receive a lesser acceleration. The shock wave has a standard deviation of stdev, which is the sharpness or broadness of the strength of the wave. age is used to calculate the radius of the shock wave. For pExplosion calls in action lists, age is the initial age of the explosion. It is incremented by dt after each call. For immediate mode, age is the current age of the explosion, and it is up to the application to increment the age parameter for each call to pExlosion. More...
 
virtual void ActionFollow (tF32 afMagnitude=1.0f, tF32 afEpsilon=kfParticlesEpsilon, tF32 afMaxRadius=kfParticlesMax)=0
 Accelerate toward the next particle in the group. This allows snaky effects where the particles follow each other. Each particle is accelerated toward the next particle in the group by an amount proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. afMaxRadius defines the sphere of influence of this action. No particle further than afMaxRadius from its predecessor is affected. More...
 
virtual void ActionGravitate (tF32 afMagnitude=1.0f, tF32 afEpsilon=kfParticlesEpsilon, tF32 afMaxRadius=kfParticlesMax)=0
 Accelerate each particle toward each other particle. Each particle is accelerated toward each other particle in the group by an amount proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. afMaxRadius defines the sphere of influence of this action. No particle further than afMaxRadius from another particle is affected. More...
 
virtual void ActionGravity (sVec3f avDirection)=0
 Accelerate particles in the given direction. The gravity acceleration vector is simply added to the velocity vector of each particle at each time step. The magnitude of the gravity vector is the acceleration due to gravity. For example, pGravity(0, 0, -9.8) specifies gravity in the negative Z direction. More...
 
virtual void ActionJet (sVec3f avCenter, tF32 afMagnitude=1.0f, tF32 afEpsilon=kfParticlesEpsilon, tF32 afMaxRadius=kfParticlesMax)=0
 Accelerate particles that are near the center of the jet. For each particle, chooses an acceleration vector from the domain and applies it to the particle's velocity. The amount of acceleration applied is directly proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. The domain from which acceleration vectors are chosen is the current velocity domain. afMaxRadius defines the sphere of influence of this action. No particle further than afMaxRadius from the center is affected. More...
 
virtual void ActionKillOld (tF32 afAgeLimit, tBool abKillLessThan=eFalse)=0
 Remove old particles. Removes all particles older than age_limit. But if kill_less_than is true, it instead removes all particles newer than age_limit. age_limit is not clamped, so negative values are ok. This can be used in conjunction with pStartingAge(-n) to create and then kill a particular set of particles. More...
 
virtual void ActionMatchVelocity (tF32 afMagnitude=1.0f, tF32 afEpsilon=kfParticlesEpsilon, tF32 afMaxRadius=kfParticlesMax)=0
 Modify each particle's velocity to be similar to that of its neighbors. Each particle is accelerated toward the weighted mean of the velocities of other particles in the group by an amount proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2 to the other particles. But when r is small, the acceleration would be infinite, so epsilon is always added to r. Using an epsilon similar in magnitude to magnitude can increase the range of influence of nearby particles on this particle. More...
 
virtual void ActionMatchRotVelocity (tF32 afMagnitude=1.0f, tF32 afEpsilon=kfParticlesEpsilon, tF32 afMaxRadius=kfParticlesMax)=0
 Modify each particle's rotational velocity to be similar to that of its neighbors. More...
 
virtual void ActionMove ()=0
 Move particle positions based on velocities. This action actually updates the particle positions by adding the current velocity to the current position. This is typically the last particle action performed in an iteration of a particle simulation, and typically only occurs once per action list. The velocity is multiplied by the time step length, dt, before being added to the position. This implements Euler's method of numerical integration with a constant, but specifiable step size. See pTimeStep for more on varying the step size. More...
 
virtual void ActionOrbitLine (sVec3f avPoint, sVec3f avAxis, tF32 afMagnitude=1.0f, tF32 afEpsilon=kfParticlesEpsilon, tF32 afMaxRadius=kfParticlesMax)=0
 Accelerate toward the closest point on the given line. p and axis define an infinite line, where p can be any point on the line and axis is any vector parallel to the line. For each particle, this action computes the vector to the closest point on the line, and accelerates the particle in the vector direction. The amount of acceleration applied is directly proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. afMaxRadius defines the infinite cylinder of influence of this action. No particle further than afMaxRadius from the line is affected. More...
 
virtual void ActionOrbitPoint (sVec3f avCenter, tF32 afMagnitude=1.0f, tF32 afEpsilon=kfParticlesEpsilon, tF32 afMaxRadius=kfParticlesMax)=0
 Accelerate toward the given center point. For each particle, this action computes the vector to the center point, and accelerates the particle in the vector direction. The amount of acceleration applied is directly proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. afMaxRadius defines the sphere of influence of this action. No particle further than afMaxRadius from the center is affected. More...
 
virtual void ActionRandomAccelerationDomain ()=0
 Accelerate particles in random directions. For each particle, chooses an acceleration vector from the specified domain and adds it to the particle's velocity. Reducing the time step, dt, will make a higher probability of being near the original velocity after unit time. Smaller dt approach a normal distribution of velocity vectors instead of a square wave distribution. More...
 
virtual void ActionRandomDisplaceDomain ()=0
 Immediately replace position with a position from the domain. For each particle, chooses a displacement vector from the specified domain and adds it to the particle's position. Reducing the time step, dt, will make a higher probability of being near the original position after unit time. Smaller dt approach a normal distribution of particle positions instead of a square wave distribution. More...
 
virtual void ActionRandomVelocityDomain ()=0
 Immediately replace velocity with a velocity from the domain. For each particle, sets the particle's velocity vector to a random vector in the specified domain. This function is not affected by dt. If you can think of an appropriate way for this to vary with dt, let me know. More...
 
virtual void ActionRandomRotVelocity ()=0
 Immediately replace rotation velocity with a velocity from the domain. More...
 
virtual void ActionRestore (tF32 afTime, tBool abVel=eTrue, tBool abRVel=eTrue)=0
 Over time, restore particles to their secondary positions. Computes a new velocity for each particle that will make the particle arrive at its positionB at the specified amount of time in the future. The curved path that the particles take is a parametric quadratic. Once the specified amount of time has passed, the particles are clamped to their positionB and their velocities are set to 0 to freeze them in place. If pRestore is called in immediate mode, it is the application's responsibility to decrease time_left by dt on each call. When in an action list, time_left gets decremented automatically. The positionB attribute of each particle is typically the particle's position when it was created, or it can be specified within a domain. This is controlled by pVertexBTracks, pVertexB, and pVertexBD. The positionB can be set at any time to the particle's current position using the pCopyVertexB action. More...
 
virtual void ActionSinkDomain (tBool abKillInside)=0
 Kill particles with positions on wrong side of the specified domain. If kill_inside is true, deletes all particles inside the given domain. If kill_inside is false, deletes all particles outside the given domain. More...
 
virtual void ActionSinkVelocityDomain (tBool abKillInside)=0
 Kill particles with velocities on wrong side of the specified domain. If kill_inside is true, deletes all particles whose velocity vectors are inside the given domain. If kill_inside is false, deletes all particles whose velocity vectors are outside the given domain. This allows particles to die when they turn around, get too fast or too slow, etc. More...
 
virtual void ActionSort (sVec3f avEye, sVec3f avLookAt)=0
 Sort the particles relativly to the specified eye and view direction. More...
 
virtual void ActionSource (tF32 afParticleRate, const sVec3f &vWordPos, const sVec2i &avTexFrameRange)=0
 Add particles in the specified domain. Adds new particles to the current particle group. The particle positions are chosen from the given domain. The particle colors, sizes, initial ages, velocities, and secondary positions are chosen according to their current domains. See pColor, pColorD, pSize, pStartingAge, pVelocity, pVelocityD, pVertexB, pVertexBD, and pVertexBTracks. When pSource is called within an action list, the particle attribute domains used are those that were current when the pSource command was called within the pNewActionList / pEndActionList block instead of when pCallActionList is called. Note that this is unlike OpenGL. particle_rate is the number of particles to add per unit time. If particle_rate / dt is a fraction then pSource adjusts the number of particles to add during this time step so that the average number added per unit time is particle_rate. More...
 
virtual void ActionSpeedLimit (tF32 afMinSpeed, tF32 afMaxSpeed=kfParticlesMax)=0
 Clamp each particle's speed to the given min and max. Computes each particle's speed (the magnitude of its velocity vector) and if it is less than min_speed or greater than max_speed it is clamped to those bounds, while preserving the velocity vector's direction. More...
 
virtual void ActionTargetColor (sColor4f avColor, tF32 afScale)=0
 Change color of all particles toward the specified color. Modifies the color and alpha of each particle to be scale percent of the way closer to the specified color and alpha. scale is multiplied by dt before scaling the sizes. Thus, using smaller dt causes a slightly faster approach to the target color. More...
 
virtual void ActionTargetSize (sVec3f avSize, sVec3f avScale)=0
 Change sizes of all particles toward the specified size. Modifies the size of each particle to be scale percent of the way closer to the specified size triple. This makes sizes grow asymptotically closer to the given size. scale is multiplied by dt before scaling the sizes. Thus, using smaller dt causes a slightly faster approach to the target size. The separate scales for each component allow only selected components to be scaled. More...
 
virtual void ActionTargetVelocity (sVec3f avVel, tF32 afScale)=0
 Modifies the velocity of each particle to be scale percent of the way closer to the specified velocity triple. This makes velocities grow asymptotically closer to the given velocity. scale is multiplied by dt before scaling the velocities. Thus, using smaller dt causes a slightly faster approach to the target velocity. More...
 
virtual void ActionTargetRotVelocity (sVec3f avVel, tF32 afScale)=0
 Modifies the rotation velocity of each particle to be scale percent of the way closer to the specified velocity triple. This makes velocities grow asymptotically closer to the given velocity. scale is multiplied by dt before scaling the velocities. Thus, using smaller dt causes a slightly faster approach to the target velocity. More...
 
virtual void ActionVortex (sVec3f avCenter, sVec3f avAxis, tF32 afMagnitude=1.0f, tF32 afTightnessExponent=1.0f, tF32 afRotSpeed=1.0f, tF32 afEpsilon=kfParticlesEpsilon, tF32 afMaxRadius=kfParticlesMax)=0
 Swirl particles around a vortex. Center and axis define an infinite line, where center represents the tip of the vortex and axis is a vector along the line, the length of which is irrelevant. As with most acceleration actions, the amount of acceleration falls off inversely with r2 to the center. But when r is small, the acceleration would be infinite, so epsilon is always added to r. Using an epsilon similar in magnitude to magnitude can increase the range of influence of the vortex. afMaxRadius defines the sphere of influence of this action. No particle further than afMaxRadius from the vortex center is affected. More...
 
virtual tF32 ActionTextureAnimation (tI32 anInc, tBool abClamp, tF32 afCurrentFrameTime, tF32 afFrameTime, const sVec2i &avTexFrameRange)=0
 Set the next texture animation frame (adds the specified increment, which can be negative). More...
 
virtual void ActionTextureRotation (tF32 afScale)=0
 Rotates the particle's texture coordinates. More...
 
virtual void ActionTargetColorAge (sColor4f avColor, tF32 afScale, tF32 afStartAge, tF32 afEndAge)=0
 Modifies the particles color over time. More...
 
virtual void ActionTargetSizeAge (sVec3f avSize, sVec3f avScale, tF32 afStartAge, tF32 afEndAge)=0
 Modified the particles size over time. More...
 

Rendering

virtual tBool SetRenderingMode (eParticleRendering aRen)=0
 Set the particle rendering mode. {Property}. More...
 
virtual eParticleRendering GetRenderingMode () const =0
 Get the particle rendering mode. {Property}. More...
 
virtual void SetRenderingData (iUnknown *apData)=0
 Set the particle rendering data. More...
 
virtual iUnknownGetRenderingData () const =0
 Get the particle rendering data. {Property}. More...
 
virtual void SetTransformMatrix (const sMatrixf &aMatrix)=0
 Set the transform matrix. {Property}. More...
 
virtual sMatrixf GetTransformMatrix () const =0
 Get the transform matrix. {Property}. More...
 
virtual void SetTransformEnabled (tBool abTransformEnabled)=0
 Set whether the particle group is transformed. {Property}. More...
 
virtual tBool GetTransformEnabled () const =0
 Get whether the particle group is transformed. {Property}. More...
 
virtual tBool Render (iCanvas *apCanvas)=0
 Render the particle system. More...
 

Additional Inherited Members

- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual void Reset ( )
pure virtual

Reset the group.

virtual void Seed ( tU32  anSeed)
pure virtual

Set the random number generator seed.

virtual void SetMaxNumParticles ( tU32  anNum)
pure virtual

Set the maximum number of particles. {Property}.

virtual tU32 GetMaxNumParticles ( ) const
pure virtual

Get the maximum number of particles. {Property}.

virtual tU32 GetNumParticles ( ) const
pure virtual

Get the number of particles currently in the group. (aka active particles) {Property}.

virtual void SetTimeStep ( tF32  afTimeStep)
pure virtual

Set the timestep. {Property} {Property}.

virtual tF32 GetTimeStep ( ) const
pure virtual

Get the timestep. {Property}.

virtual void SetTextureAnimationGrid ( const sVec2i avGridSize)
pure virtual

Set the 'grid' size for the animated textures. {Property}.

virtual sVec2i GetTextureAnimationGrid ( ) const
pure virtual

Get the 'grid' size for the animated textures. {Property}.

virtual tBool GetData ( sParticleSystemData apData) const
pure virtual

Get the particles data pointers.

Remarks
This will point into the internal memory of the implementation, thus it is unsafe and should be used accordingly. {NoAutomation}
virtual tBool SetDomainType ( eParticleDomain  aType)
pure virtual

Set the domain's type. {Property}.

virtual eParticleDomain GetDomainType ( ) const
pure virtual

Get the domain's type. {Property}.

virtual void SetDomainA ( const sVec3f aV)
pure virtual

Set the domain's A vector. {Property}.

virtual sVec3f GetDomainA ( ) const
pure virtual

Get the domain's A vector. {Property}.

virtual void SetDomainB ( const sVec3f aV)
pure virtual

Set the domain's B vector. {Property}.

virtual sVec3f GetDomainB ( ) const
pure virtual

Get the domain's B vector. {Property}.

virtual void SetDomainC ( const sVec3f aV)
pure virtual

Set the domain's C vector. {Property}.

virtual sVec3f GetDomainC ( ) const
pure virtual

Get the domain's C vector. {Property}.

virtual tBool SetDomainPoint ( sVec3f  avPoint)
pure virtual

Set the domain to a point.

virtual tBool SetDomainLine ( sVec3f  avStart,
sVec3f  avEnd 
)
pure virtual

Set the domain to a line.

virtual tBool SetDomainTriangle ( sVec3f  avA,
sVec3f  avB,
sVec3f  avC 
)
pure virtual

Set the domain to a triangle.

virtual tBool SetDomainPlane ( sPlanef  aPlane)
pure virtual

Set the domain to a plane.

virtual tBool SetDomainAABB ( sVec3f  avMin,
sVec3f  avMax 
)
pure virtual

Set the domain to a box.

virtual tBool SetDomainSphere ( sVec3f  avCenter,
tF32  afRadius1,
tF32  afRadius2 
)
pure virtual

Set the domain to a sphere.

virtual tBool SetDomainCylinder ( sVec3f  avStart,
sVec3f  avEnd,
tF32  afRadius1,
tF32  afRadius2 
)
pure virtual

Set the domain to a cylinder.

virtual tBool SetDomainCone ( sVec3f  avStart,
sVec3f  avEnd,
tF32  afRadius1,
tF32  afRadius2 
)
pure virtual

Set the domain to a cone.

virtual tBool SetDomainBlob ( sVec3f  avPosition,
tF32  afStdDev 
)
pure virtual

Set the domain to a blob.

virtual tBool SetDomainDisk ( sVec3f  avPosition,
sVec3f  avNormal,
tF32  afRadius1,
tF32  afRadius2 
)
pure virtual

Set the domain to a disk.

virtual tBool SetDomainRect ( sVec3f  avPoint,
sVec3f  avUBasis,
sVec3f  avVBasis 
)
pure virtual

Set the domain to a rectangle.

virtual void Color ( sColor4f  aColor)
pure virtual

Define the color.

virtual void ColorDomain ( )
pure virtual

Define the color in the current domain.

virtual void AlphaDomain ( )
pure virtual

Define the alpha in the current domain.

virtual void Size ( sVec3f  avSize)
pure virtual

Define the size.

virtual void SizeDomain ( )
pure virtual

Define the size in the current domain.

virtual void Mass ( tF32  afMass)
pure virtual

Define the mass.

virtual void StartingAge ( tF32  afAge,
tF32  afSigma 
)
pure virtual

Define the starting age.

Remarks
The value age can be positive, zero, or negative. Giving particles different starting ages allows pKillOld to distinguish between which to kill in interesting ways. Setting afSigma to a non-zero value will give the particles an initial age with a normal distribution with mean age and standard deviation stdev. When many particles are created at once this allows a few particles to die at each time step, yielding a more natural effect.
virtual void UpVector ( sVec3f  avUp)
pure virtual

Define the up vector.

virtual void UpVectorDomain ( )
pure virtual

Define the up vector in the current domain.

virtual void Velocity ( sVec3f  avUp)
pure virtual

Define the velocity.

virtual void VelocityDomain ( )
pure virtual

Define the velocity in the current domain.

virtual void RotationVector ( sVec3f  avUp)
pure virtual

Define the rotation vector.

virtual void RotationVectorDomain ( )
pure virtual

Define the rotation vector in the current domain.

virtual void PositionB ( sVec3f  avPos)
pure virtual

Define the secondary position.

virtual void PositionBDomain ( )
pure virtual

Define the secondary position in the current domain.

virtual void PositionBTracks ( tBool  abDoCopy)
pure virtual

Specify how the secondary position of each new particle is chosen. Specify how the positionB of each new particle emitted will be chosen. The positionB is the destination position or initial position of particles. See ActionRestore for a use of positionB. If abDoCopy is true then when a particle is created its positionB will be the same as its initial particle position (the default). If abDoCopy is false then when a particle is created its positionB will be chosen from the PositionB domain.

virtual void ActionAvoidDomain ( tF32  afMagnitude,
tF32  afEpsilon,
tF32  afLookAhead 
)
pure virtual

Steer particles away from a domain of space. Particles are tested to see whether they will pass from being outside the specified domain to being inside it within look_ahead time units from now if the next pMove action were to occur now. magnitude tells how drastically the particle velocities are modified to avoid the obstacle at each time step. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. The specific direction and amount of turn is dependent on the kind of domain being avoided.

Remarks
At present the only domains for which pAvoid is implemented are PDSphere, PDRect, PDTriangle, PDDisc and PDPlane.
virtual void ActionBounceDomain ( tF32  afFriction,
tF32  afResilience,
tF32  afCutoff 
)
pure virtual

Bounce particles off a domain of space. Particles are tested to see whether they will pass from being outside the specified domain to being inside it if the next pMove action were to occur now. If they would pass through the surface of the domain, they are instead bounced off it. That is, their velocity vector is decomposed into components normal to the surface and tangent to the surface. The direction of the normal component is reversed, and the components are recomposed into a new velocity heading away from the surface. The normal component is multiplied by the resilience parameter and the tangential component, if its magnitude is greater than cutoff, is multiplied by (1 - the friction parameter) when being composed into the new velocity vector. The cutoff parameter can allow particles to glide smoothly along a surface without sticking.

Remarks
Since particles are tested to see whether they would pass through the domain if pMove were called now, it is best to have pBounce be the last action that modifies a particle's velocity before calling pMove. Also, actions such as pRandomDisplace and pVortex that modify a particle's position directly, rather than modifying its velocity vector, may yield unsatisfying results when used with pBounce.
At present the only domains for which pBounce is implemented are PDSphere, PDRect, DTriangle, PDDisc and PDPlane. For spheres, the particle is always forced out of the sphere. For planes, triangles and discs, the particles bounce off either side of the surface. For rectangles, particles bounce off either side of the diamond-shaped patch whose corners are o, o+u, o+u+v, and o+v. See the documentation on domains for an explanation.
See the documentation of Domains for an explanation of the other arguments.
pBounce doesn't work correctly with small time step sizes for particle sliding along a surface. The friction and resilience parameters should not be scaled by dt, since a bounce happens instantaneously. On the other hand, they should be scaled by dt because particles sliding along a surface will hit more often if dt is smaller. If you have any suggestions, let me know.
virtual void ActionCopyVertexB ( tBool  abCopyPos = eTrue,
tBool  abCopyVel = eFalse 
)
pure virtual

Set the secondary position from current position. If copy_pos is true, sets the positionB of each particle in the current particle group to be equal to the current position of that particle. This makes each particle "remember" this position so it can later return to it using pRestore. If copy_vel is true, sets the velocityB of each particle in the current particle group to be equal to the current velocity of that particle. This is useful for computing the orientation of the particle when rendering it using pDrawGroupl.

virtual void ActionDamping ( sVec3f  avDamping,
tF32  afVLow = 0.0f,
tF32  afVHigh = kfParticlesMax 
)
pure virtual

Simulate air by slowing down particle velocities. If a particle's velocity magnitude is within vlow and vhigh, then multiply each component of the velocity by the respective damping constant. Typically, the three components of damping will have the same value.

Remarks
There are no bounds on the damping constants. Thus, by giving values greater than 1.0 they may be used to speed up particles in stead of slow them down.
virtual void ActionRotationDamping ( sVec3f  avDamping,
tF32  afVLow = 0.0f,
tF32  afVHigh = kfParticlesMax 
)
pure virtual

Rotation damping.

virtual void ActionExplosion ( sVec3f  avCenter,
tF32  afVelocity,
tF32  afMagnitude,
tF32  afStdev,
tF32  afEpsilon = kfParticlesEpsilon,
tF32  afAge = 0.0f 
)
pure virtual

An Explosion. Causes an explosion by accelerating all particles away from the center. Particles are accelerated away from the center by an amount proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. The shock wave of the explosion has a gaussian magnitude. The center of the gaussian travels outward from the center at the specified velocity. So at a given time step, particles at a distance (velocity * age) from center will receive the most acceleration, and particles not at the peak of the shock wave will receive a lesser acceleration. The shock wave has a standard deviation of stdev, which is the sharpness or broadness of the strength of the wave. age is used to calculate the radius of the shock wave. For pExplosion calls in action lists, age is the initial age of the explosion. It is incremented by dt after each call. For immediate mode, age is the current age of the explosion, and it is up to the application to increment the age parameter for each call to pExlosion.

Remarks
Since the current radius of the shock wave is given by (velocity
  • age) you can set up a standing wave by setting velocity to the desired radius of the wave and age to 1.0. This only works in immediate mode.
virtual void ActionFollow ( tF32  afMagnitude = 1.0f,
tF32  afEpsilon = kfParticlesEpsilon,
tF32  afMaxRadius = kfParticlesMax 
)
pure virtual

Accelerate toward the next particle in the group. This allows snaky effects where the particles follow each other. Each particle is accelerated toward the next particle in the group by an amount proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. afMaxRadius defines the sphere of influence of this action. No particle further than afMaxRadius from its predecessor is affected.

Remarks
The pFollow action does not affect the last particle in the group. This allows controlled effects where the last particle in the group is killed after each time step and replaced by a new particle at a slightly different position. See pKillOld to learn how to kill the last particle in the group after each step.
virtual void ActionGravitate ( tF32  afMagnitude = 1.0f,
tF32  afEpsilon = kfParticlesEpsilon,
tF32  afMaxRadius = kfParticlesMax 
)
pure virtual

Accelerate each particle toward each other particle. Each particle is accelerated toward each other particle in the group by an amount proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. afMaxRadius defines the sphere of influence of this action. No particle further than afMaxRadius from another particle is affected.

virtual void ActionGravity ( sVec3f  avDirection)
pure virtual

Accelerate particles in the given direction. The gravity acceleration vector is simply added to the velocity vector of each particle at each time step. The magnitude of the gravity vector is the acceleration due to gravity. For example, pGravity(0, 0, -9.8) specifies gravity in the negative Z direction.

virtual void ActionJet ( sVec3f  avCenter,
tF32  afMagnitude = 1.0f,
tF32  afEpsilon = kfParticlesEpsilon,
tF32  afMaxRadius = kfParticlesMax 
)
pure virtual

Accelerate particles that are near the center of the jet. For each particle, chooses an acceleration vector from the domain and applies it to the particle's velocity. The amount of acceleration applied is directly proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. The domain from which acceleration vectors are chosen is the current velocity domain. afMaxRadius defines the sphere of influence of this action. No particle further than afMaxRadius from the center is affected.

virtual void ActionKillOld ( tF32  afAgeLimit,
tBool  abKillLessThan = eFalse 
)
pure virtual

Remove old particles. Removes all particles older than age_limit. But if kill_less_than is true, it instead removes all particles newer than age_limit. age_limit is not clamped, so negative values are ok. This can be used in conjunction with pStartingAge(-n) to create and then kill a particular set of particles.

Remarks
In order to kill a particular particle, set pStartingAge to a number that will never be a typical age for any other particle in the group, for example -10.0. Then emit the particle using pSource or pVertex. Then do the rest of the particle actions and finally call pKillOld(-8.0, true) to kill the special particle because it is the only one with an age less than -8.0.
virtual void ActionMatchVelocity ( tF32  afMagnitude = 1.0f,
tF32  afEpsilon = kfParticlesEpsilon,
tF32  afMaxRadius = kfParticlesMax 
)
pure virtual

Modify each particle's velocity to be similar to that of its neighbors. Each particle is accelerated toward the weighted mean of the velocities of other particles in the group by an amount proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2 to the other particles. But when r is small, the acceleration would be infinite, so epsilon is always added to r. Using an epsilon similar in magnitude to magnitude can increase the range of influence of nearby particles on this particle.

Remarks
This action is more computationally intensive than the others are because each particle is affected by each other particle.
virtual void ActionMatchRotVelocity ( tF32  afMagnitude = 1.0f,
tF32  afEpsilon = kfParticlesEpsilon,
tF32  afMaxRadius = kfParticlesMax 
)
pure virtual

Modify each particle's rotational velocity to be similar to that of its neighbors.

virtual void ActionMove ( )
pure virtual

Move particle positions based on velocities. This action actually updates the particle positions by adding the current velocity to the current position. This is typically the last particle action performed in an iteration of a particle simulation, and typically only occurs once per action list. The velocity is multiplied by the time step length, dt, before being added to the position. This implements Euler's method of numerical integration with a constant, but specifiable step size. See pTimeStep for more on varying the step size.

virtual void ActionOrbitLine ( sVec3f  avPoint,
sVec3f  avAxis,
tF32  afMagnitude = 1.0f,
tF32  afEpsilon = kfParticlesEpsilon,
tF32  afMaxRadius = kfParticlesMax 
)
pure virtual

Accelerate toward the closest point on the given line. p and axis define an infinite line, where p can be any point on the line and axis is any vector parallel to the line. For each particle, this action computes the vector to the closest point on the line, and accelerates the particle in the vector direction. The amount of acceleration applied is directly proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. afMaxRadius defines the infinite cylinder of influence of this action. No particle further than afMaxRadius from the line is affected.

virtual void ActionOrbitPoint ( sVec3f  avCenter,
tF32  afMagnitude = 1.0f,
tF32  afEpsilon = kfParticlesEpsilon,
tF32  afMaxRadius = kfParticlesMax 
)
pure virtual

Accelerate toward the given center point. For each particle, this action computes the vector to the center point, and accelerates the particle in the vector direction. The amount of acceleration applied is directly proportional to magnitude. As with most acceleration actions, the amount of acceleration falls off inversely with r2. But when r is small, the acceleration would be infinite, so epsilon is always added to r. afMaxRadius defines the sphere of influence of this action. No particle further than afMaxRadius from the center is affected.

virtual void ActionRandomAccelerationDomain ( )
pure virtual

Accelerate particles in random directions. For each particle, chooses an acceleration vector from the specified domain and adds it to the particle's velocity. Reducing the time step, dt, will make a higher probability of being near the original velocity after unit time. Smaller dt approach a normal distribution of velocity vectors instead of a square wave distribution.

Remarks
See the documentation of Domains for an explanation of the other arguments.
virtual void ActionRandomDisplaceDomain ( )
pure virtual

Immediately replace position with a position from the domain. For each particle, chooses a displacement vector from the specified domain and adds it to the particle's position. Reducing the time step, dt, will make a higher probability of being near the original position after unit time. Smaller dt approach a normal distribution of particle positions instead of a square wave distribution.

Remarks
Since this action moves particle positions, unsatisfying results may occur when used with the pAvoid or pBounce actions. In particular, particles may be displaced to the opposite side of the surface without bouncing off it.
See the documentation of Domains for an explanation of the other arguments.
virtual void ActionRandomVelocityDomain ( )
pure virtual

Immediately replace velocity with a velocity from the domain. For each particle, sets the particle's velocity vector to a random vector in the specified domain. This function is not affected by dt. If you can think of an appropriate way for this to vary with dt, let me know.

Remarks
See the documentation of Domains for an explanation of the other arguments.
virtual void ActionRandomRotVelocity ( )
pure virtual

Immediately replace rotation velocity with a velocity from the domain.

virtual void ActionRestore ( tF32  afTime,
tBool  abVel = eTrue,
tBool  abRVel = eTrue 
)
pure virtual

Over time, restore particles to their secondary positions. Computes a new velocity for each particle that will make the particle arrive at its positionB at the specified amount of time in the future. The curved path that the particles take is a parametric quadratic. Once the specified amount of time has passed, the particles are clamped to their positionB and their velocities are set to 0 to freeze them in place. If pRestore is called in immediate mode, it is the application's responsibility to decrease time_left by dt on each call. When in an action list, time_left gets decremented automatically. The positionB attribute of each particle is typically the particle's position when it was created, or it can be specified within a domain. This is controlled by pVertexBTracks, pVertexB, and pVertexBD. The positionB can be set at any time to the particle's current position using the pCopyVertexB action.

Remarks
pRestore(0) is the opposite of pCopyVertexB it sets each particle's position to be equal to its positionB. However, this has the side effect of setting each particle's velocity to 0.
virtual void ActionSinkDomain ( tBool  abKillInside)
pure virtual

Kill particles with positions on wrong side of the specified domain. If kill_inside is true, deletes all particles inside the given domain. If kill_inside is false, deletes all particles outside the given domain.

Remarks
See the documentation of Domains for an explanation of the other arguments.
virtual void ActionSinkVelocityDomain ( tBool  abKillInside)
pure virtual

Kill particles with velocities on wrong side of the specified domain. If kill_inside is true, deletes all particles whose velocity vectors are inside the given domain. If kill_inside is false, deletes all particles whose velocity vectors are outside the given domain. This allows particles to die when they turn around, get too fast or too slow, etc.

Remarks
This action replaces the deprecated pKillSlow by using a sphere domain centered at the origin and a radius equal to the cutoff velocity.
See the documentation of Domains for an explanation of the other arguments.
virtual void ActionSort ( sVec3f  avEye,
sVec3f  avLookAt 
)
pure virtual

Sort the particles relativly to the specified eye and view direction.

virtual void ActionSource ( tF32  afParticleRate,
const sVec3f vWordPos,
const sVec2i avTexFrameRange 
)
pure virtual

Add particles in the specified domain. Adds new particles to the current particle group. The particle positions are chosen from the given domain. The particle colors, sizes, initial ages, velocities, and secondary positions are chosen according to their current domains. See pColor, pColorD, pSize, pStartingAge, pVelocity, pVelocityD, pVertexB, pVertexBD, and pVertexBTracks. When pSource is called within an action list, the particle attribute domains used are those that were current when the pSource command was called within the pNewActionList / pEndActionList block instead of when pCallActionList is called. Note that this is unlike OpenGL. particle_rate is the number of particles to add per unit time. If particle_rate / dt is a fraction then pSource adjusts the number of particles to add during this time step so that the average number added per unit time is particle_rate.

Remarks
anTexFrameIndex indicates which frame of a texture animation will be used initialy. Pass eInvalidHandle to pick a random texture frame.
If too few particles seem to be added each frame, it is probably because the particle group is already full. If this is bad, you can grow the group using pSetMaxParticles.
See the documentation of Domains for an explanation of the other arguments.
virtual void ActionSpeedLimit ( tF32  afMinSpeed,
tF32  afMaxSpeed = kfParticlesMax 
)
pure virtual

Clamp each particle's speed to the given min and max. Computes each particle's speed (the magnitude of its velocity vector) and if it is less than min_speed or greater than max_speed it is clamped to those bounds, while preserving the velocity vector's direction.

Remarks
The vector [0,0,0] is an exception because it has no direction. Such vectors are not modified by pSpeedLimit.
virtual void ActionTargetColor ( sColor4f  avColor,
tF32  afScale 
)
pure virtual

Change color of all particles toward the specified color. Modifies the color and alpha of each particle to be scale percent of the way closer to the specified color and alpha. scale is multiplied by dt before scaling the sizes. Thus, using smaller dt causes a slightly faster approach to the target color.

Remarks
This action makes all colors tend toward the specified, uniform color. Future versions will have more actions that modify color. Please send me suggestions (perhaps with sample implementations).
The value of scale will usually be very small (less than 0.01) to yield a gradual transition.
virtual void ActionTargetSize ( sVec3f  avSize,
sVec3f  avScale 
)
pure virtual

Change sizes of all particles toward the specified size. Modifies the size of each particle to be scale percent of the way closer to the specified size triple. This makes sizes grow asymptotically closer to the given size. scale is multiplied by dt before scaling the sizes. Thus, using smaller dt causes a slightly faster approach to the target size. The separate scales for each component allow only selected components to be scaled.

Remarks
This action makes all sizes tend toward the specified, uniform size. Future versions will have more actions that modify size. Please send me suggestions (perhaps with sample implementations).
The value of scale will usually be very small (less than 0.01) to yield a gradual transition.
virtual void ActionTargetVelocity ( sVec3f  avVel,
tF32  afScale 
)
pure virtual

Modifies the velocity of each particle to be scale percent of the way closer to the specified velocity triple. This makes velocities grow asymptotically closer to the given velocity. scale is multiplied by dt before scaling the velocities. Thus, using smaller dt causes a slightly faster approach to the target velocity.

Remarks
This action makes all velocities tend toward the specified, uniform velocity.
The value of scale will usually be very small (less than 0.01) to yield a gradual transition.
virtual void ActionTargetRotVelocity ( sVec3f  avVel,
tF32  afScale 
)
pure virtual

Modifies the rotation velocity of each particle to be scale percent of the way closer to the specified velocity triple. This makes velocities grow asymptotically closer to the given velocity. scale is multiplied by dt before scaling the velocities. Thus, using smaller dt causes a slightly faster approach to the target velocity.

virtual void ActionVortex ( sVec3f  avCenter,
sVec3f  avAxis,
tF32  afMagnitude = 1.0f,
tF32  afTightnessExponent = 1.0f,
tF32  afRotSpeed = 1.0f,
tF32  afEpsilon = kfParticlesEpsilon,
tF32  afMaxRadius = kfParticlesMax 
)
pure virtual

Swirl particles around a vortex. Center and axis define an infinite line, where center represents the tip of the vortex and axis is a vector along the line, the length of which is irrelevant. As with most acceleration actions, the amount of acceleration falls off inversely with r2 to the center. But when r is small, the acceleration would be infinite, so epsilon is always added to r. Using an epsilon similar in magnitude to magnitude can increase the range of influence of the vortex. afMaxRadius defines the sphere of influence of this action. No particle further than afMaxRadius from the vortex center is affected.

Remarks
pVortex immediately displaces particle positions, unlike most actions which affect particle velocities, so unsatisfying results may occur when used with the pAvoid or pBounce actions. In particular, particles may be displaced to the opposite side of the surface without bouncing off it.
pVortex currently does not pull the particles up or down along the axis like a tornado. This will be saved for a future release. If you can suggest an implementation, feel free to send it to me.
Particles can be attracted toward the axis of the vortex using pOrbitLine.
virtual tF32 ActionTextureAnimation ( tI32  anInc,
tBool  abClamp,
tF32  afCurrentFrameTime,
tF32  afFrameTime,
const sVec2i avTexFrameRange 
)
pure virtual

Set the next texture animation frame (adds the specified increment, which can be negative).

Parameters
anIncincrement per frame update, 1 to go fwd, -1 to go backward, invalid to pick a random frame
abClampif true the range will be the maximum
afCurrentFrameTimeis the time that has been accumulated for the current frame
afFrameTimeis the time that the frame will be displayed
avTexFrameRangeis the range of frames to play
Returns
the new current frame time
virtual void ActionTextureRotation ( tF32  afScale)
pure virtual

Rotates the particle's texture coordinates.

virtual void ActionTargetColorAge ( sColor4f  avColor,
tF32  afScale,
tF32  afStartAge,
tF32  afEndAge 
)
pure virtual

Modifies the particles color over time.

virtual void ActionTargetSizeAge ( sVec3f  avSize,
sVec3f  avScale,
tF32  afStartAge,
tF32  afEndAge 
)
pure virtual

Modified the particles size over time.

virtual tBool SetRenderingMode ( eParticleRendering  aRen)
pure virtual

Set the particle rendering mode. {Property}.

virtual eParticleRendering GetRenderingMode ( ) const
pure virtual

Get the particle rendering mode. {Property}.

virtual void SetRenderingData ( iUnknown apData)
pure virtual

Set the particle rendering data.

Remarks
The type of the data depend of the rendering type. Should be an iTexture instant for point sprites and an iDrawOperation instance for DrawOperation. Lines doesnt require any specific data. {Property}
virtual iUnknown* GetRenderingData ( ) const
pure virtual

Get the particle rendering data. {Property}.

virtual void SetTransformMatrix ( const sMatrixf aMatrix)
pure virtual

Set the transform matrix. {Property}.

virtual sMatrixf GetTransformMatrix ( ) const
pure virtual

Get the transform matrix. {Property}.

virtual void SetTransformEnabled ( tBool  abTransformEnabled)
pure virtual

Set whether the particle group is transformed. {Property}.

virtual tBool GetTransformEnabled ( ) const
pure virtual

Get whether the particle group is transformed. {Property}.

virtual tBool Render ( iCanvas apCanvas)
pure virtual

Render the particle system.