NL3D::CPSTexturedParticle Class Reference

this class adds a texture to a particle. More...

#include <ps_particle_basic.h>

Inherited by NL3D::CPSQuad, and NL3D::CPSShockWave.

List of all members.

Public Member Functions

void setTextureIndexScheme (CPSAttribMaker< sint32 > *animOrder)
 Set an attribute maker that produce a sint32 It must have been allocated by new It will be deleted by this object a texture group must have been set before this, an assertion occurs otherwise The integer is used as an index in a grouped texture.
CPSAttribMaker< sint32 > * getTextureIndexScheme (void)
 get the texture scheme (null if none)
const CPSAttribMaker< sint32 > * getTextureIndexScheme (void) const
 get the texture scheme (null if none) const version
void setTextureIndex (sint32 index)
 set a constant index for the current texture. not very useful, but available...
sint32 getTextureIndex (void) const
 get the animated texture index. MeaningFul only if a texture group was set
virtual void setTextureGroup (NLMISC::CSmartPtr< CTextureGrouped > texGroup)
 set the texture group being used. It toggles animation on
CTextureGroupedgetTextureGroup (void)
 get the texture group used. it discard any previous single texture. (if null, there's no texture animation)
const CTextureGroupedgetTextureGroup (void) const
 get the texture group used if there's a texture scheme, const version. (if null, there's no texture animation)
virtual void setTexture (CSmartPtr< ITexture > tex)
 Set a constant texture for the particle This discard any previous scheme.
ITexturegetTexture (void)
 get the constant texture
const ITexturegetTexture (void) const
 CPSTexturedParticle ()
 ctor : default have no texture. You must set it, otherwise you'll get an assertion when it's drawn
virtual ~CPSTexturedParticle ()
 dtor
void serialTextureScheme (NLMISC::IStream &f) throw (NLMISC::EStream)
 serialization. We choose a different name because of multiple-inheritance
void enumTexs (std::vector< NLMISC::CSmartPtr< ITexture > > &dest)

Protected Member Functions

virtual CPSLocatedgetTextureIndexOwner (void)=0
 deriver must return their owner there
virtual void updateMatAndVbForTexture (void)=0
 Update the material so that it match the texture scheme.
void newTextureIndexElement (const CPSEmitterInfo &info)
void deleteTextureIndexElement (uint32 index)
void resizeTextureIndex (uint32 size)

Protected Attributes

CSmartPtr< ITexture_Tex
CSmartPtr< CTextureGrouped_TexGroup
CPSAttribMaker< sint32 > * _TextureIndexScheme
sint32 _TextureIndex

Detailed Description

this class adds a texture to a particle.

The texture can be animated or not. it can be used by public multiple inheritance. The frame animation are all stored in the same texture for optimisation so it's not suited for large anim...

Definition at line 412 of file ps_particle_basic.h.


Constructor & Destructor Documentation

NL3D::CPSTexturedParticle::CPSTexturedParticle (  ) 

ctor : default have no texture. You must set it, otherwise you'll get an assertion when it's drawn

===================================================================================

Definition at line 379 of file ps_particle_basic.cpp.

References NL_PS_FUNC.

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

dtor

===================================================================================

Definition at line 387 of file ps_particle_basic.cpp.

References _TextureIndexScheme, and NL_PS_FUNC.


Member Function Documentation

void NL3D::CPSTexturedParticle::deleteTextureIndexElement ( uint32  index  )  [inline, protected]
void NL3D::CPSTexturedParticle::enumTexs ( std::vector< NLMISC::CSmartPtr< ITexture > > &  dest  ) 

Definition at line 1104 of file ps_particle_basic.cpp.

References _Tex, getTextureGroup(), and NL_PS_FUNC.

const ITexture* NL3D::CPSTexturedParticle::getTexture ( void   )  const [inline]

Definition at line 454 of file ps_particle_basic.h.

References _Tex.

ITexture* NL3D::CPSTexturedParticle::getTexture ( void   )  [inline]

get the constant texture

Definition at line 452 of file ps_particle_basic.h.

References _Tex.

const CTextureGrouped* NL3D::CPSTexturedParticle::getTextureGroup ( void   )  const [inline]

get the texture group used if there's a texture scheme, const version. (if null, there's no texture animation)

Definition at line 443 of file ps_particle_basic.h.

References _TexGroup.

