|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CParticleSystemInstanceUser Class ReferenceThis is the implementation of the user class UParticleSystemInstance.
More...
#include <particle_system_instance_user.h>
Inheritance diagram for NL3D::CParticleSystemInstanceUser:
List of all members.
Public Methods |
virtual bool | isShared () const |
virtual void | changeMRMDistanceSetup (float distanceFinest, float distanceMiddle, float distanceCoarsest) |
| Change MRM Distance setup. More...
|
virtual void | setShapeDistMax (float distMax) |
| Change Max Display distance. More...
|
virtual float | getShapeDistMax () const |
| see setShapeDistMax(). More...
|
virtual void | enableAsyncTextureMode (bool enable) |
| if true, the instance is said in "AsyncTextureMode". More...
|
virtual bool | getAsyncTextureMode () const |
virtual void | startAsyncTextureLoading () |
| Start to load all textures in AsyncTextures array (if needed) NB: old setup is kept in Material => instance is still rendered with "coherent" textures, until new textures are ready no op if not in async texture mode. More...
|
virtual bool | isAsyncTextureReady () |
| return true if all the async textures of the instances are uploaded. More...
|
virtual void | setAsyncTextureDistance (float dist) |
| For Lod of texture, and load balancing, set the approximate distance of the instance to the camera. More...
|
virtual float | getAsyncTextureDistance () const |
virtual void | setAsyncTextureDirty (bool flag) |
| User is free to flag this state, to know if startAsyncTextureLoading() should be called. More...
|
virtual bool | isAsyncTextureDirty () const |
| see dirtAsyncTextureState(). More...
|
virtual float | getDistMax () const |
virtual void | setDistMax (float distMax) |
virtual void | setCoarseMeshDist (float dist) |
virtual float | getCoarseMeshDist () const |
|
| CParticleSystemInstanceUser (CScene *scene, IModel *model) |
| ~CParticleSystemInstanceUser () |
|
virtual uint | getNumMaterials () const |
| return number of materials this mesh instance use. More...
|
virtual UInstanceMaterial & | getMaterial (uint materialId) |
| return a local access on a material, to change its values. (NB: overwrited, if animated). More...
|
virtual void | selectTextureSet (uint id) |
| Select textures of material among several sets (if available) NB: if success and if getAsyncTextureMode()==true, then setAsyncTextureDirty(true) is called. More...
|
virtual void | getShapeAABBox (NLMISC::CAABBox &bbox) const |
| Get the untransformed AABBox of the mesh. More...
|
virtual bool | canStartStop () |
| Test if there is a start/stop caps in the objects (some fxs such as remanence). More...
|
virtual void | start () |
virtual void | stop () |
virtual bool | isStarted () const |
|
virtual bool | emit (uint32 id, uint quantity) |
| All the emitters that have the given ID emit their target. More...
|
virtual bool | removeByID (uint32 id) |
| All the object with the given id are removed. More...
|
virtual bool | isSystemPresent (void) const |
| Tell wether the system is currently instanciated. More...
|
virtual bool | getSystemBBox (NLMISC::CAABBox &bbox) |
| Get the bounding box of the system, when it is present. More...
|
virtual void | setUserParam (uint index, float value) |
| Set a user param of the system. More...
|
virtual float | getUserParam (uint index) const |
| Get the value of a user param. More...
|
virtual void | bypassGlobalUserParamValue (uint userParamIndex, bool byPass=true) |
virtual bool | isGlobalUserParamValueBypassed (uint userParamIndex) const |
virtual bool | isValid (void) const |
| Test if the system is valid. More...
|
virtual void | registerPSObserver (IPSObserver *observer) |
| Register an observer that will be notified when the system becomes invalid nlassert(!isPSObserver(oberver));. More...
|
virtual bool | isPSObserver (IPSObserver *observer) |
| test whether 'observer' is an observer of this system. More...
|
virtual void | removePSObserver (IPSObserver *observer) |
| remove 'observer' from the observers of this system. More...
|
virtual uint | getNumID () const |
| 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 |
| Get the nth ID, or 0 if index is invalid. More...
|
virtual bool | getIDs (std::vector< uint32 > &dest) const |
| Get all the IDs in the system. More...
|
virtual bool | setActive (uint32 id, bool active) |
virtual bool | activateEmitters (bool active) |
|
virtual void | invalidPS (CParticleSystemModel *psm) |
| called when a system has been invalidated. More...
|
|
virtual bool | hasParticles () const |
virtual bool | hasEmmiters () const |
Private Attributes |
std::vector< IPSObserver * > | _Observers |
| list of observers. More...
|
bool | _Invalidated |
| validity flag. More...
|
Detailed Description
This is the implementation of the user class UParticleSystemInstance.
-
Author:
-
Nicolas Vizerie , Nevrax France
-
Date:
-
2001
Definition at line 47 of file particle_system_instance_user.h.
Constructor & Destructor Documentation
NL3D::CParticleSystemInstanceUser::CParticleSystemInstanceUser |
( |
CScene * |
scene, |
|
|
IModel * |
model |
|
) |
|
|
NL3D::CParticleSystemInstanceUser::~CParticleSystemInstanceUser |
( |
|
) |
|
|
Member Function Documentation
bool NL3D::CParticleSystemInstanceUser::activateEmitters |
( |
bool |
active |
) |
[virtual] |
|
void NL3D::CParticleSystemInstanceUser::bypassGlobalUserParamValue |
( |
uint |
userParamIndex, |
|
|
bool |
byPass = true |
|
) |
[virtual] |
|
virtual bool NL3D::CParticleSystemInstanceUser::canStartStop |
( |
|
) |
[inline, virtual] |
|
void NL3D::CParticleSystemInstanceUser::changeMRMDistanceSetup |
( |
float |
distanceFinest, |
|
|
float |
distanceMiddle, |
|
|
float |
distanceCoarsest |
|
) |
[virtual] |
|
|
Change MRM Distance setup.
Only for mesh which support MRM. NB MeshMultiLod apply it only on Lod0 (if Lod0 is a MRM). NB: This apply to the shape direclty!! ie All instances using same shape will be affected NB: no-op if distanceFinest<0, distanceMiddle<=distanceFinest or if distanceCoarsest<=distanceMiddle. -
Parameters:
-
distanceFinest |
The MRM has its max faces when dist<=distanceFinest. |
distanceMiddle |
The MRM has 50% of its faces at dist==distanceMiddle. |
distanceCoarsest |
The MRM has faces/Divisor (ie near 0) when dist>=distanceCoarsest. |
Implements NL3D::UInstance.
Definition at line 241 of file particle_system_instance_user.cpp.
References NL3D_MEM_PS_INSTANCE. |
bool NL3D::CParticleSystemInstanceUser::emit |
( |
uint32 |
id, |
|
|
uint |
quantity |
|
) |
[virtual] |
|
void NL3D::CParticleSystemInstanceUser::enableAsyncTextureMode |
( |
bool |
enable |
) |
[virtual] |
|
|
if true, the instance is said in "AsyncTextureMode".
Ie user must fill AsyncTextures field with name of the textures to load. At each startAsyncTextureLoading(), the system start to load async them. Then, isAsyncTextureReady() should be test each frame, to know if loading has completed. By default, AsyncTextureMode=false. When it swap from false to true, each texture file in Materials are replaced with "blank.tga", and true fileNames are copied into AsyncTextures. When it swap from true to false, the inverse is applied. NB: calling enableAsyncTextureMode(true) calls setAsyncTextureDirty(true)
Implements NL3D::UInstance.
Definition at line 417 of file particle_system_instance_user.cpp.
References NL3D_MEM_PS_INSTANCE. |
float NL3D::CParticleSystemInstanceUser::getAsyncTextureDistance |
( |
|
) |
const [virtual] |
|
bool NL3D::CParticleSystemInstanceUser::getAsyncTextureMode |
( |
|
) |
const [virtual] |
|
virtual float NL3D::CParticleSystemInstanceUser::getCoarseMeshDist |
( |
|
) |
const [inline, virtual] |
|
virtual float NL3D::CParticleSystemInstanceUser::getDistMax |
( |
|
) |
const [inline, virtual] |
|
uint32 NL3D::CParticleSystemInstanceUser::getID |
( |
uint |
index |
) |
const [virtual] |
|
bool NL3D::CParticleSystemInstanceUser::getIDs |
( |
std::vector< uint32 > & |
dest |
) |
const [virtual] |
|
uint NL3D::CParticleSystemInstanceUser::getNumID |
( |
|
) |
const [virtual] |
|
uint NL3D::CParticleSystemInstanceUser::getNumMaterials |
( |
|
) |
const [virtual] |
|
void NL3D::CParticleSystemInstanceUser::getShapeAABBox |
( |
NLMISC::CAABBox & |
bbox |
) |
const [virtual] |
|
float NL3D::CParticleSystemInstanceUser::getShapeDistMax |
( |
|
) |
const [virtual] |
|
bool NL3D::CParticleSystemInstanceUser::getSystemBBox |
( |
NLMISC::CAABBox & |
bbox |
) |
[virtual] |
|
float NL3D::CParticleSystemInstanceUser::getUserParam |
( |
uint |
index |
) |
const [virtual] |
|
bool NL3D::CParticleSystemInstanceUser::hasEmmiters |
( |
|
) |
const [virtual] |
|
bool NL3D::CParticleSystemInstanceUser::hasParticles |
( |
|
) |
const [virtual] |
|
bool NL3D::CParticleSystemInstanceUser::isAsyncTextureDirty |
( |
|
) |
const [virtual] |
|
bool NL3D::CParticleSystemInstanceUser::isAsyncTextureReady |
( |
|
) |
[virtual] |
|
bool NL3D::CParticleSystemInstanceUser::isGlobalUserParamValueBypassed |
( |
uint |
userParamIndex |
) |
const [virtual] |
|
bool NL3D::CParticleSystemInstanceUser::isPSObserver |
( |
IPSObserver * |
observer |
) |
[virtual] |
|
bool NL3D::CParticleSystemInstanceUser::isShared |
( |
|
) |
const [virtual] |
|
virtual bool NL3D::CParticleSystemInstanceUser::isStarted |
( |
|
) |
const [inline, virtual] |
|
bool NL3D::CParticleSystemInstanceUser::isSystemPresent |
( |
void |
|
) |
const [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()
Implements NL3D::UParticleSystemInstance.
Definition at line 63 of file particle_system_instance_user.cpp.
References NL3D_MEM_PS_INSTANCE.
Referenced by activateEmitters, emit, getID, getIDs, getNumID, hasEmmiters, hasParticles, removeByID, and setActive. |
bool NL3D::CParticleSystemInstanceUser::isValid |
( |
void |
|
) |
const [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...
Implements NL3D::UParticleSystemInstance.
Definition at line 113 of file particle_system_instance_user.cpp.
References _Invalidated, and NL3D_MEM_PS_INSTANCE. |
void NL3D::CParticleSystemInstanceUser::registerPSObserver |
( |
IPSObserver * |
observer |
) |
[virtual] |
|
bool NL3D::CParticleSystemInstanceUser::removeByID |
( |
uint32 |
id |
) |
[virtual] |
|
void NL3D::CParticleSystemInstanceUser::removePSObserver |
( |
IPSObserver * |
observer |
) |
[virtual] |
|
virtual void NL3D::CParticleSystemInstanceUser::selectTextureSet |
( |
uint |
id |
) |
[inline, virtual] |
|
bool NL3D::CParticleSystemInstanceUser::setActive |
( |
uint32 |
id, |
|
|
bool |
active |
|
) |
[virtual] |
|
void NL3D::CParticleSystemInstanceUser::setAsyncTextureDirty |
( |
bool |
flag |
) |
[virtual] |
|
void NL3D::CParticleSystemInstanceUser::setAsyncTextureDistance |
( |
float |
dist |
) |
[virtual] |
|
virtual void NL3D::CParticleSystemInstanceUser::setCoarseMeshDist |
( |
float |
dist |
) |
[inline, virtual] |
|
virtual void NL3D::CParticleSystemInstanceUser::setDistMax |
( |
float |
distMax |
) |
[inline, virtual] |
|
void NL3D::CParticleSystemInstanceUser::setShapeDistMax |
( |
float |
distMax |
) |
[virtual] |
|
|
Change Max Display distance.
After this distance the shape won't be displayed. setting <0 means -1 and so means DistMax = infinite (default in meshs but multilod meshes). NB: This apply to the shape direclty!! ie All instances using same shape will be affected
Note: If the instance is skinned/sticked to a skeleton, this setup is not taken into account. But you can call USkeleton::setShapeDistMax() to have same effect.
Note (complex): All instances of the same shape which are freezeHRC()-ed and are linked to the QuadGridClipManager (ie not linked to a cluster) may not be updated corretcly. In other words, you should setup this value only at beginning of program, just after creating your instance (more exactly before UScene::render()), and all instances of the same shape should be setuped with same value (or don't call setShapeDistMax() for subsequent instances). If you don't do this, QuadGridClipManager may clip such instances nearer than they should
Implements NL3D::UInstance.
Definition at line 278 of file particle_system_instance_user.cpp.
References NL3D_MEM_PS_INSTANCE. |
void NL3D::CParticleSystemInstanceUser::setUserParam |
( |
uint |
index, |
|
|
float |
value |
|
) |
[virtual] |
|
virtual void NL3D::CParticleSystemInstanceUser::start |
( |
|
) |
[inline, virtual] |
|
void NL3D::CParticleSystemInstanceUser::startAsyncTextureLoading |
( |
|
) |
[virtual] |
|
virtual void NL3D::CParticleSystemInstanceUser::stop |
( |
void |
|
) |
[inline, virtual] |
|
Member Data Documentation
bool NL3D::CParticleSystemInstanceUser::_Invalidated [private]
|
|
std::vector<IPSObserver *> NL3D::CParticleSystemInstanceUser::_Observers [private]
|
|
The documentation for this class was generated from the following files:
|
|