# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CPSQuad Class Reference

This abstract class holds what is needed with quad particles (CPSFaceLookAt, CPSFace) e.g Index and vertex buffer and method to setup them Material, and method to setup them. More...

#include <ps_quad.h>

Inheritance diagram for NL3D::CPSQuad:

NL3D::CPSParticle NL3D::CPSColoredParticle NL3D::CPSTexturedParticle NL3D::CPSMultiTexturedParticle NL3D::CPSSizedParticle NL3D::CPSMaterial NL3D::CPSLocatedBindable NLMISC::IStreamable NLMISC::IClassable NL3D::CPSFace NL3D::CPSFaceLookAt List of all members.

Public Types

enum  { quadBufSize = 800 }
 The number of quad to batche for each driver call. More...


Public Methods

 CPSQuad (CSmartPtr< ITexture > tex=NULL)
 ==================================================================================. More...

virtual bool hasTransparentFaces (void)
 ==================================================================================. More...

virtual bool hasOpaqueFaces (void)
 ==================================================================================. More...

virtual uint32 getMaxNumFaces (void) const
 ==================================================================================. More...


Static Public Methods

void initVertexBuffers ()
 ================================================================================== this static method init vertex buffers. More...


Protected Types

enum  VBType {
  VBCol = 0x0001, VBTex = 0x0002, VBTexAnimated = 0x0004, VBTex2 = 0x0008,
  VBTex2Animated = 0x0010
}

Protected Methods

virtual ~CPSQuad ()
 ==================================================================================. More...

virtual void init (void)
 ==================================================================================. More...

virtual void updateMatAndVbForColor (void)
 update the material and the vb so that they match the color scheme. Inherited from CPSColoredParticle. More...

virtual void updateMatAndVbForTexture (void)
 ==================================================================================. More...

void updateMatBeforeRendering (IDriver *drv)
 ==================================================================================. More...

void newElement (CPSLocated *emitterLocated, uint32 emitterIndex)
 this is inlined to save cost of call by derived class. More...

void deleteElement (uint32 index)
 this is inlined to save cost of call by derived class. More...

void resize (uint32 capacity)
 ==================================================================================. More...

virtual bool completeBBox (NLMISC::CAABBox &box) const
 ==================================================================================. More...

void updateVbColNUVForRender (CVertexBuffer &vb, uint32 startIndex, uint32 numQuad, uint32 srcStep)
 calculate current color and texture coordinate before any rendering size can't be higher that quadBufSize ... More...

void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 DERIVERS MUST CALL this. More...

virtual CPSLocatedgetColorOwner (void)
 deriver must return their owner there. More...

virtual CPSLocatedgetSizeOwner (void)
 deriver must return their owner there. More...

virtual CPSLocatedgetTextureIndexOwner (void)
 deriver must return their owner there. More...

CVertexBuffergetNeededVB ()
 ================================================================================== choose the vertex buffex that we need. More...


Static Protected Attributes

CVertexBuffer _VBPos
 the various kind of vertex buffers we need for quads. More...

CVertexBuffer _VBPosCol
CVertexBuffer _VBPosTex1
CVertexBuffer _VBPosTex1Col
CVertexBuffer _VBPosTex1Anim
CVertexBuffer _VBPosTex1AnimCol
CVertexBuffer _VBPosTex1Tex2
CVertexBuffer _VBPosTex1ColTex2
CVertexBuffer _VBPosTex1AnimTex2
CVertexBuffer _VBPosTex1AnimColTex2
CVertexBuffer _VBPosTex1Tex2Anim
CVertexBuffer _VBPosTex1ColTex2Anim
CVertexBuffer _VBPosTex1AnimTex2Anim
CVertexBuffer _VBPosTex1AnimColTex2Anim

Detailed Description

This abstract class holds what is needed with quad particles (CPSFaceLookAt, CPSFace) e.g Index and vertex buffer and method to setup them Material, and method to setup them.

Definition at line 44 of file ps_quad.h.


Member Enumeration Documentation

anonymous enum
 

The number of quad to batche for each driver call.

Enumeration values:
quadBufSize 

Definition at line 154 of file ps_quad.h.

enum NL3D::CPSQuad::VBType [protected]
 

Enumeration values:
VBCol 
VBTex 
VBTexAnimated 
VBTex2 
VBTex2Animated 

Definition at line 118 of file ps_quad.h.


Constructor & Destructor Documentation

NL3D::CPSQuad::CPSQuad CSmartPtr< ITexture   tex = NULL
 

==================================================================================.

This can't be a CTextureGrouped (for animation) animation must be set later by using setTextureScheme

Definition at line 199 of file ps_quad.cpp.

References NL3D::CPSLocatedBindable::_Name, init, and NL3D::CPSTexturedParticle::setTexture.

