this class adds a texture to a particle. More...
#include <ps_particle_basic.h>
Inherited by NL3D::CPSQuad, and NL3D::CPSShockWave.
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 | |
| CTextureGrouped * | getTextureGroup (void) |
| get the texture group used. it discard any previous single texture. (if null, there's no texture animation) | |
| const CTextureGrouped * | getTextureGroup (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. | |
| ITexture * | getTexture (void) |
| get the constant texture | |
| const ITexture * | getTexture (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 CPSLocated * | getTextureIndexOwner (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 |
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.
| 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.
| void NL3D::CPSTexturedParticle::deleteTextureIndexElement | ( | uint32 | index | ) | [inline, protected] |
Definition at line 490 of file ps_particle_basic.h.
References _TextureIndexScheme, NL3D::CPSAttribMaker< T >::deleteElement(), and NL3D::CPSAttribMaker< T >::hasMemory().
Referenced by NL3D::CPSShockWave::deleteElement(), and NL3D::CPSQuad::deleteElement().
| 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] |
| 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] |
Definition at line 486 of file ps_particle_basic.h.
References _TextureIndexScheme, NL3D::CPSAttribMaker< T >::hasMemory(), and NL3D::CPSAttribMaker< T >::newElement().
Referenced by NL3D::CPSShockWave::newElement(), and NL3D::CPSQuad::newElement().
| void NL3D::CPSTexturedParticle::resizeTextureIndex | ( | uint32 | size | ) | [inline, protected] |
Definition at line 494 of file ps_particle_basic.h.
References _TextureIndexScheme, getTextureIndexOwner(), NL3D::CPSAttribMaker< T >::hasMemory(), nlassert, and NL3D::CPSAttribMaker< T >::resize().
Referenced by NL3D::CPSShockWave::resize(), and NL3D::CPSQuad::resize().
| 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().
Set a constant texture for the particle This discard any previous scheme.
===================================================================================
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().
CSmartPtr<ITexture> NL3D::CPSTexturedParticle::_Tex [protected] |
Definition at line 473 of file ps_particle_basic.h.
Referenced by enumTexs(), NL3D::CPSQuad::getNeededVB(), getTexture(), setTexture(), setTextureGroup(), NL3D::CPSShockWave::updateMatAndVbForTexture(), NL3D::CPSQuad::updateMatAndVbForTexture(), NL3D::CPSQuad::updateMatBeforeRendering(), NL3D::CPSQuad::updateTexWrapMode(), and NL3D::CPSQuad::updateVbColNUVForRender().
CSmartPtr<CTextureGrouped> NL3D::CPSTexturedParticle::_TexGroup [protected] |
Definition at line 476 of file ps_particle_basic.h.
Referenced by NL3D::CPSQuad::getNeededVB(), getTextureGroup(), NL3D::CPSShockWave::getVBnPB(), setTexture(), setTextureGroup(), setTextureIndexScheme(), NL3D::CPSShockWave::updateMatAndVbForTexture(), NL3D::CPSQuad::updateMatAndVbForTexture(), NL3D::CPSShockWave::updateVbColNUVForRender(), and NL3D::CPSQuad::updateVbColNUVForRender().
sint32 NL3D::CPSTexturedParticle::_TextureIndex [protected] |
Definition at line 481 of file ps_particle_basic.h.
Referenced by getTextureIndex(), setTextureIndex(), NL3D::CPSShockWave::updateVbColNUVForRender(), and NL3D::CPSQuad::updateVbColNUVForRender().
Definition at line 478 of file ps_particle_basic.h.
Referenced by deleteTextureIndexElement(), getTextureIndexScheme(), newTextureIndexElement(), resizeTextureIndex(), setTexture(), setTextureIndex(), setTextureIndexScheme(), NL3D::CPSShockWave::updateVbColNUVForRender(), NL3D::CPSQuad::updateVbColNUVForRender(), and ~CPSTexturedParticle().
1.6.1