#include <ps_particle_basic.h>
Inheritance diagram for NL3D::CPSSizedParticle:
Definition at line 252 of file ps_particle_basic.h.
Public Member Functions | |
CPSSizedParticle () | |
ctor : default are 0.1f sized particles | |
float | getSize (void) const |
get the constant size | |
const CPSAttribMaker< float > * | getSizeScheme (void) const |
get the size scheme (NULL if none) const version | |
CPSAttribMaker< float > * | getSizeScheme (void) |
get the size scheme (NULL if none) | |
void | serialSizeScheme (NLMISC::IStream &f) throw (NLMISC::EStream) |
serialization. We choose a different name because of multiple-inheritance | |
void | setSize (float size) |
Set a constant size for the particles. | |
void | setSizeScheme (CPSAttribMaker< float > *size) |
virtual | ~CPSSizedParticle () |
dtor | |
Protected Member Functions | |
void | deleteSizeElement (uint32 index) |
virtual CPSLocated * | getSizeOwner (void)=0 |
deriver must return their owner there | |
void | newSizeElement (CPSLocated *emitterLocated, uint32 emitterIndex) |
void | resizeSize (uint32 size) |
Protected Attributes | |
float | _ParticleSize |
CPSAttribMaker< float > * | _SizeScheme |
|
ctor : default are 0.1f sized particles
Definition at line 200 of file ps_particle_basic.cpp.
00200 : _ParticleSize(0.3f), _SizeScheme(NULL) 00201 { 00202 } |
|
dtor
Definition at line 205 of file ps_particle_basic.cpp. References _SizeScheme.
00206 { 00207 delete _SizeScheme; 00208 } |
|
Definition at line 295 of file ps_particle_basic.h. References _SizeScheme, NL3D::CPSAttribMaker< float >::deleteElement(), NL3D::CPSAttribMaker< float >::hasMemory(), index, and uint32. Referenced by NL3D::CPSShockWave::deleteElement(), NL3D::CPSRibbonLookAt::deleteElement(), NL3D::CPSRibbon::deleteElement(), NL3D::CPSQuad::deleteElement(), NL3D::CPSConstraintMesh::deleteElement(), NL3D::CPSMesh::deleteElement(), and NL3D::CPSFanLight::deleteElement().
00296 { 00297 if (_SizeScheme && _SizeScheme->hasMemory()) _SizeScheme->deleteElement(index); 00298 } |
|
get the constant size
Definition at line 274 of file ps_particle_basic.h. References _ParticleSize. Referenced by NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), resizeSize(), and setSizeScheme().
00274 { return _ParticleSize; } |
|
deriver must return their owner there
Implemented in NL3D::CPSFaceLookAt::CSecondSize, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSShockWave. Referenced by resizeSize(), and setSizeScheme(). |
|
get the size scheme (NULL if none) const version
Definition at line 268 of file ps_particle_basic.h. References _SizeScheme.
00268 { return _SizeScheme; } |
|
get the size scheme (NULL if none)
Definition at line 265 of file ps_particle_basic.h. References _SizeScheme. Referenced by NL3D::CPSFaceLookAtHelper::drawLookAt(), and NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion().
00265 { return _SizeScheme; } |
|
Definition at line 291 of file ps_particle_basic.h. References _SizeScheme, NL3D::CPSAttribMaker< float >::hasMemory(), NL3D::CPSAttribMaker< float >::newElement(), and uint32. Referenced by NL3D::CPSShockWave::newElement(), NL3D::CPSRibbonLookAt::newElement(), NL3D::CPSRibbon::newElement(), NL3D::CPSQuad::newElement(), NL3D::CPSConstraintMesh::newElement(), NL3D::CPSMesh::newElement(), and NL3D::CPSFanLight::newElement().
00292 { 00293 if (_SizeScheme && _SizeScheme->hasMemory()) _SizeScheme->newElement(emitterLocated, emitterIndex); 00294 } |
|
Definition at line 299 of file ps_particle_basic.h. References _SizeScheme, getSize(), getSizeOwner(), NL3D::CPSAttribMaker< float >::hasMemory(), nlassert, NL3D::CPSAttribMaker< float >::resize(), size, and uint32. Referenced by NL3D::CPSShockWave::resize(), NL3D::CPSRibbonLookAt::resize(), NL3D::CPSRibbon::resize(), NL3D::CPSQuad::resize(), NL3D::CPSConstraintMesh::resize(), NL3D::CPSMesh::resize(), and NL3D::CPSFanLight::resize().
00300 { 00301 nlassert(size < (1 << 16)); 00302 if (_SizeScheme && _SizeScheme->hasMemory()) _SizeScheme->resize(size, getSizeOwner()->getSize()); 00303 } |
|
serialization. We choose a different name because of multiple-inheritance
Definition at line 211 of file ps_particle_basic.cpp.
00212 { 00213 f.serialVersion(1); 00214 if (f.isReading()) 00215 { 00216 if (_SizeScheme) 00217 { 00218 delete _SizeScheme; 00219 _SizeScheme = NULL; 00220 } 00221 } 00222 bool useSizeScheme = _SizeScheme != NULL; 00223 f.serial(useSizeScheme); 00224 if (useSizeScheme) 00225 { 00226 f.serialPolyPtr(_SizeScheme); 00227 } 00228 else 00229 { 00230 f.serial(_ParticleSize); 00231 } 00232 }; |
|
Set a constant size for the particles.
Definition at line 192 of file ps_particle_basic.cpp. References _ParticleSize, _SizeScheme, and size.
00193 { 00194 delete _SizeScheme; 00195 _SizeScheme = NULL; 00196 _ParticleSize = size; 00197 } |
|
Set an attribute maker that produce a size It must have been allocated by new It will be deleted by this object Definition at line 183 of file ps_particle_basic.cpp. References _SizeScheme, getSize(), getSizeOwner(), nlassert, and size.
00184 { 00185 nlassert(size != NULL); 00186 delete _SizeScheme; 00187 _SizeScheme = size; 00188 if (getSizeOwner() && size->hasMemory()) size->resize(getSizeOwner()->getMaxSize(), getSizeOwner()->getSize()); 00189 } |
|
|