NL3D::CPSFanLight Class Reference

A fan light particle. More...

#include <ps_fan_light.h>

Inherits NL3D::CPSParticle, NL3D::CPSColoredParticle, NL3D::CPSSizedParticle, NL3D::CPSRotated2DParticle, NL3D::CPSMaterial, and NL3D::CPSTexturedParticleNoAnim.

List of all members.

Public Member Functions

 NLMISC_DECLARE_CLASS (CPSFanLight)
virtual bool completeBBox (NLMISC::CAABBox &box) const
 ====================================================================================
void setNbFans (uint32 nbFans)
 ====================================================================================
void setPhaseSmoothness (uint32 smoothNess)
 Set the smoothness of phases.
uint32 getPhaseSmoothness (void) const
 retrieve the phase smoothness
void setMoveIntensity (float intensity)
 set the intensity of fan movement. Default is 1.5
float getMoveIntensity (void) const
 get the intensity of fans movement
uint32 getNbFans (void) const
void setPhaseSpeed (float multiplier)
 Set the speed for phase If the located holding this particle as a limited lifetime, it gives how many 0-2Pi cycle it'll do during its life Otherwise it gives how many cycle there are in a second.
float getPhaseSpeed (void) const
 get the speed for phase
virtual void updateMatAndVbForColor (void)
 ====================================================================================
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 setTexture (CSmartPtr< ITexture > tex)
 Set a texture. NULL remove it.
ITexturegetTexture (void)
 get the texture used
const ITexturegetTexture (void) const
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
Object



 CPSFanLight (uint32 nbFans=7)
 Ctor, with the numbers of fans to draw (minimum is 3, maximum is 128).
 ~CPSFanLight ()
 Dtor.
void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 ====================================================================================

Static Public Member Functions

static void initFanLightPrecalc (void)
 must call this at least if you intend to use fanlight

Protected Member Functions

void newElement (const CPSEmitterInfo &info)
 ====================================================================================
void deleteElement (uint32)
 ====================================================================================
virtual void resize (uint32 size)
 ====================================================================================
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

Private Types

typedef CHashMap< uint,
CVertexBuffer
TVBMap
typedef CHashMap< uint,
CIndexBuffer
TIBMap

Private Member Functions

virtual void init (void)
 initialisations
virtual void draw (bool opaque)
 ====================================================================================
void getVBnIB (CVertexBuffer *&vb, CIndexBuffer *&ib)
 ====================================================================================
uint getNumFanlightsInVB () const
 ====================================================================================
void setupMaterial ()
 ====================================================================================

Private Attributes

uint32 _NbFans
uint32 _PhaseSmoothness
float _MoveIntensity
NLMISC::CSmartPtr< ITexture_Tex
float _PhaseSpeed

Static Private Attributes

static uint8 _RandomPhaseTab [32][128]
static TVBMap _VBMap
static TVBMap _TexVBMap
static TVBMap _ColoredVBMap
static TVBMap _ColoredTexVBMap
static TIBMap _IBMap
static bool _RandomPhaseTabInitialized = false

Friends

class CPSFanLightHelper

Detailed Description

A fan light particle.

Definition at line 44 of file ps_fan_light.h.


Member Typedef Documentation

typedef CHashMap<uint, CIndexBuffer > NL3D::CPSFanLight::TIBMap [private]

Definition at line 152 of file ps_fan_light.h.

typedef CHashMap<uint, CVertexBuffer> NL3D::CPSFanLight::TVBMap [private]

Definition at line 151 of file ps_fan_light.h.


Constructor & Destructor Documentation

NL3D::CPSFanLight::CPSFanLight ( uint32  nbFans = 7  ) 

Ctor, with the numbers of fans to draw (minimum is 3, maximum is 128).

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

Definition at line 432 of file ps_fan_light.cpp.

References NL3D::CPSLocatedBindable::_Name, NL3D::CParticleSystem::getSerializeIdentifierFlag(), init(), NL_PS_FUNC, and nlassert.

NL3D::CPSFanLight::~CPSFanLight (  ) 

Dtor.

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

Definition at line 448 of file ps_fan_light.cpp.

References NL_PS_FUNC.


Member Function Documentation

bool NL3D::CPSFanLight::completeBBox ( NLMISC::CAABBox box  )  const [virtual]

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

Reimplemented from NL3D::CPSLocatedBindable.

Definition at line 423 of file ps_fan_light.cpp.

References NL_PS_FUNC.

void NL3D::CPSFanLight::deleteElement ( uint32  index  )  [protected, virtual]

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

Implements NL3D::CPSParticle.

Definition at line 295 of file ps_fan_light.cpp.

References NL3D::CPSRotated2DParticle::deleteAngle2DElement(), NL3D::CPSColoredParticle::deleteColorElement(), NL3D::CPSSizedParticle::deleteSizeElement(), and NL_PS_FUNC.

void NL3D::CPSFanLight::draw ( bool  opaque  )  [private, virtual]
void NL3D::CPSFanLight::enumTexs ( std::vector< NLMISC::CSmartPtr< ITexture > > &  dest,
IDriver drv 
) [virtual]

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

