28 #ifndef __InstanceBatch_H__
29 #define __InstanceBatch_H__
138 virtual void setupVertices(
const SubMesh* baseSubMesh ) = 0;
139 virtual void setupIndices(
const SubMesh* baseSubMesh ) = 0;
140 virtual void createAllInstancedEntities(
void);
141 virtual void deleteAllInstancedEntities(
void);
142 virtual void deleteUnusedInstancedEntities(
void);
150 void makeMatrixCameraRelative3x4(
float *mat3x4,
size_t numFloats );
153 virtual bool checkSubMeshCompatibility(
const SubMesh* baseSubMesh );
155 void updateVisibility(
void);
170 const String &batchName );
177 void _setInstancesPerBatch(
size_t instancesPerBatch );
190 void _updateBounds(
void);
202 virtual size_t calculateMaxNumInstances(
const SubMesh *baseSubMesh,
uint16 flags )
const = 0;
242 bool isBatchUnused(
void)
const {
return mUnusedEntities.size() == mInstancedEntities.size(); }
247 void getInstancedEntitiesInUse( InstancedEntityVec &outEntities );
260 void _defragmentBatch(
bool optimizeCulling, InstancedEntityVec &usedEntities );
267 void _defragmentBatchDiscard(
void);
272 virtual void _boundsDirty(
void);
324 Real getSquaredViewDepth(
const Camera* cam )
const;
326 const LightList& getLights(
void )
const;
331 const String& getMovableType(
void)
const;
333 void _notifyCurrentCamera(
Camera* cam );
337 Real getBoundingRadius(
void)
const;
339 virtual void _updateRenderQueue(
RenderQueue* queue);
A viewpoint from which the scene will be rendered.
const MaterialPtr & getMaterial(void) const
Mesh::IndexMap const * mIndexToBoneMap
virtual bool useBoneWorldMatrices() const
Tells whether world bone matrices need to be calculated.
float Real
Software floating point type.
vector< unsigned short >::type IndexMap
bool isBatchFull(void) const
unsigned short mMaterialLodIndex
virtual void setStaticAndUpdate(bool bStatic)
Tells this batch to stop updating animations, positions, rotations, and display all it's active insta...
A 3D box aligned with the x/y/z axes.
AxisAlignedBox mFullBoundingBox
This bbox contains all (visible) instanced entities.
bool mTechnSupportsSkeletal
False if a technique doesn't support skeletal animation.
Real mCachedCameraDist
Cached distance to last camera for getSquaredViewDepth.
bool mRemoveOwnVertexData
When true remove the memory of the VertexData we've created because no one else will.
Class representing an approach to rendering this particular Material.
const Ogre::MeshPtr & _getMeshReference(void) const
size_t mInstancesPerBatch
bool mRemoveOwnIndexData
When true remove the memory of the IndexData we've created because no one else will.
Abstract class defining a movable object in a scene.
InstancedEntityVec mInstancedEntities
bool mBoundsUpdated
Set to false by derived classes that need it.
Abstract class defining the interface all renderable objects must implement.
void getRenderOperation(RenderOperation &op)
bool _supportsSkeletalAnimation() const
Returns true if this technique supports skeletal animation.
InstanceManager * mCreator
bool mDirtyAnimation
Set to false at start of each _updateRenderQueue.
bool mTransformSharingDirty
Tells that the list of entity instances with shared transforms has changed.
virtual bool isStatic() const
Returns true if this batch was set as static.
const Mesh::IndexMap * _getIndexToBoneMap() const
const Camera * mCachedCamera
The camera for which the cached distance is valid.
Visitor object that can be used to iterate over a collection of Renderable instances abstractly...
Defines a part of a complete mesh.
virtual const Any & getUserAny(void) const
InstanceBatch forms part of the new Instancing system This is an abstract class that must be derived ...
bool isBatchUnused(void) const
Returns true if it no instanced entity has been requested or all of them have been removed...
'New' rendering operation using vertex buffers.
Class to manage the scene object rendering queue.
This is the main starting point for the new instancing system.
RenderOperation mRenderOperation
void _markTransformSharingDirty()
Tells that the list of entity instances with shared transforms has changed.
virtual void setUserAny(const Any &anything)
Specialisation of SharedPtr to allow SharedPtr to be assigned to MaterialPtr.
vector< InstancedEntity * >::type InstancedEntityVec
Specialisation of SharedPtr to allow SharedPtr to be assigned to MeshPtr.
InstancedEntityVec mUnusedEntities