NL3D::CPSQuad::~CPSQuad   [protected, virtual]
 

==================================================================================.

Definition at line 209 of file ps_quad.cpp.


Member Function Documentation

bool NL3D::CPSQuad::completeBBox NLMISC::CAABBox   box const [protected, virtual]
 

==================================================================================.

Reimplemented from NL3D::CPSLocatedBindable.

Definition at line 258 of file ps_quad.cpp.

References NL3D::CPSSizedParticle::_ParticleSize, and NL3D::CPSSizedParticle::_SizeScheme.

void NL3D::CPSQuad::deleteElement uint32    index [inline, protected, virtual]
 

this is inlined to save cost of call by derived class.

Implements NL3D::CPSParticle.

Reimplemented in NL3D::CPSFace.

Definition at line 95 of file ps_quad.h.

References NL3D::CPSColoredParticle::deleteColorElement, NL3D::CPSSizedParticle::deleteSizeElement, NL3D::CPSTexturedParticle::deleteTextureIndexElement, and index.

virtual CPSLocated* NL3D::CPSQuad::getColorOwner void    [inline, protected, virtual]
 

deriver must return their owner there.

Implements NL3D::CPSColoredParticle.

Definition at line 114 of file ps_quad.h.

References NL3D::CPSLocatedBindable::_Owner, and NL3D::CPSLocatedBindable::CPSLocated.

uint32 NL3D::CPSQuad::getMaxNumFaces void    const [virtual]
 

==================================================================================.

Implements NL3D::CPSParticle.

Definition at line 214 of file ps_quad.cpp.

References NL3D::CPSLocatedBindable::_Owner, and nlassert.

CVertexBuffer & NL3D::CPSQuad::getNeededVB   [protected]
 

================================================================================== choose the vertex buffex that we need.

Definition at line 146 of file ps_quad.cpp.

References NL3D::CPSMultiTexturedParticle::_AlternateOp, NL3D::CPSMultiTexturedParticle::_MainOp, NL3D::CPSMultiTexturedParticle::_TexScroll, NL3D::CPSMultiTexturedParticle::_TexScrollAlternate, NL3D::CPSMultiTexturedParticle::Decal, NL3D::CPSMultiTexturedParticle::isAlternateTextureUsed, nlassert, VBCol, VBTex, VBTex2, VBTex2Animated, VBTexAnimated, NLMISC::CVector2f::x, and NLMISC::CVector2f::y.

virtual CPSLocated* NL3D::CPSQuad::getSizeOwner void    [inline, protected, virtual]
 

deriver must return their owner there.

Implements NL3D::CPSSizedParticle.

Definition at line 115 of file ps_quad.h.

References NL3D::CPSLocatedBindable::_Owner, and NL3D::CPSLocatedBindable::CPSLocated.

virtual CPSLocated* NL3D::CPSQuad::getTextureIndexOwner void    [inline, protected, virtual]
 

deriver must return their owner there.

Implements NL3D::CPSTexturedParticle.

Definition at line 116 of file ps_quad.h.

References NL3D::CPSLocatedBindable::_Owner, and NL3D::CPSLocatedBindable::CPSLocated.

bool NL3D::CPSQuad::hasOpaqueFaces void    [virtual]
 

==================================================================================.

Implements NL3D::CPSParticle.

Definition at line 227 of file ps_quad.cpp.

References hasTransparentFaces.

Referenced by NL3D::CPSFace::step.

bool NL3D::CPSQuad::hasTransparentFaces void    [virtual]
 

==================================================================================.

Implements NL3D::CPSParticle.

Definition at line 221 of file ps_quad.cpp.

References NL3D::CPSMaterial::getBlendingMode.

Referenced by hasOpaqueFaces, and NL3D::CPSFace::step.

void NL3D::CPSQuad::init void    [protected, virtual]
 

==================================================================================.

Definition at line 233 of file ps_quad.cpp.

References NL3D::CPSMaterial::_Mat, updateMatAndVbForColor, and updateMatAndVbForTexture.

Referenced by CPSQuad.

void NL3D::CPSQuad::initVertexBuffers   [static]
 

================================================================================== this static method init vertex buffers.

Definition at line 115 of file ps_quad.cpp.

References quadBufSize, NL3D::SetupQuadVBTexCoords, VBCol, VBTex, VBTex2, VBTex2Animated, and VBTexAnimated.

void NL3D::CPSQuad::newElement CPSLocated   emitterLocated,
uint32    emitterIndex
[inline, protected, virtual]
 

this is inlined to save cost of call by derived class.

Implements NL3D::CPSParticle.

Reimplemented in NL3D::CPSFace.

Definition at line 87 of file ps_quad.h.