Reimplemented from NL3D::CPSLocatedBindable.

Definition at line 595 of file ps_fan_light.cpp.

References _Tex, and NL_PS_FUNC.

virtual CPSLocated* NL3D::CPSFanLight::getAngle2DOwner ( void   )  [inline, protected, virtual]

deriver must return their owner there

Implements NL3D::CPSRotated2DParticle.

Definition at line 148 of file ps_fan_light.h.

References NL3D::CPSLocatedBindable::_Owner.

virtual CPSLocated* NL3D::CPSFanLight::getColorOwner ( void   )  [inline, protected, virtual]

deriver must return their owner there

Implements NL3D::CPSColoredParticle.

Definition at line 146 of file ps_fan_light.h.

References NL3D::CPSLocatedBindable::_Owner.

float NL3D::CPSFanLight::getMoveIntensity ( void   )  const [inline]

get the intensity of fans movement

Definition at line 80 of file ps_fan_light.h.

References _MoveIntensity.

uint32 NL3D::CPSFanLight::getNbFans ( void   )  const [inline]

Definition at line 83 of file ps_fan_light.h.

References _NbFans.

uint NL3D::CPSFanLight::getNumFanlightsInVB (  )  const [private]

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

Definition at line 587 of file ps_fan_light.cpp.

References _NbFans, NL_PS_FUNC, and NL3D::NumVertsInBuffer.

Referenced by NL3D::CPSFanLightHelper::drawFanLight(), and getVBnIB().

uint32 NL3D::CPSFanLight::getNumWantedTris (  )  const [virtual]

return the max number of faces needed for display. This is needed for LOD balancing

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

Implements NL3D::CPSParticle.

Definition at line 263 of file ps_fan_light.cpp.

References _NbFans, NL3D::CPSLocatedBindable::_Owner, NL3D::CPSLocated::getSize(), NL_PS_FUNC, and nlassert.

uint32 NL3D::CPSFanLight::getPhaseSmoothness ( void   )  const [inline]

retrieve the phase smoothness

Definition at line 74 of file ps_fan_light.h.

References _PhaseSmoothness.

float NL3D::CPSFanLight::getPhaseSpeed ( void   )  const [inline]

get the speed for phase

Definition at line 95 of file ps_fan_light.h.

References _PhaseSpeed.

virtual CPSLocated* NL3D::CPSFanLight::getSizeOwner ( void   )  [inline, protected, virtual]

deriver must return their owner there

Implements NL3D::CPSSizedParticle.

Definition at line 147 of file ps_fan_light.h.

References NL3D::CPSLocatedBindable::_Owner.

const ITexture* NL3D::CPSFanLight::getTexture ( void   )  const [inline, virtual]

Implements NL3D::CPSTexturedParticleNoAnim.

Definition at line 125 of file ps_fan_light.h.

References _Tex.

ITexture* NL3D::CPSFanLight::getTexture ( void   )  [inline, virtual]

get the texture used

Implements NL3D::CPSTexturedParticleNoAnim.

Definition at line 121 of file ps_fan_light.h.

References _Tex.

void NL3D::CPSFanLight::getVBnIB ( CVertexBuffer *&  vb,
CIndexBuffer *&  ib 
) [private]
virtual float NL3D::CPSFanLight::getZBias ( void   )  const [inline, virtual]

Implements NL3D::CPSParticle.

Definition at line 140 of file ps_fan_light.h.

virtual bool NL3D::CPSFanLight::hasLightableFaces (  )  [inline, virtual]

from CPSParticle : return true if there are lightable faces in the object

Implements NL3D::CPSParticle.

Definition at line 131 of file ps_fan_light.h.

bool NL3D::CPSFanLight::hasOpaqueFaces ( void   )  [virtual]

return true if there are Opaque faces in the object

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

Implements NL3D::CPSParticle.

Definition at line 279 of file ps_fan_light.cpp.

References hasTransparentFaces(), and NL_PS_FUNC.

bool NL3D::CPSFanLight::hasTransparentFaces ( void   )  [virtual]

return true if there are transparent faces in the object

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

Implements NL3D::CPSParticle.

Definition at line 272 of file ps_fan_light.cpp.

References NL3D::CPSMaterial::alphaTest, NL3D::CPSMaterial::getBlendingMode(), and NL_PS_FUNC.

Referenced by hasOpaqueFaces().

void NL3D::CPSFanLight::init ( void   )  [private, virtual]

initialisations

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

Definition at line 475 of file ps_fan_light.cpp.

References NL3D::CPSMaterial::_Mat, NL3D::CMaterial::less, NL_PS_FUNC, NL3D::CMaterial::setColor(), NL3D::CMaterial::setDoubleSided(), NL3D::CMaterial::setLighting(), NL3D::CMaterial::setZFunc(), updateMatAndVbForColor(), and NLMISC::CRGBA::White.

Referenced by CPSFanLight().

void NL3D::CPSFanLight::initFanLightPrecalc ( void   )  [static]

must call this at least if you intend to use fanlight

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

