NL3D::CParticleSystem Class Reference

This class holds a particle system. More...

#include <particle_system.h>

Inherits NLMISC::CRefCount.

List of all members.

Classes

class  CCoordSystemInfo
class  CGlobalVectorValueHandle
struct  CSpawnVect
class  CUserCoordSystemInfo

Public Types

enum  TPass { Anim, SolidRender, BlendRender, ToolRender }
typedef std::vector< CPSSpawnInfoTSpawnInfoVect

Public Member Functions

void setName (const std::string &s)
 Set the name of the system.
std::string getName (void) const
 Get the name of the system.
void interpolateFXPosDelta (NLMISC::CVector &dest, TAnimationTime deltaT)
 =======================================================================================
void interpolateUserPosDelta (NLMISC::CVector &dest, TAnimationTime deltaT)
 =======================================================================================
float getAutoLODEmitRatio () const
void matrixModeChanged (CParticleSystemProcess *proc, TPSMatrixMode oldMode, TPSMatrixMode newMode)
 =======================================================================================
void addRefForUserSysCoordInfo (uint numRefs=1)
 =======================================================================================
void releaseRefForUserSysCoordInfo (uint numRefs=1)
 =======================================================================================
void dumpHierarchy ()
 =======================================================================================
Object



 CParticleSystem ()
 ctor
virtual ~CParticleSystem ()
 dtor
void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 serialize this particle system
bool merge (CParticleSystemShape *toMerge)
 Merge this system with a system instanciated from the given shape NB : This is for edition purpose, this is slow.
Sharing system



void enableSharing (bool enabled=true)
 Enable/Disable sharing.
bool isSharingEnabled () const
 Test whether sharing is enabled.
Driver setup



void setDriver (IDriver *driver)
 set the driver use to render the system
IDrivergetDriver (void)
 return the driver that will be used for rendering
Scene setup



void setScene (CScene *scene)
 Set the scene in which the particle system is inserted.
CScenegetScene () const
Position of the system



void hide (bool hidden)
 Hide / show the system This just duplicates the 'hiden' flag of matching transform (instance of CParticleSystemModel) If the system goes from 'hide' to 'show', then no trails are generated.
void onShow (bool shown)
 Called by owner model, when the visibility of this ps has changed (that is, the show / hide flag, not the 'clipped' state).
void setSysMat (const NLMISC::CMatrix *m)
 Set the matrix for elements with matrixMode == PSFXMatrix.
void setUserMatrix (const NLMISC::CMatrix *m)
 The same as 'setSysMat', but to set the matrix for elements with matrixMode == PSUserMatrix NB : pointer to the matrix should remains valid as long as that particle system exists (no copy of the matrix is kept).
const NLMISC::CMatrixgetSysMat () const
 return the matrix of the system
const NLMISC::CMatrixgetInvertedSysMat () const
 return the inverted matrix of the system
const NLMISC::CMatrixgetUserMatrix () const
 return the user matrix NB : to save memory, the user matrix is actually saved when at least one instance of CPSLocated that belongs to the system makes a reference on it.
const NLMISC::CMatrixgetInvertedUserMatrix () const
 return the inverted user matrix NB : to save memory, the user matrix is actually saved when at least one instance of CPSLocated that belongs to the system makes a reference on it.
const NLMISC::CMatrixgetUserToFXMatrix () const
const NLMISC::CMatrixgetFXToUserMatrix () const
void setViewMat (const NLMISC::CMatrix &m)
 set the view matrix This must be called otherwise results can't be correct
const NLMISC::CMatrixgetViewMat (void) const
 get the view matrix .
const NLMISC::CMatrixgetInvertedViewMat (void) const
 get the inverted view matrix . It is stored each time a new frame is processed
Execution of the system



virtual void step (TPass pass, TAnimationTime ellapsedTime, CParticleSystemShape &shape, CParticleSystemModel &model)
 execute all the process of the system.
Process attachment. Most process are located : set of objects of the same type that have a position

in space



bool attach (CParticleSystemProcess *process)
 Attach a process (such as a located : see particle_system_process.h, and ps_located.h) to the system.
CParticleSystemProcessdetach (uint index)
 Detach a process from the system (but do not delete it).
bool isProcess (const CParticleSystemProcess *process) const
 Test whether a process is part of this system.
uint getIndexOf (const CParticleSystemProcess &process) const
 Given its pointer, return an index to a process.
void remove (CParticleSystemProcess *process)
 Remove a process It is deleted by the system if not present -> nl assert.
uint32 getNbProcess (void) const
 get the number of process that are attached to the system
CParticleSystemProcessgetProcess (uint32 index)
 Get a pointer to the nth process.
const CParticleSystemProcessgetProcess (uint32 index) const
 Get a const pointer to the nth process.
Date / Time



TAnimationTime getSystemDate (void) const
 get the time ellapsed since the system was created.
void setSystemDate (float date)
 St the time of the system.
uint64 getDate (void) const
 Get the date of the system (the number of time it has been drawn in fact) This may be used to skip frames in an animation for example.
Edition methods : provides some tools for an external editor



void setCurrentEditedElement (CPSLocated *loc=NULL, uint32 index=0, class CPSLocatedBindable *bd=NULL)
 For edition purposes only : this allow to highlight in red the current element being edited.
void getCurrentEditedElement (CPSLocated *&loc, uint32 &index, CPSLocatedBindable *&lb)
 Retrieve the current edited element.
void setFontGenerator (CFontGenerator *fg)
 Set a font generator. Useful only for edition. don't need that in runtime.
CFontGeneratorgetFontGenerator (void)
 Retrieve the font generator. Edition purpose only.
const CFontGeneratorgetFontGenerator (void) const
 Retrieve the font generator (const version). Edition purpose only.
void setFontManager (CFontManager *fg)
 Set a font Manager. Useful only for edition. don't need that in runtime.
CFontManagergetFontManager (void)
 Retrieve the font Manager. Edition purpose only.
const CFontManagergetFontManager (void) const
 Retrieve the font Manager (const version). Edition purpose only.
Transparency / opacity



bool hasOpaqueObjects (void) const
 returns 'true' if the system has opaque object in it.
bool hasTransparentObjects (void) const
 returns 'true' if the system has transparent objects in it.
Lighting



bool hasLightableObjects () const
 returns 'true' if the system has lightable objects in it
Integration parameters



void enableAccurateIntegration (bool enable=true)
 This enable for more accurate integrations of movement.
bool isAccurateIntegrationEnabled (void) const
void setAccurateIntegrationParams (TAnimationTime threshold, uint32 maxNbIntegrations, bool canSlowDown, bool keepEllapsedTimeForLifeUpdate)
 the the time threshold and the max number of integration to perform, when accurate integration is activated.
void getAccurateIntegrationParams (TAnimationTime &threshold, uint32 &maxNbIntegrations, bool &canSlowDown, bool &keepEllapsedTimeForLifeUpdate)
 get the parameters used for integration.
float getTimeTheshold () const
uint getMaxNbIntegrations () const
 get max nb integrations meaningful only if 'setBypassMaxNumIntegrationSteps' is false
void setBypassMaxNumIntegrationSteps (bool bypass=true)
 When activated, this bypass the limit on the max number of integration steps This should NOT be used on FXs that are looping, because it would slow endlessly Anyway if you try to do that an assertion will ocurrs Typically, this is useful for spell fx because they are short, and it is important that they don't slow down when framerate is too choppy.
bool getBypassMaxNumIntegrationSteps () const
bool canFinish (CPSLocatedBindable **lastingForeverObj=NULL) const
 Test if the system can finish (e.g it doesn't loop, doesn't have emitter with illimited lifetime) NB : we assume that all emitters in the system are accessible, e.g that the located graph is connex.
bool hasLoop (CPSLocatedBindable **loopingObj=NULL) const
 Test if there are loops in the system.
LOD managment. LOD, when used can be performed in 2 ways :

- Hand tuned LOD (for emission, color, size : this uses LOD as an input for attribute makers).

  • Auto LOD : - With non-shared systems, it modulates the emission period, quantity etc.. to get the desired result.
    • With shared systems : One version is animated with full LOD (no hand tuned LOD should be applied !). All version are displayed with fewer particle than the full LOD, depending on their distance. Visually, this is not as good as hand-tuned system, or auto-LOD on non-shared systems, however ..


void setMaxViewDist (float maxDist)
 set the max view distance for the system (in meters) . The default is 50 meters.
float getMaxViewDist (void) const
 get the max view distance
void setLODRatio (float ratio)
 set a percentage that indicate where the 2nd LOD is located. Default is 0.5.
float getLODRatio (void) const
 get the lod ratio.
void getLODVect (NLMISC::CVector &v, float &offset, TPSMatrixMode matrixMode)
 compute a vector and a distance that are used for LOD computations.
TPSLod getLOD (void) const
 get the current LOD of the system. It is based on the distance of the center of the system to the viewer
float getOneMinusCurrentLODRatio (void) const
 get 1.f - the current lod ratio (it is updated at each motion pass)
void enableAutoLOD (bool enabled=true)
 Enable / disbale auto-lod.
bool isAutoLODEnabled () const
 test whether Auto-LOD is enabled
void setupAutoLOD (float startDistPercent, uint8 degradationExponent)
 Setup auto lod parameters.
void setMaxDistLODBias (float lodBias)
 when auto-lod on a non shared system is used, this set the degradation of the system when it is far A value of 0 mean no more emissions at all.
float getMaxDistLODBias () const
float getAutoLODStartDistPercent () const
uint8 getAutoLODDegradationExponent () const
void setAutoLODMode (bool skipParticles)
 There are 2 modes for the auto-LOD (apply to shared systems only) :

  • Particle are skip in the source container when display is performed (the default)
  • There are just less particles displayed, but this can lead to 'pulse effect'.

bool getAutoLODMode () const
void setColorAttenuationScheme (CPSAttribMaker< NLMISC::CRGBA > *colScheme)
 Setup a color attenuation scheme with the distance from the viewer.
CPSAttribMaker< NLMISC::CRGBA > * getColorAttenuationScheme ()
 Get the global color attenuation scheme.
