NL3D::CPSRotated2DParticle Class Reference

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.

List of all members.

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 floatgetRotTable (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 CPSLocatedgetAngle2DOwner (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

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

void NL3D::CPSRotated2DParticle::deleteAngle2DElement ( uint32  index  )  [inline, protected]
float NL3D::CPSRotated2DParticle::getAngle2D ( void   )  const [inline]

get the constant

Definition at line 336 of file ps_particle_basic.h.

References _Angle2D.

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]
void NL3D::CPSRotated2DParticle::resizeAngle2D ( uint32  size  )  [inline, protected]
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

See also:
setAngle2DScheme()

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().


Member Data Documentation

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().

Definition at line 369 of file ps_particle_basic.h.

Referenced by getRotTable(), and initRotTable().


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

Generated on Thu Jan 7 08:30:09 2010 for NeL by  doxygen 1.6.1