# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::UParticleSystemInstance Class Reference

Interface to manipulate a particle system. More...

#include <u_particle_system_instance.h>

Inheritance diagram for NL3D::UParticleSystemInstance:

NL3D::UInstance NL3D::UTransform NL3D::UTransformable NL3D::CParticleSystemInstanceUser List of all members.

System parameters

virtual void setUserParam (uint index, float value)=0
 Set a user param of the system. More...

virtual float getUserParam (uint index) const=0
 Get the value of a user param. More...

virtual void bypassGlobalUserParamValue (uint userParamIndex, bool byPass=true)=0
virtual bool isGlobalUserParamValueBypassed (uint userParamIndex) const=0
void setGlobalUserParamValue (const std::string &name, float value)
 Set a global user param value. User param in a system can mirror global values, which are identified by their name. More...

float getGlobalUserParamValue (const std::string &name)
void setGlobalVectorValue (const std::string &name, const NLMISC::CVector &v)
 Set a global vector value in the system. More...

NLMISC::CVector getGlobalVectorValue (const std::string &name)

Public Methods

virtual bool isSystemPresent (void) const=0
 Tell wether the system is currently instanciated. More...

virtual bool getSystemBBox (NLMISC::CAABBox &bbox)=0
 Get the bounding box of the system, when it is present. More...

virtual bool isShared () const=0
System validity
virtual bool isValid (void) const=0
 Test if the system is valid. More...

virtual void registerPSObserver (IPSObserver *observer)=0
 Register an observer that will be notified when the system becomes invalid nlassert(!isPSObserver(oberver));. More...

virtual bool isPSObserver (IPSObserver *observer)=0
 test whether 'observer' is an observer of this system. More...

virtual void removePSObserver (IPSObserver *observer)=0
 remove 'observer' from the observers of this system. More...

virtual bool emit (uint32 id, uint quantity=1)=0
 All the emitters that have the given ID emit their target. More...

virtual bool removeByID (uint32 id)=0
 All the object with the given id are removed. More...

virtual uint getNumID () const=0
 Return the number of objects in the system that are flagged with an ID, or 0 if the system is not present. More...

virtual uint32 getID (uint index) const=0
 Get the nth ID, or 0 if index is invalid. More...

virtual bool getIDs (std::vector< uint32 > &dest) const=0
 Get all the IDs in the system. More...

virtual bool setActive (uint32 id, bool active)=0
virtual bool activateEmitters (bool active)=0
virtual bool hasParticles () const=0
virtual bool hasEmmiters () const=0

Detailed Description

Interface to manipulate a particle system.

Particle system are created from a UScene. A system can be tuned by its user params (when it makes use of them). It has several states invalid : the system is invalid, this tells the user that he can destroy this instance

present : the system is available for modification. This may not be the case when the system has been temporarily remove because it is not visible anymore.

Author:
Nicolas Vizerie , Nevrax France
Date:
2001

Definition at line 52 of file u_particle_system_instance.h.


Member Function Documentation

virtual bool NL3D::UParticleSystemInstance::activateEmitters bool    active [pure virtual]
 

Implemented in NL3D::CParticleSystemInstanceUser.

virtual void NL3D::UParticleSystemInstance::bypassGlobalUserParamValue uint    userParamIndex,
bool    byPass = true
[pure virtual]
 

Implemented in NL3D::CParticleSystemInstanceUser.

virtual bool NL3D::UParticleSystemInstance::emit uint32    id,
uint    quantity = 1
[pure virtual]
 

All the emitters that have the given ID emit their target.

Returns:
false if the id is invalid, or if it isn't an emitter ID

Implemented in NL3D::CParticleSystemInstanceUser.

float NL3D::UParticleSystemInstance::getGlobalUserParamValue const std::string &    name [static]
 

Definition at line 382 of file particle_system_instance_user.cpp.

References NL3D_MEM_PS_INSTANCE, and nlwarning.

NLMISC::CVector NL3D::UParticleSystemInstance::getGlobalVectorValue const std::string &    name [static]
 

Definition at line 405 of file particle_system_instance_user.cpp.

References NL3D_MEM_PS_INSTANCE, nlwarning, and NLMISC::CVector::Null.

virtual uint32 NL3D::UParticleSystemInstance::getID uint    index const [pure virtual]
 

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

Implemented in NL3D::CParticleSystemInstanceUser.

virtual bool NL3D::UParticleSystemInstance::getIDs std::vector< uint32 > &    dest const [pure virtual]
 

Get all the IDs in the system.

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

Implemented in NL3D::CParticleSystemInstanceUser.

virtual uint NL3D::UParticleSystemInstance::getNumID   const [pure virtual]
 

Return the number of objects in the system that are flagged with an ID, or 0 if the system is not present.

Implemented in NL3D::CParticleSystemInstanceUser.

virtual bool NL3D::UParticleSystemInstance::getSystemBBox NLMISC::CAABBox   bbox [pure virtual]
 

