Lugre::cFastBatch Class Reference

#include <lugre_fastbatch.h>

Inheritance diagram for Lugre::cFastBatch:

Inheritance graph
[legend]
Collaboration diagram for Lugre::cFastBatch:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 cFastBatch ()
virtual ~cFastBatch ()
void AddMesh (cBufferedMesh &pBufferedMesh, const Ogre::Vector3 &vPos, const Ogre::Quaternion &qRot=Ogre::Quaternion::IDENTITY, const Ogre::Vector3 &vScale=Ogre::Vector3::UNIT_SCALE, const Ogre::ColourValue &vCol=Ogre::ColourValue::White, const bool bColourOverride=false, const float fOrderValue=0)
void Build ()
 call this after adding all meshes... use only once
void SetDisplayRange (const float fMin, const float fMax)
 inclusive range of order vals, useful for blending out upper floors
const Ogre::Vector3 & GetBoundsCenter () const
virtual void _updateRenderQueue (Ogre::RenderQueue *queue)
virtual const
Ogre::AxisAlignedBox & 
getBoundingBox (void) const
Ogre::Real getBoundingRadius (void) const
virtual const Ogre::String & getMovableType (void) const

Private Types

typedef std::map< std::string,
cSubBatch * >::iterator 
tSubBatchMapIterator
typedef std::map< std::string,
cSubBatch * > 
tSubBatchMap

Private Attributes

tSubBatchMap mSubBatches
Ogre::AxisAlignedBox mBounds
Ogre::Vector3 mvBoundsCenter
Ogre::Real mfBoundRad

Classes

class  cInstance
 records positions of added meshes More...
class  cSubBatch
 one material group More...


Detailed Description

a geometry batching util, similar to Ogre::StaticGeometry, but more lightweight, and geared towards being constructed during runtime e.g. uses meshbuffer to avoid reading from vram also you don't have to create entities of meshes you want to add allows colour modulation by adding/modifying vertex colour allows movement at runtime, by being attached to scenenode keeping the parent scenenode world transform(pos+rot) at identity migth be better for performance, the position/rotation of added meshes is baked to vertexdata and doesn't have a runtime penalty warning, added geometry is effectively duplicated, using more vram, but allowing higher speeds note : you can use order values to do things like blend out upper floors effectively (by offset,len instead of buffer change), see SetDisplayRange(min,max)

Definition at line 67 of file lugre_fastbatch.h.


Member Typedef Documentation

typedef std::map<std::string,cSubBatch*>::iterator Lugre::cFastBatch::tSubBatchMapIterator [private]

Definition at line 103 of file lugre_fastbatch.h.

typedef std::map<std::string,cSubBatch*> Lugre::cFastBatch::tSubBatchMap [private]

Definition at line 105 of file lugre_fastbatch.h.


Constructor & Destructor Documentation

Lugre::cFastBatch::cFastBatch (  ) 

Definition at line 23 of file lugre_fastbatch.cpp.

References mBounds, and mfBoundRad.

Lugre::cFastBatch::~cFastBatch (  )  [virtual]

Definition at line 38 of file lugre_fastbatch.cpp.

References mSubBatches.


Member Function Documentation

void Lugre::cFastBatch::AddMesh ( cBufferedMesh pBufferedMesh,
const Ogre::Vector3 &  vPos,
const Ogre::Quaternion &  qRot = Ogre::Quaternion::IDENTITY,
const Ogre::Vector3 &  vScale = Ogre::Vector3::UNIT_SCALE,
const Ogre::ColourValue &  vCol = Ogre::ColourValue::White,
const bool  bColourOverride = false,
const float  fOrderValue = 0 
)

add mesh, if bColourOverride is false then vCol is ignored fOrderValue can be used to blend out ranges without the need to change the buffers (uses renderop offset,length)

Definition at line 44 of file lugre_fastbatch.cpp.

References Lugre::cFastBatch::cSubBatch::AddInstance(), DEBUG_FASTBATCH, Lugre::cBufferedMesh::GetBounds(), Lugre::cBufferedSubMesh::GetFormatHash(), Lugre::cBufferedSubMesh::GetFormatHashWithColour(), Lugre::cBufferedMesh::GetSubMesh(), Lugre::cBufferedMesh::GetSubMeshCount(), Lugre::cBufferedSubMesh::GetUsesShared(), mBounds, and mSubBatches.

void Lugre::cFastBatch::Build (  ) 

call this after adding all meshes... use only once

Definition at line 86 of file lugre_fastbatch.cpp.

References DEBUG_FASTBATCH, mBounds, mfBoundRad, mSubBatches, mvBoundsCenter, and Lugre::mymax().

Referenced by Lugre::cGfx3D_L::FastBatch_Build().

void Lugre::cFastBatch::SetDisplayRange ( const float  fMin,
const float  fMax 
)

inclusive range of order vals, useful for blending out upper floors

Definition at line 108 of file lugre_fastbatch.cpp.

References mSubBatches.

Referenced by Lugre::cGfx3D_L::FastBatch_SetDisplayRange().

const Ogre::Vector3& Lugre::cFastBatch::GetBoundsCenter (  )  const [inline]

Definition at line 89 of file lugre_fastbatch.h.

References mvBoundsCenter.

Referenced by Lugre::cFastBatch::cSubBatch::getSquaredViewDepth().

void Lugre::cFastBatch::_updateRenderQueue ( Ogre::RenderQueue *  queue  )  [virtual]

Definition at line 112 of file lugre_fastbatch.cpp.

References mSubBatches.

virtual const Ogre::AxisAlignedBox& Lugre::cFastBatch::getBoundingBox ( void   )  const [inline, virtual]

Definition at line 94 of file lugre_fastbatch.h.

References mBounds.

Ogre::Real Lugre::cFastBatch::getBoundingRadius ( void   )  const [inline]

Definition at line 98 of file lugre_fastbatch.h.

References mfBoundRad.

const Ogre::String & Lugre::cFastBatch::getMovableType ( void   )  const [virtual]

Definition at line 123 of file lugre_fastbatch.cpp.


Member Data Documentation

Definition at line 106 of file lugre_fastbatch.h.

Referenced by _updateRenderQueue(), AddMesh(), Build(), SetDisplayRange(), and ~cFastBatch().

Ogre::AxisAlignedBox Lugre::cFastBatch::mBounds [private]

Definition at line 107 of file lugre_fastbatch.h.

Referenced by AddMesh(), Build(), cFastBatch(), and getBoundingBox().

Ogre::Vector3 Lugre::cFastBatch::mvBoundsCenter [private]

Definition at line 108 of file lugre_fastbatch.h.

Referenced by Build(), and GetBoundsCenter().

Ogre::Real Lugre::cFastBatch::mfBoundRad [private]

Definition at line 109 of file lugre_fastbatch.h.

Referenced by Build(), cFastBatch(), and getBoundingRadius().


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

Generated on Wed Feb 8 06:00:21 2012 for cpp by  doxygen 1.5.6