#include <ps_shockwave.h>
Inherits NL3D::CPSParticle, NL3D::CPSSizedParticle, NL3D::CPSColoredParticle, NL3D::CPSTexturedParticle, NL3D::CPSRotated3DPlaneParticle, NL3D::CPSRotated2DParticle, and NL3D::CPSMaterial.
Public Member Functions | |
| CPSShockWave (uint nbSeg=9, float radiusCut=0.8f, CSmartPtr< ITexture > tex=NULL) | |
| ctor | |
| void | setNbSegs (uint nbSeg) |
| set a new number of seg (mus be >= 3 and <= 64) | |
| uint | getNbSegs (void) const |
| retrieve the number of segs | |
| void | setRadiusCut (float aRatio) |
| set a new radius cut | |
| float | getRadiusCut (void) const |
| get the radius ratio | |
| virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
| serialisation. Derivers must override this, and call their parent version | |
| NLMISC_DECLARE_CLASS (CPSShockWave) | |
| virtual bool | completeBBox (NLMISC::CAABBox &box) const |
| complete the bbox depending on the size of particles | |
| virtual bool | hasTransparentFaces (void) |
| return true if there are transparent faces in the object | |
| virtual bool | hasOpaqueFaces (void) |
| return true if there are Opaque faces in the object | |
| virtual uint32 | getNumWantedTris () const |
| return the max number of faces needed for display. This is needed for LOD balancing | |
| void | setUFactor (float value) |
| set the U factor for textures | |
| float | getUFactor (void) const |
| get the U factor for textures | |
| virtual bool | hasLightableFaces () |
| from CPSParticle : return true if there are lightable faces in the object | |
| virtual bool | supportGlobalColorLighting () const |
| virtual void | enumTexs (std::vector< NLMISC::CSmartPtr< ITexture > > &dest, IDriver &drv) |
| ================================================================================= | |
| virtual void | setZBias (float value) |
| virtual float | getZBias () const |
Protected Member Functions | |
| void | updateVbColNUVForRender (uint32 startIndex, uint32 size, uint32 srcStep, CVertexBuffer &vb, IDriver &drv) |
| calculate current color and texture coordinate before any rendering size can't be higher that shockWaveBufSize . | |
| virtual void | updateMatAndVbForColor (void) |
| update the material and the vb so that they match the color scheme. Inherited from CPSColoredParticle | |
| virtual void | updateMatAndVbForTexture (void) |
| update the material and the vb so that they match the texture scheme. | |
| virtual void | newElement (const CPSEmitterInfo &info) |
| Generate a new element for this bindable. | |
| virtual void | deleteElement (uint32 index) |
| Delete an element given its index Attributes of the located that hold this bindable are still accessible for the index given index out of range -> nl_assert. | |
| virtual void | resize (uint32 size) |
| Resize the bindable attributes containers. | |
| virtual CPSLocated * | getColorOwner (void) |
| deriver must return their owner there | |
| virtual CPSLocated * | getSizeOwner (void) |
| deriver must return their owner there | |
| virtual CPSLocated * | getAngle2DOwner (void) |
| deriver must return their owner there | |
| virtual CPSLocated * | getPlaneBasisOwner (void) |
| if this is false, constant size will be used instead of a scheme | |
| virtual CPSLocated * | getTextureIndexOwner (void) |
| deriver must return their owner there | |
Private Types | |
| typedef CHashMap< uint, CVertexBuffer > | TVBMap |
| typedef CHashMap< uint, CIndexBuffer > | TPBMap |
Private Member Functions | |
| void | getVBnPB (CVertexBuffer *&vb, CIndexBuffer *&pb) |
| ================================================================================= | |
| uint | getNumShockWavesInVB () const |
| ================================================================================= | |
| void | setupUFactor () |
| ================================================================================= | |
| virtual void | draw (bool opaque) |
| ================================================================================= | |
| virtual void | init (void) |
| initialisations | |
Private Attributes | |
| uint32 | _NbSeg |
| float | _RadiusCut |
| float | _UFactor |
Static Private Attributes | |
| static TPBMap | _PBMap |
| static TVBMap | _VBMap |
| static TVBMap | _AnimTexVBMap |
| static TVBMap | _ColoredVBMap |
| static TVBMap | _ColoredAnimTexVBMap |
Friends | |
| class | CPSShockWaveHelper |
Definition at line 34 of file ps_shockwave.h.
typedef CHashMap<uint, CIndexBuffer> NL3D::CPSShockWave::TPBMap [private] |
Definition at line 135 of file ps_shockwave.h.
typedef CHashMap<uint, CVertexBuffer> NL3D::CPSShockWave::TVBMap [private] |
Definition at line 134 of file ps_shockwave.h.
| NL3D::CPSShockWave::CPSShockWave | ( | uint | nbSeg = 9, |
|
| float | radiusCut = 0.8f, |
|||
| CSmartPtr< ITexture > | tex = NULL | |||
| ) |
ctor
=================================================================================
| nbSeg | : number of seg for the circonference of the shockwave. must be >= 3 and <= 64. | |
| radiusCut | : indicate how much to subtract to the outter radius to get the inner radius | |
| tex | : the texture that must be applied to the shockwave |
Definition at line 198 of file ps_shockwave.cpp.
References NL3D::CPSLocatedBindable::_Name, NL3D::CParticleSystem::getSerializeIdentifierFlag(), init(), NL_PS_FUNC, nlassert, and NL3D::CPSTexturedParticle::setTexture().
| bool NL3D::CPSShockWave::completeBBox | ( | NLMISC::CAABBox & | box | ) | const [virtual] |
complete the bbox depending on the size of particles
=================================================================================
Reimplemented from NL3D::CPSLocatedBindable.
Definition at line 388 of file ps_shockwave.cpp.
References NL_PS_FUNC.
| void NL3D::CPSShockWave::deleteElement | ( | uint32 | index | ) | [protected, virtual] |
Delete an element given its index Attributes of the located that hold this bindable are still accessible for the index given index out of range -> nl_assert.
=================================================================================
Implements NL3D::CPSParticle.
Definition at line 488 of file ps_shockwave.cpp.
References NL3D::CPSRotated2DParticle::deleteAngle2DElement(), NL3D::CPSColoredParticle::deleteColorElement(), NL3D::CPSSizedParticle::deleteSizeElement(), NL3D::CPSTexturedParticle::deleteTextureIndexElement(), and NL_PS_FUNC.
| void NL3D::CPSShockWave::draw | ( | bool | opaque | ) | [private, virtual] |
=================================================================================
update the material if the global color of the system is variable
update the material if the global color of the system is variable
Reimplemented from NL3D::CPSParticle.
Definition at line 308 of file ps_shockwave.cpp.
References NL3D::CPSColoredParticle::_Color, NL3D::CPSColoredParticle::_ColorScheme, NL3D::CPSMaterial::_Mat, NL3D::CPSLocatedBindable::_Owner, NL3D::CPSAttrib< T >::begin(), NL3D::CPSParticle::computeSrcStep(), NL3D::CPSShockWaveHelper::drawShockWave(), NL3D::CPSMaterial::forceModulateConstantColor(), NL3D::CParticleSystem::getColorAttenuationScheme(), NL3D::CParticleSystem::getForceGlobalColorLightingFlag(), NL3D::CParticleSystem::getGlobalColor(), NL3D::CParticleSystem::getGlobalColorLighted(), NL3D::CParticleSystemProcess::getOwner(), NL3D::CPSLocated::getPos(), NL3D::CPSLocated::getSize(), NL3D::CParticleSystem::isUserColorUsed(), NLMISC::CRGBA::modulateFromColor(), NL_PS_FUNC, PARTICLES_CHECK_MEM, NL3D::CMaterial::setColor(), setupUFactor(), NL3D::CPSParticle::step(), and NL3D::CPSParticle::usesGlobalColorLighting().
| void NL3D::CPSShockWave::enumTexs | ( | std::vector< NLMISC::CSmartPtr< ITexture > > & | dest, | |
| IDriver & | drv | |||
| ) | [virtual] |
=================================================================================
Reimplemented from NL3D::CPSLocatedBindable.
Definition at line 575 of file ps_shockwave.cpp.
References NL_PS_FUNC.
| virtual CPSLocated* NL3D::CPSShockWave::getAngle2DOwner | ( | void | ) | [inline, protected, virtual] |
deriver must return their owner there
Implements NL3D::CPSRotated2DParticle.
Definition at line 129 of file ps_shockwave.h.
References NL3D::CPSLocatedBindable::_Owner.
| virtual CPSLocated* NL3D::CPSShockWave::getColorOwner | ( | void | ) | [inline, protected, virtual] |
deriver must return their owner there
Implements NL3D::CPSColoredParticle.
Definition at line 127 of file ps_shockwave.h.
References NL3D::CPSLocatedBindable::_Owner.
| uint NL3D::CPSShockWave::getNbSegs | ( | void | ) | const [inline] |
| uint NL3D::CPSShockWave::getNumShockWavesInVB | ( | ) | const [private] |
=================================================================================
Definition at line 567 of file ps_shockwave.cpp.
References _NbSeg, NL_PS_FUNC, and NL3D::NumVertsInBuffer.
Referenced by NL3D::CPSShockWaveHelper::drawShockWave(), and getVBnPB().
| uint32 NL3D::CPSShockWave::getNumWantedTris | ( | ) | const [virtual] |
return the max number of faces needed for display. This is needed for LOD balancing
=================================================================================
Implements NL3D::CPSParticle.
Definition at line 212 of file ps_shockwave.cpp.
References _NbSeg, NL3D::CPSLocatedBindable::_Owner, NL3D::CPSLocated::getSize(), NL_PS_FUNC, and nlassert.
| virtual CPSLocated* NL3D::CPSShockWave::getPlaneBasisOwner | ( | void | ) | [inline, protected, virtual] |
if this is false, constant size will be used instead of a scheme
deriver must return their owner there
Implements NL3D::CPSRotated3DPlaneParticle.
Definition at line 130 of file ps_shockwave.h.
References NL3D::CPSLocatedBindable::_Owner.
| float NL3D::CPSShockWave::getRadiusCut | ( | void | ) | const [inline] |
| virtual CPSLocated* NL3D::CPSShockWave::getSizeOwner | ( | void | ) | [inline, protected, virtual] |
deriver must return their owner there
Implements NL3D::CPSSizedParticle.
Definition at line 128 of file ps_shockwave.h.
References NL3D::CPSLocatedBindable::_Owner.
| virtual CPSLocated* NL3D::CPSShockWave::getTextureIndexOwner | ( | void | ) | [inline, protected, virtual] |
deriver must return their owner there
Implements NL3D::CPSTexturedParticle.
Definition at line 131 of file ps_shockwave.h.
References NL3D::CPSLocatedBindable::_Owner.
| float NL3D::CPSShockWave::getUFactor | ( | void | ) | const [inline] |
| void NL3D::CPSShockWave::getVBnPB | ( | CVertexBuffer *& | vb, | |
| CIndexBuffer *& | pb | |||
| ) | [private] |
=================================================================================
Definition at line 509 of file ps_shockwave.cpp.
References _AnimTexVBMap, _ColoredAnimTexVBMap, _ColoredVBMap, NL3D::CPSColoredParticle::_ColorScheme, _NbSeg, _PBMap, NL3D::CPSTexturedParticle::_TexGroup, _VBMap, NL3D::CVertexBuffer::AGPVolatile, getNumShockWavesInVB(), NL3D::CIndexBuffer::lock(), NL3D::CVertexBuffer::lock(), NL_DEFAULT_INDEX_BUFFER_FORMAT, NL_PS_FUNC, NL_SET_IB_NAME, nlassert, NL3D::CVertexBuffer::PositionFlag, NL3D::CVertexBuffer::PrimaryColorFlag, NL3D::CIndexBuffer::setFormat(), NL3D::CVertexBuffer::setName(), NL3D::CIndexBuffer::setNumIndexes(), NL3D::CVertexBuffer::setNumVertices(), NL3D::CVertexBuffer::setPreferredMemory(), NL3D::CVertexBufferReadWrite::setTexCoord(), NL3D::CIndexBufferReadWrite::setTri(), NL3D::CVertexBuffer::setVertexFormat(), and NL3D::CVertexBuffer::TexCoord0Flag.
Referenced by NL3D::CPSShockWaveHelper::drawShockWave().
| virtual float NL3D::CPSShockWave::getZBias | ( | void | ) | const [inline, virtual] |
Implements NL3D::CPSParticle.
Definition at line 97 of file ps_shockwave.h.
| virtual bool NL3D::CPSShockWave::hasLightableFaces | ( | ) | [inline, virtual] |
from CPSParticle : return true if there are lightable faces in the object
Implements NL3D::CPSParticle.
Definition at line 87 of file ps_shockwave.h.
| bool NL3D::CPSShockWave::hasOpaqueFaces | ( | void | ) | [virtual] |
return true if there are Opaque faces in the object
=================================================================================
Implements NL3D::CPSParticle.
Definition at line 228 of file ps_shockwave.cpp.
References hasTransparentFaces(), and NL_PS_FUNC.
| bool NL3D::CPSShockWave::hasTransparentFaces | ( | void | ) | [virtual] |
return true if there are transparent faces in the object
=================================================================================
Implements NL3D::CPSParticle.
Definition at line 221 of file ps_shockwave.cpp.
References NL3D::CPSMaterial::alphaTest, NL3D::CPSMaterial::getBlendingMode(), and NL_PS_FUNC.
Referenced by hasOpaqueFaces().
| void NL3D::CPSShockWave::init | ( | void | ) | [private, virtual] |
initialisations
=================================================================================
Definition at line 396 of file ps_shockwave.cpp.
References NL3D::CPSMaterial::_Mat, NL3D::CMaterial::less, NL_PS_FUNC, NL3D::CMaterial::setDoubleSided(), NL3D::CMaterial::setLighting(), NL3D::CMaterial::setZFunc(), updateMatAndVbForColor(), and updateMatAndVbForTexture().
Referenced by CPSShockWave().
| void NL3D::CPSShockWave::newElement | ( | const CPSEmitterInfo & | info | ) | [protected, virtual] |
Generate a new element for this bindable.
=================================================================================
They are generated according to the properties of the class
Implements NL3D::CPSParticle.
Definition at line 478 of file ps_shockwave.cpp.
References NL3D::CPSRotated2DParticle::newAngle2DElement(), NL3D::CPSColoredParticle::newColorElement(), NL3D::CPSSizedParticle::newSizeElement(), NL3D::CPSTexturedParticle::newTextureIndexElement(), and NL_PS_FUNC.
| NL3D::CPSShockWave::NLMISC_DECLARE_CLASS | ( | CPSShockWave | ) |
| void NL3D::CPSShockWave::resize | ( | uint32 | size | ) | [protected, virtual] |
Resize the bindable attributes containers.
=================================================================================
Size is the max number of element to be contained. DERIVERS MUST CALL THEIR PARENT VERSION should not be called directly. Call CPSLocated::resize instead
Implements NL3D::CPSParticle.
Definition at line 498 of file ps_shockwave.cpp.
References NL_PS_FUNC, nlassert, NL3D::CPSRotated2DParticle::resizeAngle2D(), NL3D::CPSColoredParticle::resizeColor(), NL3D::CPSSizedParticle::resizeSize(), and NL3D::CPSTexturedParticle::resizeTextureIndex().
Referenced by setNbSegs(), setRadiusCut(), setUFactor(), and updateMatAndVbForColor().
| void NL3D::CPSShockWave::serial | ( | NLMISC::IStream & | f | ) | throw (NLMISC::EStream) [virtual] |
serialisation. Derivers must override this, and call their parent version
=================================================================================
Reimplemented from NL3D::CPSParticle.
Definition at line 268 of file ps_shockwave.cpp.
References NL_PS_FUNC, NL3D::CPSParticle::serial(), NL3D::CPSRotated2DParticle::serialAngle2DScheme(), NL3D::CPSColoredParticle::serialColorScheme(), NL3D::CPSRotated3DPlaneParticle::serialPlaneBasisScheme(), NL3D::CPSSizedParticle::serialSizeScheme(), and NL3D::CPSTexturedParticle::serialTextureScheme().
| void NL3D::CPSShockWave::setNbSegs | ( | uint | nbSeg | ) |
set a new number of seg (mus be >= 3 and <= 64)
=================================================================================
Definition at line 235 of file ps_shockwave.cpp.
References _NbSeg, NL3D::CPSLocatedBindable::_Owner, NL3D::CPSLocated::getMaxSize(), NL_PS_FUNC, nlassert, and resize().
| void NL3D::CPSShockWave::setRadiusCut | ( | float | aRatio | ) |
set a new radius cut
=================================================================================
Definition at line 248 of file ps_shockwave.cpp.
References NL3D::CPSLocatedBindable::_Owner, _RadiusCut, NL3D::CPSLocated::getMaxSize(), NL_PS_FUNC, and resize().
| void NL3D::CPSShockWave::setUFactor | ( | float | value | ) |
set the U factor for textures
=================================================================================
Definition at line 259 of file ps_shockwave.cpp.
References NL3D::CPSLocatedBindable::_Owner, _UFactor, NL3D::CPSLocated::getSize(), NL_PS_FUNC, nlassert, and resize().
| void NL3D::CPSShockWave::setupUFactor | ( | ) | [inline, private] |
=================================================================================
Definition at line 288 of file ps_shockwave.cpp.
References NL3D::CPSMaterial::_Mat, _UFactor, NL3D::CMaterial::enableUserTexMat(), NLMISC::CVector::I, NLMISC::CVector::J, NLMISC::CVector::K, NL_PS_FUNC, NLMISC::CMatrix::setRot(), and NL3D::CMaterial::setUserTexMat().
Referenced by draw().
| virtual void NL3D::CPSShockWave::setZBias | ( | float | value | ) | [inline, virtual] |
Implements NL3D::CPSParticle.
Definition at line 96 of file ps_shockwave.h.
| virtual bool NL3D::CPSShockWave::supportGlobalColorLighting | ( | ) | const [inline, virtual] |
Implements NL3D::CPSParticle.
Definition at line 90 of file ps_shockwave.h.
| void NL3D::CPSShockWave::updateMatAndVbForColor | ( | void | ) | [protected, virtual] |
update the material and the vb so that they match the color scheme. Inherited from CPSColoredParticle
=================================================================================
Implements NL3D::CPSColoredParticle.
Definition at line 461 of file ps_shockwave.cpp.
References NL3D::CPSLocatedBindable::_Owner, NL3D::CPSLocated::getMaxSize(), NL_PS_FUNC, and resize().
Referenced by init().
| void NL3D::CPSShockWave::updateMatAndVbForTexture | ( | void | ) | [protected, virtual] |
update the material and the vb so that they match the texture scheme.
=================================================================================
Implements NL3D::CPSTexturedParticle.
Definition at line 471 of file ps_shockwave.cpp.
References NL3D::CPSMaterial::_Mat, NL3D::CPSTexturedParticle::_Tex, NL3D::CPSTexturedParticle::_TexGroup, NL_PS_FUNC, and NL3D::CMaterial::setTexture().
Referenced by init().
| void NL3D::CPSShockWave::updateVbColNUVForRender | ( | uint32 | startIndex, | |
| uint32 | size, | |||
| uint32 | srcStep, | |||
| CVertexBuffer & | vb, | |||
| IDriver & | drv | |||
| ) | [protected] |
calculate current color and texture coordinate before any rendering size can't be higher that shockWaveBufSize .
=================================================================================
..
Definition at line 407 of file ps_shockwave.cpp.
References NL3D::CPSColoredParticle::_ColorScheme, _NbSeg, NL3D::CPSLocatedBindable::_Owner, NL3D::CPSTexturedParticle::_TexGroup, NL3D::CPSTexturedParticle::_TextureIndex, NL3D::CPSTexturedParticle::_TextureIndexScheme, _UFactor, NL3D::CVertexBufferReadWrite::getColorPointer(), NL3D::CVertexBufferReadWrite::getTexCoordPointer(), NL3D::CVertexBuffer::getVertexSize(), NL3D::CVertexBuffer::lock(), NL3D::CPSAttribMaker< T >::make(), NL3D::CPSAttribMaker< T >::makeN(), NL_PS_FUNC, nlassert, NL3D::ShockWaveBufSize, NL3D::CTextureGrouped::TFourUV::uv0, and NL3D::CTextureGrouped::TFourUV::uv3.
Referenced by NL3D::CPSShockWaveHelper::drawShockWave().
friend class CPSShockWaveHelper [friend] |
Definition at line 149 of file ps_shockwave.h.
CPSShockWave::TVBMap NL3D::CPSShockWave::_AnimTexVBMap [static, private] |
Definition at line 139 of file ps_shockwave.h.
Referenced by getVBnPB().
CPSShockWave::TVBMap NL3D::CPSShockWave::_ColoredAnimTexVBMap [static, private] |
Definition at line 141 of file ps_shockwave.h.
Referenced by getVBnPB().
CPSShockWave::TVBMap NL3D::CPSShockWave::_ColoredVBMap [static, private] |
Definition at line 140 of file ps_shockwave.h.
Referenced by getVBnPB().
uint32 NL3D::CPSShockWave::_NbSeg [private] |
Definition at line 143 of file ps_shockwave.h.
Referenced by NL3D::CPSShockWaveHelper::drawShockWave(), getNbSegs(), getNumShockWavesInVB(), getNumWantedTris(), getVBnPB(), setNbSegs(), and updateVbColNUVForRender().
CPSShockWave::TPBMap NL3D::CPSShockWave::_PBMap [static, private] |
Definition at line 137 of file ps_shockwave.h.
Referenced by getVBnPB().
float NL3D::CPSShockWave::_RadiusCut [private] |
Definition at line 145 of file ps_shockwave.h.
Referenced by NL3D::CPSShockWaveHelper::drawShockWave(), getRadiusCut(), and setRadiusCut().
float NL3D::CPSShockWave::_UFactor [private] |
Definition at line 147 of file ps_shockwave.h.
Referenced by getUFactor(), setUFactor(), setupUFactor(), and updateVbColNUVForRender().
CPSShockWave::TVBMap NL3D::CPSShockWave::_VBMap [static, private] |
Definition at line 138 of file ps_shockwave.h.
Referenced by getVBnPB().
1.6.1