Get the bounding box of the system, when it is present.

You should call this instead of UInstance::getShapeAABBox() because the bbox may change over time, and thusn its shape doesn't hold any info on it...

Parameters:
bbox  a reference to the bbox to fill
Returns:
true if the bbox has been filled
See also:
isPresent()

Implemented in NL3D::CParticleSystemInstanceUser.

virtual float NL3D::UParticleSystemInstance::getUserParam uint    index const [pure virtual]
 

Get the value of a user param.

Parameters:
index  the index of the user param to get. For now it ranges from 0 to 3
Returns:
the value of the user param (>= 0 and <= 1)
See also:
isSystemPresent()

Implemented in NL3D::CParticleSystemInstanceUser.

virtual bool NL3D::UParticleSystemInstance::hasEmmiters   const [pure virtual]
 

Implemented in NL3D::CParticleSystemInstanceUser.

virtual bool NL3D::UParticleSystemInstance::hasParticles   const [pure virtual]
 

Implemented in NL3D::CParticleSystemInstanceUser.

virtual bool NL3D::UParticleSystemInstance::isGlobalUserParamValueBypassed uint    userParamIndex const [pure virtual]
 

Implemented in NL3D::CParticleSystemInstanceUser.

virtual bool NL3D::UParticleSystemInstance::isPSObserver IPSObserver   observer [pure virtual]
 

test whether 'observer' is an observer of this system.

See also:
removePSObserver() , registerPSObserver()

Implemented in NL3D::CParticleSystemInstanceUser.

virtual bool NL3D::UParticleSystemInstance::isShared   const [pure virtual]
 

Implemented in NL3D::CParticleSystemInstanceUser.

virtual bool NL3D::UParticleSystemInstance::isSystemPresent void    const [pure virtual]
 

Tell wether the system is currently instanciated.

This may not be the case when the system is not visible You must check this before you use any method that access the system. If you don't, there will be an assertion when you'll try to access it example : UParticleSystemInstance *mySystem = ... ... if (mySystem->isSystemPresent()) { /// perform modification on the system here mySystem->setUserParam(0, 0.5f); }

See also:
isValid()

Implemented in NL3D::CParticleSystemInstanceUser.

virtual bool NL3D::UParticleSystemInstance::isValid void    const [pure virtual]
 

Test if the system is valid.

A system is invalid when it should be destroyed. It's then up to the system user to destroy it (thus avoiding invalid pointers...) This usually happens when the system has been created with the flag 'destroy when no more particles' or 'destroy when no more emitter and no more particles' , or when it is out of range. Of course, an invalid system will always return false when isSystemPresent() is called...

Returns:
true if the system has been invalidated. You can remove this object from the scene then...

Implemented in NL3D::CParticleSystemInstanceUser.

virtual void NL3D::UParticleSystemInstance::registerPSObserver IPSObserver   observer [pure virtual]
 

Register an observer that will be notified when the system becomes invalid nlassert(!isPSObserver(oberver));.

See also:
isPSObserver() , removePSObserver()

Implemented in NL3D::CParticleSystemInstanceUser.

virtual bool NL3D::UParticleSystemInstance::removeByID uint32    id [pure virtual]
 

All the object with the given id are removed.

Returns:
false if the id is invalid.

Implemented in NL3D::CParticleSystemInstanceUser.

virtual void NL3D::UParticleSystemInstance::removePSObserver IPSObserver   observer [pure virtual]
 

remove 'observer' from the observers of this system.

Not an observer => nlassert

See also:
registerPSObserver() , isPSObserver()

Implemented in NL3D::CParticleSystemInstanceUser.

virtual bool NL3D::UParticleSystemInstance::setActive uint32    id,
bool    active
[pure virtual]
 

Implemented in NL3D::CParticleSystemInstanceUser.

void NL3D::UParticleSystemInstance::setGlobalUserParamValue const std::string &    name,
float    value
[static]
 

Set a global user param value. User param in a system can mirror global values, which are identified by their name.

Definition at line 370 of file particle_system_instance_user.cpp.

References NL3D_MEM_PS_INSTANCE, nlwarning, and value.

void NL3D::UParticleSystemInstance::setGlobalVectorValue const std::string &    name,
const NLMISC::CVector   v
[static]
 

Set a global vector value in the system.

Some object in the system can bind their parameters to such a global value Example : direction of wind could be stored in the global variable 'WIND'

Definition at line 394 of file particle_system_instance_user.cpp.

References NL3D_MEM_PS_INSTANCE, nlwarning, and v.

virtual void NL3D::UParticleSystemInstance::setUserParam uint    index,
float    value
[pure virtual]
 

Set a user param of the system.

Each user param must be >= 0 and <= 1

Parameters:
index  the index of the user param to modify. For now it ranges from 0 to 3 \value the new value of the parameter
See also:
isSystemPresent()

Implemented in NL3D::CParticleSystemInstanceUser.


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