NL3D::CPSShockWave Class Reference

#include <ps_shockwave.h>

Inherits NL3D::CPSParticle, NL3D::CPSSizedParticle, NL3D::CPSColoredParticle, NL3D::CPSTexturedParticle, NL3D::CPSRotated3DPlaneParticle, NL3D::CPSRotated2DParticle, and NL3D::CPSMaterial.

List of all members.

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 CPSLocatedgetColorOwner (void)
 deriver must return their owner there
virtual CPSLocatedgetSizeOwner (void)
 deriver must return their owner there
virtual CPSLocatedgetAngle2DOwner (void)
 deriver must return their owner there
virtual CPSLocatedgetPlaneBasisOwner (void)
 if this is false, constant size will be used instead of a scheme
virtual CPSLocatedgetTextureIndexOwner (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

Detailed Description

Definition at line 34 of file ps_shockwave.h.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

NL3D::CPSShockWave::CPSShockWave ( uint  nbSeg = 9,
float  radiusCut = 0.8f,
CSmartPtr< ITexture tex = NULL 
)

ctor

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

Parameters:
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().


Member Function Documentation

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]
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]

retrieve the number of segs

Definition at line 53 of file ps_shockwave.h.

References _NbSeg.

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]

get the radius ratio

Definition at line 61 of file ps_shockwave.h.

References _RadiusCut.

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]

get the U factor for textures

Definition at line 84 of file ps_shockwave.h.

References _UFactor.

void NL3D::CPSShockWave::getVBnPB ( CVertexBuffer *&  vb,
CIndexBuffer *&  pb 
) [private]
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)

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

See also:
CPSShockWave()

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

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

See also:
CPSShockWave()

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]

Friends And Related Function Documentation

friend class CPSShockWaveHelper [friend]

Definition at line 149 of file ps_shockwave.h.


Member Data Documentation

Definition at line 139 of file ps_shockwave.h.

Referenced by getVBnPB().

Definition at line 141 of file ps_shockwave.h.

Referenced by getVBnPB().

Definition at line 140 of file ps_shockwave.h.

Referenced by getVBnPB().

Definition at line 137 of file ps_shockwave.h.

Referenced by getVBnPB().

Definition at line 147 of file ps_shockwave.h.

Referenced by getUFactor(), setUFactor(), setupUFactor(), and updateVbColNUVForRender().

Definition at line 138 of file ps_shockwave.h.

Referenced by getVBnPB().


The documentation for this class was generated from the following files:

Generated on Thu Jan 7 08:30:10 2010 for NeL by  doxygen 1.6.1