Definition at line 231 of file ps_fan_light.cpp.

References _RandomPhaseTab, _RandomPhaseTabInitialized, NL3D::BlurBytesTab(), and NL_PS_FUNC.

Referenced by NL3D::CPSUtil::registerParticles().

void NL3D::CPSFanLight::newElement ( const CPSEmitterInfo info  )  [protected, virtual]

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

Implements NL3D::CPSParticle.

Definition at line 286 of file ps_fan_light.cpp.

References NL3D::CPSRotated2DParticle::newAngle2DElement(), NL3D::CPSColoredParticle::newColorElement(), NL3D::CPSSizedParticle::newSizeElement(), and NL_PS_FUNC.

NL3D::CPSFanLight::NLMISC_DECLARE_CLASS ( CPSFanLight   ) 
void NL3D::CPSFanLight::resize ( uint32  size  )  [protected, virtual]

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

Implements NL3D::CPSParticle.

Definition at line 464 of file ps_fan_light.cpp.

References NL_PS_FUNC, nlassert, NL3D::CPSRotated2DParticle::resizeAngle2D(), NL3D::CPSColoredParticle::resizeColor(), and NL3D::CPSSizedParticle::resizeSize().

Referenced by setNbFans().

void NL3D::CPSFanLight::serial ( NLMISC::IStream f  )  throw (NLMISC::EStream) [virtual]

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

Reimplemented from NL3D::CPSParticle.

Definition at line 399 of file ps_fan_light.cpp.

References NL_PS_FUNC, NL3D::CPSParticle::serial(), NL3D::CPSRotated2DParticle::serialAngle2DScheme(), NL3D::CPSColoredParticle::serialColorScheme(), and NL3D::CPSSizedParticle::serialSizeScheme().

void NL3D::CPSFanLight::setMoveIntensity ( float  intensity  )  [inline]

set the intensity of fan movement. Default is 1.5

Definition at line 77 of file ps_fan_light.h.

References _MoveIntensity.

void NL3D::CPSFanLight::setNbFans ( uint32  nbFans  ) 

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

Definition at line 455 of file ps_fan_light.cpp.

References _NbFans, NL3D::CPSLocatedBindable::_Owner, NL3D::CPSLocated::getMaxSize(), NL_PS_FUNC, and resize().

void NL3D::CPSFanLight::setPhaseSmoothness ( uint32  smoothNess  )  [inline]

Set the smoothness of phases.

The default is 0 which means no smoothness. n mean that the phase will be linearly interpolated between each n + 1 fans It ranges from 0 to 31

Definition at line 67 of file ps_fan_light.h.

References _PhaseSmoothness, and nlassert.

void NL3D::CPSFanLight::setPhaseSpeed ( float  multiplier  ) 

Set the speed for phase If the located holding this particle as a limited lifetime, it gives how many 0-2Pi cycle it'll do during its life Otherwise it gives how many cycle there are in a second.

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

Definition at line 304 of file ps_fan_light.cpp.

References _PhaseSpeed, and NL_PS_FUNC.

void NL3D::CPSFanLight::setTexture ( CSmartPtr< ITexture tex  )  [inline, virtual]

Set a texture. NULL remove it.

Implements NL3D::CPSTexturedParticleNoAnim.

Definition at line 115 of file ps_fan_light.h.

References _Tex.

void NL3D::CPSFanLight::setupMaterial (  )  [inline, private]
virtual void NL3D::CPSFanLight::setZBias ( float  value  )  [inline, virtual]

Implements NL3D::CPSParticle.

Definition at line 139 of file ps_fan_light.h.

virtual bool NL3D::CPSFanLight::supportGlobalColorLighting (  )  const [inline, virtual]

Implements NL3D::CPSParticle.

Definition at line 134 of file ps_fan_light.h.

void NL3D::CPSFanLight::updateMatAndVbForColor ( void   )  [virtual]

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

Implements NL3D::CPSColoredParticle.

Definition at line 487 of file ps_fan_light.cpp.

References NL_PS_FUNC.

Referenced by init().


Friends And Related Function Documentation

friend class CPSFanLightHelper [friend]

Definition at line 150 of file ps_fan_light.h.


Member Data Documentation

Definition at line 165 of file ps_fan_light.h.

Referenced by getVBnIB().

Definition at line 164 of file ps_fan_light.h.

Referenced by getVBnIB().

Definition at line 166 of file ps_fan_light.h.

Referenced by getVBnIB().

Definition at line 160 of file ps_fan_light.h.

Referenced by NL3D::CPSFanLightHelper::drawFanLight(), and initFanLightPrecalc().

Definition at line 168 of file ps_fan_light.h.

Referenced by NL3D::CPSFanLightHelper::drawFanLight(), and initFanLightPrecalc().

Definition at line 157 of file ps_fan_light.h.

Referenced by enumTexs(), getTexture(), getVBnIB(), setTexture(), and setupMaterial().

Definition at line 163 of file ps_fan_light.h.

Referenced by getVBnIB().

Definition at line 162 of file ps_fan_light.h.

Referenced by getVBnIB().


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

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