Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes
Forests::BatchedGeometry Class Reference

Description

A "lightweight" version of Ogre::StaticGeometry, which gives you a little more control over the batch materials, etc.

Definition at line 23 of file BatchedGeometry.h.

+ Inheritance diagram for Forests::BatchedGeometry:

Data Structures

class  SubBatch
 

Public Types

typedef std::map< Ogre::String, SubBatch * > TSubBatchMap
 
typedef Ogre::MapIterator< TSubBatchMap > TSubBatchIterator
 
typedef Ogre::ConstMapIterator< TSubBatchMap > TConstSubBatchIterator
 

Public Member Functions

 BatchedGeometry (Ogre::SceneManager *mgr, Ogre::SceneNode *rootSceneNode)
 
 ~BatchedGeometry ()
 
TConstSubBatchIterator getSubBatchIterator () const
 
TSubBatchIterator getSubBatchIterator ()
 
virtual void addEntity (Ogre::Entity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &orientation=Ogre::Quaternion::IDENTITY, const Ogre::Vector3 &scale=Ogre::Vector3::UNIT_SCALE, const Ogre::ColourValue &color=Ogre::ColourValue::White)
 
void build ()
 
void clear ()
 
Ogre::Vector3 _convertToLocal (const Ogre::Vector3 &globalVec) const
 
const Ogre::AxisAlignedBox & getBoundingBox (void) const
 
Ogre::Real getBoundingRadius (void) const
 

Static Protected Member Functions

static Ogre::String getFormatString (Ogre::SubEntity *ent)
 
static void extractVertexDataFromShared (const Ogre::MeshPtr &mesh)
 

Protected Attributes

bool m_Built
 
bool m_BoundsUndefined
 
Ogre::Vector3 m_vecCenter
 
Ogre::AxisAlignedBox m_boundsAAB
 
TSubBatchMap m_mapSubBatch
 

Static Protected Attributes

static const size_t s_vertexType2Size [Ogre::VET_COLOUR_ABGR+1]
 

Private Member Functions

bool isVisible ()
 
const Ogre::String & getMovableType (void) const
 
void visitRenderables (Ogre::Renderable::Visitor *visitor, bool debugRenderables)
 
void _notifyCurrentCamera (Ogre::Camera *cam)
 
void _updateRenderQueue (Ogre::RenderQueue *queue)
 

Private Attributes

bool m_bWithinFarDistance
 
Ogre::Real m_fRadius
 
Ogre::Real m_fMinDistanceSquared
 
Ogre::SceneManager * m_pSceneMgr
 
Ogre::SceneNode * m_pSceneNode
 
Ogre::SceneNode * m_pParentSceneNode
 

Member Typedef Documentation

◆ TConstSubBatchIterator

Definition at line 138 of file BatchedGeometry.h.

◆ TSubBatchIterator

Definition at line 137 of file BatchedGeometry.h.

◆ TSubBatchMap

typedef std::map<Ogre::String, SubBatch*> Forests::BatchedGeometry::TSubBatchMap

Stores a list of GeomBatch'es, using a format string (generated with getGeometryFormatString()) as the key value.

Definition at line 136 of file BatchedGeometry.h.

Constructor & Destructor Documentation

◆ BatchedGeometry()

BatchedGeometry::BatchedGeometry ( Ogre::SceneManager *  mgr,
Ogre::SceneNode *  rootSceneNode 
)

Constructor.

Definition at line 75 of file BatchedGeometry.cpp.

◆ ~BatchedGeometry()

BatchedGeometry::~BatchedGeometry ( )

Definition at line 91 of file BatchedGeometry.cpp.

Member Function Documentation

◆ _convertToLocal()

Ogre::Vector3 BatchedGeometry::_convertToLocal ( const Ogre::Vector3 &  globalVec) const

Definition at line 458 of file BatchedGeometry.cpp.

◆ _notifyCurrentCamera()

void BatchedGeometry::_notifyCurrentCamera ( Ogre::Camera *  cam)
private

Definition at line 436 of file BatchedGeometry.cpp.

◆ _updateRenderQueue()

void BatchedGeometry::_updateRenderQueue ( Ogre::RenderQueue *  queue)
private

Definition at line 407 of file BatchedGeometry.cpp.

◆ addEntity()

void BatchedGeometry::addEntity ( Ogre::Entity *  ent,
const Ogre::Vector3 &  position,
const Ogre::Quaternion &  orientation = Ogre::Quaternion::IDENTITY,
const Ogre::Vector3 &  scale = Ogre::Vector3::UNIT_SCALE,
const Ogre::ColourValue &  color = Ogre::ColourValue::White 
)
virtual

Definition at line 107 of file BatchedGeometry.cpp.

◆ build()

void BatchedGeometry::build ( )

Make sure the batch hasn't already been built

Definition at line 343 of file BatchedGeometry.cpp.

◆ clear()

void BatchedGeometry::clear ( )

Definition at line 377 of file BatchedGeometry.cpp.

◆ extractVertexDataFromShared()