References NL3D::CPSLocatedBindable::CPSLocated, NL3D::CPSColoredParticle::newColorElement, NL3D::CPSSizedParticle::newSizeElement, and NL3D::CPSTexturedParticle::newTextureIndexElement.

void NL3D::CPSQuad::resize uint32    capacity [protected, virtual]
 

==================================================================================.

Implements NL3D::CPSParticle.

Reimplemented in NL3D::CPSFace.

Definition at line 272 of file ps_quad.cpp.

References nlassert, NL3D::CPSColoredParticle::resizeColor, NL3D::CPSSizedParticle::resizeSize, and NL3D::CPSTexturedParticle::resizeTextureIndex.

void NL3D::CPSQuad::serial NLMISC::IStream   f throw (NLMISC::EStream) [protected, virtual]
 

DERIVERS MUST CALL this.

Reimplemented from NL3D::CPSParticle.

Reimplemented in NL3D::CPSFace.

Definition at line 295 of file ps_quad.cpp.

void NL3D::CPSQuad::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 281 of file ps_quad.cpp.

Referenced by init.

void NL3D::CPSQuad::updateMatAndVbForTexture void    [protected, virtual]
 

==================================================================================.

Implements NL3D::CPSTexturedParticle.

Definition at line 245 of file ps_quad.cpp.

References NL3D::CPSMaterial::_Mat, NL3D::CPSTexturedParticle::_Tex, NL3D::CPSTexturedParticle::_TexGroup, and NL3D::CPSMultiTexturedParticle::touch.

Referenced by init.

void NL3D::CPSQuad::updateMatBeforeRendering IDriver   drv [protected]
 

==================================================================================.

Definition at line 515 of file ps_quad.cpp.

References NL3D::CPSColoredParticle::_Color, NL3D::CPSColoredParticle::_ColorScheme, NL3D::CPSMaterial::_Mat, NL3D::CPSLocatedBindable::_Owner, NL3D::CPSTexturedParticle::_Tex, NL3D::CPSMaterial::forceModulateConstantColor, NL3D::CPSMultiTexturedParticle::isMultiTextureEnabled, NLMISC::CRGBA::modulateFromColor, nlassert, and NL3D::CPSMultiTexturedParticle::setupMaterial.

void NL3D::CPSQuad::updateVbColNUVForRender CVertexBuffer   vb,
uint32    startIndex,
uint32    numQuad,
uint32    srcStep
[protected]
 

calculate current color and texture coordinate before any rendering size can't be higher that quadBufSize ...

Definition at line 382 of file ps_quad.cpp.

References NL3D::CPSMultiTexturedParticle::_AlternateTexture2, NL3D::CPSColoredParticle::_ColorScheme, NL3D::CPSLocatedBindable::_Owner, NL3D::CPSTexturedParticle::_Tex, NL3D::CPSTexturedParticle::_TexGroup, NL3D::CPSMultiTexturedParticle::_TexScroll, NL3D::CPSMultiTexturedParticle::_TexScrollAlternate, NL3D::CPSMultiTexturedParticle::_Texture2, NL3D::CPSTexturedParticle::_TextureIndex, NL3D::CPSTexturedParticle::_TextureIndexScheme, NL3D::FillQuadCoords, NL3D::FillQuadCoordsLocalTime, NL3D::CPSMultiTexturedParticle::getUseLocalDate, NL3D::CPSMultiTexturedParticle::getUseLocalDateAlt, NL3D::CPSMultiTexturedParticle::isAlternateTextureUsed, nlassert, quadBufSize, stride, NLMISC::CVector2f::x, and NLMISC::CVector2f::y.


Member Data Documentation

CVertexBuffer NL3D::CPSQuad::_VBPos [static, protected]
 

the various kind of vertex buffers we need for quads.

Definition at line 53 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosCol [static, protected]
 

Definition at line 54 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosTex1 [static, protected]
 

Definition at line 55 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosTex1Anim [static, protected]
 

Definition at line 57 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosTex1AnimCol [static, protected]
 

Definition at line 58 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosTex1AnimColTex2 [static, protected]
 

Definition at line 63 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosTex1AnimColTex2Anim [static, protected]
 

Definition at line 68 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosTex1AnimTex2 [static, protected]
 

Definition at line 62 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosTex1AnimTex2Anim [static, protected]
 

Definition at line 67 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosTex1Col [static, protected]
 

Definition at line 56 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosTex1ColTex2 [static, protected]
 

Definition at line 61 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosTex1ColTex2Anim [static, protected]
 

Definition at line 66 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosTex1Tex2 [static, protected]
 

Definition at line 60 of file ps_quad.cpp.

CVertexBuffer NL3D::CPSQuad::_VBPosTex1Tex2Anim [static, protected]
 

Definition at line 65 of file ps_quad.cpp.


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