this class adds tunable 2D rotation to a particle, it can be used by public multiple inheritance More...
#include <ps_particle_basic.h>
Inherited by NL3D::CDummy2DAngle, NL3D::CPSFaceLookAt, NL3D::CPSFanLight, NL3D::CPSMesh, and NL3D::CPSShockWave.
Public Member Functions | |
| void | setAngle2DScheme (CPSAttribMaker< float > *scheme) |
| Set an attribute maker that produce a float It must have been allocated by new It will be deleted by this object Output angles must range from 0.0f to 256.0f. | |
| CPSAttribMaker< float > * | getAngle2DScheme (void) |
| get the angle 2D scheme (NULL if none) | |
| const CPSAttribMaker< float > * | getAngle2DScheme (void) const |
| get the angle 2D scheme (NULL if none) const version | |
| void | setAngle2D (float angle) |
| Set a constant angle for the particle. | |
| float | getAngle2D (void) const |
| get the constant | |
| CPSRotated2DParticle () | |
| ctor : default are unrotated particles (angle = 0.0f) | |
| virtual | ~CPSRotated2DParticle () |
| dtor | |
| void | serialAngle2DScheme (NLMISC::IStream &f) throw (NLMISC::EStream) |
| serialization. We choose a different name because of multiple-inheritance | |
Static Public Member Functions | |
| static const float * | getRotTable (void) |
| this return a float table used to speed up rotations of face look at and the like for each angle, there are 4 float : 2 couple of float : a1, b1, a2, b2 a1 * I + b1 * K = up left corner, a2 * I + b2 * K = up right corner, This table must have been initialized with initRotTable | |
| static void | initRotTable (void) |
| init the rotation table | |
Protected Member Functions | |
| virtual CPSLocated * | getAngle2DOwner (void)=0 |
| deriver must return their owner there | |
| void | newAngle2DElement (const CPSEmitterInfo &info) |
| void | deleteAngle2DElement (uint32 index) |
| void | resizeAngle2D (uint32 size) |
Protected Attributes | |
| float | _Angle2D |
| CPSAttribMaker< float > * | _Angle2DScheme |
Static Protected Attributes | |
| static float | _RotTable [4 *256] |
| static bool | _InitializedRotTab = false |
| it is true if the table has been initialized, for debug purposes | |
this class adds tunable 2D rotation to a particle, it can be used by public multiple inheritance
Definition at line 311 of file ps_particle_basic.h.
| NL3D::CPSRotated2DParticle::CPSRotated2DParticle | ( | ) |
ctor : default are unrotated particles (angle = 0.0f)
===================================================================================
Definition at line 271 of file ps_particle_basic.cpp.
References NL_PS_FUNC.
| NL3D::CPSRotated2DParticle::~CPSRotated2DParticle | ( | ) | [virtual] |
dtor
===================================================================================
Definition at line 277 of file ps_particle_basic.cpp.
References _Angle2DScheme, and NL_PS_FUNC.
| void NL3D::CPSRotated2DParticle::deleteAngle2DElement | ( | uint32 | index | ) | [inline, protected] |
Definition at line 380 of file ps_particle_basic.h.
References _Angle2DScheme, NL3D::CPSAttribMaker< T >::deleteElement(), and NL3D::CPSAttribMaker< T >::hasMemory().
Referenced by NL3D::CPSShockWave::deleteElement(), NL3D::CPSMesh::deleteElement(), NL3D::CPSFanLight::deleteElement(), and NL3D::CPSFaceLookAt::deleteElement().
| float NL3D::CPSRotated2DParticle::getAngle2D | ( | void | ) | const [inline] |
| virtual CPSLocated* NL3D::CPSRotated2DParticle::getAngle2DOwner | ( | void | ) | [protected, pure virtual] |
deriver must return their owner there
Implemented in NL3D::CPSFaceLookAt, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSShockWave, and NL3D::CDummy2DAngle.
Referenced by resizeAngle2D(), and setAngle2DScheme().
| const CPSAttribMaker<float>* NL3D::CPSRotated2DParticle::getAngle2DScheme | ( | void | ) | const [inline] |
get the angle 2D scheme (NULL if none) const version
Definition at line 326 of file ps_particle_basic.h.
References _Angle2DScheme.
| CPSAttribMaker<float>* NL3D::CPSRotated2DParticle::getAngle2DScheme | ( | void | ) | [inline] |
get the angle 2D scheme (NULL if none)
Definition at line 323 of file ps_particle_basic.h.
References _Angle2DScheme.
| static const float* NL3D::CPSRotated2DParticle::getRotTable | ( | void | ) | [inline, static] |
this return a float table used to speed up rotations of face look at and the like for each angle, there are 4 float : 2 couple of float : a1, b1, a2, b2 a1 * I + b1 * K = up left corner, a2 * I + b2 * K = up right corner, This table must have been initialized with initRotTable
Definition at line 354 of file ps_particle_basic.h.
References _InitializedRotTab, _RotTable, and nlassert.
Referenced by NL3D::CPSFaceLookAtHelper::drawLookAt(), and NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion().
| void NL3D::CPSRotated2DParticle::initRotTable | ( | void | ) | [static] |
init the rotation table
===================================================================================
Definition at line 309 of file ps_particle_basic.cpp.
References _InitializedRotTab, _RotTable, NL_PS_FUNC, and NLMISC::Pi.
Referenced by NL3D::CPSUtil::registerParticles().
| void NL3D::CPSRotated2DParticle::newAngle2DElement | ( | const CPSEmitterInfo & | info | ) | [inline, protected] |
Definition at line 376 of file ps_particle_basic.h.
References _Angle2DScheme, NL3D::CPSAttribMaker< T >::hasMemory(), and NL3D::CPSAttribMaker< T >::newElement().
Referenced by NL3D::CPSShockWave::newElement(), NL3D::CPSMesh::newElement(), NL3D::CPSFanLight::newElement(), and NL3D::CPSFaceLookAt::newElement().
| void NL3D::CPSRotated2DParticle::resizeAngle2D | ( | uint32 | size | ) | [inline, protected] |
Definition at line 384 of file ps_particle_basic.h.
References _Angle2DScheme, getAngle2DOwner(), NL3D::CPSAttribMaker< T >::hasMemory(), nlassert, and NL3D::CPSAttribMaker< T >::resize().
Referenced by NL3D::CPSShockWave::resize(), NL3D::CPSMesh::resize(), NL3D::CPSFanLight::resize(), and NL3D::CPSFaceLookAt::resize().
| void NL3D::CPSRotated2DParticle::serialAngle2DScheme | ( | NLMISC::IStream & | f | ) | throw (NLMISC::EStream) |
serialization. We choose a different name because of multiple-inheritance
===================================================================================
Definition at line 284 of file ps_particle_basic.cpp.
References NL_PS_FUNC.
Referenced by NL3D::CPSShockWave::serial(), NL3D::CPSRibbon::serial(), NL3D::CPSMesh::serial(), NL3D::CPSFanLight::serial(), and NL3D::CPSFaceLookAt::serial().
| void NL3D::CPSRotated2DParticle::setAngle2D | ( | float | angle | ) |
Set a constant angle for the particle.
===================================================================================
Angles range from 0.0f to 256.0f (2 pi) This discrad any previous scheme
Definition at line 262 of file ps_particle_basic.cpp.
References _Angle2D, _Angle2DScheme, and NL_PS_FUNC.
| void NL3D::CPSRotated2DParticle::setAngle2DScheme | ( | CPSAttribMaker< float > * | scheme | ) |
Set an attribute maker that produce a float It must have been allocated by new It will be deleted by this object Output angles must range from 0.0f to 256.0f.
===================================================================================
Definition at line 252 of file ps_particle_basic.cpp.
References _Angle2DScheme, getAngle2DOwner(), NL3D::CPSAttribMaker< T >::hasMemory(), NL_PS_FUNC, nlassert, and NL3D::CPSAttribMaker< T >::resize().
float NL3D::CPSRotated2DParticle::_Angle2D [protected] |
Definition at line 367 of file ps_particle_basic.h.
Referenced by NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), NL3D::CPSShockWaveHelper::drawShockWave(), getAngle2D(), setAngle2D(), and NL3D::CPSMesh::updatePos().
CPSAttribMaker<float>* NL3D::CPSRotated2DParticle::_Angle2DScheme [protected] |
Definition at line 368 of file ps_particle_basic.h.
Referenced by deleteAngle2DElement(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), NL3D::CPSShockWaveHelper::drawShockWave(), getAngle2DScheme(), newAngle2DElement(), resizeAngle2D(), setAngle2D(), setAngle2DScheme(), NL3D::CPSMesh::updatePos(), and ~CPSRotated2DParticle().
bool NL3D::CPSRotated2DParticle::_InitializedRotTab = false [static, protected] |
it is true if the table has been initialized, for debug purposes
Definition at line 373 of file ps_particle_basic.h.
Referenced by getRotTable(), and initRotTable().
float NL3D::CPSRotated2DParticle::_RotTable [static, protected] |
Definition at line 369 of file ps_particle_basic.h.
Referenced by getRotTable(), and initRotTable().
1.6.1