void BatchedGeometry::extractVertexDataFromShared ( const Ogre::MeshPtr &  mesh)
staticprotected

Definition at line 225 of file BatchedGeometry.cpp.

◆ getBoundingBox()

const Ogre::AxisAlignedBox & Forests::BatchedGeometry::getBoundingBox ( void  ) const
inline

Definition at line 159 of file BatchedGeometry.h.

◆ getBoundingRadius()

Ogre::Real Forests::BatchedGeometry::getBoundingRadius ( void  ) const
inline

Definition at line 160 of file BatchedGeometry.h.

◆ getFormatString()

String BatchedGeometry::getFormatString ( Ogre::SubEntity *  ent)
staticprotected

Definition at line 323 of file BatchedGeometry.cpp.

◆ getMovableType()

const Ogre::String & BatchedGeometry::getMovableType ( void  ) const
private

Definition at line 98 of file BatchedGeometry.cpp.

◆ getSubBatchIterator() [1/2]

TSubBatchIterator Forests::BatchedGeometry::getSubBatchIterator ( )
inline

Definition at line 147 of file BatchedGeometry.h.

◆ getSubBatchIterator() [2/2]

TConstSubBatchIterator Forests::BatchedGeometry::getSubBatchIterator ( ) const
inline

Definition at line 146 of file BatchedGeometry.h.

◆ isVisible()

bool BatchedGeometry::isVisible ( )
private

Definition at line 428 of file BatchedGeometry.cpp.

◆ visitRenderables()

void Forests::BatchedGeometry::visitRenderables ( Ogre::Renderable::Visitor *  visitor,
bool  debugRenderables 
)
inlineprivate

Definition at line 165 of file BatchedGeometry.h.

Field Documentation

◆ m_boundsAAB

Ogre::AxisAlignedBox Forests::BatchedGeometry::m_boundsAAB
protected

Definition at line 179 of file BatchedGeometry.h.

◆ m_BoundsUndefined

bool Forests::BatchedGeometry::m_BoundsUndefined
protected

Definition at line 177 of file BatchedGeometry.h.

◆ m_Built

bool Forests::BatchedGeometry::m_Built
protected

Definition at line 176 of file BatchedGeometry.h.

◆ m_bWithinFarDistance

bool Forests::BatchedGeometry::m_bWithinFarDistance
private

Definition at line 185 of file BatchedGeometry.h.

◆ m_fMinDistanceSquared

Ogre::Real Forests::BatchedGeometry::m_fMinDistanceSquared
private

Definition at line 187 of file BatchedGeometry.h.

◆ m_fRadius

Ogre::Real Forests::BatchedGeometry::m_fRadius
private

Definition at line 186 of file BatchedGeometry.h.

◆ m_mapSubBatch

TSubBatchMap Forests::BatchedGeometry::m_mapSubBatch
protected

Definition at line 180 of file BatchedGeometry.h.

◆ m_pParentSceneNode

Ogre::SceneNode* Forests::BatchedGeometry::m_pParentSceneNode
private

Definition at line 190 of file BatchedGeometry.h.

◆ m_pSceneMgr

Ogre::SceneManager* Forests::BatchedGeometry::m_pSceneMgr
private

Definition at line 188 of file BatchedGeometry.h.

◆ m_pSceneNode

Ogre::SceneNode* Forests::BatchedGeometry::m_pSceneNode
private

Definition at line 189 of file BatchedGeometry.h.

◆ m_vecCenter

Ogre::Vector3 Forests::BatchedGeometry::m_vecCenter
protected

Definition at line 178 of file BatchedGeometry.h.

◆ s_vertexType2Size

const size_t BatchedGeometry::s_vertexType2Size
staticprotected
Initial value:
= {
VertexElement::getTypeSize(VET_FLOAT1),
VertexElement::getTypeSize(VET_FLOAT2),
VertexElement::getTypeSize(VET_FLOAT3),
VertexElement::getTypeSize(VET_FLOAT4),
VertexElement::getTypeSize(VET_COLOUR),
VertexElement::getTypeSize(VET_SHORT1),
VertexElement::getTypeSize(VET_SHORT2),
VertexElement::getTypeSize(VET_SHORT3),
VertexElement::getTypeSize(VET_SHORT4),
VertexElement::getTypeSize(VET_UBYTE4),
VertexElement::getTypeSize(VET_COLOUR_ARGB),
VertexElement::getTypeSize(VET_COLOUR_ABGR)
}

Internal matrix for remap vertex type to vertex size instead call VertexElement::getTypeSize.

For Ogre 1.7.2 and 1.7.3 VertexElementType enum writed as.

VET_FLOAT1 = 0 VET_FLOAT2 = 1 VET_FLOAT3 = 2 VET_FLOAT4 = 3 VET_COLOUR = 4 VET_SHORT1 = 5 VET_SHORT2 = 6 VET_SHORT3 = 7 VET_SHORT4 = 8 VET_UBYTE4 = 9 VET_COLOUR_ARGB = 10 VET_COLOUR_ABGR = 11

Definition at line 182 of file BatchedGeometry.h.


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