CTextureGrouped* NL3D::CPSTexturedParticle::getTextureGroup ( void   )  [inline]

get the texture group used. it discard any previous single texture. (if null, there's no texture animation)

Definition at line 440 of file ps_particle_basic.h.

References _TexGroup.

Referenced by enumTexs().

sint32 NL3D::CPSTexturedParticle::getTextureIndex ( void   )  const [inline]

get the animated texture index. MeaningFul only if a texture group was set

Definition at line 434 of file ps_particle_basic.h.

References _TextureIndex.

virtual CPSLocated* NL3D::CPSTexturedParticle::getTextureIndexOwner ( void   )  [protected, pure virtual]

deriver must return their owner there

Implemented in NL3D::CPSQuad, and NL3D::CPSShockWave.

Referenced by resizeTextureIndex(), and setTextureIndexScheme().

const CPSAttribMaker<sint32>* NL3D::CPSTexturedParticle::getTextureIndexScheme ( void   )  const [inline]

get the texture scheme (null if none) const version

Definition at line 428 of file ps_particle_basic.h.

References _TextureIndexScheme.

CPSAttribMaker<sint32>* NL3D::CPSTexturedParticle::getTextureIndexScheme ( void   )  [inline]

get the texture scheme (null if none)

Definition at line 425 of file ps_particle_basic.h.

References _TextureIndexScheme.

void NL3D::CPSTexturedParticle::newTextureIndexElement ( const CPSEmitterInfo info  )  [inline, protected]
void NL3D::CPSTexturedParticle::resizeTextureIndex ( uint32  size  )  [inline, protected]
void NL3D::CPSTexturedParticle::serialTextureScheme ( NLMISC::IStream f  )  throw (NLMISC::EStream)

serialization. We choose a different name because of multiple-inheritance

===================================================================================

Definition at line 394 of file ps_particle_basic.cpp.

References NL_PS_FUNC, and NL3D::CTextureGrouped::serial().

Referenced by NL3D::CPSShockWave::serial(), and NL3D::CPSQuad::serial().

void NL3D::CPSTexturedParticle::setTexture ( CSmartPtr< ITexture tex  )  [virtual]

Set a constant texture for the particle This discard any previous scheme.

===================================================================================

See also:
setTextureScheme()

Reimplemented in NL3D::CPSQuad.

Definition at line 368 of file ps_particle_basic.cpp.

References _Tex, _TexGroup, _TextureIndexScheme, NL_PS_FUNC, and updateMatAndVbForTexture().

Referenced by NL3D::CPSShockWave::CPSShockWave().

void NL3D::CPSTexturedParticle::setTextureGroup ( NLMISC::CSmartPtr< CTextureGrouped texGroup  )  [virtual]

set the texture group being used. It toggles animation on

===================================================================================

Reimplemented in NL3D::CPSQuad.

Definition at line 355 of file ps_particle_basic.cpp.

References _Tex, _TexGroup, NL_PS_FUNC, nlassert, and updateMatAndVbForTexture().

void NL3D::CPSTexturedParticle::setTextureIndex ( sint32  index  ) 

set a constant index for the current texture. not very useful, but available...

===================================================================================

Definition at line 346 of file ps_particle_basic.cpp.

References _TextureIndex, _TextureIndexScheme, and NL_PS_FUNC.

void NL3D::CPSTexturedParticle::setTextureIndexScheme ( CPSAttribMaker< sint32 > *  animOrder  ) 

Set an attribute maker that produce a sint32 It must have been allocated by new It will be deleted by this object a texture group must have been set before this, an assertion occurs otherwise The integer is used as an index in a grouped texture.

===================================================================================

It tells which frame to use

Definition at line 332 of file ps_particle_basic.cpp.

References _TexGroup, _TextureIndexScheme, getTextureIndexOwner(), NL3D::CPSAttribMaker< T >::hasMemory(), NL_PS_FUNC, nlassert, NL3D::CPSAttribMaker< T >::resize(), and updateMatAndVbForTexture().

virtual void NL3D::CPSTexturedParticle::updateMatAndVbForTexture ( void   )  [protected, pure virtual]

Update the material so that it match the texture scheme.

Implemented in NL3D::CPSQuad, and NL3D::CPSShockWave.

Referenced by setTexture(), setTextureGroup(), and setTextureIndexScheme().


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