const CPSAttribMaker
< NLMISC::CRGBA > * 
getColorAttenuationScheme () const
void setUserColor (NLMISC::CRGBA userColor)
 Set the user color of the system Final color is the color due to attenuationByDistance (.
NLMISC::CRGBA getUserColor () const
bool isUserColorUsed () const
NLMISC::CRGBA getGlobalColor () const
 Get the current global color of the system.
NLMISC::CRGBA getGlobalColorLighted () const
 Get the current global color of the system with lighting included.
bool getForceGlobalColorLightingFlag ()
void setForceGlobalColorLightingFlag (bool enable)
void setLightingColor (NLMISC::CRGBA col)
NLMISC::CRGBA getLightingColor () const



float getWantedNumTris (float dist)
 =======================================================================================
void setNumTris (uint numFaces)
 set the number of tree the system may use. If not clled this will be the max
bool isLoadBalancingEnabled () const
 Ask for the particle system to reevaluate the max number of faces it may need.
void enableLoadBalancing (bool enabled=true)
 Enable / disable load balancing. By default its on.
Bounding box managment



void computeBBox (NLMISC::CAABBox &aabbox)
 Compute the aabbox of this system, (expressed in thesystem basis) If the bbox is precomputed, the precomputed bbox is returned.
void forceComputeBBox (NLMISC::CAABBox &aabbox)
 Force computation of current bbox, even if a precomputed bbox has been set.
void setAutoComputeBBox (bool enable=true)
 When this is set to false, the system will recompute his bbox each time it is querried This may be needed for systems that move fast.
bool getAutoComputeBBox (void) const
 test whether the system compute himself his bbox
void setPrecomputedBBox (const NLMISC::CAABBox &precompBBox)
 set a precomputed bbox (expressed in the system basis).
void getLastComputedBBox (NLMISC::CAABBox &dest)
 get the last computed bbox
external access to locatedBindable. PRIVATE PART (to avoid the use of friend)



void registerLocatedBindableExternID (uint32 id, CPSLocatedBindable *lb)
 register a locatedBindable, and allow it to be referenced by the given ID this locatedBindable must belong to this system.
void unregisterLocatedBindableExternID (CPSLocatedBindable *lb)
 unregister the given located bindable. An assertion is raised if it has not been registered before
external access to locatedBindable. PUBLIC PART



uint getNumLocatedBindableByExternID (uint32 id) const
 return the number the number of located bindable bound with this ID
CPSLocatedBindablegetLocatedBindableByExternID (uint32 id, uint index)
 return the nth locatedBindable associtaed with this ID.
const CPSLocatedBindablegetLocatedBindableByExternID (uint32 id, uint index) const
 =======================================================================================
uint getNumID () const
 Get the number of IDs in the system.
uint32 getID (uint index) const
 Get the nth ID, or 0 if index is invalid.
void getIDs (std::vector< uint32 > &dest) const
 Get all the IDs in the system.

Static Public Attributes

static uint32 NbParticlesDrawn = 0
 used for benchs. must be reset by the user
static std::vector
< NLMISC::CSmartPtr
< CSpawnVect > > 
_Spawns
static std::vector< uint_ParticleToRemove
static std::vector< sint_ParticleRemoveListIndex
static std::vector< uint_CollidingParticles
static std::vector
< NLMISC::CVector
_SpawnPos
static TAnimationTime EllapsedTime = 0.f
static TAnimationTime InverseTotalEllapsedTime = 0.f
static TAnimationTime RealEllapsedTime = 0.f
static float RealEllapsedTimeRatio = 1.f
static bool InsideSimLoop = false
static bool InsideRemoveLoop = false
static bool InsideNewElementsLoop = false
static CParticleSystemModelOwnerModel = NULL

Private Types

typedef std::map< std::string,
float
TGlobalValuesMap
typedef std::map< std::string,
NLMISC::CVector
TGlobalVectorValuesMap
typedef CPSVector
< CParticleSystemProcess * >
::V 
TProcessVect
typedef CPSMultiMap< uint32,
CPSLocatedBindable * >::M 
TLBMap

Private Member Functions

void stepLocated (TPSProcessPass pass)
 process a pass on the bound located
float updateLODRatio ()
 =======================================================================================
float getDistFromViewer () const
 =======================================================================================
void updateColor (float distFromViewer)
 =======================================================================================
void updateNumWantedTris ()
void updateProcessIndices ()
 =======================================================================================
void checkIntegrity ()
 =======================================================================================

Private Attributes

NLMISC::CAABBox _PreComputedBBox
IDriver_Driver
TProcessVect _ProcessVect
CFontGenerator_FontGenerator
CFontManager_FontManager
CCoordSystemInfo _CoordSystemInfo
CUserCoordSystemInfo_UserCoordSystemInfo
NLMISC::CMatrix _ViewMat
NLMISC::CMatrix _InvertedViewMat
uint64 _Date
sint64 _LastUpdateDate
 Last update date of the system. Useful with sharing only, to avoid several motions.
CPSLocated_CurrEditedElementLocated
CPSLocatedBindable_CurrEditedElementLocatedBindable
uint32 _CurrEditedElementIndex
CScene_Scene
 the scene in which the particle system is inserted.
std::string _Name
TAnimationTime _TimeThreshold
TAnimationTime _SystemDate
uint32 _MaxNbIntegrations
float _LODRatio
float _OneMinusCurrentLODRatio
float _MaxViewDist
float _MaxDistLODBias
float _InvMaxViewDist
float _InvCurrentViewDist
float _AutoLODEmitRatio
TDieCondition _DieCondition
TAnimationTime _DelayBeforeDieTest
uint _NumWantedTris
TAnimType _AnimType
float _UserParam [MaxPSUserParam]
const
TGlobalValuesMap::value_type ** 
_UserParamGlobalValue
uint8 _BypassGlobalUserParam
TPresetBehaviour _PresetBehaviour
TLBMap _LBMap
float _AutoLODStartDistPercent
uint8 _AutoLODDegradationExponent
CPSAttribMaker< NLMISC::CRGBA > * _ColorAttenuationScheme
NLMISC::CRGBA _GlobalColor
NLMISC::CRGBA _GlobalColorLighted
NLMISC::CRGBA _LightingColor
NLMISC::CRGBA _UserColor
bool _ComputeBBox: 1
bool _BBoxTouched: 1
 when set to true, the system will compute his BBox every time computeBBox is called
bool _AccurateIntegration: 1
bool _CanSlowDown: 1
bool _DestroyModelWhenOutOfRange: 1
bool _DestroyWhenOutOfFrustum: 1
bool _Sharing: 1
bool _AutoLOD: 1
bool _KeepEllapsedTimeForLifeUpdate: 1
bool _AutoLODSkipParticles: 1
bool _EnableLoadBalancing: 1
bool _EmitThreshold: 1
bool _BypassIntegrationStepLimit: 1
bool _ForceGlobalColorLighting: 1
bool _AutoComputeDelayBeforeDeathTest: 1
bool _AutoCount: 1
bool _HiddenAtCurrentFrame: 1
bool _HiddenAtPreviousFrame: 1

Static Private Attributes

static TGlobalValuesMap _GlobalValuesMap
static TGlobalVectorValuesMap _GlobalVectorValuesMap
static UPSSoundServer_SoundServer = NULL
static bool _SerialIdentifiers = false
static bool _ForceDisplayBBox = false

Friends

class CParticleSystemModel

Invalidity flags (no direct effect, just indications for a third party, a model holding the system for example)



enum  TDieCondition { none, noMoreParticles, noMoreParticlesAndEmitters }
 

this enum give consitions on which the system may be invalid

More...
enum  TAnimType { AnimVisible = 0, AnimInCluster, AnimAlways, LastValue }
 

This enum tells when animation must be performed.

More...
enum  TPresetBehaviour {
  EnvironmentFX = 0, RunningEnvironmentFX, SpellFX, LoopingSpellFX,
  MinorFX, UserBehaviour, MovingLoopingFX, SpawnedEnvironmentFX,
  GroundFX, Projectile, PresetLast
}
 

Because choosing the previous parameters can be difficult, this define presets hat can be used to tune the system easily.

More...
void setDestroyModelWhenOutOfRange (bool enable=true)
 Tell the system that it is invalid when its out of range.
bool getDestroyModelWhenOutOfRange (void) const
 check whether the system is invalid it's out of range.
void setDestroyCondition (TDieCondition dieCondition)
 when != to none, the Model hodling this sytem will be considered invalid when dieCondition is met This is only an indication flag and must be checked by third party (a model holding it for example) that must then use the right methods
bool isDestroyConditionVerified () const
 =======================================================================================
TDieCondition getDestroyCondition (void) const
 get the destroy condition
void setDelayBeforeDeathConditionTest (TAnimationTime delay)
 Set a delay before to apply the death condition test This may be necessary : the system could be destroyed because there are no particles, but no particles were emitted yet.
void systemDurationChanged ()
 Must be called by a sub component of the system to tell that the duration of the system may have changed.
TAnimationTime getDelayBeforeDeathConditionTest () const
 Get the a delay before to apply the death condition test If the delay was set to -1 or a negative value, this will compute the delay.
void setAutoComputeDelayBeforeDeathConditionTest (bool computeAuto)
 Tells that the system should recompute the delay before death test itself This delay is updated when :

  • The system structure is changed (located added, merge .

bool getAutoComputeDelayBeforeDeathConditionTest () const
void destroyWhenOutOfFrustum (bool enable=true)
 tells the model holding this system that he become invalid when its out of the view frustum.
bool doesDestroyWhenOutOfFrustum (void) const
 check whether the system must be destroyed when it goes out of the frustum
bool hasEmitters (void) const
 return true when there are still emitters in the system
bool hasParticles () const
 return true when there are still particles
bool hasTemporaryParticles () const
 return true when there are still temporary particles
void performMotionWhenOutOfFrustum (bool enable=true)
 Deprecated.
bool doesPerformMotionWhenOutOfFrustum (void) const
 Deprecated.
void setAnimType (TAnimType animType)
 Tells when animation must be done.
TAnimType getAnimType () const
 Test what the animation type is.
void activatePresetBehaviour (TPresetBehaviour behaviour)
 =======================================================================================
TPresetBehaviour getBehaviourType () const

User parameters. They may be or not used by the system. Their meaning is defined during the construction

of the system



void setUserParam (uint userParamIndex, float value)
 Set the value of a user parameter.
float getUserParam (uint userParamIndex) const
 Get a user param.
void bindGlobalValueToUserParam (const std::string &globalValueName, uint userParamIndex)
 Bind/Unbind a global value to a user param.
std::string getGlobalValueName (uint userParamIndex) const
 =======================================================================================
static void setGlobalValue (const std::string &name, float value)
 =======================================================================================
static float getGlobalValue (const std::string &name)
 =======================================================================================
static void setGlobalVectorValue (const std::string &name, const NLMISC::CVector &value)
 Set a global vector value.
static NLMISC::CVector getGlobalVectorValue (const std::string &name)
 =======================================================================================
static CGlobalVectorValueHandle getGlobalVectorValueHandle (const std::string &name)
 =======================================================================================

sound managment



void stopSound ()
 immediatly shut down all the sound in this system
void reactivateSound ()
 =======================================================================================
static void registerSoundServer (UPSSoundServer *soundServer)
 register a Sound server to this system. All systems share the same sound server.
static UPSSoundServergetSoundServer (void)
 get the current sound server used by this system. NULL if none

Misc. options / functions



void enableEmitThreshold (bool enabled=true)
 When using an emitter, it is allowed to have a period of '0'.
bool isEmitThresholdEnabled () const
void activateEmitters (bool active)
 =======================================================================================
bool hasActiveEmitters () const
 =======================================================================================
bool hasEmittersTemplates () const
 =======================================================================================
float evalDuration () const
 Eval a duration of the system (duration after which there are no particle lefts).
void setAutoCountFlag (bool enabled)
 Enable/Disable auto-count mode.
bool getAutoCountFlag () const
void matchArraySize ()
 Ensure that getMaxSize() == getSize() for each particle array.
uint getMaxNumParticles () const
 =======================================================================================
uint getCurrNumParticles () const
 =======================================================================================
void getTargeters (const CPSLocated *target, std::vector< CPSTargetLocatedBindable * > &targeters)
 =======================================================================================
void enumTexs (std::vector< NLMISC::CSmartPtr< ITexture > > &dest, IDriver &drv)
 =======================================================================================
void setZBias (float value)
 =======================================================================================
void getSortingByEmitterPrecedence (std::vector< uint > &result) const
 get sorting of the system emitter precedence (it is topological sort of the graph of emitters) The result vector contains the index of each process (see getProcess) in order
static void setSerializeIdentifierFlag (bool on)
static bool getSerializeIdentifierFlag ()
static void forceDisplayBBox (bool on)

Detailed Description

This class holds a particle system.

Most of the time it is used with a particle system model. See particle_system_shape.h and particle_system_model.h for more details. It can be used directly to create a shape. If you plan to use this without a particle system model, make sure :

Definition at line 78 of file particle_system.h.


Member Typedef Documentation

typedef std::map<std::string, float> NL3D::CParticleSystem::TGlobalValuesMap [private]

Definition at line 1057 of file particle_system.h.

typedef std::map<std::string, NLMISC::CVector> NL3D::CParticleSystem::TGlobalVectorValuesMap [private]

Definition at line 1058 of file particle_system.h.

Definition at line 1185 of file particle_system.h.

Definition at line 1081 of file particle_system.h.

Definition at line 1240 of file particle_system.h.


Member Enumeration Documentation

This enum tells when animation must be performed.

Enumerator:
AnimVisible 
AnimInCluster 
AnimAlways 
LastValue 

Definition at line 860 of file particle_system.h.

this enum give consitions on which the system may be invalid

Enumerator:
none 
noMoreParticles 
noMoreParticlesAndEmitters 

Definition at line 770 of file particle_system.h.

Enumerator:
Anim 
SolidRender 
BlendRender 
ToolRender 

Definition at line 83 of file particle_system.h.

Because choosing the previous parameters can be difficult, this define presets hat can be used to tune the system easily.

Any call to :

  • setDestroyModelWhenOutOfRange
  • setAnimType
  • setDestroyCondition
  • destroyWhenOutOfFrustum
  • performMotionWhenOutOfFrustum

will set the behaviour to 'user'

Enumerator:
EnvironmentFX 
RunningEnvironmentFX 
SpellFX 
LoopingSpellFX 
MinorFX 
UserBehaviour 
MovingLoopingFX 
SpawnedEnvironmentFX 
GroundFX 
Projectile 

usually fx of foot steps (dust clouds etc.

). Always animated, persistents, duration of fxs is garanteed, but not velocity of particle if framerate is too choppy (usually ok because particle stay in place with those fxs)

PresetLast 

Definition at line 905 of file particle_system.h.


Constructor & Destructor Documentation

NL3D::CParticleSystem::CParticleSystem (  ) 

ctor

Definition at line 110 of file particle_system.cpp.

References _UserParam, NL3D::MaxPSUserParam, and NL_PS_FUNC_MAIN.

NL3D::CParticleSystem::~CParticleSystem (  )  [virtual]

dtor

======================================================================================= dtor

Definition at line 301 of file particle_system.cpp.

References _ColorAttenuationScheme, _ProcessVect, _UserCoordSystemInfo, _UserParamGlobalValue, and NL_PS_FUNC_MAIN.


Member Function Documentation

void NL3D::CParticleSystem::activateEmitters ( bool  active  ) 
void NL3D::CParticleSystem::activatePresetBehaviour ( TPresetBehaviour  behaviour  ) 
void NL3D::CParticleSystem::addRefForUserSysCoordInfo ( uint  numRefs = 1  ) 
bool NL3D::CParticleSystem::attach ( CParticleSystemProcess process  ) 

Attach a process (such as a located : see particle_system_process.h, and ps_located.h) to the system.

=======================================================================================

It is then owned by the process and will be deleted by it. if already present -> nl assert

Returns:
true if the operation could be performed. It can fail when this cause the system the system to last forever, which is incompatible with the 'BypassMaxNumIntegrationSteps' in CParticleSystem

Definition at line 1044 of file particle_system.cpp.

References _ProcessVect, canFinish(), getBypassMaxNumIntegrationSteps(), NL_PS_FUNC_MAIN, nlassert, nlwarning, NL3D::CParticleSystemProcess::setIndex(), NL3D::CParticleSystemProcess::setOwner(), and systemDurationChanged().

Referenced by merge().

void NL3D::CParticleSystem::bindGlobalValueToUserParam ( const std::string &  globalValueName,
uint  userParamIndex 
)

Bind/Unbind a global value to a user param.

=======================================================================================

Any further call to setUserParam will then be overriden by the user param. Example of use : global strenght of wind.

Parameters:
globalValueName NULL to unbind the value, or the name of the value

Definition at line 1563 of file particle_system.cpp.

References _GlobalValuesMap, _UserParamGlobalValue, NL3D::MaxPSUserParam, NL_PS_FUNC_MAIN, and nlassert.

bool NL3D::CParticleSystem::canFinish ( CPSLocatedBindable **  lastingForeverObj = NULL  )  const

Test if the system can finish (e.g it doesn't loop, doesn't have emitter with illimited lifetime) NB : we assume that all emitters in the system are accessible, e.g that the located graph is connex.

=======================================================================================

Parameters:
lastingForeverObj,if not NULL, the pointer will be filled with the first object that last or emit forever, or create a loop.

Definition at line 1675 of file particle_system.cpp.

References _ProcessVect, NL3D::CPSLocated::getBoundObject(), NL3D::CPSLocated::getLastForever(), NL3D::CPSLocated::getNbBoundObjects(), hasLoop(), NL_PS_FUNC_MAIN, and NL3D::CPSEmitter::testEmitForever().

Referenced by attach(), NL3D::CPSLocated::bind(), merge(), setBypassMaxNumIntegrationSteps(), NL3D::CPSEmitter::setEmittedType(), and NL3D::CPSLocated::setLastForever().

void NL3D::CParticleSystem::checkIntegrity (  )  [private]

=======================================================================================

Definition at line 2156 of file particle_system.cpp.

References _ProcessVect, _UserCoordSystemInfo, NL_PS_FUNC_MAIN, nlassert, and NL3D::CParticleSystem::CUserCoordSystemInfo::NumRef.

void NL3D::CParticleSystem::computeBBox ( NLMISC::CAABBox aabbox  ) 

Compute the aabbox of this system, (expressed in thesystem basis) If the bbox is precomputed, the precomputed bbox is returned.

=======================================================================================

Parameters:
aabbox a ref to the result box

Definition at line 1114 of file particle_system.cpp.

References _BBoxTouched, _ComputeBBox, _PreComputedBBox, forceComputeBBox(), and NL_PS_FUNC_MAIN.

Referenced by NL3D::CParticleSystemShape::buildFromPS(), and step().

void NL3D::CParticleSystem::destroyWhenOutOfFrustum ( bool  enable = true  )  [inline]

tells the model holding this system that he become invalid when its out of the view frustum.

This is only an indication flag and must be checked by third party (a model holding it for example) It has no direct effects

See also:
doesDestroyWhenOutOfRange()

Definition at line 838 of file particle_system.h.

References _DestroyWhenOutOfFrustum, _PresetBehaviour, and UserBehaviour.

Referenced by activatePresetBehaviour().

CParticleSystemProcess * NL3D::CParticleSystem::detach ( uint  index  ) 

Detach a process from the system (but do not delete it).

=======================================================================================

Definition at line 1466 of file particle_system.cpp.

References _ProcessVect, NL_PS_FUNC_MAIN, nlassert, and systemDurationChanged().

Referenced by merge().

bool NL3D::CParticleSystem::doesDestroyWhenOutOfFrustum ( void   )  const [inline]

check whether the system must be destroyed when it goes out of the frustum

See also:
getDelayBeforeDeathConditionTest()

Definition at line 847 of file particle_system.h.

References _DestroyWhenOutOfFrustum.

Referenced by NL3D::CParticleSystemShape::buildFromPS().

bool NL3D::CParticleSystem::doesPerformMotionWhenOutOfFrustum ( void   )  const [inline]

Deprecated.

Test if animType == AnimInCluster. *

See also:
setAnimType(TAnimType animType)

Definition at line 880 of file particle_system.h.

References _AnimType, and AnimInCluster.

void NL3D::CParticleSystem::dumpHierarchy (  ) 

=======================================================================================

Definition at line 2307 of file particle_system.cpp.

References _ProcessVect, NL3D::CPSLocated::getBoundObject(), NL3D::CPSEmitter::getEmittedType(), NL3D::CPSLocatedBindable::getName(), NL3D::CPSLocated::getName(), NL3D::CPSLocated::getNbBoundObjects(), NL_PS_FUNC_MAIN, and nlinfo.

void NL3D::CParticleSystem::enableAccurateIntegration ( bool  enable = true  )  [inline]

This enable for more accurate integrations of movement.

When this is activated, integration is performed in a more accurate way when the ellapsed time goes over a threshold, but it is more slow to perform.

Definition at line 466 of file particle_system.h.

References _AccurateIntegration.

void NL3D::CParticleSystem::enableAutoLOD ( bool  enabled = true  )  [inline]

Enable / disbale auto-lod.

When auto-LOD is enabled, less particles are displayed when the system is far. This apply to all particles in the systems (unless they override that behaviour). The default is AutoLOD off.

Definition at line 604 of file particle_system.h.

References _AutoLOD.

void NL3D::CParticleSystem::enableEmitThreshold ( bool  enabled = true  )  [inline]

When using an emitter, it is allowed to have a period of '0'.

This special value means that the emitter should emit at each frame. This is deprecated now (not framerate independent ..), but some previous systems may use it. This option force a minimum period for all emitters. NB : the system should be restarted for this to work correctly The default is true

Definition at line 1002 of file particle_system.h.

References _EmitThreshold.

void NL3D::CParticleSystem::enableLoadBalancing ( bool  enabled = true  ) 

Enable / disable load balancing. By default its on.

=======================================================================================

Definition at line 222 of file particle_system.cpp.

References _EnableLoadBalancing, and NL_PS_FUNC_MAIN.

void NL3D::CParticleSystem::enableSharing ( bool  enabled = true  )  [inline]

Enable/Disable sharing.

When sharing is enabled, the state of a particle system is the same for all the system that have the same shape. This allow to gain memory. However, such system should not be built with LOD in mind (for example, less emission with distance) LOD should be automatic for these system (see Auto-Lod). This means that sharing is only useful for system that have the same state, and if they are numerous : motion is performed once, but only for one system with no LOD. LOD is done during display only (when activated). The default for systems is to have no sharing.

Definition at line 120 of file particle_system.h.

References _Sharing.

void NL3D::CParticleSystem::enumTexs ( std::vector< NLMISC::CSmartPtr< ITexture > > &  dest,
IDriver drv 
)

=======================================================================================

Definition at line 2181 of file particle_system.cpp.

References _ProcessVect, and NL_PS_FUNC_MAIN.

Referenced by NL3D::CParticleSystemShape::flushTextures(), and NL3D::CParticleSystemShape::instanciatePS().

float NL3D::CParticleSystem::evalDuration (  )  const

Eval a duration of the system (duration after which there are no particle lefts).

=======================================================================================

It is meaningful only if the system can finish. After the given duration particle will have been spawn, and will possibly have finished their life. The system may last longer (case where an emitter is triggered when it bounce cannot be evaluated correclty without running the system) NB : calling this is costly

Definition at line 1774 of file particle_system.cpp.

References _ProcessVect, NL3D::CToVisitEmitter::Duration, NL3D::CPSLocated::evalMaxDuration(), NL3D::CPSEmitter::externEmit, NL3D::CPSLocated::getBoundObject(), NL3D::CPSEmitter::getEmissionType(), NL3D::CPSEmitter::getEmitDelay(), NL3D::CPSEmitter::getEmittedType(), NL3D::CPSLocated::getLastForever(), NL3D::CPSEmitter::getMaxEmissionCount(), NL3D::CPSAttribMaker< T >::getMaxValue(), NL3D::CPSLocated::getNbBoundObjects(), NL3D::CPSEmitter::getPeriod(), NL3D::CPSEmitter::getPeriodScheme(), NL3D::CPSLocated::getSize(), NL3D::CPSLocatedBindable::getType(), NL3D::CToVisitEmitter::Located, NL_PS_FUNC_MAIN, NL3D::CPSEmitter::onBounce, NL3D::CPSEmitter::once, NL3D::CPSEmitter::onDeath, NL3D::PSEmitter, NL3D::PSParticle, NL3D::CPSEmitter::regular, and NLMISC::safe_cast().

Referenced by getDelayBeforeDeathConditionTest().

void NL3D::CParticleSystem::forceComputeBBox ( NLMISC::CAABBox aabbox  ) 

Force computation of current bbox, even if a precomputed bbox has been set.

=======================================================================================

Definition at line 1081 of file particle_system.cpp.

References _ProcessVect, NLMISC::CAABBox::computeAABBoxUnion(), NL3D::CPSLocated::getConversionMatrix(), NL_PS_FUNC_MAIN, NLMISC::CVector::Null, NL3D::PSFXWorldMatrix, NLMISC::CAABBox::setCenter(), NLMISC::CAABBox::setHalfSize(), and NLMISC::CAABBox::transformAABBox().

Referenced by computeBBox().

static void NL3D::CParticleSystem::forceDisplayBBox ( bool  on  )  [inline, static]

Definition at line 1047 of file particle_system.h.

References _ForceDisplayBBox.

void NL3D::CParticleSystem::getAccurateIntegrationParams ( TAnimationTime threshold,
uint32 maxNbIntegrations,
bool canSlowDown,
bool keepEllapsedTimeForLifeUpdate 
) [inline]

get the parameters used for integration.

See also:
setAccurateIntegrationParams()

Definition at line 494 of file particle_system.h.

References _CanSlowDown, _KeepEllapsedTimeForLifeUpdate, _MaxNbIntegrations, _TimeThreshold, and NL_PS_FUNC_MAIN.

TAnimType NL3D::CParticleSystem::getAnimType (  )  const [inline]
bool NL3D::CParticleSystem::getAutoComputeBBox ( void   )  const [inline]

test whether the system compute himself his bbox

Definition at line 733 of file particle_system.h.

References _ComputeBBox.

Referenced by NL3D::CParticleSystemShape::buildFromPS().

bool NL3D::CParticleSystem::getAutoComputeDelayBeforeDeathConditionTest (  )  const [inline]

Definition at line 831 of file particle_system.h.

References _AutoComputeDelayBeforeDeathTest.

Referenced by systemDurationChanged().

bool NL3D::CParticleSystem::getAutoCountFlag (  )  const [inline]
uint8 NL3D::CParticleSystem::getAutoLODDegradationExponent (  )  const [inline]

Definition at line 633 of file particle_system.h.

References _AutoLODDegradationExponent.

float NL3D::CParticleSystem::getAutoLODEmitRatio (  )  const [inline]

Definition at line 1229 of file particle_system.h.

References _AutoLODEmitRatio.

Referenced by NL3D::CPSEmitter::computeSpawns().

bool NL3D::CParticleSystem::getAutoLODMode (  )  const [inline]

Definition at line 640 of file particle_system.h.

References _AutoLODSkipParticles.

float NL3D::CParticleSystem::getAutoLODStartDistPercent (  )  const [inline]

Definition at line 632 of file particle_system.h.

References _AutoLODStartDistPercent.

TPresetBehaviour NL3D::CParticleSystem::getBehaviourType (  )  const [inline]

Definition at line 928 of file particle_system.h.

References _PresetBehaviour, and NL_PS_FUNC_MAIN.

bool NL3D::CParticleSystem::getBypassMaxNumIntegrationSteps (  )  const [inline]
const CPSAttribMaker<NLMISC::CRGBA>* NL3D::CParticleSystem::getColorAttenuationScheme (  )  const [inline]

Definition at line 661 of file particle_system.h.

References _ColorAttenuationScheme.

CPSAttribMaker<NLMISC::CRGBA>* NL3D::CParticleSystem::getColorAttenuationScheme (  )  [inline]
void NL3D::CParticleSystem::getCurrentEditedElement ( CPSLocated *&  loc,
uint32 index,
CPSLocatedBindable *&  lb 
) [inline]
uint NL3D::CParticleSystem::getCurrNumParticles (  )  const
uint64 NL3D::CParticleSystem::getDate ( void   )  const [inline]

Get the date of the system (the number of time it has been drawn in fact) This may be used to skip frames in an animation for example.

Definition at line 312 of file particle_system.h.

References _Date, and NL_PS_FUNC_MAIN.

TAnimationTime NL3D::CParticleSystem::getDelayBeforeDeathConditionTest (  )  const

Get the a delay before to apply the death condition test If the delay was set to -1 or a negative value, this will compute the delay.

=======================================================================================

Definition at line 1755 of file particle_system.cpp.

References _DelayBeforeDieTest, evalDuration(), NL_PS_FUNC_MAIN, and NL3D::PS_MIN_TIMEOUT.

Referenced by isDestroyConditionVerified().

TDieCondition NL3D::CParticleSystem::getDestroyCondition ( void   )  const [inline]

get the destroy condition

Definition at line 790 of file particle_system.h.

References _DieCondition.

Referenced by isDestroyConditionVerified().

bool NL3D::CParticleSystem::getDestroyModelWhenOutOfRange ( void   )  const [inline]

check whether the system is invalid it's out of range.

Definition at line 766 of file particle_system.h.

References _DestroyModelWhenOutOfRange.

Referenced by NL3D::CParticleSystemShape::buildFromPS().

float NL3D::CParticleSystem::getDistFromViewer (  )  const [inline, private]

=======================================================================================

Definition at line 377 of file particle_system.cpp.

References _InvertedViewMat, NLMISC::CMatrix::getPos(), getSysMat(), NL_PS_FUNC_MAIN, and NLMISC::CVector::norm().

Referenced by step(), and updateLODRatio().

IDriver* NL3D::CParticleSystem::getDriver ( void   )  [inline]

return the driver that will be used for rendering

Definition at line 134 of file particle_system.h.

References _Driver.

Referenced by NL3D::CPSLocated::getDriver(), and step().

const CFontGenerator* NL3D::CParticleSystem::getFontGenerator ( void   )  const [inline]

Retrieve the font generator (const version). Edition purpose only.

Definition at line 422 of file particle_system.h.

References _FontGenerator.

CFontGenerator* NL3D::CParticleSystem::getFontGenerator ( void   )  [inline]

Retrieve the font generator. Edition purpose only.

Definition at line 419 of file particle_system.h.

References _FontGenerator.

Referenced by NL3D::CParticleSystemProcess::getFontGenerator().

const CFontManager* NL3D::CParticleSystem::getFontManager ( void   )  const [inline]

Retrieve the font Manager (const version). Edition purpose only.

Definition at line 431 of file particle_system.h.

References _FontManager.

CFontManager* NL3D::CParticleSystem::getFontManager ( void   )  [inline]

Retrieve the font Manager. Edition purpose only.

Definition at line 428 of file particle_system.h.

References _FontManager.

Referenced by NL3D::CParticleSystemProcess::getFontManager().

bool NL3D::CParticleSystem::getForceGlobalColorLightingFlag (  )  [inline]
const NLMISC::CMatrix& NL3D::CParticleSystem::getFXToUserMatrix (  )  const [inline]
NLMISC::CRGBA NL3D::CParticleSystem::getGlobalColor (  )  const [inline]

Get the current global color of the system.

(It is updated just before drawing...). It there's no color attenuation scheme it can be assumed to be the same than the user color

Definition at line 677 of file particle_system.h.

References _GlobalColor.

Referenced by NL3D::CPSRibbonLookAt::displayRibbons(), NL3D::CPSShockWave::draw(), NL3D::CPSDot::draw(), NL3D::CPSTailDot::setupGlobalColor(), NL3D::CPSFanLight::setupMaterial(), NL3D::CPSRibbon::setupTexturedGlobalColor(), NL3D::CPSRibbon::setupUntexturedGlobalColor(), NL3D::CPSTailDot::step(), NL3D::CPSRibbonLookAt::step(), NL3D::CPSRibbon::step(), and NL3D::CPSLight::step().

NLMISC::CRGBA NL3D::CParticleSystem::getGlobalColorLighted (  )  const [inline]
float NL3D::CParticleSystem::getGlobalValue ( const std::string &  name  )  [static]

=======================================================================================

Definition at line 1613 of file particle_system.cpp.

References _GlobalValuesMap, and NL_PS_FUNC.

Referenced by NL3D::UParticleSystemInstance::getGlobalUserParamValue().

std::string NL3D::CParticleSystem::getGlobalValueName ( uint  userParamIndex  )  const

=======================================================================================

Definition at line 1622 of file particle_system.cpp.

References _UserParamGlobalValue, NL3D::MaxPSUserParam, NL_PS_FUNC_MAIN, and nlassert.

NLMISC::CVector NL3D::CParticleSystem::getGlobalVectorValue ( const std::string &  name  )  [static]

=======================================================================================

Definition at line 1641 of file particle_system.cpp.

References _GlobalVectorValuesMap, NL_PS_FUNC, nlassert, and NLMISC::CVector::Null.

CParticleSystem::CGlobalVectorValueHandle NL3D::CParticleSystem::getGlobalVectorValueHandle ( const std::string &  name  )  [static]
uint32 NL3D::CParticleSystem::getID ( uint  index  )  const

Get the nth ID, or 0 if index is invalid.

=======================================================================================

Definition at line 1514 of file particle_system.cpp.

References _LBMap, and NL_PS_FUNC_MAIN.

Referenced by NL3D::UParticleSystemInstance::getID().

void NL3D::CParticleSystem::getIDs ( std::vector< uint32 > &  dest  )  const

Get all the IDs in the system.

=======================================================================================

Warning:
As IDs are not internally stored in a vector, it is faster than several calls to getID

Definition at line 1527 of file particle_system.cpp.

References _LBMap, and NL_PS_FUNC_MAIN.

Referenced by NL3D::UParticleSystemInstance::getIDs().

uint NL3D::CParticleSystem::getIndexOf ( const CParticleSystemProcess process  )  const

Given its pointer, return an index to a process.

=======================================================================================

The process must be part of the system, otherwise an assertion is raised

Definition at line 1497 of file particle_system.cpp.

References NL3D::CParticleSystemProcess::getIndex(), isProcess(), NL_PS_FUNC_MAIN, and nlassert.

Referenced by getSortingByEmitterPrecedence(), and merge().

const NLMISC::CMatrix& NL3D::CParticleSystem::getInvertedSysMat (  )  const [inline]
const NLMISC::CMatrix& NL3D::CParticleSystem::getInvertedUserMatrix (  )  const [inline]

return the inverted user matrix NB : to save memory, the user matrix is actually saved when at least one instance of CPSLocated that belongs to the system makes a reference on it.

This is usually the case when CPSLocated::setMatrixMode(PSUserMatrix) is called. If no reference is made, then the inverted system matrix is returned instead.

Definition at line 199 of file particle_system.h.

References _UserCoordSystemInfo, NL3D::CParticleSystem::CUserCoordSystemInfo::CoordSystemInfo, getInvertedSysMat(), NL3D::CParticleSystem::CCoordSystemInfo::InvMatrix, and NL3D::CParticleSystem::CCoordSystemInfo::Matrix.

Referenced by NL3D::CPSLocated::getConversionMatrix(), getLODVect(), NL3D::CPSLocated::getWorldToLocalMatrix(), and NL3D::CPSLocated::newElement().

const NLMISC::CMatrix& NL3D::CParticleSystem::getInvertedViewMat ( void   )  const [inline]

get the inverted view matrix . It is stored each time a new frame is processed

Definition at line 215 of file particle_system.h.

References _InvertedViewMat.

Referenced by NL3D::CPSLocated::computeI(), NL3D::CPSLocated::computeIWithZAxisAligned(), NL3D::CPSLocated::computeJ(), NL3D::CPSLocated::computeK(), and NL3D::CPSLocatedBindable::getInvertedViewMat().

void NL3D::CParticleSystem::getLastComputedBBox ( NLMISC::CAABBox dest  )  [inline]

get the last computed bbox

Definition at line 748 of file particle_system.h.

References _PreComputedBBox.

NLMISC::CRGBA NL3D::CParticleSystem::getLightingColor (  )  const [inline]

Definition at line 687 of file particle_system.h.

References _LightingColor.

const CPSLocatedBindable * NL3D::CParticleSystem::getLocatedBindableByExternID ( uint32  id,
uint  index 
) const

=======================================================================================

Definition at line 1326 of file particle_system.cpp.

References _LBMap, and NL_PS_FUNC_MAIN.

CPSLocatedBindable * NL3D::CParticleSystem::getLocatedBindableByExternID ( uint32  id,
uint  index 
)

return the nth locatedBindable associtaed with this ID.

=======================================================================================

Returns:
NULL if it doesn't exist

Definition at line 1311 of file particle_system.cpp.

References _LBMap, and NL_PS_FUNC_MAIN.

Referenced by NL3D::CPSLocated::deleteElementBase(), NL3D::UParticleSystemInstance::emit(), NL3D::UParticleSystemInstance::removeByID(), and NL3D::UParticleSystemInstance::setActive().

TPSLod NL3D::CParticleSystem::getLOD ( void   )  const

get the current LOD of the system. It is based on the distance of the center of the system to the viewer

=======================================================================================

Definition at line 1265 of file particle_system.cpp.

References _InvCurrentViewDist, _InvertedViewMat, _LODRatio, NLMISC::CMatrix::getJ(), NLMISC::CMatrix::getPos(), getSysMat(), NL_PS_FUNC_MAIN, NL3D::PSLod1, and NL3D::PSLod2.

Referenced by NL3D::CPSLocated::step().

float NL3D::CParticleSystem::getLODRatio ( void   )  const [inline]

get the lod ratio.

Definition at line 584 of file particle_system.h.

References _LODRatio.

void NL3D::CParticleSystem::getLODVect ( NLMISC::CVector v,
float offset,
TPSMatrixMode  matrixMode 
)

compute a vector and a distance that are used for LOD computations.

=======================================================================================

You'll have for a given pos : pos * v + offset = 0 at the nearest point, and 1 when pos is at maxDist from the viewer. This is used by sub-component of the system.

Definition at line 1231 of file particle_system.cpp.

References _InvCurrentViewDist, _InvertedViewMat, getInvertedSysMat(), getInvertedUserMatrix(), NLMISC::CMatrix::getJ(), NLMISC::CMatrix::getPos(), NLMISC::CMatrix::mulVector(), NL_PS_FUNC_MAIN, nlassert, NL3D::PSFXWorldMatrix, NL3D::PSIdentityMatrix, and NL3D::PSUserMatrix.

Referenced by NL3D::CPSLocated::getLODVect().

float NL3D::CParticleSystem::getMaxDistLODBias (  )  const [inline]

Definition at line 628 of file particle_system.h.

References _MaxDistLODBias.

uint NL3D::CParticleSystem::getMaxNbIntegrations (  )  const [inline]

get max nb integrations meaningful only if 'setBypassMaxNumIntegrationSteps' is false

Definition at line 512 of file particle_system.h.

References _MaxNbIntegrations.

uint NL3D::CParticleSystem::getMaxNumParticles (  )  const
float NL3D::CParticleSystem::getMaxViewDist ( void   )  const [inline]

get the max view distance

Definition at line 578 of file particle_system.h.

References _MaxViewDist.

Referenced by NL3D::CParticleSystemShape::buildFromPS(), and NL3D::CParticleSystemModel::traverseClip().

std::string NL3D::CParticleSystem::getName ( void   )  const [inline]

Get the name of the system.

Definition at line 438 of file particle_system.h.

References _Name.

uint32 NL3D::CParticleSystem::getNbProcess ( void   )  const [inline]

get the number of process that are attached to the system

Definition at line 273 of file particle_system.h.

References _ProcessVect.

Referenced by activateEmitters(), getCurrNumParticles(), getMaxNumParticles(), getTargeters(), hasActiveEmitters(), hasEmittersTemplates(), matchArraySize(), reactivateSound(), and stopSound().

uint NL3D::CParticleSystem::getNumID (  )  const

Get the number of IDs in the system.

=======================================================================================

Definition at line 1507 of file particle_system.cpp.

References _LBMap, and NL_PS_FUNC_MAIN.

Referenced by NL3D::UParticleSystemInstance::getNumID().

uint NL3D::CParticleSystem::getNumLocatedBindableByExternID ( uint32  id  )  const

return the number the number of located bindable bound with this ID

=======================================================================================

Definition at line 1304 of file particle_system.cpp.

References _LBMap, and NL_PS_FUNC_MAIN.

Referenced by NL3D::CPSLocated::deleteElementBase(), NL3D::UParticleSystemInstance::emit(), NL3D::UParticleSystemInstance::removeByID(), and NL3D::UParticleSystemInstance::setActive().

float NL3D::CParticleSystem::getOneMinusCurrentLODRatio ( void   )  const [inline]

get 1.f - the current lod ratio (it is updated at each motion pass)

Definition at line 597 of file particle_system.h.

References _OneMinusCurrentLODRatio.

Referenced by NL3D::CPSLocated::doLODDegradation(), and NL3D::CPSRibbonBase::updateLOD().

const CParticleSystemProcess* NL3D::CParticleSystem::getProcess ( uint32  index  )  const [inline]

Get a const pointer to the nth process.

Out of range -> nlassert

Definition at line 289 of file particle_system.h.

References _ProcessVect, and nlassert.

CParticleSystemProcess* NL3D::CParticleSystem::getProcess ( uint32  index  )  [inline]

Get a pointer to the nth process.

Out of range -> nlassert

Definition at line 279 of file particle_system.h.

References _ProcessVect, and nlassert.

Referenced by activateEmitters(), getCurrNumParticles(), getMaxNumParticles(), getTargeters(), hasActiveEmitters(), hasEmittersTemplates(), matchArraySize(), reactivateSound(), and stopSound().

CScene* NL3D::CParticleSystem::getScene (  )  const [inline]
static bool NL3D::CParticleSystem::getSerializeIdentifierFlag (  )  [inline, static]
void NL3D::CParticleSystem::getSortingByEmitterPrecedence ( std::vector< uint > &  result  )  const

get sorting of the system emitter precedence (it is topological sort of the graph of emitters) The result vector contains the index of each process (see getProcess) in order

=======================================================================================

Definition at line 2201 of file particle_system.cpp.

References _ProcessVect, DO_SBEP_CHECK, NL3D::CPSLocated::getBoundObject(), NL3D::CPSEmitter::getEmittedType(), getIndexOf(), NL3D::CPSLocated::getNbBoundObjects(), NL3D::CPSLocatedBindable::getType(), hasLoop(), NL_PS_FUNC_MAIN, nlassert, NL3D::PSEmitter, and NLMISC::safe_cast().

Referenced by NL3D::CParticleSystemShape::flushTextures(), and step().

static UPSSoundServer* NL3D::CParticleSystem::getSoundServer ( void   )  [inline, static]

get the current sound server used by this system. NULL if none

Definition at line 946 of file particle_system.h.

References _SoundServer, and NL_PS_FUNC.

Referenced by NL3D::CPSSound::newElement().

const NLMISC::CMatrix& NL3D::CParticleSystem::getSysMat (  )  const [inline]
TAnimationTime NL3D::CParticleSystem::getSystemDate ( void   )  const [inline]
void NL3D::CParticleSystem::getTargeters ( const CPSLocated target,
std::vector< CPSTargetLocatedBindable * > &  targeters 
)
float NL3D::CParticleSystem::getTimeTheshold (  )  const [inline]

Definition at line 508 of file particle_system.h.

References _TimeThreshold.

NLMISC::CRGBA NL3D::CParticleSystem::getUserColor (  )  const [inline]

Definition at line 669 of file particle_system.h.

References _UserColor.

const NLMISC::CMatrix& NL3D::CParticleSystem::getUserMatrix (  )  const [inline]

return the user matrix NB : to save memory, the user matrix is actually saved when at least one instance of CPSLocated that belongs to the system makes a reference on it.

This is usually the case when CPSLocated::setMatrixMode(PSUserMatrix) is called. If no reference is made, then the fx matrix is returned instead

Definition at line 188 of file particle_system.h.

References _UserCoordSystemInfo, NL3D::CParticleSystem::CUserCoordSystemInfo::CoordSystemInfo, getSysMat(), NL3D::CParticleSystem::CCoordSystemInfo::Matrix, and NL_PS_FUNC_MAIN.

Referenced by NL3D::CPSLocated::getConversionMatrix(), NL3D::CPSLocated::getLocalToWorldMatrix(), and NL3D::CPSLocated::newElement().

float NL3D::CParticleSystem::getUserParam ( uint  userParamIndex  )  const [inline]

Get a user param.

The max number of user param is in MaxPSUserParam.

Definition at line 340 of file particle_system.h.

References _UserParam, NL3D::MaxPSUserParam, NL_PS_FUNC_MAIN, and nlassert.

Referenced by NL3D::CPSLocated::getUserParam().

const NLMISC::CMatrix& NL3D::CParticleSystem::getUserToFXMatrix (  )  const [inline]
const NLMISC::CMatrix& NL3D::CParticleSystem::getViewMat ( void   )  const [inline]

get the view matrix .

Definition at line 212 of file particle_system.h.

References _ViewMat.

Referenced by NL3D::CPSLocatedBindable::getViewMat().

float NL3D::CParticleSystem::getWantedNumTris ( float  dist  ) 

=======================================================================================

nlassertex(retValue >= 0 && retValue < 10000, ("dist = %f, _MaxViewDist = %f, _MaxNumFacesWanted = %d, retValue = %f", dist, _MaxViewDist, _MaxNumFacesWanted, retValue));

Definition at line 257 of file particle_system.cpp.

References _EnableLoadBalancing, _InvMaxViewDist, _MaxViewDist, _NumWantedTris, and NL_PS_FUNC_MAIN.

Referenced by setNumTris().

bool NL3D::CParticleSystem::hasActiveEmitters (  )  const
bool NL3D::CParticleSystem::hasEmitters ( void   )  const

return true when there are still emitters in the system

=======================================================================================

Definition at line 327 of file particle_system.cpp.

References _ProcessVect, and NL_PS_FUNC_MAIN.

Referenced by NL3D::UParticleSystemInstance::hasEmmiters(), and isDestroyConditionVerified().

bool NL3D::CParticleSystem::hasEmittersTemplates (  )  const
bool NL3D::CParticleSystem::hasLightableObjects (  )  const

returns 'true' if the system has lightable objects in it

=======================================================================================

for each process

Definition at line 1206 of file particle_system.cpp.

References _ForceGlobalColorLighting, _ProcessVect, NL3D::CPSLocated::getBoundObject(), NL3D::CPSLocated::getNbBoundObjects(), NL3D::CPSLocatedBindable::getType(), NL_PS_FUNC_MAIN, and NL3D::PSParticle.

bool NL3D::CParticleSystem::hasLoop ( CPSLocatedBindable **  loopingObj = NULL  )  const

Test if there are loops in the system.

=======================================================================================

E.g A emit B emit A NB : we assume that all emitters in the system are accessible, e.g that the located graph is connex

Parameters:
loopingObj,if not NULL, will be filled with the first object that creates a loop.

Definition at line 1708 of file particle_system.cpp.

References _ProcessVect, NL3D::CPSEmitter::checkLoop(), NL3D::CPSLocated::getBoundObject(), NL3D::CPSLocated::getNbBoundObjects(), and NL_PS_FUNC_MAIN.

Referenced by canFinish(), getSortingByEmitterPrecedence(), and NL3D::CPSEmitter::setEmittedType().

bool NL3D::CParticleSystem::hasOpaqueObjects ( void   )  const

returns 'true' if the system has opaque object in it.

=======================================================================================

for each process

Definition at line 1160 of file particle_system.cpp.

References _ProcessVect, NL3D::CPSLocated::getBoundObject(), NL3D::CPSLocated::getNbBoundObjects(), NL3D::CPSLocatedBindable::getType(), NL_PS_FUNC_MAIN, and NL3D::PSParticle.

bool NL3D::CParticleSystem::hasParticles (  )  const

return true when there are still particles

=======================================================================================

Definition at line 338 of file particle_system.cpp.

References _ProcessVect, and NL_PS_FUNC_MAIN.

Referenced by NL3D::UParticleSystemInstance::hasParticles(), and isDestroyConditionVerified().

bool NL3D::CParticleSystem::hasTemporaryParticles (  )  const

return true when there are still temporary particles

=======================================================================================

Definition at line 349 of file particle_system.cpp.

References _ProcessVect, NL3D::CPSLocated::hasParticles(), and NL_PS_FUNC_MAIN.

bool NL3D::CParticleSystem::hasTransparentObjects ( void   )  const

returns 'true' if the system has transparent objects in it.

=======================================================================================

for each process

Definition at line 1183 of file particle_system.cpp.

References _ProcessVect, NL3D::CPSLocated::getBoundObject(), NL3D::CPSLocated::getNbBoundObjects(), NL3D::CPSLocatedBindable::getType(), NL_PS_FUNC_MAIN, and NL3D::PSParticle.

void NL3D::CParticleSystem::hide ( bool  hidden  )  [inline]

Hide / show the system This just duplicates the 'hiden' flag of matching transform (instance of CParticleSystemModel) If the system goes from 'hide' to 'show', then no trails are generated.

Definition at line 157 of file particle_system.h.

References _HiddenAtCurrentFrame.

Referenced by NL3D::CParticleSystemModel::doAnimate().

void NL3D::CParticleSystem::interpolateFXPosDelta ( NLMISC::CVector dest,
TAnimationTime  deltaT 
)
void NL3D::CParticleSystem::interpolateUserPosDelta ( NLMISC::CVector dest,
TAnimationTime  deltaT 
)
bool NL3D::CParticleSystem::isAccurateIntegrationEnabled ( void   )  const [inline]

Definition at line 467 of file particle_system.h.

References _AccurateIntegration.

bool NL3D::CParticleSystem::isAutoLODEnabled (  )  const [inline]

test whether Auto-LOD is enabled

Definition at line 607 of file particle_system.h.

References _AutoLOD.

Referenced by NL3D::CPSEmitter::computeSpawns().

bool NL3D::CParticleSystem::isDestroyConditionVerified (  )  const
bool NL3D::CParticleSystem::isEmitThresholdEnabled (  )  const [inline]
bool NL3D::CParticleSystem::isLoadBalancingEnabled (  )  const [inline]

Ask for the particle system to reevaluate the max number of faces it may need.

You don't usually need to call this Test whether load balancing has been activated for that system

Definition at line 706 of file particle_system.h.

References _EnableLoadBalancing.

bool NL3D::CParticleSystem::isProcess ( const CParticleSystemProcess process  )  const

Test whether a process is part of this system.

=======================================================================================

Definition at line 1486 of file particle_system.cpp.

References _ProcessVect, and NL_PS_FUNC_MAIN.

Referenced by getIndexOf(), getTargeters(), and matrixModeChanged().

bool NL3D::CParticleSystem::isSharingEnabled (  )  const [inline]
bool NL3D::CParticleSystem::isUserColorUsed (  )  const [inline]
void NL3D::CParticleSystem::matchArraySize (  ) 

Ensure that getMaxSize() == getSize() for each particle array.

=======================================================================================

It is usefule for edition, when the system is in auto-count mode See setAutoCountFlag

Definition at line 2012 of file particle_system.cpp.

References getNbProcess(), getProcess(), NL3D::CPSLocated::getSize(), NL3D::CParticleSystemProcess::isLocated(), NL_PS_FUNC_MAIN, and NL3D::CPSLocated::resize().

void NL3D::CParticleSystem::matrixModeChanged ( CParticleSystemProcess proc,
TPSMatrixMode  oldMode,
TPSMatrixMode  newMode 
)

=======================================================================================

Definition at line 2110 of file particle_system.cpp.

References addRefForUserSysCoordInfo(), isProcess(), NL_PS_FUNC_MAIN, nlassert, NL3D::PSUserMatrix, and releaseRefForUserSysCoordInfo().

Referenced by NL3D::CParticleSystemProcess::setMatrixMode().

bool NL3D::CParticleSystem::merge ( CParticleSystemShape toMerge  ) 

Merge this system with a system instanciated from the given shape NB : This is for edition purpose, this is slow.

=======================================================================================

Returns:
true if the operation could be performed. It can fail when this cause the system the system to last forever, which is incompatible with the 'BypassMaxNumIntegrationSteps' in CParticleSystem.

Definition at line 1340 of file particle_system.cpp.

References _ProcessVect, _Scene, attach(), canFinish(), CHECK_INTEGRITY, detach(), getBypassMaxNumIntegrationSteps(), getIndexOf(), NL3D::CParticleSystemShape::instanciatePS(), NL_PS_FUNC_MAIN, nlassert, nlwarning, and systemDurationChanged().

void NL3D::CParticleSystem::onShow ( bool  shown  ) 

Called by owner model, when the visibility of this ps has changed (that is, the show / hide flag, not the 'clipped' state).

=======================================================================================

Definition at line 2329 of file particle_system.cpp.

References _ProcessVect, and NL_PS_FUNC_MAIN.

void NL3D::CParticleSystem::performMotionWhenOutOfFrustum ( bool  enable = true  )  [inline]

Deprecated.

This set the animation type to AnimInCluster.

See also:
setAnimType(TAnimType animType)

Definition at line 870 of file particle_system.h.

References _AnimType, _PresetBehaviour, AnimInCluster, AnimVisible, NL_PS_FUNC_MAIN, and UserBehaviour.

void NL3D::CParticleSystem::reactivateSound (  ) 

=======================================================================================

Definition at line 201 of file particle_system.cpp.

References NL3D::CPSLocated::getBoundObject(), NL3D::CPSLocated::getNbBoundObjects(), getNbProcess(), getProcess(), NL3D::CPSLocatedBindable::getType(), NL_PS_FUNC_MAIN, and NL3D::PSSound.

Referenced by NL3D::CParticleSystemManager::reactivateSound().

void NL3D::CParticleSystem::registerLocatedBindableExternID ( uint32  id,
CPSLocatedBindable lb 
)

register a locatedBindable, and allow it to be referenced by the given ID this locatedBindable must belong to this system.

=======================================================================================

each pair <id, locatedBindable> must be unique, but there may be sevral LB for the same key

Definition at line 1274 of file particle_system.cpp.

References _LBMap, NL3D::CParticleSystemProcess::getOwner(), NL3D::CPSLocatedBindable::getOwner(), NL_PS_FUNC_MAIN, and nlassert.

Referenced by NL3D::CPSLocated::bind(), and NL3D::CPSLocatedBindable::setExternID().

void NL3D::CParticleSystem::registerSoundServer ( UPSSoundServer soundServer  )  [static]

register a Sound server to this system. All systems share the same sound server.

=======================================================================================

Definition at line 1927 of file particle_system.cpp.

References _SoundServer, NL_PS_FUNC, NL3D::CParticleSystemManager::reactivateSoundForAllManagers(), and NL3D::CParticleSystemManager::stopSoundForAllManagers().

Referenced by NL3D::assignSoundServerToPS().

void NL3D::CParticleSystem::releaseRefForUserSysCoordInfo ( uint  numRefs = 1  ) 
void NL3D::CParticleSystem::remove ( CParticleSystemProcess process  ) 

Remove a process It is deleted by the system if not present -> nl assert.

=======================================================================================

Definition at line 1068 of file particle_system.cpp.

References _ProcessVect, NL_PS_FUNC_MAIN, nlassert, NL3D::CParticleSystemProcess::setOwner(), systemDurationChanged(), and updateProcessIndices().

void NL3D::CParticleSystem::serial ( NLMISC::IStream f  )  throw (NLMISC::EStream)

serialize this particle system

=======================================================================================

Definition at line 754 of file particle_system.cpp.

References CHECK_INTEGRITY, NLMISC::IStream::current, NL3D::MaxPSUserParam, NL_PS_FUNC_MAIN, nlassert, and nlctassert.

void NL3D::CParticleSystem::setAccurateIntegrationParams ( TAnimationTime  threshold,
uint32  maxNbIntegrations,
bool  canSlowDown,
bool  keepEllapsedTimeForLifeUpdate 
) [inline]

the the time threshold and the max number of integration to perform, when accurate integration is activated.

The default is 0.15 for time threshold and 2 for max NbIntegrations

Parameters:
canSlowDown : Allow the system to slow down in speed but to keep accuracy in its movement. It is useful for critical situations where the framerate is very low. The default is true.

Definition at line 474 of file particle_system.h.

References _CanSlowDown, _KeepEllapsedTimeForLifeUpdate, _MaxNbIntegrations, _PresetBehaviour, _TimeThreshold, NL_PS_FUNC_MAIN, and UserBehaviour.

void NL3D::CParticleSystem::setAnimType ( TAnimType  animType  )  [inline]

Tells when animation must be done.

Definition at line 883 of file particle_system.h.

References _AnimType, _PresetBehaviour, LastValue, NL_PS_FUNC_MAIN, nlassert, and UserBehaviour.

Referenced by activatePresetBehaviour().

void NL3D::CParticleSystem::setAutoComputeBBox ( bool  enable = true  )  [inline]

When this is set to false, the system will recompute his bbox each time it is querried This may be needed for systems that move fast.

Definition at line 729 of file particle_system.h.

References _ComputeBBox.

void NL3D::CParticleSystem::setAutoComputeDelayBeforeDeathConditionTest ( bool  computeAuto  ) 

Tells that the system should recompute the delay before death test itself This delay is updated when :

  • The system structure is changed (located added, merge .

=======================================================================================

.)

  • The lifetime of a located is changed
  • Emitter parameters are modified

Definition at line 1746 of file particle_system.cpp.

References _AutoComputeDelayBeforeDeathTest, NL_PS_FUNC_MAIN, and setDelayBeforeDeathConditionTest().

void NL3D::CParticleSystem::setAutoCountFlag ( bool  enabled  )  [inline]

Enable/Disable auto-count mode.

The default is disabled In this mode, when a particle is spawned it is guaranteed to be created. Particle array are resized if necessary for this. This helps to tune the size of arrays that contains particle This is well adapted for edition, but shouldn't be use at runtime because array are reallocated which doesn't give the best performance. It is why that state isn't serialized. When the system is modified by the user, he should call resetAutoCount, so that array match the current number of particles. This is useful if the user modifiy the system and that the number of particles decreases

Definition at line 1026 of file particle_system.h.

References _AutoCount.

void NL3D::CParticleSystem::setAutoLODMode ( bool  skipParticles  )  [inline]

There are 2 modes for the auto-LOD (apply to shared systems only) :

  • Particle are skip in the source container when display is performed (the default)
  • There are just less particles displayed, but this can lead to 'pulse effect'.

This is faster, though.

Definition at line 639 of file particle_system.h.

References _AutoLODSkipParticles.

void NL3D::CParticleSystem::setBypassMaxNumIntegrationSteps ( bool  bypass = true  )  [inline]

When activated, this bypass the limit on the max number of integration steps This should NOT be used on FXs that are looping, because it would slow endlessly Anyway if you try to do that an assertion will ocurrs Typically, this is useful for spell fx because they are short, and it is important that they don't slow down when framerate is too choppy.

Definition at line 520 of file particle_system.h.

References _BypassIntegrationStepLimit, _PresetBehaviour, canFinish(), NL_PS_FUNC_MAIN, nlassert, nlwarning, and UserBehaviour.

Referenced by activatePresetBehaviour().

void NL3D::CParticleSystem::setColorAttenuationScheme ( CPSAttribMaker< NLMISC::CRGBA > *  colScheme  )  [inline]

Setup a color attenuation scheme with the distance from the viewer.

This doesn't act on a particle basis, the whole color of the system is changed in an uniform way so it is fast (the same can be achieved on a particle basis). This bypass the source of the scheme : it is set to 0 when the system is on the user, and to 1 when it is at its max distance.

Parameters:
scheme A color scheme, that is then owned by this object. NULL disable color attenuation. Any previous scheme is removed

Definition at line 648 of file particle_system.h.

References _ColorAttenuationScheme, _GlobalColor, NL_PS_FUNC_MAIN, and NLMISC::CRGBA::White.

void NL3D::CParticleSystem::setCurrentEditedElement ( CPSLocated loc = NULL,
uint32  index = 0,
class CPSLocatedBindable bd = NULL 
) [inline]

For edition purposes only : this allow to highlight in red the current element being edited.

Parameters:
located The located the current element belongs to, or NULL if no element is selected. the index of the element in the located. the located bindable that is selected into a located (NULL = all)

Definition at line 396 of file particle_system.h.

References _CurrEditedElementIndex, _CurrEditedElementLocated, _CurrEditedElementLocatedBindable, and NL_PS_FUNC_MAIN.

void NL3D::CParticleSystem::setDelayBeforeDeathConditionTest ( TAnimationTime  delay  )  [inline]

Set a delay before to apply the death condition test This may be necessary : the system could be destroyed because there are no particles, but no particles were emitted yet.

This is an indication, and has no direct effect, and must be check by calling isDestroyConditionVerified()

If -1 is set (or a negative value), then the system will compute that delay itself

See also:
hasEmitters()
hasParticles()
getDelayBeforeDeathConditionTest()

Definition at line 803 of file particle_system.h.

References _DelayBeforeDieTest, and NL_PS_FUNC_MAIN.

Referenced by setAutoComputeDelayBeforeDeathConditionTest(), and systemDurationChanged().

void NL3D::CParticleSystem::setDestroyCondition ( TDieCondition  dieCondition  )  [inline]

when != to none, the Model hodling this sytem will be considered invalid when dieCondition is met This is only an indication flag and must be checked by third party (a model holding it for example) that must then use the right methods

See also:
hasEmitters
hasParticles

Definition at line 779 of file particle_system.h.

References _DieCondition, _PresetBehaviour, NL_PS_FUNC_MAIN, and UserBehaviour.

Referenced by activatePresetBehaviour().

void NL3D::CParticleSystem::setDestroyModelWhenOutOfRange ( bool  enable = true  )  [inline]

Tell the system that it is invalid when its out of range.

The default is false. This is only a indication flag and must be checked by third party (a model holding the system for example)

Definition at line 758 of file particle_system.h.

References _DestroyModelWhenOutOfRange, _PresetBehaviour, NL_PS_FUNC_MAIN, and UserBehaviour.

Referenced by activatePresetBehaviour().

void NL3D::CParticleSystem::setDriver ( IDriver driver  )  [inline]

set the driver use to render the system

Definition at line 131 of file particle_system.h.

References _Driver.

Referenced by NL3D::CParticleSystemShape::render().

void NL3D::CParticleSystem::setFontGenerator ( CFontGenerator fg  )  [inline]

Set a font generator. Useful only for edition. don't need that in runtime.

Definition at line 416 of file particle_system.h.

References _FontGenerator.

void NL3D::CParticleSystem::setFontManager ( CFontManager fg  )  [inline]

Set a font Manager. Useful only for edition. don't need that in runtime.

Definition at line 425 of file particle_system.h.

References _FontManager.

void NL3D::CParticleSystem::setForceGlobalColorLightingFlag ( bool  enable  )  [inline]

Definition at line 684 of file particle_system.h.

References _ForceGlobalColorLighting.

void NL3D::CParticleSystem::setGlobalValue ( const std::string &  name,
float  value 
) [static]

=======================================================================================

Definition at line 1604 of file particle_system.cpp.

References _GlobalValuesMap, NLMISC::clamp(), NL_PS_FUNC, and nlassert.

Referenced by NL3D::UParticleSystemInstance::setGlobalUserParamValue().

void NL3D::CParticleSystem::setGlobalVectorValue ( const std::string &  name,
const NLMISC::CVector value 
) [static]

Set a global vector value.

=======================================================================================

Global vector values are set to (0, 0, 0) by default Global vector values are used in some places. For example, direction for a directionnal force.

Definition at line 1632 of file particle_system.cpp.

References _GlobalVectorValuesMap, NL_PS_FUNC, and nlassert.

void NL3D::CParticleSystem::setLightingColor ( NLMISC::CRGBA  col  )  [inline]

Definition at line 686 of file particle_system.h.

References _LightingColor.

void NL3D::CParticleSystem::setLODRatio ( float  ratio  )  [inline]

set a percentage that indicate where the 2nd LOD is located. Default is 0.5.

Definition at line 581 of file particle_system.h.

References _LODRatio, and nlassert.

void NL3D::CParticleSystem::setMaxDistLODBias ( float  lodBias  ) 

when auto-lod on a non shared system is used, this set the degradation of the system when it is far A value of 0 mean no more emissions at all.

=======================================================================================

A value of 0.1 means 10% of emission and so on. A value of 1 means there's no LOD at all..

Definition at line 1667 of file particle_system.cpp.

References _MaxDistLODBias, NLMISC::clamp(), and NL_PS_FUNC_MAIN.

void NL3D::CParticleSystem::setMaxViewDist ( float  maxDist  )  [inline]

set the max view distance for the system (in meters) . The default is 50 meters.

Definition at line 569 of file particle_system.h.

References _InvCurrentViewDist, _InvMaxViewDist, _MaxViewDist, NL_PS_FUNC_MAIN, and nlassert.

void NL3D::CParticleSystem::setName ( const std::string &  s  )  [inline]

Set the name of the system.

Definition at line 435 of file particle_system.h.

References _Name.

void NL3D::CParticleSystem::setNumTris ( uint  numFaces  ) 

set the number of tree the system may use. If not clled this will be the max

=======================================================================================

Definition at line 269 of file particle_system.cpp.

References _EnableLoadBalancing, _InvCurrentViewDist, _InvertedViewMat, _InvMaxViewDist, _NumWantedTris, NLMISC::CMatrix::getPos(), getSysMat(), getWantedNumTris(), and NL_PS_FUNC_MAIN.

Referenced by NL3D::CParticleSystemModel::doAnimate().

void NL3D::CParticleSystem::setPrecomputedBBox ( const NLMISC::CAABBox precompBBox  )  [inline]

set a precomputed bbox (expressed in the system basis).

This is allowed only when setAutoComputeBBox is called with false (nlassert otherwise).

Definition at line 740 of file particle_system.h.

References _ComputeBBox, _PreComputedBBox, NL_PS_FUNC_MAIN, and nlassert.

void NL3D::CParticleSystem::setScene ( CScene scene  )  [inline]

Set the scene in which the particle system is inserted.

This is needed when system must add objects to the scene (for particle that are mesh for instance)

Definition at line 143 of file particle_system.h.

References _Scene.

Referenced by NL3D::CParticleSystemShape::instanciatePS().

static void NL3D::CParticleSystem::setSerializeIdentifierFlag ( bool  on  )  [inline, static]

Definition at line 1040 of file particle_system.h.

References _SerialIdentifiers.

void NL3D::CParticleSystem::setSysMat ( const NLMISC::CMatrix m  ) 

Set the matrix for elements with matrixMode == PSFXMatrix.

=======================================================================================

NB: The previous matrix position is backuped during this call (used to interpolate the system position during integration), so this should be called only once per frame NB : pointer to the matrix should remains valid as long as that particle system exists (no copy of the matrix is kept)

Definition at line 1128 of file particle_system.cpp.

References _CoordSystemInfo, _SystemDate, NLMISC::CMatrix::getPos(), NLMISC::CMatrix::inverted(), NL3D::CParticleSystem::CCoordSystemInfo::InvMatrix, NL3D::CParticleSystem::CCoordSystemInfo::Matrix, NL_PS_FUNC_MAIN, NLMISC::CVector::Null, and NL3D::CParticleSystem::CCoordSystemInfo::OldPos.

Referenced by NL3D::CParticleSystemModel::doAnimate(), and NL3D::CParticleSystemShape::render().

void NL3D::CParticleSystem::setSystemDate ( float  date  ) 

St the time of the system.

=======================================================================================

Definition at line 1915 of file particle_system.cpp.

References _ProcessVect, _SystemDate, and NL_PS_FUNC_MAIN.

void NL3D::CParticleSystem::setupAutoLOD ( float  startDistPercent,
uint8  degradationExponent 
) [inline]

Setup auto lod parameters.

Parameters:
start A percentage of the max view dist that tells when the auto-lod must start.
strenght The degradation speed. It is interpreted as an exponent.

Definition at line 613 of file particle_system.h.

References _AutoLODDegradationExponent, _AutoLODStartDistPercent, NL_PS_FUNC_MAIN, and nlassert.

void NL3D::CParticleSystem::setUserColor ( NLMISC::CRGBA  userColor  )  [inline]

Set the user color of the system Final color is the color due to attenuationByDistance (.

See also:
getColorAttenuationScheme() modulated by the user color NB : that state is not serialized

Definition at line 668 of file particle_system.h.

References _UserColor.

void NL3D::CParticleSystem::setUserMatrix ( const NLMISC::CMatrix m  ) 
void NL3D::CParticleSystem::setUserParam ( uint  userParamIndex,
float  value 
) [inline]

Set the value of a user parameter.

It must range from 0 to 1. The user value are not saved, and their default value is 0.f. The max number of user param is MaxPSUserParam.

Definition at line 329 of file particle_system.h.

References _UserParam, NLMISC::clamp(), NL3D::MaxInputValue, NL3D::MaxPSUserParam, NL_PS_FUNC_MAIN, and nlassert.

Referenced by NL3D::CParticleSystemModel::doAnimate().

void NL3D::CParticleSystem::setViewMat ( const NLMISC::CMatrix m  ) 

set the view matrix This must be called otherwise results can't be correct

=======================================================================================

Definition at line 319 of file particle_system.cpp.

References _InvertedViewMat, _ViewMat, NLMISC::CMatrix::inverted(), and NL_PS_FUNC_MAIN.

Referenced by NL3D::CParticleSystemModel::doAnimate().

void NL3D::CParticleSystem::setZBias ( float  value  ) 

=======================================================================================

Definition at line 2191 of file particle_system.cpp.

References _ProcessVect, and NL_PS_FUNC_MAIN.

void NL3D::CParticleSystem::step ( TPass  pass,
TAnimationTime  ellapsedTime,
CParticleSystemShape shape,
CParticleSystemModel model 
) [virtual]

execute all the process of the system.

=======================================================================================

It uses the driver that was set by a call to setDriver.

Parameters:
ellapsedTime The ellapsed time since the last call
pass the pass to be executed
See also:
setDriver

When shared, the LOD ratio must be computed there

When shared, the LOD ratio must be computed there When shared, the LOD ratio must be computed there

Definition at line 427 of file particle_system.cpp.

References _AccurateIntegration, _AutoLOD, _AutoLODDegradationExponent, _AutoLODEmitRatio, _AutoLODStartDistPercent, _BBoxTouched, _BypassGlobalUserParam, _BypassIntegrationStepLimit, _CanSlowDown, _CoordSystemInfo, _Date, _ForceDisplayBBox, _HiddenAtCurrentFrame, _HiddenAtPreviousFrame, _KeepEllapsedTimeForLifeUpdate, _MaxDistLODBias, _MaxNbIntegrations, _OneMinusCurrentLODRatio, _ParticleRemoveListIndex, _ParticleToRemove, NL3D::CParticleSystemShape::_ProcessOrder, _ProcessVect, _Sharing, _Spawns, _SystemDate, _TimeThreshold, _UserCoordSystemInfo, _UserParam, _UserParamGlobalValue, NL3D::CPSLocated::addNewlySpawnedParticles(), Anim, BlendRender, CHECK_INTEGRITY, NL3D::CPSLocated::checkLife(), NLMISC::clamp(), computeBBox(), NL3D::CPSLocated::computeForces(), NL3D::CPSLocated::computeMotion(), NL3D::CPSLocated::computeNewParticleMotion(), NL3D::CPSLocated::computeSpawns(), NL3D::CParticleSystem::CUserCoordSystemInfo::CoordSystemInfo, NL3D::CParticleSystem::CCoordSystemInfo::CurrentDeltaPos, NL3D::CPSUtil::displayBBox(), NL3D::CPSLocated::doLODDegradation(), EllapsedTime, getDistFromViewer(), getDriver(), NL3D::CPSLocated::getMaxSize(), NLMISC::CMatrix::getPos(), NL3D::CPSLocated::getSize(), getSortingByEmitterPrecedence(), NL3D::CPSLocated::hasCollisionInfos(), NL3D::CPSLocated::hasLODDegradation(), InsideSimLoop, InverseTotalEllapsedTime, NL3D::CPSLocated::isParametricMotionEnabled(), NL3D::CParticleSystem::CCoordSystemInfo::Matrix, NL3D::MaxPSUserParam, MINI_TIMER, NL_PS_FUNC_MAIN, nlassert, nlctassert, NLMISC::CVector::Null, NL3D::CParticleSystem::CCoordSystemInfo::OldPos, OwnerModel, NL3D::PSAnim10, NL3D::PSAnim11, NL3D::PSAnim2, NL3D::PSAnim3, NL3D::PSAnim4, NL3D::PSAnim5, NL3D::PSBlendRender, NL3D::PSMotion, NL3D::PSSolidRender, NL3D::PSToolRender, RealEllapsedTime, RealEllapsedTimeRatio, NL3D::CPSLocated::removeOldParticles(), NL3D::CPSLocated::resetCollisions(), NL3D::IDriver::setupModelMatrix(), SolidRender, stepLocated(), ToolRender, NL3D::CPSLocated::updateCollisions(), updateColor(), NL3D::CPSLocated::updateLife(), updateLODRatio(), and updateNumWantedTris().

Referenced by NL3D::CParticleSystemModel::doAnimate(), and NL3D::CParticleSystemShape::render().

void NL3D::CParticleSystem::stepLocated ( TPSProcessPass  pass  )  [private]

process a pass on the bound located

=======================================================================================

Definition at line 364 of file particle_system.cpp.

References _ProcessVect, and NL_PS_FUNC_MAIN.

Referenced by step().

void NL3D::CParticleSystem::stopSound (  ) 

immediatly shut down all the sound in this system

======================================================================================= immediatly shut down all the sound in this system

Definition at line 181 of file particle_system.cpp.

References NL3D::CPSLocated::getBoundObject(), NL3D::CPSLocated::getNbBoundObjects(), getNbProcess(), getProcess(), NL3D::CPSLocatedBindable::getType(), NL_PS_FUNC_MAIN, and NL3D::PSSound.

Referenced by NL3D::CParticleSystemManager::stopSound().

void NL3D::CParticleSystem::systemDurationChanged (  ) 

Must be called by a sub component of the system to tell that the duration of the system may have changed.

=======================================================================================

This can happen typically if :

  • The system structure is changed (located added, merge ..)
  • The lifetime of a located is changed
  • Emitter parameters are modified In this case, if the system must stop when there are no particle left, the delay before that test must be recomputed

Definition at line 1736 of file particle_system.cpp.

References getAutoComputeDelayBeforeDeathConditionTest(), NL_PS_FUNC_MAIN, and setDelayBeforeDeathConditionTest().

Referenced by attach(), NL3D::CPSLocated::bind(), detach(), merge(), NL3D::CPSLocated::remove(), remove(), NL3D::CPSEmitter::setEmissionType(), NL3D::CPSEmitter::setEmitDelay(), NL3D::CPSEmitter::setEmittedType(), NL3D::CPSLocated::setInitialLife(), NL3D::CPSLocated::setLifeScheme(), NL3D::CPSEmitter::setPeriod(), and NL3D::CPSEmitter::setPeriodScheme().

void NL3D::CParticleSystem::unregisterLocatedBindableExternID ( CPSLocatedBindable lb  ) 

unregister the given located bindable. An assertion is raised if it has not been registered before

=======================================================================================

Definition at line 1290 of file particle_system.cpp.

References _LBMap, NL3D::CPSLocatedBindable::getExternID(), NL3D::CParticleSystemProcess::getOwner(), NL3D::CPSLocatedBindable::getOwner(), NL_PS_FUNC_MAIN, and nlassert.

Referenced by NL3D::CPSLocatedBindable::setExternID(), and NL3D::CPSLocatedBindable::~CPSLocatedBindable().

void NL3D::CParticleSystem::updateColor ( float  distFromViewer  )  [inline, private]

=======================================================================================

Definition at line 398 of file particle_system.cpp.

References _ColorAttenuationScheme, _GlobalColor, _GlobalColorLighted, _InvMaxViewDist, _LightingColor, _UserColor, NLMISC::clamp(), NL3D::CPSAttribMaker< T >::get(), NLMISC::CRGBA::modulateFromColor(), NL_PS_FUNC_MAIN, and NLMISC::CRGBA::White.

Referenced by step().

float NL3D::CParticleSystem::updateLODRatio (  )  [inline, private]

=======================================================================================

Definition at line 388 of file particle_system.cpp.

References _InvCurrentViewDist, _OneMinusCurrentLODRatio, NLMISC::clamp(), getDistFromViewer(), and NL_PS_FUNC_MAIN.

Referenced by step().

void NL3D::CParticleSystem::updateNumWantedTris (  )  [private]

=======================================================================================

Definition at line 246 of file particle_system.cpp.

References _NumWantedTris, _ProcessVect, and NL_PS_FUNC_MAIN.

Referenced by step().

void NL3D::CParticleSystem::updateProcessIndices (  )  [private]

=======================================================================================

Definition at line 2296 of file particle_system.cpp.

References _ProcessVect, and NL_PS_FUNC_MAIN.

Referenced by remove().


Friends And Related Function Documentation

friend class CParticleSystemModel [friend]

Definition at line 1060 of file particle_system.h.


Member Data Documentation

Definition at line 1212 of file particle_system.h.

Referenced by getAutoCountFlag(), and setAutoCountFlag().

Definition at line 1204 of file particle_system.h.

Referenced by enableAutoLOD(), isAutoLODEnabled(), and step().

Definition at line 1189 of file particle_system.h.

Referenced by getAutoLODDegradationExponent(), setupAutoLOD(), and step().

Definition at line 1168 of file particle_system.h.

Referenced by getAutoLODEmitRatio(), and step().

Definition at line 1206 of file particle_system.h.

Referenced by getAutoLODMode(), and setAutoLODMode().

Definition at line 1188 of file particle_system.h.

Referenced by getAutoLODStartDistPercent(), setupAutoLOD(), and step().

when set to true, the system will compute his BBox every time computeBBox is called

Definition at line 1198 of file particle_system.h.

Referenced by computeBBox(), and step().

Definition at line 1180 of file particle_system.h.

Referenced by NL3D::CParticleSystemModel::doAnimate(), and step().

Definition at line 1253 of file particle_system.h.

Definition at line 1143 of file particle_system.h.

Referenced by getCurrentEditedElement(), and setCurrentEditedElement().

Definition at line 1139 of file particle_system.h.

Referenced by getCurrentEditedElement(), and setCurrentEditedElement().

Definition at line 1141 of file particle_system.h.

Referenced by getCurrentEditedElement(), and setCurrentEditedElement().

Definition at line 1133 of file particle_system.h.

Referenced by getDate(), and step().

Definition at line 1202 of file particle_system.h.

Referenced by destroyWhenOutOfFrustum(), and doesDestroyWhenOutOfFrustum().

Definition at line 1170 of file particle_system.h.

Referenced by getDestroyCondition(), and setDestroyCondition().

Definition at line 1079 of file particle_system.h.

Referenced by getDriver(), and setDriver().

Definition at line 1208 of file particle_system.h.

Referenced by enableEmitThreshold(), and isEmitThresholdEnabled().

Definition at line 1083 of file particle_system.h.

Referenced by getFontGenerator(), and setFontGenerator().

Definition at line 1084 of file particle_system.h.

Referenced by getFontManager(), and setFontManager().

Definition at line 1217 of file particle_system.h.

Referenced by forceDisplayBBox(), and step().

Definition at line 1192 of file particle_system.h.

Referenced by getGlobalColor(), setColorAttenuationScheme(), and updateColor().

Definition at line 1193 of file particle_system.h.

Referenced by getGlobalColorLighted(), and updateColor().

Definition at line 1073 of file particle_system.h.

Referenced by bindGlobalValueToUserParam(), getGlobalValue(), and setGlobalValue().

Definition at line 1213 of file particle_system.h.

Referenced by hide(), and step().

Definition at line 1214 of file particle_system.h.

Referenced by step().

Definition at line 1166 of file particle_system.h.

Referenced by getLOD(), getLODVect(), setMaxViewDist(), setNumTris(), and updateLODRatio().

Definition at line 1165 of file particle_system.h.

Referenced by getWantedNumTris(), setMaxViewDist(), setNumTris(), and updateColor().

Last update date of the system. Useful with sharing only, to avoid several motions.

Definition at line 1136 of file particle_system.h.

Referenced by NL3D::CParticleSystemModel::traverseAnimDetail().

Definition at line 1194 of file particle_system.h.

Referenced by getLightingColor(), setLightingColor(), and updateColor().

Definition at line 1161 of file particle_system.h.

Referenced by getLOD(), getLODRatio(), and setLODRatio().

Definition at line 1164 of file particle_system.h.

Referenced by getMaxDistLODBias(), setMaxDistLODBias(), and step().

Definition at line 1163 of file particle_system.h.

Referenced by getMaxViewDist(), getWantedNumTris(), and setMaxViewDist().

std::string NL3D::CParticleSystem::_Name [private]

Definition at line 1154 of file particle_system.h.

Referenced by getName(), and setName().

Definition at line 1172 of file particle_system.h.

Referenced by getWantedNumTris(), setNumTris(), and updateNumWantedTris().

Definition at line 1162 of file particle_system.h.

Referenced by getOneMinusCurrentLODRatio(), step(), and updateLODRatio().

Definition at line 1077 of file particle_system.h.

Referenced by computeBBox(), getLastComputedBBox(), and setPrecomputedBBox().

the scene in which the particle system is inserted.

This is needed because the system may add objects to the scene (for particle that are meshs for instance)

Definition at line 1150 of file particle_system.h.

Referenced by getScene(), merge(), and setScene().

Definition at line 1216 of file particle_system.h.

Referenced by getSerializeIdentifierFlag(), and setSerializeIdentifierFlag().

Definition at line 1203 of file particle_system.h.

Referenced by enableSharing(), isSharingEnabled(), and step().

Definition at line 1175 of file particle_system.h.

Referenced by getSoundServer(), and registerSoundServer().

Definition at line 1157 of file particle_system.h.

Referenced by getSystemDate(), setSysMat(), setSystemDate(), setUserMatrix(), and step().

Definition at line 1195 of file particle_system.h.

Referenced by getUserColor(), isUserColorUsed(), setUserColor(), and updateColor().

Definition at line 1177 of file particle_system.h.

Referenced by CParticleSystem(), getUserParam(), setUserParam(), and step().

const TGlobalValuesMap::value_type** NL3D::CParticleSystem::_UserParamGlobalValue [private]

Definition at line 1126 of file particle_system.h.

Referenced by getViewMat(), and setViewMat().

Definition at line 1263 of file particle_system.h.

Referenced by NL3D::CPSLocated::addNewlySpawnedParticles().

Definition at line 1258 of file particle_system.h.

Referenced by interpolateFXPosDelta(), interpolateUserPosDelta(), and step().

used for benchs. must be reset by the user

Definition at line 236 of file particle_system.h.

Referenced by NL3D::CPSLocated::incrementNbDrawnParticles().

Definition at line 1264 of file particle_system.h.

Referenced by NL3D::CPSLight::step(), step(), and NL3D::CPSMesh::updatePos().


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

Generated on Thu Jan 7 08:30:06 2010 for NeL by  doxygen 1.6.1