This is the base class for all particles. More...
#include <ps_particle_basic.h>
Inherits NL3D::CPSLocatedBindable.
Inherited by NL3D::CPSConstraintMesh, NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSQuad, NL3D::CPSRibbonBase, and NL3D::CPSShockWave.
Public Member Functions | |
| CPSParticle () | |
| Constructor. | |
| uint32 | getType (void) const |
| return this bindable type | |
| virtual uint32 | getPriority (void) const |
| return priority | |
| virtual bool | hasParticles (void) const |
| return true if this located bindable derived class holds alive particles | |
| virtual void | step (TPSProcessPass pass) |
| process one pass for the particles. | |
| virtual bool | hasTransparentFaces (void)=0 |
| return true if there are transparent faces in the object | |
| virtual bool | hasOpaqueFaces (void)=0 |
| return true if there are Opaque faces in the object | |
| virtual bool | hasLightableFaces ()=0 |
| Returns true if there are lightable faces in the object. | |
| bool | usesGlobalColorLighting () |
| Returns true if the object can use global lighting color. | |
| void | enableGlobalColorLighting (bool enabled) |
| virtual bool | supportGlobalColorLighting () const =0 |
| virtual void | draw (bool opaque) |
| derivers draw the particles here | |
| virtual void | showTool () |
| draw the particles for edition mode. The default behaviour just draw a wireframe model | |
| virtual uint32 | getNumWantedTris () const =0 |
| return the max number of faces needed for display. This is needed for LOD balancing | |
| virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
| serialisation. Derivers must override this, and call their parent version | |
| void | disableAutoLOD (bool disable=true) |
| Force the Auto-LOD to be disbaled. When set to false, the default behaviour set in the system is used. | |
| bool | isAutoLODDisabled () const |
| Test whether Auto-LOD is disabled. | |
| virtual void | setZBias (float value)=0 |
| virtual float | getZBias () const =0 |
Protected Member Functions | |
| virtual void | newElement (const CPSEmitterInfo &info)=0 |
| Shortcut to notify that the max number of faces has changed This must be called when a geometric property of the particle has been modified This needn't to be called during CPSParticle::resize overrides. | |
| virtual void | deleteElement (uint32 index)=0 |
| Delete an element given its index Attributes of the located that hold this bindable are still accessible for the index given index out of range -> nl_assert. | |
| virtual void | resize (uint32 size)=0 |
| Resize the bindable attributes containers. | |
| void | computeSrcStep (uint32 &step, uint &numToProcess) |
| System may have hand-tuned LOD, or auto LOD. | |
Private Attributes | |
| bool | _DisableAutoLOD |
| Disable Auto-LOD flag. | |
| bool | _UsesGlobalColorLighting |
This is the base class for all particles.
A deriver must provide a drawing method for his particle. Not sharable accross systems.
Definition at line 53 of file ps_particle_basic.h.
| NL3D::CPSParticle::CPSParticle | ( | ) |
System may have hand-tuned LOD, or auto LOD.
This compute the number of particles that must really be displayed, and the src step that allow to go through the whole collection. The step in the source is in a fixed point 16:16 format
Definition at line 81 of file ps_particle_basic.cpp.
References _DisableAutoLOD, NL3D::CPSLocatedBindable::_Owner, NLMISC::clamp(), NL3D::CParticleSystemProcess::getOwner(), NL3D::CPSLocated::getSize(), NL_PS_FUNC, and nlassert.
Referenced by NL3D::CPSShockWave::draw(), NL3D::CPSConstraintMesh::draw(), NL3D::CPSFanLight::draw(), NL3D::CPSFaceLookAt::draw(), NL3D::CPSDot::draw(), NL3D::CPSTailDot::step(), NL3D::CPSRibbonLookAt::step(), NL3D::CPSRibbon::step(), and NL3D::CPSFace::step().
| virtual void NL3D::CPSParticle::deleteElement | ( | uint32 | index | ) | [protected, pure virtual] |
Delete an element given its index Attributes of the located that hold this bindable are still accessible for the index given index out of range -> nl_assert.
Implements NL3D::CPSLocatedBindable.
Implemented in NL3D::CPSDot, NL3D::CPSFace, NL3D::CPSFaceLookAt, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonBase, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.
| void NL3D::CPSParticle::disableAutoLOD | ( | bool | disable = true |
) | [inline] |
Force the Auto-LOD to be disbaled. When set to false, the default behaviour set in the system is used.
Definition at line 135 of file ps_particle_basic.h.
References _DisableAutoLOD.
| virtual void NL3D::CPSParticle::draw | ( | bool | opaque | ) | [inline, virtual] |
derivers draw the particles here
Reimplemented in NL3D::CPSDot, NL3D::CPSFaceLookAt, NL3D::CPSFanLight, NL3D::CPSConstraintMesh, and NL3D::CPSShockWave.
Definition at line 108 of file ps_particle_basic.h.
Referenced by step().
| void NL3D::CPSParticle::enableGlobalColorLighting | ( | bool | enabled | ) | [inline] |
Definition at line 103 of file ps_particle_basic.h.
References _UsesGlobalColorLighting.
| virtual uint32 NL3D::CPSParticle::getNumWantedTris | ( | ) | const [pure virtual] |
return the max number of faces needed for display. This is needed for LOD balancing
Implemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.
| virtual uint32 NL3D::CPSParticle::getPriority | ( | void | ) | const [inline, virtual] |
return priority
Implements NL3D::CPSLocatedBindable.
Definition at line 64 of file ps_particle_basic.h.
| uint32 NL3D::CPSParticle::getType | ( | void | ) | const [inline, virtual] |
return this bindable type
Implements NL3D::CPSLocatedBindable.
Definition at line 61 of file ps_particle_basic.h.
References NL3D::PSParticle.
| virtual float NL3D::CPSParticle::getZBias | ( | ) | const [pure virtual] |
| virtual bool NL3D::CPSParticle::hasLightableFaces | ( | ) | [pure virtual] |
Returns true if there are lightable faces in the object.
Implemented in NL3D::CPSDot, NL3D::CPSFace, NL3D::CPSFaceLookAt, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.
| virtual bool NL3D::CPSParticle::hasOpaqueFaces | ( | void | ) | [pure virtual] |
return true if there are Opaque faces in the object
Implemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.
Referenced by step().
| virtual bool NL3D::CPSParticle::hasParticles | ( | void | ) | const [inline, virtual] |
return true if this located bindable derived class holds alive particles
Reimplemented from NL3D::CPSLocatedBindable.
Definition at line 67 of file ps_particle_basic.h.
References NL3D::CPSLocatedBindable::_Owner, NL3D::CPSLocated::getSize(), and nlassert.
| virtual bool NL3D::CPSParticle::hasTransparentFaces | ( | void | ) | [pure virtual] |
return true if there are transparent faces in the object
Implemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.
Referenced by step().
| bool NL3D::CPSParticle::isAutoLODDisabled | ( | ) | const [inline] |
Test whether Auto-LOD is disabled.
Definition at line 138 of file ps_particle_basic.h.
References _DisableAutoLOD.
| virtual void NL3D::CPSParticle::newElement | ( | const CPSEmitterInfo & | info | ) | [protected, pure virtual] |
Shortcut to notify that the max number of faces has changed This must be called when a geometric property of the particle has been modified This needn't to be called during CPSParticle::resize overrides.
Generate a new element for this bindable. They are generated according to the properties of the class
Implements NL3D::CPSLocatedBindable.
Implemented in NL3D::CPSDot, NL3D::CPSFace, NL3D::CPSFaceLookAt, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonBase, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.
| virtual void NL3D::CPSParticle::resize | ( | uint32 | size | ) | [protected, pure virtual] |
Resize the bindable attributes containers.
Size is the max number of element to be contained. DERIVERS MUST CALL THEIR PARENT VERSION should not be called directly. Call CPSLocated::resize instead
Implements NL3D::CPSLocatedBindable.
Implemented in NL3D::CPSDot, NL3D::CPSFace, NL3D::CPSFaceLookAt, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonBase, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.
| virtual void NL3D::CPSParticle::serial | ( | NLMISC::IStream & | f | ) | throw (NLMISC::EStream) [inline, virtual] |
serialisation. Derivers must override this, and call their parent version
version 3 : global color lighting version 2 : auto-lod saved
Reimplemented from NL3D::CPSLocatedBindable.
Reimplemented in NL3D::CPSDot, NL3D::CPSFace, NL3D::CPSFaceLookAt, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonBase, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.
Definition at line 117 of file ps_particle_basic.h.
References _DisableAutoLOD, and _UsesGlobalColorLighting.
Referenced by NL3D::CPSShockWave::serial(), NL3D::CPSRibbonLookAt::serial(), NL3D::CPSRibbonBase::serial(), NL3D::CPSQuad::serial(), NL3D::CPSConstraintMesh::serial(), NL3D::CPSMesh::serial(), NL3D::CPSFanLight::serial(), and NL3D::CPSDot::serial().
| virtual void NL3D::CPSParticle::setZBias | ( | float | value | ) | [pure virtual] |
Reimplemented from NL3D::CPSLocatedBindable.
Implemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.
| void NL3D::CPSParticle::showTool | ( | void | ) | [virtual] |
draw the particles for edition mode. The default behaviour just draw a wireframe model
Definition at line 53 of file ps_particle_basic.cpp.
References NL3D::CPSLocatedBindable::displayIcon2d(), NLMISC::CVector::I, I, NLMISC::CVector::J, NL_PS_FUNC, and PARTICLES_CHECK_MEM.
Referenced by NL3D::CPSConstraintMesh::step(), NL3D::CPSMesh::step(), NL3D::CPSFace::step(), and step().
| virtual void NL3D::CPSParticle::step | ( | TPSProcessPass | pass | ) | [inline, virtual] |
process one pass for the particles.
The default behaviour shows the particles
Implements NL3D::CPSLocatedBindable.
Reimplemented in NL3D::CPSFace, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSTailDot.
Definition at line 72 of file ps_particle_basic.h.
References draw(), hasOpaqueFaces(), hasTransparentFaces(), NL3D::PSBlendRender, NL3D::PSSolidRender, NL3D::PSToolRender, and showTool().
Referenced by NL3D::CPSShockWave::draw(), NL3D::CPSFanLight::draw(), NL3D::CPSFaceLookAt::draw(), and NL3D::CPSDot::draw().
| virtual bool NL3D::CPSParticle::supportGlobalColorLighting | ( | ) | const [pure virtual] |
| bool NL3D::CPSParticle::usesGlobalColorLighting | ( | ) | [inline] |
Returns true if the object can use global lighting color.
(example : 'lookat' particle do not have normals, so they use global lighting color instead
Definition at line 101 of file ps_particle_basic.h.
References _UsesGlobalColorLighting.
Referenced by NL3D::CPSTailDot::displayRibbons(), NL3D::CPSRibbonLookAt::displayRibbons(), NL3D::CPSRibbon::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(), NL3D::CPSQuad::updateMatBeforeRendering(), NL3D::CPSTailDot::updateMaterial(), NL3D::CPSRibbon::updateTexturedMaterial(), and NL3D::CPSRibbon::updateUntexturedMaterial().
bool NL3D::CPSParticle::_DisableAutoLOD [private] |
Disable Auto-LOD flag.
Definition at line 183 of file ps_particle_basic.h.
Referenced by computeSrcStep(), disableAutoLOD(), isAutoLODDisabled(), and serial().
Definition at line 184 of file ps_particle_basic.h.
Referenced by enableGlobalColorLighting(), serial(), and usesGlobalColorLighting().
1.6.1