#include <ps_particle_basic.h>
Inheritance diagram for NL3D::CPSTexturedParticle:
Definition at line 411 of file ps_particle_basic.h.
Public Member Functions | |
CPSTexturedParticle () | |
=================================================================================== | |
void | enumTexs (std::vector< NLMISC::CSmartPtr< ITexture > > &dest) |
const ITexture * | getTexture (void) const |
ITexture * | getTexture (void) |
get the constant texture | |
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) | |
CTextureGrouped * | getTextureGroup (void) |
get the texture group used. it discard any previous single texture. (if null, there's no texture animation) | |
sint32 | getTextureIndex (void) const |
get the animated texture index. MeaningFul only if a texture group was set | |
const CPSAttribMaker< sint32 > * | getTextureIndexScheme (void) const |
get the texture scheme (null if none) const version | |
CPSAttribMaker< sint32 > * | getTextureIndexScheme (void) |
get the texture scheme (null if none) | |
void | serialTextureScheme (NLMISC::IStream &f) throw (NLMISC::EStream) |
=================================================================================== | |
void | setTexture (CSmartPtr< ITexture > tex) |
=================================================================================== | |
void | setTextureGroup (NLMISC::CSmartPtr< CTextureGrouped > texGroup) |
=================================================================================== | |
void | setTextureIndex (sint32 index) |
=================================================================================== | |
void | setTextureIndexScheme (CPSAttribMaker< sint32 > *animOrder) |
=================================================================================== | |
virtual | ~CPSTexturedParticle () |
=================================================================================== | |
Protected Member Functions | |
void | deleteTextureIndexElement (uint32 index) |
virtual CPSLocated * | getTextureIndexOwner (void)=0 |
deriver must return their owner there | |
void | newTextureIndexElement (CPSLocated *emitterLocated, uint32 emitterIndex) |
void | resizeTextureIndex (uint32 size) |
virtual void | updateMatAndVbForTexture (void)=0 |
Update the material so that it match the texture scheme. | |
Protected Attributes | |
CSmartPtr< ITexture > | _Tex |
CSmartPtr< CTextureGrouped > | _TexGroup |
sint32 | _TextureIndex |
CPSAttribMaker< sint32 > * | _TextureIndexScheme |
|
===================================================================================
Definition at line 359 of file ps_particle_basic.cpp.
00359 : _TexGroup(NULL), 00360 _TextureIndexScheme(NULL), 00361 _TextureIndex(0) 00362 { 00363 } |
|
===================================================================================
Definition at line 366 of file ps_particle_basic.cpp. References _TextureIndexScheme.
00367 { 00368 delete _TextureIndexScheme; 00369 } |
|
Definition at line 489 of file ps_particle_basic.h. References _TextureIndexScheme, NL3D::CPSAttribMaker< sint32 >::deleteElement(), NL3D::CPSAttribMaker< sint32 >::hasMemory(), index, and uint32. Referenced by NL3D::CPSShockWave::deleteElement(), and NL3D::CPSQuad::deleteElement().
00490 { 00491 if (_TextureIndexScheme && _TextureIndexScheme->hasMemory()) _TextureIndexScheme->deleteElement(index); 00492 } |
|
Definition at line 955 of file ps_particle_basic.cpp. References getTextureGroup().
00956 { 00957 if (_Tex) 00958 { 00959 dest.push_back(_Tex); 00960 } 00961 if (getTextureGroup()) 00962 { 00963 dest.push_back(getTextureGroup()); 00964 } 00965 } |
|
Definition at line 453 of file ps_particle_basic.h.
00453 { return _Tex; } |
|
get the constant texture
Definition at line 451 of file ps_particle_basic.h.
00451 { return _Tex; } |
|
get the texture group used if there's a texture scheme, const version. (if null, there's no texture animation)
Definition at line 442 of file ps_particle_basic.h. References _TexGroup.
00442 { return _TexGroup; } |
|
get the texture group used. it discard any previous single texture. (if null, there's no texture animation)
Definition at line 439 of file ps_particle_basic.h. References _TexGroup. Referenced by enumTexs().
00439 { return _TexGroup; } |
|
get the animated texture index. MeaningFul only if a texture group was set
Definition at line 433 of file ps_particle_basic.h. References _TextureIndex, and sint32.
00433 { return _TextureIndex; } |
|
deriver must return their owner there
Implemented in NL3D::CPSQuad, and NL3D::CPSShockWave. Referenced by resizeTextureIndex(), and setTextureIndexScheme(). |
|
get the texture scheme (null if none) const version
Definition at line 427 of file ps_particle_basic.h. References _TextureIndexScheme.
00427 { return _TextureIndexScheme; } |
|
get the texture scheme (null if none)
Definition at line 424 of file ps_particle_basic.h. References _TextureIndexScheme.
00424 { return _TextureIndexScheme; } |
|
Definition at line 485 of file ps_particle_basic.h. References _TextureIndexScheme, NL3D::CPSAttribMaker< sint32 >::hasMemory(), NL3D::CPSAttribMaker< sint32 >::newElement(), and uint32. Referenced by NL3D::CPSShockWave::newElement(), and NL3D::CPSQuad::newElement().
00486 { 00487 if (_TextureIndexScheme && _TextureIndexScheme->hasMemory()) _TextureIndexScheme->newElement(emitterLocated, emitterIndex); 00488 } |
|
Definition at line 493 of file ps_particle_basic.h. References _TextureIndexScheme, getTextureIndexOwner(), NL3D::CPSAttribMaker< sint32 >::hasMemory(), nlassert, NL3D::CPSAttribMaker< sint32 >::resize(), size, and uint32. Referenced by NL3D::CPSShockWave::resize(), and NL3D::CPSQuad::resize().
00494 { 00495 nlassert(size < (1 << 16)); 00496 if (_TextureIndexScheme && _TextureIndexScheme->hasMemory()) _TextureIndexScheme->resize(size, getTextureIndexOwner()->getSize() ); 00497 } |
|
===================================================================================
Definition at line 372 of file ps_particle_basic.cpp.
00373 { 00374 f.serialVersion(1); 00375 if (f.isReading()) 00376 { 00377 if (_TextureIndexScheme) 00378 { 00379 delete _TextureIndexScheme; 00380 _TextureIndexScheme = NULL; 00381 _Tex = NULL; 00382 _TexGroup = NULL; 00383 } 00384 } 00385 00386 bool useAnimatedTexture; 00387 if (!f.isReading()) 00388 { 00389 useAnimatedTexture = (_TexGroup != NULL); 00390 } 00391 f.serial(useAnimatedTexture); 00392 if (useAnimatedTexture) 00393 { 00394 if (f.isReading()) 00395 { 00396 CTextureGrouped *ptTex = NULL; 00397 f.serialPolyPtr(ptTex); 00398 _TexGroup = ptTex; 00399 } 00400 else 00401 { 00402 CTextureGrouped *ptTex = _TexGroup; 00403 f.serialPolyPtr(ptTex); 00404 } 00405 00406 bool useTextureIndexScheme = _TextureIndexScheme != NULL; 00407 f.serial(useTextureIndexScheme); 00408 if (useTextureIndexScheme) 00409 { 00410 f.serialPolyPtr(_TextureIndexScheme); 00411 _TextureIndex = 0; 00412 } 00413 else 00414 { 00415 f.serial(_TextureIndex); 00416 } 00417 } 00418 else 00419 { 00420 if (f.isReading()) 00421 { 00422 ITexture *ptTex = NULL; 00423 f.serialPolyPtr(ptTex); 00424 _Tex = ptTex; 00425 } 00426 else 00427 { 00428 ITexture *ptTex = _Tex; 00429 f.serialPolyPtr(ptTex); 00430 } 00431 } 00432 } |
|
=================================================================================== Set a constant texture for the particle This discard any previous scheme
Definition at line 349 of file ps_particle_basic.cpp. References _TexGroup, _TextureIndexScheme, and updateMatAndVbForTexture(). Referenced by NL3D::CPSQuad::CPSQuad(), and NL3D::CPSShockWave::CPSShockWave().
00350 { 00351 delete _TextureIndexScheme; 00352 _TextureIndexScheme = NULL; 00353 _Tex = tex; 00354 _TexGroup = NULL; // release any grouped texture if one was set before 00355 updateMatAndVbForTexture(); 00356 } |
|
===================================================================================
Definition at line 337 of file ps_particle_basic.cpp. References _TexGroup, nlassert, and updateMatAndVbForTexture().
00338 { 00339 nlassert(texGroup); 00340 if (_Tex) 00341 { 00342 _Tex = NULL; 00343 } 00344 _TexGroup = texGroup; 00345 updateMatAndVbForTexture(); 00346 } |
|
===================================================================================
Definition at line 329 of file ps_particle_basic.cpp. References _TextureIndex, _TextureIndexScheme, index, and sint32.
00330 { 00331 delete _TextureIndexScheme; 00332 _TextureIndexScheme = NULL; 00333 _TextureIndex = index; 00334 } |
|
=================================================================================== 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 316 of file ps_particle_basic.cpp. References _TexGroup, _TextureIndexScheme, getTextureIndexOwner(), nlassert, NL3D::CPSAttribMaker< T >::resize(), and updateMatAndVbForTexture().
00317 { 00318 nlassert(animOrder); 00319 nlassert(_TexGroup); // setTextureGroup must have been called before this 00320 delete _TextureIndexScheme; 00321 _TextureIndexScheme = animOrder; 00322 if (getTextureIndexOwner() && animOrder->hasMemory()) animOrder->resize(getTextureIndexOwner()->getMaxSize(), getTextureIndexOwner()->getSize()); 00323 00324 00325 updateMatAndVbForTexture(); 00326 } |
|
Update the material so that it match the texture scheme.
Implemented in NL3D::CPSQuad, and NL3D::CPSShockWave. Referenced by setTexture(), setTextureGroup(), and setTextureIndexScheme(). |
|
Definition at line 472 of file ps_particle_basic.h. Referenced by NL3D::CPSFaceHelper::drawFaces(). |
|
Definition at line 475 of file ps_particle_basic.h. Referenced by getTextureGroup(), setTexture(), setTextureGroup(), and setTextureIndexScheme(). |
|
Definition at line 480 of file ps_particle_basic.h. Referenced by getTextureIndex(), and setTextureIndex(). |
|
Definition at line 477 of file ps_particle_basic.h. Referenced by deleteTextureIndexElement(), getTextureIndexScheme(), newTextureIndexElement(), resizeTextureIndex(), setTexture(), setTextureIndex(), setTextureIndexScheme(), and ~CPSTexturedParticle(). |