A fan light particle. More...
#include <ps_fan_light.h>
Inherits NL3D::CPSParticle, NL3D::CPSColoredParticle, NL3D::CPSSizedParticle, NL3D::CPSRotated2DParticle, NL3D::CPSMaterial, and NL3D::CPSTexturedParticleNoAnim.
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. | |
| ITexture * | getTexture (void) |
| get the texture used | |
| const ITexture * | getTexture (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 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 | |
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 |
A fan light particle.
Definition at line 44 of file ps_fan_light.h.
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.
| 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.
| 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] |
====================================================================================
Reimplemented from NL3D::CPSParticle.
Definition at line 362 of file ps_fan_light.cpp.
References NL3D::CPSLocatedBindable::_Owner, NL3D::CPSAttrib< T >::begin(), NL3D::CPSParticle::computeSrcStep(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CPSLocated::getPos(), NL3D::CPSLocated::getSize(), NL3D::CPSLocated::getTime(), NL_PS_FUNC, PARTICLES_CHECK_MEM, setupMaterial(), and NL3D::CPSParticle::step().
| 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] |
| 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] |
====================================================================================
Definition at line 494 of file ps_fan_light.cpp.
References _ColoredTexVBMap, _ColoredVBMap, NL3D::CPSColoredParticle::_ColorScheme, _IBMap, _NbFans, _Tex, _TexVBMap, _VBMap, NL3D::CVertexBuffer::AGPVolatile, getNumFanlightsInVB(), NL3D::CIndexBufferReadWrite::getPtr(), NL3D::CVertexBuffer::lock(), NL3D::CIndexBuffer::lock(), NL_DEFAULT_INDEX_BUFFER_FORMAT, NL_PS_FUNC, NL_SET_IB_NAME, nlassert, NL3D::CVertexBuffer::PositionFlag, NL3D::CVertexBuffer::PrimaryColorFlag, NL3D::CVertexBufferReadWrite::setColor(), NL3D::CIndexBuffer::setFormat(), NL3D::CVertexBuffer::setName(), NL3D::CIndexBuffer::setNumIndexes(), NL3D::CVertexBuffer::setNumVertices(), NL3D::CVertexBuffer::setPreferredMemory(), NL3D::CVertexBufferReadWrite::setTexCoord(), NL3D::CVertexBuffer::setVertexFormat(), NL3D::CVertexBuffer::TexCoord0Flag, and NLMISC::CRGBA::White.
Referenced by NL3D::CPSFanLightHelper::drawFanLight().
| 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.
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] |
====================================================================================
update material color
Definition at line 311 of file ps_fan_light.cpp.
References NL3D::CPSColoredParticle::_Color, NL3D::CPSColoredParticle::_ColorScheme, NL3D::CPSMaterial::_Mat, NL3D::CPSLocatedBindable::_Owner, _Tex, NL3D::CMaterial::Constant, NL3D::CMaterial::Diffuse, NL3D::CPSMaterial::forceTexturedMaterialStages(), NL3D::CParticleSystem::getColorAttenuationScheme(), NL3D::CParticleSystem::getForceGlobalColorLightingFlag(), NL3D::CParticleSystem::getGlobalColor(), NL3D::CParticleSystem::getGlobalColorLighted(), NL3D::CParticleSystemProcess::getOwner(), NL3D::CParticleSystem::isUserColorUsed(), NLMISC::CRGBA::modulateFromColor(), NL_PS_FUNC, NL3D::CMaterial::Previous, NL3D::CMaterial::setTexture(), NL3D::SetupModulatedStage(), NL3D::CMaterial::texConstantColor(), NL3D::CMaterial::Texture, and NL3D::CPSParticle::usesGlobalColorLighting().
Referenced by draw().
| 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().
friend class CPSFanLightHelper [friend] |
Definition at line 150 of file ps_fan_light.h.
CPSFanLight::TVBMap NL3D::CPSFanLight::_ColoredTexVBMap [static, private] |
Definition at line 165 of file ps_fan_light.h.
Referenced by getVBnIB().
CPSFanLight::TVBMap NL3D::CPSFanLight::_ColoredVBMap [static, private] |
Definition at line 164 of file ps_fan_light.h.
Referenced by getVBnIB().
CPSFanLight::TIBMap NL3D::CPSFanLight::_IBMap [static, private] |
Definition at line 166 of file ps_fan_light.h.
Referenced by getVBnIB().
float NL3D::CPSFanLight::_MoveIntensity [private] |
Definition at line 156 of file ps_fan_light.h.
Referenced by NL3D::CPSFanLightHelper::drawFanLight(), getMoveIntensity(), and setMoveIntensity().
uint32 NL3D::CPSFanLight::_NbFans [private] |
Definition at line 154 of file ps_fan_light.h.
Referenced by NL3D::CPSFanLightHelper::drawFanLight(), getNbFans(), getNumFanlightsInVB(), getNumWantedTris(), getVBnIB(), and setNbFans().
uint32 NL3D::CPSFanLight::_PhaseSmoothness [private] |
Definition at line 155 of file ps_fan_light.h.
Referenced by NL3D::CPSFanLightHelper::drawFanLight(), getPhaseSmoothness(), and setPhaseSmoothness().
float NL3D::CPSFanLight::_PhaseSpeed [private] |
Definition at line 158 of file ps_fan_light.h.
Referenced by NL3D::CPSFanLightHelper::drawFanLight(), getPhaseSpeed(), and setPhaseSpeed().
uint8 NL3D::CPSFanLight::_RandomPhaseTab [static, private] |
Definition at line 160 of file ps_fan_light.h.
Referenced by NL3D::CPSFanLightHelper::drawFanLight(), and initFanLightPrecalc().
bool NL3D::CPSFanLight::_RandomPhaseTabInitialized = false [static, private] |
Definition at line 168 of file ps_fan_light.h.
Referenced by NL3D::CPSFanLightHelper::drawFanLight(), and initFanLightPrecalc().
NLMISC::CSmartPtr<ITexture> NL3D::CPSFanLight::_Tex [private] |
Definition at line 157 of file ps_fan_light.h.
Referenced by enumTexs(), getTexture(), getVBnIB(), setTexture(), and setupMaterial().
CPSFanLight::TVBMap NL3D::CPSFanLight::_TexVBMap [static, private] |
Definition at line 163 of file ps_fan_light.h.
Referenced by getVBnIB().
CPSFanLight::TVBMap NL3D::CPSFanLight::_VBMap [static, private] |
Definition at line 162 of file ps_fan_light.h.
Referenced by getVBnIB().
1.6.1