NL3D::CPSLocated Class Reference

this class is a located : it belongs to a particle system, and it represents any kind of object that has a position in the world. More...

#include <ps_located.h>

Inherits NL3D::CParticleSystemProcess.

List of all members.

Classes

struct  CParametricInfo
 WARNING : private use by forces only. More...

Public Types

typedef CPSAttrib
< CParametricInfo
TPSAttribParametricInfo
 WARNING : private use by forces only.

Public Member Functions

PS_FAST_OBJ_ALLOC CPSLocated ()
 Constructor.
virtual ~CPSLocated ()
 dtor
virtual bool isLocated () const
bool bind (CPSLocatedBindable *lb)
 attach a bindable object to this located, such as a force or a particle a bindable must be attached only once (-> nlassert) The bindable is then owned by the system and will be deleted by it.
CPSLocatedBindableunbind (uint index)
 Detach a bindable object from this located.
bool isBound (const CPSLocatedBindable *lb) const
 test whether a located bindable is attached to that object
uint getIndexOf (const CPSLocatedBindable *lb) const
 Get the index of a located bindable that is bound to that object.
void remove (const CPSLocatedBindable *lb)
 remove a bound object from the located if the object doesnt exist -> nlassert it is deleted
virtual void releaseRefTo (const CParticleSystemProcess *other)
 From CParticleSystemProcess.
virtual void releaseAllRef ()
 From CParticleSystemProcess.
uint32 getNbBoundObjects (void) const
 count the number of bound objects
const CPSLocatedBindablegetBoundObject (uint32 index) const
 get a pointer to a bound object (const version)
CPSLocatedBindablegetBoundObject (uint32 index)
 get a pointer to a bound object
void postNewElement (const NLMISC::CVector &pos, const NLMISC::CVector &speed, CPSLocated &emitterLocated, uint32 indexInEmitter, TPSMatrixMode speedCoordSystem, TAnimationTime lifeTime)
 Post a new Element to be created.
sint32 newElement (const NLMISC::CVector &pos, const NLMISC::CVector &speed, CPSLocated *emitterLocated, uint32 indexInEmitter, TPSMatrixMode speedCoordSystem, bool doEmitOnce=false)
 Generate one more instance in a located.
void deleteElement (uint32 index)
 Delete one located in the container not present -> nlassert.
TAnimationTime getAgeInSeconds (uint elementIndex) const
CScenegetScene (void)
 shortcut to get the scene
void getLODVect (NLMISC::CVector &v, float &offset, TPSMatrixMode matrixMode)
 shortcut to the same method of the owning particle system
void incrementNbDrawnParticles (uint num)
 Shorcut to increase the particle counter (number of particle drawn, for benchmark purpose ) should be called only by bound object that display particles.
uint32 getNewElementIndex (void) const
 Get the index of the new element that is created Valid only after the newElement method (overridable) of a LocatedBindable is called : you get the index of the located being generated, if you need its pos, speed, or mass.
