NL3D::CPSColoredParticle Class Reference

this class adds tunable color to a particle. Can be added using public multiple inheritance More...

#include <ps_particle_basic.h>

Inherited by NL3D::CPSConstraintMesh, NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.

List of all members.

Public Member Functions

void setColorScheme (CPSAttribMaker< CRGBA > *col)
 Set an attribute maker that produce a color It must have been allocated by new It will be deleted by this object.
CPSAttribMaker< CRGBA > * getColorScheme (void)
 get the color scheme (NULL if none)
const CPSAttribMaker< CRGBA > * getColorScheme (void) const
 get the color scheme (NULL if none) const version
void setColor (NLMISC::CRGBA col)
 Set a constant color for the particles. remove any previous scheme.
NLMISC::CRGBA getColor (void) const
 Get the color.
 CPSColoredParticle ()
 ctor : default are white particles (constant color)
virtual ~CPSColoredParticle ()
 dtor
void serialColorScheme (NLMISC::IStream &f) throw (NLMISC::EStream)
 serialization.

Protected Member Functions

virtual CPSLocatedgetColorOwner (void)=0
 deriver must return their owner there
virtual void updateMatAndVbForColor (void)=0
 Update the material and the vb and the like so that they match the color scheme.
void newColorElement (const CPSEmitterInfo &info)
void deleteColorElement (uint32 index)
void resizeColor (uint32 size)

Protected Attributes

CRGBA _Color
CPSAttribMaker< CRGBA > * _ColorScheme

Detailed Description

this class adds tunable color to a particle. Can be added using public multiple inheritance

Definition at line 191 of file ps_particle_basic.h.


Constructor & Destructor Documentation

NL3D::CPSColoredParticle::CPSColoredParticle (  ) 

ctor : default are white particles (constant color)

Definition at line 146 of file ps_particle_basic.cpp.

References NL_PS_FUNC.

NL3D::CPSColoredParticle::~CPSColoredParticle (  )  [virtual]

dtor

Definition at line 152 of file ps_particle_basic.cpp.

References _ColorScheme, and NL_PS_FUNC.


Member Function Documentation

void NL3D::CPSColoredParticle::deleteColorElement ( uint32  index  )  [inline, protected]
NLMISC::CRGBA NL3D::CPSColoredParticle::getColor ( void   )  const [inline]

Get the color.

Definition at line 211 of file ps_particle_basic.h.

References _Color.

virtual CPSLocated* NL3D::CPSColoredParticle::getColorOwner ( void   )  [protected, pure virtual]
const CPSAttribMaker<CRGBA>* NL3D::CPSColoredParticle::getColorScheme ( void   )  const [inline]

get the color scheme (NULL if none) const version

Definition at line 205 of file ps_particle_basic.h.

References _ColorScheme.

CPSAttribMaker<CRGBA>* NL3D::CPSColoredParticle::getColorScheme ( void   )  [inline]

get the color scheme (NULL if none)

Definition at line 202 of file ps_particle_basic.h.

References _ColorScheme.

void NL3D::CPSColoredParticle::newColorElement ( const CPSEmitterInfo info  )  [inline, protected]
void NL3D::CPSColoredParticle::resizeColor ( uint32  size  )  [inline, protected]
void NL3D::CPSColoredParticle::serialColorScheme ( NLMISC::IStream f  )  throw (NLMISC::EStream)
void NL3D::CPSColoredParticle::setColor ( NLMISC::CRGBA  col  ) 

Set a constant color for the particles. remove any previous scheme.

Definition at line 136 of file ps_particle_basic.cpp.

References _Color, _ColorScheme, NL_PS_FUNC, and updateMatAndVbForColor().

void NL3D::CPSColoredParticle::setColorScheme ( CPSAttribMaker< CRGBA > *  col  ) 

Set an attribute maker that produce a color It must have been allocated by new It will be deleted by this object.

Definition at line 125 of file ps_particle_basic.cpp.

References _ColorScheme, getColorOwner(), NL3D::CPSAttribMaker< T >::hasMemory(), NL_PS_FUNC, nlassert, NL3D::CPSAttribMaker< T >::resize(), and updateMatAndVbForColor().

virtual void NL3D::CPSColoredParticle::updateMatAndVbForColor ( void   )  [protected, pure virtual]

Update the material and the vb and the like so that they match the color scheme.

Implemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.

Referenced by setColor(), and setColorScheme().


Member Data Documentation


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