10#ifndef __BatchedGeometry_H__
11#define __BatchedGeometry_H__
13#include <OgrePrerequisites.h>
14#include <OgreMovableObject.h>
15#include <OgreSceneNode.h>
16#include <OgreMaterialManager.h>
35 QueuedMesh(Ogre::SubMesh* sm,
const Ogre::Vector3 &pos,
const Ogre::Quaternion &ori,
36 const Ogre::Vector3 &scl,
const Ogre::ColourValue &clr,
void *userData_ = 0) :
68 void addSubEntity(Ogre::SubEntity *ent,
const Ogre::Vector3 &position,
69 const Ogre::Quaternion &orientation,
const Ogre::Vector3 &scale,
70 const Ogre::ColourValue &color = Ogre::ColourValue::White,
void* userData = NULL);
84 const Ogre::LightList&
getLights(
void)
const;
89 Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
91 m_ptrMaterial = Ogre::MaterialManager::getSingleton().getByName(mat, rg);
107 const std::vector<Ogre::VertexDeclaration::VertexElementList> &vertexBufferElements, std::vector<Ogre::uchar*> &vertexBuffers,
108 Ogre::VertexData *dst);
110 static void _buildFullTransform(
const QueuedMesh &queuedMesh,
const Ogre::Vector3 &parentGeomCenter,
111 const std::vector<Ogre::VertexDeclaration::VertexElementList> &vertexBufferElements, std::vector<Ogre::uchar*> &vertexBuffers,
112 Ogre::VertexData *dst);
143 BatchedGeometry(Ogre::SceneManager *mgr, Ogre::SceneNode *rootSceneNode);
149 virtual void addEntity(Ogre::Entity *ent,
const Ogre::Vector3 &position,
150 const Ogre::Quaternion &orientation = Ogre::Quaternion::IDENTITY,
151 const Ogre::Vector3 &scale = Ogre::Vector3::UNIT_SCALE,
152 const Ogre::ColourValue &color = Ogre::ColourValue::White);
Visible chunk of geometry.
virtual void build()
Build (assemble a vertex/index buffers) geometry for rendering.
BatchedGeometry * m_pParentGeom
static void _buildFullTransform(const QueuedMesh &queuedMesh, const Ogre::Vector3 &parentGeomCenter, const std::vector< Ogre::VertexDeclaration::VertexElementList > &vertexBufferElements, std::vector< Ogre::uchar * > &vertexBuffers, Ogre::VertexData *dst)
Build vertex of QueuedMesh if it have some orientation.
void setMaterial(Ogre::MaterialPtr &mat)
void getWorldTransforms(Ogre::Matrix4 *xform) const
Ogre::Real getSquaredViewDepth(const Ogre::Camera *cam) const
Ogre::Technique * m_pBestTechnique
Technique recalculated every frame.
const Ogre::LightList & getLights(void) const
void addSubEntity(Ogre::SubEntity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &orientation, const Ogre::Vector3 &scale, const Ogre::ColourValue &color=Ogre::ColourValue::White, void *userData=NULL)
Ogre::SubMesh * m_pSubMesh
Ogre::SubMesh for Index/Vertex buffers manipulation.
const Ogre::String & getMaterialName() const
Get material name. Be careful, resource group name missing.
void setMaterialName(const Ogre::String &mat, const Ogre::String &rg=Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
const Ogre::MaterialPtr & getMaterial(void) const
const Ogre::Vector3 & getWorldPosition(void) const
const Ogre::Quaternion & getWorldOrientation(void) const
Ogre::MaterialPtr m_ptrMaterial
void getRenderOperation(Ogre::RenderOperation &op)
Ogre::IndexData * m_pIndexData
bool m_RequireVertexColors
static void _buildIdentiryOrientation(const QueuedMesh &queuedMesh, const Ogre::Vector3 &parentGeomCenter, const std::vector< Ogre::VertexDeclaration::VertexElementList > &vertexBufferElements, std::vector< Ogre::uchar * > &vertexBuffers, Ogre::VertexData *dst)
Build vertex of QueuedMesh if it have identity orientation.
void addSelfToRenderQueue(Ogre::RenderQueueGroup *rqg)
std::vector< QueuedMesh > TMeshQueue
Queue of meshes for build batch of geometry.
Ogre::Technique * getTechnique() const
TMeshQueue m_queueMesh
The list of meshes to be added to this batch.
Ogre::VertexData * m_pVertexData
bool castsShadows(void) const
A "lightweight" version of Ogre::StaticGeometry, which gives you a little more control over the batch...
bool m_bWithinFarDistance
TSubBatchIterator getSubBatchIterator()
Ogre::Vector3 m_vecCenter
Ogre::Real m_fMinDistanceSquared
const Ogre::String & getMovableType(void) const
static void extractVertexDataFromShared(const Ogre::MeshPtr &mesh)
Ogre::Real getBoundingRadius(void) const
void visitRenderables(Ogre::Renderable::Visitor *visitor, bool debugRenderables)
Ogre::SceneNode * m_pParentSceneNode
std::map< Ogre::String, SubBatch * > TSubBatchMap
Stores a list of GeomBatch'es, using a format string (generated with getGeometryFormatString()) as th...
const Ogre::AxisAlignedBox & getBoundingBox(void) const
Ogre::MapIterator< TSubBatchMap > TSubBatchIterator
Ogre::AxisAlignedBox m_boundsAAB
Ogre::SceneManager * m_pSceneMgr
Ogre::Vector3 _convertToLocal(const Ogre::Vector3 &globalVec) const
static const size_t s_vertexType2Size[Ogre::VET_COLOUR_ABGR+1]
Internal matrix for remap vertex type to vertex size instead call VertexElement::getTypeSize.
TConstSubBatchIterator getSubBatchIterator() const
static Ogre::String getFormatString(Ogre::SubEntity *ent)
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)
Ogre::SceneNode * m_pSceneNode
void _updateRenderQueue(Ogre::RenderQueue *queue)
TSubBatchMap m_mapSubBatch
Ogre::ConstMapIterator< TSubBatchMap > TConstSubBatchIterator
void _notifyCurrentCamera(Ogre::Camera *cam)
QueuedMesh(Ogre::SubMesh *sm, const Ogre::Vector3 &pos, const Ogre::Quaternion &ori, const Ogre::Vector3 &scl, const Ogre::ColourValue &clr, void *userData_=0)
Ogre::Quaternion orientation