bool computeBBox (NLMISC::CAABBox &aabbox) const
 Compute the aabbox of this located, (expressed in world basis.
void setInitialLife (TAnimationTime lifeTime)
 Set the duration of locateds.
void setLifeScheme (CPSAttribMaker< float > *scheme)
 Set a scheme (allocated by new, released by that object) that generate the duration of locateds.
TAnimationTime getInitialLife (void) const
 get the life of created particles (valid if they have a limited life time)
CPSAttribMaker< float > * getLifeScheme (void)
 get the life scheme of created particle, null if none (valid if they have a limited life time)
const CPSAttribMaker< float > * getLifeScheme (void) const
void setInitialMass (float mass)
 Set the mass of locateds.
void setMassScheme (CPSAttribMaker< float > *scheme)
 Set a scheme (allocated by new, released by that object) that generate the mass of locateds.
float getInitialMass (void) const
 get the mass of created particle
CPSAttribMaker< float > * getMassScheme (void)
 get the scheme that compute mass of created particles, null if none
const CPSAttribMaker< float > * getMassScheme (void) const
bool setLastForever ()
 set immortality for located
bool getLastForever (void) const
 retrieve immortality for locateds
TPSAttribFloatgetInvMass (void)
 get mass inverse attrib ref
const TPSAttribFloatgetInvMass (void) const
 get mass inverse attrib const ref
TPSAttribVectorgetPos (void)
 get Pos attrib ref
const TPSAttribVectorgetPos (void) const
 get Pos attrib const ref
TPSAttribVectorgetSpeed (void)
 get Speed attrib ref
const TPSAttribVectorgetSpeed (void) const
 get Speed attrib const ref
TPSAttribTimegetTime (void)
 get Time attrib ref
const TPSAttribTimegetTime (void) const
 get Time attrib const ref
TPSAttribTimegetTimeIncrement (void)
 get TotalTime attrib ref
const TPSAttribTimegetTimeIncrement (void) const
 get TotalTime attrib const ref
virtual void step (TPSProcessPass pass)
 process the system
void computeMotion ()
 ***************************************************************************************
void computeNewParticleMotion (uint firstInstanceIndex)
 ***************************************************************************************
void updateCollisions ()
 ***************************************************************************************
uint32 getSize (void) const
 get the current number of instance in this located container
uint32 getMaxSize (void) const
 get the max number of instance in this located container
void resize (uint32 newSize)
 Resize the located container, in order to accept more instances.
void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 serialization
IDrivergetDriver () const
 Shortcut to get an instance of the 3d driver.
float getUserParam (uint numParam) const
 shorcut to get a user param that was set in the owner system
 NLMISC_DECLARE_CLASS (CPSLocated)
void setupDriverModelMatrix (void)
 Setup the driver model matrix. It is set accrodingly to the basis of the located.
NLMISC::CVector computeI (void) const
 Compute a vector that will map to (1 0 0) after view and model transform.
NLMISC::CVector computeIWithZAxisAligned (void) const
 ***************************************************************************************
NLMISC::CVector computeJ (void) const
 Compute a vector that will map to (0 1 0) after view and model transform.
NLMISC::CVector computeK (void) const
 Compute a vector that will map to (0 0 1) after view and model transform.
NLMISC::CVector computeKWithZAxisAligned (void) const
 ***************************************************************************************
void queryCollisionInfo (void)
 call this if you need collision infos.
void releaseCollisionInfo (void)
 Release the collideInfos attribute.
bool hasCollisionInfos () const
 test whether this located has collision infos
void computeSpawns (uint firstInstanceIndex, bool includeEmitOnce)
 ***************************************************************************************
void computeForces ()
 ***************************************************************************************
void computeCollisions (uint firstInstanceIndex, const NLMISC::CVector *posBefore, const NLMISC::CVector *posAfter)
 ***************************************************************************************
const NLMISC::CMatrixgetLocalToWorldMatrix () const
const NLMISC::CMatrixgetWorldToLocalMatrix () const
void registerDtorObserver (CPSLocatedBindable *observer)
 Register a dtor observer; (that derives from CPSLocatedBindable) Each observer will be called when this object dtor is called (call of method notifyTargetRemoved() ) This allow for objects that hold this as a target to know when it is suppressed (example : collision objects hold located as targets) When an observer is detroyed, it MUST call unregisterDtorObserver, The same observer can only register once, otherwise, an assertion occurs.
void unregisterDtorObserver (CPSLocatedBindable *anObserver)
 remove a dtor observer (not present -> nlassert) see register dtor observer
void setName (const std::string &name)
 set the located bindable name (edition purpose)
std::string getName (void) const
 get the located bindable name (edition purpose)
virtual bool hasParticles (void) const
 tells whether there are alive entities / particles in the system
virtual bool hasEmitters (void) const
 tells whether there are alive emitters / particles in the system
void forceLODDegradation (bool enable=true)
 Enable the to force LOD degradation.
bool hasLODDegradation (void) const
 Test whether LOD degradation was activated.
virtual uint getNumWantedTris () const
 for the CPSLocated to reevaluate the max number of faces it may need
virtual void setMatrixMode (TPSMatrixMode matrixMode)
 ***************************************************************************************
bool supportParametricMotion (void) const
 Test whether this located support parametric motion.
void enableParametricMotion (bool enable=true)
 When set to true, this tells the system to use parametric motion.
bool isParametricMotionEnabled (void) const
 test whether parametric motion is enabled
virtual void performParametricMotion (TAnimationTime date)
 inherited from CParticlesystemProcess perform parametric motion for this located to reach the given date
void updateLife ()
 make the particle older of the given amount.
void removeOldParticles ()
 Remove old particles that were marked as 'dead'.
void addNewlySpawnedParticles ()
 Add newly spawned particles.
void integrateSingle (float startDate, float deltaT, uint numStep, uint32 indexInLocated, NLMISC::CVector *destPos, uint posStride=sizeof(NLMISC::CVector)) const
 Compute the trajectory of the given located.
void computeParametricPos (float date, uint indexInLocated, NLMISC::CVector &dest) const
void enableTriggerOnDeath (bool enable=true)
 Enable a trigger on death. It is used to create emission on an emitter with a given ID.
bool isTriggerOnDeathEnabled (void) const
 Test whether a trigger on death has been enabled.
void setTriggerEmitterID (uint32 id)
 Set an ID for the emitter to be triggered on death.
uint32 getTriggerEmitterID (void) const
 Get the ID for the emitter to be triggered on death.
float evalMaxDuration () const
 eval max duration of the located (if no scheme is used, this is the lifetime) nb : return -1 if located last for ever
virtual uint getUserMatrixUsageCount () const
 ***************************************************************************************
virtual void enumTexs (std::vector< NLMISC::CSmartPtr< ITexture > > &dest, IDriver &drv)
 ***************************************************************************************
virtual void setZBias (float value)
 ***************************************************************************************
void checkLife () const
 ***************************************************************************************
virtual void onShow (bool shown)
 ***************************************************************************************
void registerIntegrableForce (CPSForce *f)
 PRIVATE USE: register a force that is integrable on this located. It must have been registered only once.
void unregisterIntegrableForce (CPSForce *f)
 PRIVATE USE: unregister a force that is integrable with this located.
void integrableForceBasisChanged (TPSMatrixMode basis)
 PRIVATE USE: says that an integrable force basis has changed, and says which is the right basis.
void addNonIntegrableForceRef (void)
 PRIVATE USE: add a reference count that says that non-integrable forces have been added.
void releaseNonIntegrableForceRef (void)
 PRIVATE USE: decrease the reference count to say that a non-integrable force has been removed.
TPSAttribParametricInfogetParametricInfos ()
 PRIVATE USE : access to parametric infos.
virtual void systemDateChanged ()
 PRIVATE USE : called by the system when its date has been manually changed.
void resetCollisions (uint numInstances)
 ***************************************************************************************
void doLODDegradation ()
 PRIVATE USE :Should be only called by the sim loop when hasLODDegradation() returns true. /see forceLODDegradation.

Static Public Member Functions

static const NLMISC::CMatrixgetConversionMatrix (const CParticleSystem &ps, TPSMatrixMode to, TPSMatrixMode from)
static const NLMISC::CMatrixgetConversionMatrix (const CPSLocated *A, const CPSLocated *B)
 get a matrix that helps to express located B coordinate in located A basis A and B must belong to the same system

Public Attributes

CPSAttrib< CParametricInfo_PInfo
 WARNING : private use by forces only.

Static Public Attributes

static CPSCollisionInfo_FirstCollision = NULL
static std::vector
< CPSCollisionInfo
_Collisions

Protected Types

typedef CPSVector
< CPSLocatedBindable * >::V 
TLocatedBoundCont
typedef CPSVector
< CPSLocatedBindable * >::V 
TDtorObserversVect
typedef CPSVector< CPSForce * >::V TForceVect

Protected Member Functions

void allocateParametricInfos (void)
 allocate parametric infos
void releaseParametricInfos (void)
 release paametric infos
void notifyMotionTypeChanged (void)
 notify the attached object that we have switch between parametric / incremental motion
void checkIntegrity () const
 ***************************************************************************************

Protected Attributes

uint32 _Size
 Cache the max number of faces this located may want.
uint32 _MaxSize
uint32 _CollisionInfoNbRef
TPSAttribVector_CollisionNextPos
float _InitialLife
CPSAttribMaker< float > * _LifeScheme
float _InitialMass
CPSAttribMaker< float > * _MassScheme
bool _LODDegradation: 1
bool _ParametricMotion: 1
bool _TriggerOnDeath: 1
bool _LastForever: 1
uint32 _TriggerID
uint16 _NonIntegrableForceNbRefs
 Number of forces, (counts collision zones too).
uint16 _NumIntegrableForceWithDifferentBasis
 Number of forces that apply on that located that have the same basis that this one (required for parametric animation).
std::string _Name
TLocatedBoundCont _LocatedBoundCont
TPSAttribFloat _InvMass
TPSAttribVector _Pos
TPSAttribVector _Speed
TPSAttribTime _Time
TPSAttribTime _TimeIncrement
TDtorObserversVect _DtorObserversVect
TForceVect _IntegrableForces

Private Member Functions

void deleteElement (uint32 index, TAnimationTime timeUntilNextSimStep)
 ***************************************************************************************
void deleteElementBase (uint32 index)
 ***************************************************************************************
TAnimationTime computeDateFromCollisionToNextSimStep (uint particleIndex, float particleAgeInSeconds)
 ***************************************************************************************
sint32 newElement (const CPSSpawnInfo &si, bool doEmitOnce, TAnimationTime ellapsedTime)
 ***************************************************************************************

Friends

class CPSForce

Detailed Description

this class is a located : it belongs to a particle system, and it represents any kind of object that has a position in the world.

A located don't do anything by itself. You must bind objects to it, such as a particle, a force and so on. It is important to remember that a located holds all instance of object of one type (force, emitter, particles or both...), not only one. Not sharable accross systems

Definition at line 104 of file ps_located.h.


Member Typedef Documentation

Definition at line 641 of file ps_located.h.

typedef CPSVector<CPSForce *>::V NL3D::CPSLocated::TForceVect [protected]

Definition at line 644 of file ps_located.h.

Definition at line 605 of file ps_located.h.

WARNING : private use by forces only.

Definition at line 633 of file ps_located.h.


Constructor & Destructor Documentation

NL3D::CPSLocated::CPSLocated (  ) 

Constructor.

***************************************************************************************

Constructor

Definition at line 70 of file ps_located.cpp.

References NL_PS_FUNC.

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

Member Function Documentation

void NL3D::CPSLocated::addNewlySpawnedParticles (  ) 
void NL3D::CPSLocated::addNonIntegrableForceRef ( void   ) 

PRIVATE USE: add a reference count that says that non-integrable forces have been added.

***************************************************************************************

Definition at line 2570 of file ps_located.cpp.

References _NonIntegrableForceNbRefs, CHECK_PS_INTEGRITY, NL_PS_FUNC, and releaseParametricInfos().

Referenced by NL3D::CPSZone::attachTarget(), and NL3D::CPSForce::attachTarget().

void NL3D::CPSLocated::allocateParametricInfos ( void   )  [protected]
bool NL3D::CPSLocated::bind ( CPSLocatedBindable lb  ) 

attach a bindable object to this located, such as a force or a particle a bindable must be attached only once (-> nlassert) The bindable is then owned by the system and will be deleted by it.

***************************************************************************************

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

sorted insertion (by decreasing priority order) of a bindable (particle e.g an aspect, emitter) in a located

the max number of shapes may have changed

Definition at line 866 of file ps_located.cpp.

References _LocatedBoundCont, _MaxSize, NL3D::CParticleSystemProcess::_Owner, _ParametricMotion, _Size, NL3D::CParticleSystem::canFinish(), CHECK_PS_INTEGRITY, NL3D::CParticleSystem::getBypassMaxNumIntegrationSteps(), NL3D::CPSLocatedBindable::getExternID(), getIndexOf(), NL3D::CPSLocatedBindable::motionTypeChanged(), NL3D::CPSLocatedBindable::newElement(), NL_PS_FUNC, nlassert, nlwarning, NL3D::CParticleSystem::registerLocatedBindableExternID(), NL3D::CPSLocatedBindable::resize(), NL3D::CPSEmitterInfo::setDefaults(), NL3D::CPSLocatedBindable::setOwner(), NL3D::CParticleSystem::systemDurationChanged(), and unbind().

void NL3D::CPSLocated::checkIntegrity (  )  const [protected]

***************************************************************************************

Definition at line 136 of file ps_located.cpp.

References _CollisionNextPos, _InvMass, _Pos, _Speed, _Time, _TimeIncrement, NL3D::CPSAttrib< T >::getMaxSize(), NL3D::CPSAttrib< T >::getSize(), hasCollisionInfos(), NL_PS_FUNC, and nlassert.

void NL3D::CPSLocated::checkLife (  )  const

***************************************************************************************

Definition at line 3133 of file ps_located.cpp.

References getLastForever(), getSize(), getTime(), NL_PS_FUNC, and nlassert.

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

bool NL3D::CPSLocated::computeBBox ( NLMISC::CAABBox aabbox  )  const [virtual]

Compute the aabbox of this located, (expressed in world basis.

***************************************************************************************

Returns:
true if there is any aabbox
Parameters:
aabbox a ref to the result box

Implements NL3D::CParticleSystemProcess.

Definition at line 2429 of file ps_located.cpp.

References _LocatedBoundCont, _Pos, _Size, NL3D::CPSAttrib< T >::begin(), CHECK_PS_INTEGRITY, NLMISC::CAABBox::computeAABBoxUnion(), NL3D::CPSAttrib< T >::end(), min, NLMISC::CVector::minof(), NL_PS_FUNC, and NLMISC::CAABBox::setMinMax().

void NL3D::CPSLocated::computeCollisions ( uint  firstInstanceIndex,
const NLMISC::CVector posBefore,
const NLMISC::CVector posAfter 
)

***************************************************************************************

Definition at line 3048 of file ps_located.cpp.

References _DtorObserversVect, NL_PS_FUNC, and NL3D::PSZone.

Referenced by computeMotion(), and computeNewParticleMotion().

TAnimationTime NL3D::CPSLocated::computeDateFromCollisionToNextSimStep ( uint  particleIndex,
float  particleAgeInSeconds 
) [inline, private]

***************************************************************************************

Definition at line 2145 of file ps_located.cpp.

References _Collisions, NL3D::CParticleSystem::EllapsedTime, NL_PS_FUNC, NL3D::CParticleSystem::RealEllapsedTime, and NL3D::CParticleSystem::RealEllapsedTimeRatio.

Referenced by removeOldParticles(), and updateCollisions().

void NL3D::CPSLocated::computeForces (  ) 

***************************************************************************************

Definition at line 3095 of file ps_located.cpp.

References _DtorObserversVect, NL3D::CPSForce::computeForces(), NL3D::CParticleSystem::InsideSimLoop, NL_PS_FUNC, nlassert, and NL3D::PSForce.

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

NLMISC::CVector NL3D::CPSLocated::computeI ( void   )  const

Compute a vector that will map to (1 0 0) after view and model transform.

***************************************************************************************

This allow to have object that always faces the user, whatever basis they are in

Definition at line 659 of file ps_located.cpp.

References NL3D::CParticleSystemProcess::_Owner, CHECK_PS_INTEGRITY, NLMISC::CMatrix::getI(), NL3D::CParticleSystem::getInvertedViewMat(), NL3D::CParticleSystemProcess::getMatrixMode(), NL3D::CParticleSystem::getSysMat(), getWorldToLocalMatrix(), NLMISC::CMatrix::mulVector(), NL_PS_FUNC, and NL3D::PSIdentityMatrix.

Referenced by NL3D::CPSLocatedBindable::computeI(), and NL3D::CPSRibbonLookAt::displayRibbons().

NLMISC::CVector NL3D::CPSLocated::computeIWithZAxisAligned ( void   )  const
NLMISC::CVector NL3D::CPSLocated::computeJ ( void   )  const

Compute a vector that will map to (0 1 0) after view and model transform.

***************************************************************************************

This allow to have object that always faces the user, whatever basis they are in

Definition at line 724 of file ps_located.cpp.

References NL3D::CParticleSystemProcess::_Owner, CHECK_PS_INTEGRITY, NL3D::CParticleSystem::getInvertedViewMat(), NLMISC::CMatrix::getJ(), NL3D::CParticleSystemProcess::getMatrixMode(), NL3D::CParticleSystem::getSysMat(), getWorldToLocalMatrix(), NLMISC::CMatrix::mulVector(), NL_PS_FUNC, and NL3D::PSIdentityMatrix.

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

NLMISC::CVector NL3D::CPSLocated::computeK ( void   )  const

Compute a vector that will map to (0 0 1) after view and model transform.

***************************************************************************************

This allow to have object that always faces the user, whatever basis they are in

Definition at line 755 of file ps_located.cpp.

References NL3D::CParticleSystemProcess::_Owner, CHECK_PS_INTEGRITY, NL3D::CParticleSystem::getInvertedViewMat(), NLMISC::CMatrix::getK(), NL3D::CParticleSystemProcess::getMatrixMode(), NL3D::CParticleSystem::getSysMat(), getWorldToLocalMatrix(), NLMISC::CMatrix::mulVector(), NL_PS_FUNC, and NL3D::PSIdentityMatrix.

Referenced by NL3D::CPSLocatedBindable::computeK(), and NL3D::CPSRibbonLookAt::displayRibbons().

NLMISC::CVector NL3D::CPSLocated::computeKWithZAxisAligned ( void   )  const
void NL3D::CPSLocated::computeMotion (  ) 

***************************************************************************************

Definition at line 1778 of file ps_located.cpp.

References _CollisionNextPos, _Collisions, _Pos, _Size, _Speed, computeCollisions(), NL3D::CParticleSystem::EllapsedTime, NL3D::IntegrateSpeed(), MINI_TIMER, NL_PS_FUNC, nlassert, NL3D::PSMotion3, NL3D::PSMotion4, and NL3D::CPSAttrib< T >::swap().

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

void NL3D::CPSLocated::computeNewParticleMotion ( uint  firstInstanceIndex  ) 

***************************************************************************************

Definition at line 1808 of file ps_located.cpp.

References _CollisionNextPos, _Pos, _Size, NL3D::CParticleSystem::_SpawnPos, computeCollisions(), NL_PS_FUNC, nlassert, and resetCollisions().

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

void NL3D::CPSLocated::computeParametricPos ( float  date,
uint  indexInLocated,
NLMISC::CVector dest 
) const [inline]

Definition at line 1061 of file ps_located.h.

References integrateSingle().

Referenced by removeOldParticles().

void NL3D::CPSLocated::computeSpawns ( uint  firstInstanceIndex,
bool  includeEmitOnce 
)
void NL3D::CPSLocated::deleteElement ( uint32  index,
TAnimationTime  timeUntilNextSimStep 
) [private]

***************************************************************************************

Definition at line 1347 of file ps_located.cpp.

References _LocatedBoundCont, _Size, deleteElementBase(), NL3D::CParticleSystem::InsideRemoveLoop, NL3D::CParticleSystem::InsideSimLoop, NL_PS_FUNC, and nlassert.

void NL3D::CPSLocated::deleteElement ( uint32  index  ) 

Delete one located in the container not present -> nlassert.

***************************************************************************************

Definition at line 1327 of file ps_located.cpp.

References _LocatedBoundCont, _Size, CHECK_PS_INTEGRITY, deleteElementBase(), NL3D::CParticleSystem::InsideRemoveLoop, NL3D::CParticleSystem::InsideSimLoop, NL_PS_FUNC, and nlassert.

Referenced by doLODDegradation(), NL3D::UParticleSystemInstance::removeByID(), removeOldParticles(), and resize().

void NL3D::CPSLocated::deleteElementBase ( uint32  index  )  [inline, private]
void NL3D::CPSLocated::doLODDegradation (  ) 

PRIVATE USE :Should be only called by the sim loop when hasLODDegradation() returns true. /see forceLODDegradation.

***************************************************************************************

Definition at line 1919 of file ps_located.cpp.

References _MaxSize, NL3D::CParticleSystemProcess::_Owner, _Size, deleteElement(), NL3D::CParticleSystem::EllapsedTime, NL3D::CParticleSystem::getOneMinusCurrentLODRatio(), NL3D::CParticleSystem::InsideRemoveLoop, NL3D::CParticleSystem::InsideSimLoop, NL_PS_FUNC, nlassert, and step().

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

void NL3D::CPSLocated::enableParametricMotion ( bool  enable = true  ) 

When set to true, this tells the system to use parametric motion.

***************************************************************************************

This is needed in a few case only, and can only work if all the forces that apply to the system are integrable. An assertion happens otherwise

When set to true, this tells the system to use parametric motion. This is needed in a few case only, and can only work if all the forces that apply to the system are integrable

Definition at line 399 of file ps_located.cpp.

References allocateParametricInfos(), CHECK_PS_INTEGRITY, NL_PS_FUNC, nlassert, releaseParametricInfos(), and supportParametricMotion().

void NL3D::CPSLocated::enableTriggerOnDeath ( bool  enable = true  )  [inline]

Enable a trigger on death. It is used to create emission on an emitter with a given ID.

Definition at line 527 of file ps_located.h.

References _TriggerOnDeath.

void NL3D::CPSLocated::enumTexs ( std::vector< NLMISC::CSmartPtr< ITexture > > &  dest,
IDriver drv 
) [virtual]

***************************************************************************************

Implements NL3D::CParticleSystemProcess.

Definition at line 3028 of file ps_located.cpp.

References _LocatedBoundCont, and NL_PS_FUNC.

float NL3D::CPSLocated::evalMaxDuration (  )  const

eval max duration of the located (if no scheme is used, this is the lifetime) nb : return -1 if located last for ever

***************************************************************************************

Definition at line 127 of file ps_located.cpp.

References _InitialLife, _LastForever, _LifeScheme, NL3D::CPSAttribMaker< T >::getMaxValue(), and NL_PS_FUNC.

Referenced by NL3D::CParticleSystem::evalDuration().

void NL3D::CPSLocated::forceLODDegradation ( bool  enable = true  )  [inline]

Enable the to force LOD degradation.

This will suppress instances immediately, (during the motion pass) so that there won't be more than maxNbInstance * dist / maxDist instances. This may not be desirable every time since particle dissapear on screen, which may be noticeable.

Definition at line 473 of file ps_located.h.

References _LODDegradation.

TAnimationTime NL3D::CPSLocated::getAgeInSeconds ( uint  elementIndex  )  const [inline]
CPSLocatedBindable* NL3D::CPSLocated::getBoundObject ( uint32  index  )  [inline]

get a pointer to a bound object

Definition at line 176 of file ps_located.h.

References _LocatedBoundCont, and nlassert.

const CPSLocatedBindable* NL3D::CPSLocated::getBoundObject ( uint32  index  )  const [inline]
const NLMISC::CMatrix & NL3D::CPSLocated::getConversionMatrix ( const CPSLocated A,
const CPSLocated B 
) [inline, static]

get a matrix that helps to express located B coordinate in located A basis A and B must belong to the same system

Definition at line 1041 of file ps_located.h.

References NL3D::CParticleSystemProcess::_Owner, getConversionMatrix(), NL3D::CParticleSystemProcess::getMatrixMode(), and nlassert.

const NLMISC::CMatrix & NL3D::CPSLocated::getConversionMatrix ( const CParticleSystem ps,
TPSMatrixMode  to,
TPSMatrixMode  from 
) [static]
IDriver * NL3D::CPSLocated::getDriver ( void   )  const

Shortcut to get an instance of the 3d driver.

***************************************************************************************

Definition at line 818 of file ps_located.cpp.

References NL3D::CParticleSystemProcess::_Owner, CHECK_PS_INTEGRITY, NL3D::CParticleSystem::getDriver(), NL_PS_FUNC, and nlassert.

Referenced by NL3D::CPSLocatedBindable::getDriver(), and setupDriverModelMatrix().

uint NL3D::CPSLocated::getIndexOf ( const CPSLocatedBindable lb  )  const

Get the index of a located bindable that is bound to that object.

***************************************************************************************

If it isn't bound, an assertion is raised

Definition at line 2631 of file ps_located.cpp.

References _LocatedBoundCont, CHECK_PS_INTEGRITY, NL_PS_FUNC, and nlassert.

Referenced by bind().

TAnimationTime NL3D::CPSLocated::getInitialLife ( void   )  const [inline]

get the life of created particles (valid if they have a limited life time)

Definition at line 271 of file ps_located.h.

References _InitialLife.

float NL3D::CPSLocated::getInitialMass ( void   )  const [inline]

get the mass of created particle

Definition at line 290 of file ps_located.h.

References _InitialMass.

Referenced by NL3D::CPSBrownianForce::computeForces(), NL3D::CPSMagneticForce::computeForces(), and NL3D::CPSDirectionnalForce::computeForces().

const TPSAttribFloat& NL3D::CPSLocated::getInvMass ( void   )  const [inline]

get mass inverse attrib const ref

Definition at line 310 of file ps_located.h.

References _InvMass.

TPSAttribFloat& NL3D::CPSLocated::getInvMass ( void   )  [inline]
bool NL3D::CPSLocated::getLastForever ( void   )  const [inline]
const CPSAttribMaker<float>* NL3D::CPSLocated::getLifeScheme ( void   )  const [inline]

Definition at line 275 of file ps_located.h.

References _LifeScheme.

CPSAttribMaker<float>* NL3D::CPSLocated::getLifeScheme ( void   )  [inline]

get the life scheme of created particle, null if none (valid if they have a limited life time)

Definition at line 274 of file ps_located.h.

References _LifeScheme.

const NLMISC::CMatrix & NL3D::CPSLocated::getLocalToWorldMatrix (  )  const
void NL3D::CPSLocated::getLODVect ( NLMISC::CVector v,
float offset,
TPSMatrixMode  matrixMode 
)
const CPSAttribMaker<float>* NL3D::CPSLocated::getMassScheme ( void   )  const [inline]

Definition at line 294 of file ps_located.h.

References _MassScheme.

CPSAttribMaker<float>* NL3D::CPSLocated::getMassScheme ( void   )  [inline]

get the scheme that compute mass of created particles, null if none

Definition at line 293 of file ps_located.h.

References _MassScheme.

Referenced by NL3D::CPSBrownianForce::computeForces(), NL3D::CPSMagneticForce::computeForces(), and NL3D::CPSDirectionnalForce::computeForces().

uint32 NL3D::CPSLocated::getMaxSize ( void   )  const [inline]
std::string NL3D::CPSLocated::getName ( void   )  const [inline]

get the located bindable name (edition purpose)

Definition at line 459 of file ps_located.h.

References _Name.

Referenced by NL3D::CParticleSystem::dumpHierarchy().

uint32 NL3D::CPSLocated::getNbBoundObjects ( void   )  const [inline]
uint32 NL3D::CPSLocated::getNewElementIndex ( void   )  const [inline]

Get the index of the new element that is created Valid only after the newElement method (overridable) of a LocatedBindable is called : you get the index of the located being generated, if you need its pos, speed, or mass.

Definition at line 245 of file ps_located.h.

References _Size.

Referenced by NL3D::CPSRibbonBase::newElement(), NL3D::CPSConstraintMesh::newElement(), and NL3D::CPSFace::newElement().

uint NL3D::CPSLocated::getNumWantedTris (  )  const [virtual]

for the CPSLocated to reevaluate the max number of faces it may need

ask for the max number of faces the located wants (for LOD balancing)

***************************************************************************************

Implements NL3D::CParticleSystemProcess.

Definition at line 459 of file ps_located.cpp.

References _LocatedBoundCont, NL3D::CParticleSystemProcess::_Owner, CHECK_PS_INTEGRITY, NL_PS_FUNC, NL3D::PSParticle, and NLMISC::safe_cast().

TPSAttribParametricInfo& NL3D::CPSLocated::getParametricInfos (  )  [inline]

PRIVATE USE : access to parametric infos.

Definition at line 675 of file ps_located.h.

References _PInfo.

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

const TPSAttribVector& NL3D::CPSLocated::getPos ( void   )  const [inline]

get Pos attrib const ref

Definition at line 315 of file ps_located.h.

References _Pos.

TPSAttribVector& NL3D::CPSLocated::getPos ( void   )  [inline]

get Pos attrib ref

Definition at line 313 of file ps_located.h.

References _Pos.

Referenced by NL3D::CPSEmitter::bounceOccured(), NL3D::CPSZonePlane::buildBasis(), NL3D::CPSZoneRectangle::computeCollisions(), NL3D::CPSZoneCylinder::computeCollisions(), NL3D::CPSZoneDisc::computeCollisions(), NL3D::CPSZoneSphere::computeCollisions(), NL3D::CPSZonePlane::computeCollisions(), NL3D::CPSCylindricVortex::computeForces(), NL3D::CPSSpring::computeForces(), NL3D::CPSCentralGravity::computeForces(), NL3D::CIsotropicForceT< T >::computeForces(), NL3D::CPSEmitter::deleteElement(), NL3D::CPSLocatedBindable::displayIcon2d(), NL3D::CPSEmitter::doEmitOnce(), NL3D::CPSShockWave::draw(), NL3D::CPSConstraintMesh::draw(), NL3D::CPSFanLight::draw(), NL3D::CPSFaceLookAt::draw(), NL3D::CPSDot::draw(), NL3D::GenEmitterPositions(), NL3D::GenEmitterPositionsWithLOD(), NL3D::CPSAttribMakerT< T, F >::get(), NL3D::CPSZoneRectangle::getMatrix(), NL3D::CPSZoneCylinder::getMatrix(), NL3D::CPSZoneDisc::getMatrix(), NL3D::CPSZoneSphere::getMatrix(), NL3D::CPSCylindricVortex::getMatrix(), NL3D::CPSSphericalEmitter::getMatrix(), NL3D::CPSEmitterRectangle::getMatrix(), NL3D::CPSAttribMakerT< NLMISC::CRGBA, CPSValueGradientFuncRGBA >::make(), NL3D::CPSAttribMakerT< NLMISC::CRGBA, CPSValueGradientFuncRGBA >::make4(), NL3D::CPSAttribMakerT< NLMISC::CRGBA, CPSValueGradientFuncRGBA >::makeN(), NL3D::CPSSound::newElement(), NL3D::CPSRibbonBase::newElement(), newElement(), postNewElement(), NL3D::CPSEmitter::processEmit(), NL3D::CPSEmitter::processEmitOutsideSimLoop(), NL3D::CPSRibbonBase::resetFromOwner(), NL3D::CPSZoneRectangle::setMatrix(), NL3D::CPSZoneCylinder::setMatrix(), NL3D::CPSZoneDisc::setMatrix(), NL3D::CPSZoneSphere::setMatrix(), NL3D::CPSZonePlane::setMatrix(), NL3D::CPSCylindricVortex::setMatrix(), NL3D::CPSSphericalEmitter::setMatrix(), NL3D::CPSEmitterRectangle::setMatrix(), NL3D::CPSZoneRectangle::show(), NL3D::CPSZoneCylinder::show(), NL3D::CPSZoneDisc::show(), NL3D::CPSZoneSphere::show(), NL3D::CPSZonePlane::show(), NL3D::CPSLight::show(), NL3D::CPSCylindricVortex::show(), NL3D::CPSGravity::show(), NL3D::CPSDirectionnalForce::show(), NL3D::CPSSphericalEmitter::showTool(), NL3D::CPSEmitterRectangle::showTool(), NL3D::CPSEmitter::showTool(), NL3D::CPSSound::step(), NL3D::CPSLight::step(), NL3D::CPSFace::step(), NL3D::CPSRibbonBase::updateGlobals(), and NL3D::CPSMesh::updatePos().

CScene * NL3D::CPSLocated::getScene ( void   ) 
uint32 NL3D::CPSLocated::getSize ( void   )  const [inline]

get the current number of instance in this located container

Definition at line 345 of file ps_located.h.

References _Size.

Referenced by checkLife(), NL3D::CPSZoneRectangle::computeCollisions(), NL3D::CPSZoneCylinder::computeCollisions(), NL3D::CPSZoneDisc::computeCollisions(), NL3D::CPSZoneSphere::computeCollisions(), NL3D::CPSZonePlane::computeCollisions(), NL3D::CPSBrownianForce::computeForces(), NL3D::CPSMagneticForce::computeForces(), NL3D::CPSCylindricVortex::computeForces(), NL3D::CPSSpring::computeForces(), NL3D::CPSCentralGravity::computeForces(), NL3D::CPSGravity::computeForces(), NL3D::CPSDirectionnalForce::computeForces(), NL3D::CIsotropicForceT< T >::computeForces(), NL3D::CPSEmitter::computeSpawns(), NL3D::CPSParticle::computeSrcStep(), NL3D::CPSRibbonBase::deleteElement(), NL3D::CPSConstraintMesh::deleteElement(), NL3D::CPSFace::deleteElement(), NL3D::CPSLocatedBindable::displayIcon2d(), NL3D::CPSEmitter::doEmitOnce(), NL3D::CPSShockWave::draw(), NL3D::CPSFanLight::draw(), NL3D::CPSFaceLookAt::draw(), NL3D::CPSDot::draw(), NL3D::CPSRibbonBase::dupRibbon(), NL3D::UParticleSystemInstance::emit(), NL3D::CParticleSystem::evalDuration(), NL3D::CParticleSystem::getCurrNumParticles(), NL3D::CPSTailDot::getNumWantedTris(), NL3D::CPSShockWave::getNumWantedTris(), NL3D::CPSRibbonLookAt::getNumWantedTris(), NL3D::CPSRibbon::getNumWantedTris(), NL3D::CPSQuad::getNumWantedTris(), NL3D::CPSConstraintMesh::getNumWantedTris(), NL3D::CPSFanLight::getNumWantedTris(), NL3D::CPSDot::getNumWantedTris(), NL3D::CPSEmitter::hasEmitters(), NL3D::CPSParticle::hasParticles(), NL3D::CParticleSystem::matchArraySize(), newElement(), NL3D::CPSEmitter::processRegularEmission(), NL3D::CPSEmitter::processRegularEmissionConsistent(), NL3D::CPSEmitter::processRegularEmissionConsistentWithNoLOD(), NL3D::CPSEmitter::processRegularEmissionWithNoLOD(), NL3D::UParticleSystemInstance::removeByID(), NL3D::CPSConstraintMesh::resize(), NL3D::CPSEmitter::resize(), NL3D::CPSLight::setAttenEndScheme(), NL3D::CPSLight::setAttenStartScheme(), NL3D::CPSLight::setColorScheme(), NL3D::CPSSound::setGainScheme(), NL3D::CPSEmitter::setGenNbScheme(), NL3D::CPSConstraintMesh::setMorphScheme(), NL3D::CPSLocatedBindable::setOwner(), NL3D::CPSEmitter::setPeriodScheme(), NL3D::CPSSound::setPitchScheme(), NL3D::CPSShockWave::setUFactor(), NL3D::CPSZoneRectangle::show(), NL3D::CPSCylindricVortex::show(), NL3D::CPSDirectionnalForce::show(), NL3D::CPSEmitterRectangle::showTool(), NL3D::CPSEmitter::showTool(), NL3D::CPSSound::step(), NL3D::CPSFace::step(), NL3D::CParticleSystem::step(), NL3D::CPSEmitter::updateEmitTrigger(), NL3D::CPSRibbonBase::updateGlobals(), NL3D::CPSEmitter::updateMaxCountVect(), and NL3D::CPSMesh::updatePos().

const TPSAttribVector& NL3D::CPSLocated::getSpeed ( void   )  const [inline]

get Speed attrib const ref

Definition at line 320 of file ps_located.h.

References _Speed.

TPSAttribVector& NL3D::CPSLocated::getSpeed ( void   )  [inline]
const TPSAttribTime& NL3D::CPSLocated::getTime ( void   )  const [inline]

get Time attrib const ref

Definition at line 325 of file ps_located.h.

References _Time.

TPSAttribTime& NL3D::CPSLocated::getTime ( void   )  [inline]
const TPSAttribTime& NL3D::CPSLocated::getTimeIncrement ( void   )  const [inline]

get TotalTime attrib const ref

Definition at line 330 of file ps_located.h.

References _TimeIncrement.

TPSAttribTime& NL3D::CPSLocated::getTimeIncrement ( void   )  [inline]

get TotalTime attrib ref

Definition at line 328 of file ps_located.h.

References _TimeIncrement.

uint32 NL3D::CPSLocated::getTriggerEmitterID ( void   )  const [inline]

Get the ID for the emitter to be triggered on death.

Definition at line 540 of file ps_located.h.

References _TriggerID, _TriggerOnDeath, and nlassert.

uint NL3D::CPSLocated::getUserMatrixUsageCount (  )  const [virtual]

***************************************************************************************

Reimplemented from NL3D::CParticleSystemProcess.

Definition at line 3016 of file ps_located.cpp.

References _LocatedBoundCont, and NL_PS_FUNC.

float NL3D::CPSLocated::getUserParam ( uint  numParam  )  const
const NLMISC::CMatrix & NL3D::CPSLocated::getWorldToLocalMatrix (  )  const
bool NL3D::CPSLocated::hasCollisionInfos (  )  const [inline]

test whether this located has collision infos

Definition at line 412 of file ps_located.h.

References _CollisionNextPos.

Referenced by checkIntegrity(), postNewElement(), removeOldParticles(), and NL3D::CParticleSystem::step().

bool NL3D::CPSLocated::hasEmitters ( void   )  const [virtual]

tells whether there are alive emitters / particles in the system

Reimplemented from NL3D::CParticleSystemProcess.

Definition at line 500 of file ps_located.cpp.

References _LocatedBoundCont, CHECK_PS_INTEGRITY, NL_PS_FUNC, and NL3D::PSEmitter.

bool NL3D::CPSLocated::hasLODDegradation ( void   )  const [inline]

Test whether LOD degradation was activated.

See also:
forceLODDegradation()

Definition at line 478 of file ps_located.h.

References _LODDegradation.

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

bool NL3D::CPSLocated::hasParticles ( void   )  const [virtual]

tells whether there are alive entities / particles in the system

*************************************************************************************** tells whether there are alive entities / particles in the system

Reimplemented from NL3D::CParticleSystemProcess.

Definition at line 486 of file ps_located.cpp.

References _LocatedBoundCont, CHECK_PS_INTEGRITY, NL_PS_FUNC, and NL3D::PSParticle.

Referenced by NL3D::CParticleSystem::hasTemporaryParticles().

void NL3D::CPSLocated::incrementNbDrawnParticles ( uint  num  ) 

Shorcut to increase the particle counter (number of particle drawn, for benchmark purpose ) should be called only by bound object that display particles.

***************************************************************************************

Definition at line 541 of file ps_located.cpp.

References CHECK_PS_INTEGRITY, NL3D::CParticleSystem::NbParticlesDrawn, and NL_PS_FUNC.

Referenced by NL3D::CPSTailDot::displayRibbons(), NL3D::CPSRibbonLookAt::displayRibbons(), NL3D::CPSRibbon::displayRibbons(), NL3D::CPSConstraintMesh::draw(), NL3D::CPSDot::draw(), NL3D::CPSFaceHelper::drawFaces(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), NL3D::CPSShockWaveHelper::drawShockWave(), and NL3D::CPSMesh::updatePos().

void NL3D::CPSLocated::integrableForceBasisChanged ( TPSMatrixMode  basis  ) 

PRIVATE USE: says that an integrable force basis has changed, and says which is the right basis.

***************************************************************************************

Definition at line 2591 of file ps_located.cpp.

References _NumIntegrableForceWithDifferentBasis, CHECK_PS_INTEGRITY, NL3D::CParticleSystemProcess::getMatrixMode(), NL_PS_FUNC, and releaseParametricInfos().

Referenced by setMatrixMode().

void NL3D::CPSLocated::integrateSingle ( float  startDate,
float  deltaT,
uint  numStep,
uint32  indexInLocated,
NLMISC::CVector destPos,
uint  posStride = sizeof(NLMISC::CVector) 
) const
bool NL3D::CPSLocated::isBound ( const CPSLocatedBindable lb  )  const

test whether a located bindable is attached to that object

***************************************************************************************

Definition at line 2622 of file ps_located.cpp.

References _LocatedBoundCont, CHECK_PS_INTEGRITY, and NL_PS_FUNC.

virtual bool NL3D::CPSLocated::isLocated (  )  const [inline, virtual]

Reimplemented from NL3D::CParticleSystemProcess.

Definition at line 115 of file ps_located.h.

References NL_PS_FUNC.

bool NL3D::CPSLocated::isParametricMotionEnabled ( void   )  const [inline, virtual]
bool NL3D::CPSLocated::isTriggerOnDeathEnabled ( void   )  const [inline]

Test whether a trigger on death has been enabled.

Definition at line 530 of file ps_located.h.

References _TriggerOnDeath.

sint32 NL3D::CPSLocated::newElement ( const CPSSpawnInfo si,
bool  doEmitOnce,
TAnimationTime  ellapsedTime 
) [private]

***************************************************************************************

Definition at line 1039 of file ps_located.cpp.

References _CollisionNextPos, _InitialLife, _InitialMass, _InvMass, _LifeScheme, _LocatedBoundCont, _MassScheme, _MaxSize, NL3D::CParticleSystemProcess::_Owner, _ParametricMotion, NL3D::CPSEmitter::_Phase, _PInfo, _Pos, _Size, NL3D::CParticleSystem::_SpawnPos, _Speed, _Time, _TimeIncrement, CHECK_PS_INTEGRITY, NL3D::CPSSpawnInfo::EmitterInfo, NL3D::CPSAttribMaker< T >::get(), NL3D::CParticleSystem::getAutoCountFlag(), NL3D::CPSEmitter::getBypassEmitOnDeath(), getConversionMatrix(), NL3D::CPSEmitter::getEmissionType(), NL3D::CParticleSystem::getInvertedSysMat(), NL3D::CParticleSystem::getInvertedUserMatrix(), getLastForever(), NL3D::CParticleSystemProcess::getMatrixMode(), getMaxSize(), getSize(), NL3D::CParticleSystem::getSysMat(), NL3D::CParticleSystem::getSystemDate(), NL3D::CParticleSystem::getUserMatrix(), NL3D::CPSAttrib< T >::insert(), NL3D::CParticleSystem::InsideSimLoop, NL3D::CParticleSystem::interpolateFXPosDelta(), NL3D::CParticleSystem::interpolateUserPosDelta(), NL3D::CPSSpawnInfo::LifeTime, NL3D::CPSEmitterInfo::Loc, min, NLMISC::CMatrix::mulVector(), NL_PS_FUNC, nlassert, NL3D::CPSEmitter::once, NL3D::PSEmitter, NL3D::PSFXWorldMatrix, NL3D::PSIdentityMatrix, NL3D::PSUserMatrix, NLMISC::raiseToNextPowerOf2(), NL3D::CParticleSystem::RealEllapsedTime, NL3D::CParticleSystem::RealEllapsedTimeRatio, resize(), NLMISC::safe_cast(), NL3D::CPSEmitter::singleEmit(), NL3D::CPSSpawnInfo::SpawnPos, NL3D::CPSSpawnInfo::Speed, and NL3D::CPSSpawnInfo::SpeedCoordSystem.

sint32 NL3D::CPSLocated::newElement ( const NLMISC::CVector pos,
const NLMISC::CVector speed,
CPSLocated emitterLocated,
uint32  indexInEmitter,
TPSMatrixMode  speedCoordSystem,
bool  doEmitOnce = false 
)

Generate one more instance in a located.

***************************************************************************************

The coordinates are given in the chosen basis for the located. If the emitterLocated ptr is not null, then the coordinate are taken from the emitterLocated basis and are expressed in this located basis. Will succeed only if it hasn't reach the max number of allowed instances return will be -1 if call failed or an index to the created object. Index is only valid after creation. Any processing pass on the system will make it invalid. It can be used with any attribute modification method of located and located bindable

Parameters:
indexInEmitter The index of the emitter (in the emitterLocated object)
basisConversionForSpeed : if false, the speed vector is taken as if even if emitter and emittee basis are differents.
lifeTime : for how much time particle has been alive
ellapsedTime : time ellapsed since the beginning of the sim step.
doEmitOnce : When the element is created, all emitters flagged as 'EmitOnce' will be triggered

Definition at line 1247 of file ps_located.cpp.

References NL3D::CPSSpawnInfo::EmitterInfo, getInvMass(), getPos(), getSpeed(), getTime(), NL3D::CPSEmitterInfo::InvMass, NL3D::CPSEmitterInfo::Life, NL3D::CPSSpawnInfo::LifeTime, NL3D::CPSEmitterInfo::Loc, NL_PS_FUNC, NLMISC::CVector::Null, NL3D::CPSEmitterInfo::Pos, NL3D::CPSSpawnInfo::SpawnPos, NL3D::CPSSpawnInfo::Speed, NL3D::CPSEmitterInfo::Speed, and NL3D::CPSSpawnInfo::SpeedCoordSystem.

Referenced by addNewlySpawnedParticles(), and NL3D::CPSEmitter::processEmitOutsideSimLoop().

NL3D::CPSLocated::NLMISC_DECLARE_CLASS ( CPSLocated   ) 
void NL3D::CPSLocated::notifyMotionTypeChanged ( void   )  [protected]

notify the attached object that we have switch between parametric / incremental motion

***************************************************************************************

Definition at line 252 of file ps_located.cpp.

References _LocatedBoundCont, _ParametricMotion, CHECK_PS_INTEGRITY, and NL_PS_FUNC.

Referenced by allocateParametricInfos(), and releaseParametricInfos().

void NL3D::CPSLocated::onShow ( bool  shown  )  [virtual]

***************************************************************************************

Implements NL3D::CParticleSystemProcess.

Definition at line 3147 of file ps_located.cpp.

References _LocatedBoundCont.

void NL3D::CPSLocated::performParametricMotion ( TAnimationTime  date  )  [virtual]

inherited from CParticlesystemProcess perform parametric motion for this located to reach the given date

***************************************************************************************

Reimplemented from NL3D::CParticleSystemProcess.

Definition at line 313 of file ps_located.cpp.

References _IntegrableForces, _ParametricMotion, _PInfo, _Pos, _Size, _Speed, NL3D::CPSAttrib< T >::begin(), CHECK_PS_INTEGRITY, NL3D::CPSAttrib< T >::end(), NL_PS_FUNC, nlassert, and supportParametricMotion().

void NL3D::CPSLocated::postNewElement ( const NLMISC::CVector pos,
const NLMISC::CVector speed,
CPSLocated emitterLocated,
uint32  indexInEmitter,
TPSMatrixMode  speedCoordSystem,
TAnimationTime  lifeTime 
)
void NL3D::CPSLocated::queryCollisionInfo ( void   ) 

call this if you need collision infos.

***************************************************************************************

The collide info attribute is not included by default to save memory. The first call will create the attribute, and others will add references. You can then access the infos by calling getCollisioInfo You must call releaseCollideInfo after use.

Definition at line 2498 of file ps_located.cpp.

References _CollisionInfoNbRef, _CollisionNextPos, _MaxSize, _Size, CHECK_PS_INTEGRITY, NL3D::CPSAttrib< T >::insert(), NL_PS_FUNC, and NL3D::CPSAttrib< T >::resize().

Referenced by NL3D::CPSZone::attachTarget().

void NL3D::CPSLocated::registerDtorObserver ( CPSLocatedBindable observer  ) 

Register a dtor observer; (that derives from CPSLocatedBindable) Each observer will be called when this object dtor is called (call of method notifyTargetRemoved() ) This allow for objects that hold this as a target to know when it is suppressed (example : collision objects hold located as targets) When an observer is detroyed, it MUST call unregisterDtorObserver, The same observer can only register once, otherwise, an assertion occurs.

***************************************************************************************

Definition at line 943 of file ps_located.cpp.

References _DtorObserversVect, CHECK_PS_INTEGRITY, NL_PS_FUNC, and nlassert.

Referenced by NL3D::CPSTargetLocatedBindable::attachTarget(), and NL3D::CPSEmitter::setEmittedType().

void NL3D::CPSLocated::registerIntegrableForce ( CPSForce f  ) 

PRIVATE USE: register a force that is integrable on this located. It must have been registered only once.

***************************************************************************************

Definition at line 2538 of file ps_located.cpp.

References _IntegrableForces, _NumIntegrableForceWithDifferentBasis, CHECK_PS_INTEGRITY, NL3D::CParticleSystemProcess::getMatrixMode(), NL3D::CPSLocatedBindable::getOwner(), NL_PS_FUNC, nlassert, and releaseParametricInfos().

Referenced by NL3D::CPSForce::attachTarget().

void NL3D::CPSLocated::releaseAllRef (  )  [virtual]

From CParticleSystemProcess.

***************************************************************************************

Release any reference this located may have to other process of the system For example, this is used when detaching a process of a system.

Implements NL3D::CParticleSystemProcess.

Definition at line 220 of file ps_located.cpp.

References _CollisionInfoNbRef, _DtorObserversVect, _IntegrableForces, _LocatedBoundCont, _NonIntegrableForceNbRefs, CHECK_PS_INTEGRITY, NL_PS_FUNC, and nlassert.

void NL3D::CPSLocated::releaseCollisionInfo ( void   ) 

Release the collideInfos attribute.

***************************************************************************************

Definition at line 2520 of file ps_located.cpp.

References _CollisionInfoNbRef, _CollisionNextPos, CHECK_PS_INTEGRITY, NL_PS_FUNC, and nlassert.

Referenced by NL3D::CPSZone::releaseTargetRsc().

void NL3D::CPSLocated::releaseNonIntegrableForceRef ( void   ) 

PRIVATE USE: decrease the reference count to say that a non-integrable force has been removed.

***************************************************************************************

Definition at line 2580 of file ps_located.cpp.

References _NonIntegrableForceNbRefs, CHECK_PS_INTEGRITY, NL_PS_FUNC, and nlassert.

Referenced by NL3D::CPSZone::releaseTargetRsc(), and NL3D::CPSForce::releaseTargetRsc().

void NL3D::CPSLocated::releaseParametricInfos ( void   )  [protected]
void NL3D::CPSLocated::releaseRefTo ( const CParticleSystemProcess other  )  [virtual]

From CParticleSystemProcess.

***************************************************************************************

Release any reference this located may have on the given process. For example, this is used when detaching a located of a system.

Definition at line 192 of file ps_located.cpp.

References _DtorObserversVect, _LocatedBoundCont, CHECK_PS_INTEGRITY, NL_PS_FUNC, and NL3D::CPSLocatedBindable::notifyTargetRemoved().

void NL3D::CPSLocated::remove ( const CPSLocatedBindable lb  ) 

remove a bound object from the located if the object doesnt exist -> nlassert it is deleted

***************************************************************************************

Definition at line 926 of file ps_located.cpp.

References _LocatedBoundCont, NL3D::CParticleSystemProcess::_Owner, CHECK_PS_INTEGRITY, NL_PS_FUNC, nlassert, and NL3D::CParticleSystem::systemDurationChanged().

void NL3D::CPSLocated::removeOldParticles (  ) 
void NL3D::CPSLocated::resetCollisions ( uint  numInstances  ) 

***************************************************************************************

Definition at line 1817 of file ps_located.cpp.

References _Collisions, _FirstCollision, NL3D::CPSCollisionInfo::Dist, NL3D::CPSCollisionInfo::Next, and NL_PS_FUNC.

Referenced by computeNewParticleMotion(), and NL3D::CParticleSystem::step().

void NL3D::CPSLocated::resize ( uint32  newSize  ) 

Resize the located container, in order to accept more instances.

Resize the located container.

compute the new max number of faces

Definition at line 1366 of file ps_located.cpp.

References _CollisionNextPos, _InvMass, _LocatedBoundCont, _MaxSize, _ParametricMotion, _PInfo, _Pos, _Size, _Speed, _Time, _TimeIncrement, CHECK_PS_INTEGRITY, deleteElement(), NL_PS_FUNC, nlassert, and NL3D::CPSAttrib< T >::resize().

Referenced by NL3D::CParticleSystem::matchArraySize(), and newElement().

void NL3D::CPSLocated::serial ( NLMISC::IStream f  )  throw (NLMISC::EStream) [virtual]

serialization

***************************************************************************************

Reimplemented from NL3D::CParticleSystemProcess.

Definition at line 1428 of file ps_located.cpp.

References CHECK_PS_INTEGRITY, NL3D::CPSAttrib< T >::clear(), NLMISC::IStream::current, NL3D::CParticleSystem::getSerializeIdentifierFlag(), NL_PS_FUNC, nlassert, and NL3D::CParticleSystemProcess::serial().

void NL3D::CPSLocated::setInitialLife ( TAnimationTime  lifeTime  ) 

Set the duration of locateds.

***************************************************************************************

Any previous call to setLastForever() is discarded Any previous scheme for lifetime is dicarded

Reset all particles current date to 0. This is needed because we do not check if particle life is over when the date of the system has not gone beyond the life duration of particles

Definition at line 549 of file ps_located.cpp.

References _InitialLife, _LastForever, _LifeScheme, NL3D::CParticleSystemProcess::_Owner, _Size, _Time, CHECK_PS_INTEGRITY, NL_PS_FUNC, and NL3D::CParticleSystem::systemDurationChanged().

void NL3D::CPSLocated::setInitialMass ( float  mass  ) 

Set the mass of locateds.

***************************************************************************************

Any previous scheme for Mass is dicarded

Definition at line 592 of file ps_located.cpp.

References _InitialMass, _MassScheme, CHECK_PS_INTEGRITY, and NL_PS_FUNC.

bool NL3D::CPSLocated::setLastForever (  ) 

set immortality for located

***************************************************************************************

See also:
setInitialLife
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 158 of file ps_located.cpp.

References _LastForever, NL3D::CParticleSystemProcess::_Owner, NL3D::CParticleSystem::canFinish(), CHECK_PS_INTEGRITY, NL3D::CParticleSystem::getBypassMaxNumIntegrationSteps(), NL_PS_FUNC, and nlwarning.

void NL3D::CPSLocated::setLifeScheme ( CPSAttribMaker< float > *  scheme  ) 

Set a scheme (allocated by new, released by that object) that generate the duration of locateds.

***************************************************************************************

Such a scheme can't own its memory. Any previous call to setLastForever() is discarded Any previous scheme for lifetime is discarded

Definition at line 574 of file ps_located.cpp.

References _LastForever, _LifeScheme, NL3D::CParticleSystemProcess::_Owner, CHECK_PS_INTEGRITY, NL3D::CPSAttribMaker< T >::hasMemory(), NL_PS_FUNC, nlassert, and NL3D::CParticleSystem::systemDurationChanged().

void NL3D::CPSLocated::setMassScheme ( CPSAttribMaker< float > *  scheme  ) 

Set a scheme (allocated by new, released by that object) that generate the mass of locateds.

***************************************************************************************

Such a scheme can't own its memory. Any previous scheme for Mass is discarded

Definition at line 603 of file ps_located.cpp.

References _MassScheme, CHECK_PS_INTEGRITY, NL3D::CPSAttribMaker< T >::hasMemory(), NL_PS_FUNC, and nlassert.

void NL3D::CPSLocated::setMatrixMode ( TPSMatrixMode  matrixMode  )  [virtual]

***************************************************************************************

Reimplemented from NL3D::CParticleSystemProcess.

Definition at line 416 of file ps_located.cpp.

References _IntegrableForces, _LocatedBoundCont, CHECK_PS_INTEGRITY, NL3D::CParticleSystemProcess::getMatrixMode(), integrableForceBasisChanged(), and NL_PS_FUNC.

void NL3D::CPSLocated::setName ( const std::string &  name  )  [inline]

set the located bindable name (edition purpose)

Definition at line 456 of file ps_located.h.

References _Name.

void NL3D::CPSLocated::setTriggerEmitterID ( uint32  id  )  [inline]

Set an ID for the emitter to be triggered on death.

Definition at line 533 of file ps_located.h.

References _TriggerID, _TriggerOnDeath, and nlassert.

void NL3D::CPSLocated::setupDriverModelMatrix ( void   ) 

Setup the driver model matrix. It is set accrodingly to the basis of the located.

Setup the driver model matrix.

It is set accordingly to the basis used for rendering

Definition at line 2489 of file ps_located.cpp.

References CHECK_PS_INTEGRITY, getDriver(), getLocalToWorldMatrix(), NL_PS_FUNC, and NL3D::IDriver::setupModelMatrix().

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

void NL3D::CPSLocated::setZBias ( float  value  )  [virtual]

***************************************************************************************

Implements NL3D::CParticleSystemProcess.

Definition at line 3038 of file ps_located.cpp.

References _LocatedBoundCont, and NL_PS_FUNC.

void NL3D::CPSLocated::step ( TPSProcessPass  pass  )  [virtual]

process the system

***************************************************************************************

Implements NL3D::CParticleSystemProcess.

Definition at line 1951 of file ps_located.cpp.

References _LocatedBoundCont, NL3D::CParticleSystemProcess::_Owner, _Size, CHECK_PS_INTEGRITY, NL3D::CParticleSystem::getLOD(), NL_PS_FUNC, NL3D::PSLod1n2, and NL3D::PSMotion.

Referenced by doLODDegradation().

bool NL3D::CPSLocated::supportParametricMotion ( void   )  const

Test whether this located support parametric motion.

Definition at line 389 of file ps_located.cpp.

References _NonIntegrableForceNbRefs, _NumIntegrableForceWithDifferentBasis, and NL_PS_FUNC.

Referenced by allocateParametricInfos(), enableParametricMotion(), integrateSingle(), and performParametricMotion().

void NL3D::CPSLocated::systemDateChanged (  )  [virtual]

PRIVATE USE : called by the system when its date has been manually changed.

***************************************************************************************

Reimplemented from NL3D::CParticleSystemProcess.

Definition at line 179 of file ps_located.cpp.

References _LocatedBoundCont, CHECK_PS_INTEGRITY, and NL_PS_FUNC.

CPSLocatedBindable * NL3D::CPSLocated::unbind ( uint  index  ) 

Detach a bindable object from this located.

***************************************************************************************

Ownership is transferred to the caller Any reference the object may have in the system is lost (targets..) After that is may be inserted an other system.

Definition at line 2609 of file ps_located.cpp.

References _LocatedBoundCont, CHECK_PS_INTEGRITY, NL_PS_FUNC, and nlassert.

Referenced by bind().

void NL3D::CPSLocated::unregisterDtorObserver ( CPSLocatedBindable anObserver  ) 

remove a dtor observer (not present -> nlassert) see register dtor observer

***************************************************************************************

Definition at line 954 of file ps_located.cpp.

References _DtorObserversVect, CHECK_PS_INTEGRITY, NL_PS_FUNC, and nlassert.

Referenced by NL3D::CPSLocatedBindable::notifyTargetRemoved(), NL3D::CPSEmitter::setEmittedType(), and NL3D::CPSEmitter::~CPSEmitter().

void NL3D::CPSLocated::unregisterIntegrableForce ( CPSForce f  ) 

PRIVATE USE: unregister a force that is integrable with this located.

***************************************************************************************

Definition at line 2554 of file ps_located.cpp.

References _IntegrableForces, _NumIntegrableForceWithDifferentBasis, CHECK_PS_INTEGRITY, NL3D::CParticleSystemProcess::getMatrixMode(), NL3D::CPSLocatedBindable::getOwner(), NL_PS_FUNC, and nlassert.

Referenced by NL3D::CPSForce::releaseTargetRsc().

void NL3D::CPSLocated::updateCollisions (  ) 
void NL3D::CPSLocated::updateLife (  ) 

make the particle older of the given amount.

***************************************************************************************

Should not be called directly, as it is called by the system during its step method Dying particles are marked (removed in a later pass by called removeOldParticles)

all particles have the same lifetime

Definition at line 2000 of file ps_located.cpp.

References _InitialLife, _LastForever, _LifeScheme, NL3D::CParticleSystemProcess::_Owner, NL3D::CParticleSystem::_ParticleRemoveListIndex, NL3D::CParticleSystem::_ParticleToRemove, _Size, _Time, _TimeIncrement, NL3D::CPSAttrib< T >::begin(), CHECK_PS_INTEGRITY, NL3D::CPSAttrib< T >::end(), NL3D::CParticleSystem::getSystemDate(), NL_PS_FUNC, nlassert, and NL3D::CParticleSystem::RealEllapsedTime.

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


Friends And Related Function Documentation

friend class CPSForce [friend]

Definition at line 571 of file ps_located.h.


Member Data Documentation

Definition at line 580 of file ps_located.h.

Referenced by queryCollisionInfo(), releaseAllRef(), releaseCollisionInfo(), and ~CPSLocated().

Definition at line 698 of file ps_located.h.

Referenced by resetCollisions(), NL3D::CPSCollisionInfo::update(), and updateCollisions().

Definition at line 589 of file ps_located.h.

Referenced by getInitialMass(), newElement(), and setInitialMass().

Definition at line 610 of file ps_located.h.

Referenced by checkIntegrity(), deleteElementBase(), getInvMass(), newElement(), and resize().

Definition at line 591 of file ps_located.h.

Referenced by forceLODDegradation(), and hasLODDegradation().

Definition at line 590 of file ps_located.h.

Referenced by getMassScheme(), newElement(), setInitialMass(), setMassScheme(), and ~CPSLocated().

std::string NL3D::CPSLocated::_Name [protected]

Definition at line 603 of file ps_located.h.

Referenced by getName(), and setName().

Number of forces, (counts collision zones too).

that are not integrable over time. If this is not 0, then the trajectory cannot be computed at any time. A force that is integrable must be in the same basis than the located.

Definition at line 599 of file ps_located.h.

Referenced by addNonIntegrableForceRef(), releaseAllRef(), releaseNonIntegrableForceRef(), supportParametricMotion(), and ~CPSLocated().

Number of forces that apply on that located that have the same basis that this one (required for parametric animation).

Definition at line 601 of file ps_located.h.

Referenced by integrableForceBasisChanged(), registerIntegrableForce(), supportParametricMotion(), and unregisterIntegrableForce().

WARNING : private use by forces only.

this vector is only used if parametric motion is achievable and enabled, because of the extra storage space

Definition at line 638 of file ps_located.h.

Referenced by allocateParametricInfos(), deleteElementBase(), getParametricInfos(), NL3D::CPSBrownianForce::integrate(), NL3D::CPSGravity::integrate(), integrateSingle(), NL3D::CPSBrownianForce::integrateSingle(), NL3D::CPSGravity::integrateSingle(), newElement(), performParametricMotion(), releaseParametricInfos(), and resize().

Definition at line 595 of file ps_located.h.

Referenced by deleteElementBase(), getTriggerEmitterID(), and setTriggerEmitterID().


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

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