OGRE  1.9.0
OgreInstancedGeometry.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26-----------------------------------------------------------------------------
27*/
28#ifndef __InstancedGeometry_H__
29#define __InstancedGeometry_H__
30
31#include "OgrePrerequisites.h"
32#include "OgreMovableObject.h"
34#include "OgreSkeleton.h"
36#include "OgreAnimationTrack.h"
37#include "OgreBone.h"
39#include "OgreMesh.h"
40#include "OgreHeaderPrefix.h"
41
42namespace Ogre {
43
106 {
107 public:
121 {
122 public:
123 OptimisedSubMeshGeometry() :vertexData(0), indexData(0) {}
125 {
126 delete vertexData;
127 delete indexData;
128 }
131 };
136 {
139 };
144 {
154 unsigned int ID;
155 };
160 {
165 unsigned int ID;
166 };
168
169 // forward declarations
170 class LODBucket;
171 class MaterialBucket;
172 class BatchInstance;
173 class InstancedObject;
174
180 {
181 protected:
182
202 unsigned short mTexCoordIndex;
204
205 template<typename T>
206 void copyIndexes(const T* src, T* dst, size_t count, size_t indexOffset)
207 {
208 if (indexOffset == 0)
209 {
210 memcpy(dst, src, sizeof(T) * count);
211 }
212 else
213 {
214 while(count--)
215 {
216 *dst++ = static_cast<T>(*src++ + indexOffset);
217 }
218 }
219 }
220
223
224 public:
226 const VertexData* vData, const IndexData* iData);
228 const VertexData* vData, const IndexData* iData);
232 MaterialBucket* getParent(void) { return mParent; }
235 const VertexData* getVertexData(void) const { return mVertexData; }
237 const IndexData* getIndexData(void) const { return mIndexData; }
239 const MaterialPtr& getMaterial(void) const;
242 virtual unsigned short getNumWorldTransforms(void) const ;
244 const LightList& getLights(void) const;
245 bool getCastsShadows(void) const;
252 void build();
254 void dump(std::ofstream& of) const;
256 AxisAlignedBox & getAABB(void){return mAABB;}
259
260 };
262 {
263 friend class GeometryBucket;
264 public:
266 {
272 TS_WORLD
273 };
276 protected:
278 unsigned short mIndex;
290 unsigned short mNumBoneMatrices;
293 public:
294 InstancedObject(unsigned short index);
297 void setPosition( Vector3 position);
298 const Vector3& getPosition(void) const;
299 void yaw(const Radian& angle);
300 void pitch(const Radian& angle);
301 void roll(const Radian& angle);
302 void rotate(const Quaternion& q);
303 void setScale(const Vector3& scale);
304 const Vector3& getScale() const;
310 GeometryBucketList&getGeometryBucketList(void){return mGeometryBucketList;}
311 void translate(const Matrix3& axes, const Vector3& move);
312 void translate(const Vector3& d);
314 void updateAnimation(void);
316 SkeletonInstance*getSkeletonInstance(void){return mSkeletonInstance;}
317
318 };
322 {
323 public:
326 protected:
338 // index to current Geometry Buckets for a given geometry format
343
344 public:
345 MaterialBucket(LODBucket* parent, const String& materialName);
347 LODBucket* getParent(void) { return mParent; }
349 const String& getMaterialName(void) const { return mMaterialName; }
353 void build();
356 Real lodValue);
358 const MaterialPtr& getMaterial(void) const { return mMaterial; }
364 Technique* getCurrentTechnique(void) const { return mTechnique; }
366 void dump(std::ofstream& of) const;
373 void setLastIndex(int index){mLastIndex=index;}
374 int getLastIndex(){return mLastIndex;}
375 void setMaterial(const String & name);
377
378 };
385 {
386 public:
389 protected:
393 unsigned short mLod;
400 public:
401 LODBucket(BatchInstance* parent, unsigned short lod, Real lodValue);
402 virtual ~LODBucket();
403 BatchInstance* getParent(void) { return mParent; }
405 ushort getLod(void) const { return mLod; }
407 Real getLodValue(void) const { return mLodValue; }
411 void build();
414 Real lodValue);
420 void dump(std::ofstream& of) const;
424
425 };
435 {
436 friend class MaterialBucket;
437 public:
438
439
444 protected:
445
456
458 public:
473 protected:
478
479 public:
482 virtual ~BatchInstance();
483 // more fields can be added in subclasses
484 InstancedGeometry* getParent(void) const { return mParent;}
488 void build();
490 uint32 getID(void) const { return mBatchInstanceID; }
492// const Vector3& getCentre(void) const { return mCentre; }
493 const String& getMovableType(void) const;
495 const AxisAlignedBox& getBoundingBox(void) const;
499 bool isVisible(void) const;
502 bool debugRenderables = false);
503
504 // uint32 getTypeFlags(void) const;
505
510 const LightList& getLights(void) const;
511
514
516 void dump(std::ofstream& of) const;
521 void addInstancedObject(unsigned short index, InstancedObject* object);
524 SceneNode*getSceneNode(void){return mNode;}
525 ObjectsMap& getInstancesMap(void){return mInstancesMap;}
527
528 };
539 protected:
540 // General state & settings
543 bool mBuilt;
558 unsigned int mObjectCount;
573
579
599 ushort& x, ushort& y, ushort& z);
609 ushort x, ushort y, ushort z);
618 const Vector3& position, const Quaternion& orientation,
619 const Vector3& scale);
625
631 template <typename T>
633 {
634 remap.clear();
635 for (size_t i = 0; i < numIndexes; ++i)
636 {
637 // use insert since duplicates are silently discarded
638 remap.insert(IndexRemap::value_type(*pBuffer++, remap.size()));
639 // this will have mapped oldindex -> new index IF oldindex
640 // wasn't already there
641 }
642 }
644 template <typename T>
645 void remapIndexes(T* src, T* dst, const IndexRemap& remap,
646 size_t numIndexes)
647 {
648 for (size_t i = 0; i < numIndexes; ++i)
649 {
650 // look up original and map to target
651 IndexRemap::const_iterator ix = remap.find(*src++);
652 assert(ix != remap.end());
653 *dst++ = static_cast<T>(ix->second);
654 }
655 }
656
657 public:
662
664 const String& getName(void) const { return mName; }
684 virtual void addEntity(Entity* ent, const Vector3& position,
685 const Quaternion& orientation = Quaternion::IDENTITY,
686 const Vector3& scale = Vector3::UNIT_SCALE);
687
707 virtual void addSceneNode(const SceneNode* node);
708
719 virtual void build(void);
734 virtual void destroy(void);
735
739 virtual void reset(void);
740
751 mUpperDistance = dist;
752 mSquaredUpperDistance = mUpperDistance * mUpperDistance;
753 }
754
756 virtual Real getRenderingDistance(void) const { return mUpperDistance; }
757
760 { return mSquaredUpperDistance; }
761
763 virtual void setVisible(bool visible);
764
766 virtual bool isVisible(void) const { return mVisible; }
767
785 virtual void setCastShadows(bool castShadows);
787 virtual bool getCastShadows(void) { return mCastShadows; }
788
799 virtual void setBatchInstanceDimensions(const Vector3& size) {
800 mBatchInstanceDimensions = size;
801 mHalfBatchInstanceDimensions = size * 0.5;
802 }
804 virtual const Vector3& getBatchInstanceDimensions(void) const { return mBatchInstanceDimensions; }
816 virtual void setOrigin(const Vector3& origin) { mOrigin = origin; }
818 virtual const Vector3& getOrigin(void) const { return mOrigin; }
819
832
834 virtual uint8 getRenderQueueGroup(void) const;
843 bool debugRenderables = false);
844
848 virtual void dump(const String& filename) const;
853 SkeletonInstance *getBaseSkeletonInstance(void){return mSkeletonInstance;}
858 SkeletonPtr getBaseSkeleton(void){return mBaseSkeleton;}
863 AnimationStateSet* getBaseAnimationState(void){return mAnimationState;}
868 unsigned int getObjectCount(void){return mObjectCount;}
869
876 virtual void setProvideWorldInverses(bool flag);
877
883 virtual bool getProvideWorldInverses(void) const { return mProvideWorldInverses; }
884 };
885
888}
889
890#include "OgreHeaderSuffix.h"
891
892#endif
893
#define _OgreExport
#define _OgrePrivate
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Class encapsulating a set of AnimationState objects.
Represents the state of an animation and the weight of its influence.
A 3D box aligned with the x/y/z axes.
A viewpoint from which the scene will be rendered.
Definition OgreCamera.h:87
Defines an instance of a discrete, movable object based on a Mesh.
Definition OgreEntity.h:83
Summary class collecting together index data source information.
The details of a topological BatchInstance which is the highest level of partitioning for this class.
void attachToScene()
attach the BatchInstance to the scene
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables=false)
Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject ...
void setBoundingBox(AxisAlignedBox &box)
bool isVisible(void) const
Returns whether or not this object is supposed to be visible or not.
InstancedObjectIterator getObjectIterator()
uint32 mBatchInstanceID
Unique identifier for the BatchInstance.
void assign(QueuedSubMesh *qmesh)
Assign a queued mesh to this BatchInstance, read for final build.
SceneManager * mSceneMgr
Scene manager link.
const String & getMovableType(void) const
Get the centre point of the BatchInstance.
vector< LODBucket * >::type LODBucketList
list of LOD Buckets in this BatchInstance
const LodStrategy * mLodStrategy
LOD strategy reference.
InstancedObject * isInstancedObjectPresent(unsigned short index)
void addInstancedObject(unsigned short index, InstancedObject *object)
InstancedGeometry * mParent
Parent static geometry.
void updateBoundingBox()
update the bounding box of the BatchInstance according to the positions of the objects
Real getBoundingRadius(void) const
Retrieves the radius of the origin-centered bounding sphere for this object.
ushort mCurrentLod
The current LOD level, as determined from the last camera.
AxisAlignedBox mAABB
Local AABB relative to BatchInstance centre.
uint32 getID(void) const
Get the BatchInstance ID of this BatchInstance.
Real mSquaredViewDepth
Cached squared view depth value to avoid recalculation by GeometryBucket.
void build()
Build this BatchInstance.
const AxisAlignedBox & getBoundingBox(void) const
Retrieves the local axis-aligned bounding box for this object.
VectorIterator< LODBucketList > LODIterator
QueuedSubMeshList mQueuedSubMeshes
Local list of queued meshes (not used for deallocation)
void dump(std::ofstream &of) const
Dump contents for diagnostics.
InstancedGeometry * getParent(void) const
void _updateRenderQueue(RenderQueue *queue)
Internal method by which the movable object must add Renderable subclass instances to the rendering q...
LODBucketList mLodBucketList
List of LOD buckets
map< unsignedshort, InstancedObject * >::type ObjectsMap
Mesh::LodValueList mLodValues
LOD values as built up - use the max at each level.
BatchInstance(InstancedGeometry *parent, const String &name, SceneManager *mgr, uint32 BatchInstanceID)
void _notifyCurrentCamera(Camera *cam)
Internal method to notify the object of the camera to be used for the next rendering operation.
Real mLodValue
Current LOD value, passed on to do material LOD later.
const LightList & getLights(void) const
Shared set of lights for all GeometryBuckets.
LODIterator getLODIterator(void)
Get an iterator over the LODs in this BatchInstance.
MapIterator< ObjectsMap > InstancedObjectIterator
Camera * mCamera
Current camera, passed on to do material LOD later.
void updateContainers(LODBucket *bucket)
fill in the list
A GeometryBucket is a the lowest level bucket where geometry with the same vertex & index format is s...
void _initGeometryBucket(GeometryBucket *bucket)
GeometryBucket(const String &name, MaterialBucket *parent, const String &formatString, GeometryBucket *bucket)
const IndexData * getIndexData(void) const
Get the index data for this geometry.
Real getBoundingRadius(void) const
Retrieves the radius of the origin-centered bounding sphere for this object.
void _initGeometryBucket(const VertexData *vData, const IndexData *iData)
InstancedGeometry * mBatch
Pointer to the Batch.
AxisAlignedBox & getAABB(void)
Return the BoundingBox information. Useful when cloning the batch instance.
bool assign(QueuedGeometry *qsm)
Try to assign geometry to this bucket.
size_t mMaxVertexIndex
Maximum vertex indexable.
GeometryBucket(const String &name, MaterialBucket *parent, const String &formatString, const VertexData *vData, const IndexData *iData)
IndexData * mIndexData
Index information, includes index type which limits the max number of vertices which are allowed in o...
unsigned short mTexCoordIndex
Index of the Texcoord where the index is stored.
String mFormatString
String identifying the vertex / index format.
Real getSquaredViewDepth(const Camera *cam) const
Returns the camera-relative squared depth of this renderable.
GeometryBucket(MaterialBucket *parent, const String &formatString, GeometryBucket *bucket)
Technique * getTechnique(void) const
Retrieves a pointer to the Material Technique this renderable object uses.
void getWorldTransforms(Matrix4 *xform) const
Gets the world transform matrix / matrices for this renderable object.
HardwareIndexBuffer::IndexType mIndexType
Size of indexes.
const MaterialPtr & getMaterial(void) const
Retrieves a weak reference to the material this renderable object uses.
const VertexData * getVertexData(void) const
Get the vertex data for this geometry.
MaterialBucket * mParent
Pointer to parent bucket.
VertexData * mVertexData
Vertex information, includes current number of vertices committed to be a part of this bucket.
QueuedGeometryList mQueuedGeometry
Geometry which has been queued up pre-build (not for deallocation)
virtual unsigned short getNumWorldTransforms(void) const
Returns the number of world transform matrices this renderable requires.
void copyIndexes(const T *src, T *dst, size_t count, size_t indexOffset)
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables)
Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject ...
void dump(std::ofstream &of) const
Dump contents for diagnostics.
const LightList & getLights(void) const
Gets a list of lights, ordered relative to how close they are to this renderable.
bool getCastsShadows(void) const
Method which reports whether this renderable would normally cast a shadow.
GeometryBucket(MaterialBucket *parent, const String &formatString, const VertexData *vData, const IndexData *iData)
void setScale(const Vector3 &scale)
AnimationStateSet * mAnimationState
State of animation for animable meshes.
AnimationState * getAnimationState(const String &name) const
void setPositionAndOrientation(Vector3 p, const Quaternion &q)
@ TS_PARENT
Transform is relative to the space of the parent node.
@ TS_LOCAL
Transform is relative to the local space.
void addBucketToList(GeometryBucket *bucket)
void translate(const Matrix3 &axes, const Vector3 &move)
InstancedObject(unsigned short index, SkeletonInstance *skeleton, AnimationStateSet *animations)
Matrix4 * mBoneMatrices
Cached bone matrices in skeleton local space.
const Vector3 & getPosition(void) const
unsigned long mFrameAnimationLastUpdated
Records the last frame in which animation was updated.
Matrix4 * mBoneWorldMatrices
Cached bone matrices, including any world transform.
void setOrientation(const Quaternion &q)
vector< GeometryBucket * >::type GeometryBucketList
list of Geometry Buckets that contains the instanced object
void rotate(const Quaternion &q)
A LODBucket is a collection of smaller buckets with the same LOD.
ushort getLod(void) const
Get the LOD index.
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables)
MaterialIterator getMaterialIterator(void)
Get an iterator over the materials in this LOD.
MapIterator< MaterialBucketMap > MaterialIterator
Iterator over the materials in this LOD.
Real getLodValue(void) const
Get the LOD value.
map< String, MaterialBucket * >::type MaterialBucketMap
Lookup of Material Buckets in this BatchInstance.
QueuedGeometryList mQueuedGeometryList
Geometry queued for a single LOD (deallocated here)
LODBucket(BatchInstance *parent, unsigned short lod, Real lodValue)
Real mLodValue
LOD value at which this LOD starts to apply (squared)
BatchInstance * mParent
Pointer to parent BatchInstance.
void dump(std::ofstream &of) const
Dump contents for diagnostics.
void addRenderables(RenderQueue *queue, uint8 group, Real lodValue)
Add children to the render queue.
void assign(QueuedSubMesh *qsm, ushort atLod)
Assign a queued submesh to this bucket, using specified mesh LOD.
void updateContainers(MaterialBucket *bucket, String &name)
fill the map
unsigned short mLod
LOD level (0 == full LOD)
MaterialBucketMap mMaterialBucketMap
Lookup of Material Buckets in this BatchInstance.
A MaterialBucket is a collection of smaller buckets with the same Material (and implicitly the same L...
LODBucket * mParent
Pointer to parent LODBucket.
GeometryBucketList mGeometryBucketList
list of Geometry Buckets in this BatchInstance
GeometryIterator getGeometryIterator(void)
Get an iterator over the contained geometry.
void updateContainers(GeometryBucket *bucket, const String &format)
fill in the map and the list
MaterialPtr mMaterial
Pointer to material being used.
map< String, GeometryBucket * >::type CurrentGeometryMap
void setMaterial(const String &name)
MaterialBucket(LODBucket *parent, const String &materialName)
String getGeometryFormatString(SubMeshLodGeometryLink *geom)
Get a packed string identifying the geometry format.
void dump(std::ofstream &of) const
Dump contents for diagnostics.
const MaterialPtr & getMaterial(void) const
Get the material for this bucket.
void assign(QueuedGeometry *qsm)
Assign geometry to this bucket.
Technique * getCurrentTechnique(void) const
Get the current Technique.
MaterialBucket::GeometryBucketList * getGeometryBucketList(void) const
Return the geometry list.
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables)
VectorIterator< GeometryBucketList > GeometryIterator
Iterator over geometry.
void addRenderables(RenderQueue *queue, uint8 group, Real lodValue)
Add children to the render queue.
MaterialBucket::CurrentGeometryMap * getMaterialBucketMap(void) const
Return the geometry map.
const String & getMaterialName(void) const
Get the material name.
vector< GeometryBucket * >::type GeometryBucketList
list of Geometry Buckets in this BatchInstance
Struct holding geometry optimised per SubMesh / LOD level, ready for copying to instances.
Pre-transforms and batches up meshes for efficient use as instanced geometry in a scene.
virtual BatchInstance * getBatchInstance(const AxisAlignedBox &bounds, bool autoCreate)
Virtual method for getting a BatchInstance most suitable for the passed in bounds.
virtual bool getProvideWorldInverses(void) const
unsigned int mObjectCount
number of objects in the batch
void buildIndexRemap(T *pBuffer, size_t numIndexes, IndexRemap &remap)
Method for figuring out which vertices are used by an index buffer and calculating a remap lookup for...
bool mProvideWorldInverses
Flags to indicate whether the World Transform Inverse matrices are passed to the shaders.
virtual uint32 packIndex(ushort x, ushort y, ushort z)
Pack 3 indexes into a single index value.
virtual uint8 getRenderQueueGroup(void) const
Gets the queue group for this entity, see setRenderQueueGroup for full details.
MapIterator< BatchInstanceMap > BatchInstanceIterator
Iterator for iterating over contained BatchInstances.
virtual Real getVolumeIntersection(const AxisAlignedBox &box, ushort x, ushort y, ushort z)
Get the volume intersection for an indexed BatchInstance with some bounds.
SkeletonPtr mBaseSkeleton
this is just a pointer to the base skeleton that will be used for each animated object in the batches...
SkeletonInstance * getBaseSkeletonInstance(void)
virtual void setBatchInstanceDimensions(const Vector3 &size)
Sets the size of a single BatchInstance of geometry.
virtual bool isVisible(void) const
Are the batches visible?
virtual void setProvideWorldInverses(bool flag)
void addBatchInstance(void)
Add a new batch instance.
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables=false)
Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject ...
vector< String >::type QueuedSubMeshOriginList
virtual bool getCastShadows(void)
Will the geometry from this object cast shadows?
AnimationStateSet * getBaseAnimationState(void)
virtual AxisAlignedBox calculateBounds(VertexData *vertexData, const Vector3 &position, const Quaternion &orientation, const Vector3 &scale)
Calculate world bounds from a set of vertex data.
uint8 mRenderQueueID
The render queue to use when rendering this object.
unsigned int getObjectCount(void)
virtual void addEntity(Entity *ent, const Vector3 &position, const Quaternion &orientation=Quaternion::IDENTITY, const Vector3 &scale=Vector3::UNIT_SCALE)
Adds an Entity to the static geometry.
BatchInstance * mInstancedGeometryInstance
virtual Real getRenderingDistance(void) const
Gets the distance at which batches are no longer rendered.
virtual BatchInstance * getBatchInstance(uint32 index)
Get the BatchInstance using a packed index, returns null if it doesn't exist.
map< size_t, size_t >::type IndexRemap
OptimisedSubMeshGeometryList mOptimisedSubMeshGeometryList
List of geometry which has been optimised for SubMesh use This is the primary storage used for cleani...
virtual AxisAlignedBox getBatchInstanceBounds(ushort x, ushort y, ushort z)
Get the bounds of an indexed BatchInstance.
RenderOperationVector & getRenderOperationVector()
get the mRenderOps vector.
virtual void getBatchInstanceIndexes(const Vector3 &point, ushort &x, ushort &y, ushort &z)
Get the BatchInstance indexes for a point.
vector< SubMeshLodGeometryLink >::type SubMeshLodGeometryLinkList
virtual void setCastShadows(bool castShadows)
Sets whether this geometry should cast shadows.
SkeletonInstance * mSkeletonInstance
virtual const Vector3 & getBatchInstanceDimensions(void) const
Gets the size of a single batch of geometry.
map< SubMesh *, SubMeshLodGeometryLinkList * >::type SubMeshGeometryLookup
SubMeshLodGeometryLinkList * determineGeometry(SubMesh *sm)
Look up or calculate the geometry data to use for this SubMesh.
virtual void setOrigin(const Vector3 &origin)
Sets the origin of the geometry.
void splitGeometry(VertexData *vd, IndexData *id, SubMeshLodGeometryLink *targetGeomLink)
Split some shared geometry into dedicated geometry.
virtual BatchInstance * getBatchInstance(const Vector3 &point, bool autoCreate)
Get the BatchInstance within which a point lies.
virtual void setVisible(bool visible)
Hides or shows all the batches.
bool mRenderQueueIDSet
Flags whether the RenderQueue's default should be used.
InstancedGeometry(SceneManager *owner, const String &name)
Constructor; do not use directly (.
const String & getName(void) const
Get the name of this object.
virtual BatchInstance * getBatchInstance(ushort x, ushort y, ushort z, bool autoCreate)
Get the BatchInstance using indexes.
virtual void build(void)
Build the geometry.
virtual void reset(void)
Clears any of the entities / nodes added to this geometry and destroys anything which has already bee...
virtual const Vector3 & getOrigin(void) const
Gets the origin of this geometry.
vector< QueuedGeometry * >::type QueuedGeometryList
virtual Vector3 getBatchInstanceCentre(ushort x, ushort y, ushort z)
Get the centre of an indexed BatchInstance.
SubMeshGeometryLookup mSubMeshGeometryLookup
Cached links from SubMeshes to (potentially optimised) geometry This is not used for deletion since t...
map< uint32, BatchInstance * >::type BatchInstanceMap
Indexed BatchInstance map based on packed x/y/z BatchInstance index, 10 bits for each axis.
virtual BatchInstance * getInstancedGeometryInstance(void)
get the first BatchInstance or create on if it does not exists.
list< OptimisedSubMeshGeometry * >::type OptimisedSubMeshGeometryList
virtual void destroy(void)
Destroys all the built geometry state (reverse of build).
BatchInstanceIterator getBatchInstanceIterator(void)
Get an iterator over the BatchInstances in this geometry.
BatchInstanceMap mBatchInstanceMap
Map of BatchInstances.
void remapIndexes(T *src, T *dst, const IndexRemap &remap, size_t numIndexes)
Method for altering indexes based on a remap.
vector< QueuedSubMesh * >::type QueuedSubMeshList
AnimationStateSet * mAnimationState
This is the main animation state.
virtual void setRenderQueueGroup(uint8 queueID)
Sets the render queue group this object will be rendered through.
vector< RenderOperation * >::type RenderOperationVector
Simple vectors where are stored all the render operations of the Batch.
virtual void addSceneNode(const SceneNode *node)
Adds all the Entity objects attached to a SceneNode and all it's children to the static geometry.
virtual void setRenderingDistance(Real dist)
Sets the distance at which batches are no longer rendered.
virtual Real getSquaredRenderingDistance(void) const
Gets the squared distance at which batches are no longer rendered.
virtual ~InstancedGeometry()
Destructor.
RenderOperationVector mRenderOps
This vector stores all the renderOperation used in the batch.
virtual void dump(const String &filename) const
Dump the contents of this InstancedGeometry to a file for diagnostic purposes.
Strategy for determining level of detail.
A 3x3 matrix which can represent rotations around axes.
Definition OgreMatrix3.h:69
Class encapsulating a standard 4x4 homogeneous matrix.
Definition OgreMatrix4.h:79
Abstract class defining a movable object in a scene.
Implementation of a Quaternion, i.e.
Wrapper class which indicates a given angle value is in Radians.
Definition OgreMath.h:48
Class to manage the scene object rendering queue.
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
Manages the organisation and rendering of a 'scene' i.e.
Class representing a node in the scene graph.
Reference-counted shared pointer, used for objects where implicit destruction is required.
Simple implementation of MovableObject and Renderable for single-part custom objects.
A SkeletonInstance is a single instance of a Skeleton used by a world object.
Defines a part of a complete mesh.
Definition OgreSubMesh.h:63
Class representing an approach to rendering this particular Material.
Standard 3-dimensional vector.
Definition OgreVector3.h:52
Summary class collecting together vertex source information.
_StringBase String
Structure recording a queued geometry for low level builds.
Structure recording a queued submesh for the build.
SubMeshLodGeometryLinkList * geometryLodList
Link to LOD list of geometry, potentially optimised.
AxisAlignedBox worldBounds
Pre-transformed world AABB.
std::list< T, A > type
std::map< K, V, P, A > type
std::vector< T, A > type