Go to the documentation of this file.
28 #ifndef __InstanceBatch_H__
29 #define __InstanceBatch_H__
175 const String &batchName );
247 bool isBatchUnused(
void)
const {
return mUnusedEntities.size() == mInstancedEntities.size(); }
364 #endif // __InstanceBatch_H__
vector< unsigned short >::type IndexMap
RenderOperation mRenderOperation
virtual bool useBoneWorldMatrices() const
Tells whether world bone matrices need to be calculated.
virtual void deleteUnusedInstancedEntities(void)
bool isBatchUnused(void) const
Returns true if it no instanced entity has been requested or all of them have been removed.
virtual InstancedEntity * generateInstancedEntity(size_t num)
Creates a new InstancedEntity instance.
A viewpoint from which the scene will be rendered.
virtual void _boundsDirty(void)
Called by InstancedEntity(s) to tell us we need to update the bounds (we touch the SceneNode so the S...
void _defragmentBatch(bool optimizeCulling, InstancedEntityVec &usedEntities, CustomParamsVec &usedParams)
vector< Vector4 >::type CustomParamsVec
This is the main starting point for the new instancing system.
void removeInstancedEntity(InstancedEntity *instancedEntity)
Removes an InstancedEntity from the scene retrieved with getNewInstancedEntity, putting back into a q...
Abstract class defining a movable object in a scene.
Mesh::IndexMap const * mIndexToBoneMap
bool _supportsSkeletalAnimation() const
Returns true if this technique supports skeletal animation.
virtual void setupIndices(const SubMesh *baseSubMesh)=0
Class representing an approach to rendering this particular Material.
Technique * getTechnique(void) const
virtual size_t calculateMaxNumInstances(const SubMesh *baseSubMesh, uint16 flags) const =0
Some techniques have a limit on how many instances can be done.
const AxisAlignedBox & getBoundingBox(void) const
virtual void buildFrom(const SubMesh *baseSubMesh, const RenderOperation &renderOperation)
Instancing consumes significantly more GPU memory than regular rendering methods.
bool mRemoveOwnVertexData
When true remove the memory of the VertexData we've created because no one else will.
InstanceManager * mCreator
void makeMatrixCameraRelative3x4(float *mat3x4, size_t numFloats)
Takes an array of 3x4 matrices and makes it camera relative.
void updateVisibility(void)
Defines a part of a complete mesh.
InstancedEntityVec mUnusedEntities
void _defragmentBatchDiscard(void)
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables=false)
Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject ...
InstancedEntityVec mInstancedEntities
const Ogre::MeshPtr & _getMeshReference(void) const
virtual OGRE_DEPRECATED const Any & getUserAny(void) const
void _setInstancesPerBatch(size_t instancesPerBatch)
Raises an exception if trying to change it after being built.
A 3D box aligned with the x/y/z axes.
InstanceBatch(InstanceManager *creator, MeshPtr &meshReference, const MaterialPtr &material, size_t instancesPerBatch, const Mesh::IndexMap *indexToBoneMap, const String &batchName)
bool isBatchFull(void) const
unsigned short mMaterialLodIndex
void defragmentBatchNoCull(InstancedEntityVec &usedEntities, CustomParamsVec &usedParams)
virtual void createAllInstancedEntities(void)
virtual void setStaticAndUpdate(bool bStatic)
Tells this batch to stop updating animations, positions, rotations, and display all it's active insta...
Real getBoundingRadius(void) const
bool mTechnSupportsSkeletal
False if a technique doesn't support skeletal animation.
void getRenderOperation(RenderOperation &op)
virtual void _updateRenderQueue(RenderQueue *queue)
Internal method by which the movable object must add Renderable subclass instances to the rendering q...
vector< InstancedEntity * >::type InstancedEntityVec
virtual void deleteAllInstancedEntities(void)
const MaterialPtr & getMaterial(void) const
size_t mInstancesPerBatch
virtual RenderOperation build(const SubMesh *baseSubMesh)
Constructs all the data needed to use this batch, as well as the InstanceEntities.
4-dimensional homogeneous vector.
const String & getMovableType(void) const
bool mRemoveOwnIndexData
When true remove the memory of the IndexData we've created because no one else will.
virtual OGRE_DEPRECATED void setUserAny(const Any &anything)
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
const Camera * mCachedCamera
The camera for which the cached distance is valid.
Abstract class defining the interface all renderable objects must implement.
void _setCustomParam(InstancedEntity *instancedEntity, unsigned char idx, const Vector4 &newParam)
virtual void setupVertices(const SubMesh *baseSubMesh)=0
float Real
Software floating point type.
InstanceBatch forms part of the new Instancing system This is an abstract class that must be derived ...
void getInstancedEntitiesInUse(InstancedEntityVec &outEntities, CustomParamsVec &outParams)
Fills the input vector with the instances that are currently being used or were requested.
const Mesh::IndexMap * _getIndexToBoneMap() const
CustomParamsVec mCustomParams
Real mCachedCameraDist
Cached distance to last camera for getSquaredViewDepth.
virtual bool checkSubMeshCompatibility(const SubMesh *baseSubMesh)
Returns false on errors that would prevent building this batch from the given submesh.
const Vector4 & _getCustomParam(InstancedEntity *instancedEntity, unsigned char idx)
Real getSquaredViewDepth(const Camera *cam) const
void defragmentBatchDoCull(InstancedEntityVec &usedEntities, CustomParamsVec &usedParams)
virtual bool isStatic() const
Returns true if this batch was set as static.
bool mTransformSharingDirty
Tells that the list of entity instances with shared transforms has changed.
AxisAlignedBox mFullBoundingBox
This bbox contains all (visible) instanced entities.
void _markTransformSharingDirty()
Tells that the list of entity instances with shared transforms has changed.
'New' rendering operation using vertex buffers.
void _notifyCurrentCamera(Camera *cam)
Class to manage the scene object rendering queue.
InstancedEntity * createInstancedEntity()
Returns a pointer to a new InstancedEntity ready to use Note it's actually preallocated,...
const LightList & getLights(void) const
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.