28 #ifndef __InstanceBatch_H__ 29 #define __InstanceBatch_H__ 143 virtual void setupVertices(
const SubMesh* baseSubMesh ) = 0;
144 virtual void setupIndices(
const SubMesh* baseSubMesh ) = 0;
145 virtual void createAllInstancedEntities(
void);
146 virtual void deleteAllInstancedEntities(
void);
147 virtual void deleteUnusedInstancedEntities(
void);
155 void makeMatrixCameraRelative3x4(
float *mat3x4,
size_t numFloats );
158 virtual bool checkSubMeshCompatibility(
const SubMesh* baseSubMesh );
160 void updateVisibility(
void);
163 void defragmentBatchNoCull( InstancedEntityVec &usedEntities, CustomParamsVec &usedParams );
170 void defragmentBatchDoCull( InstancedEntityVec &usedEntities, CustomParamsVec &usedParams );
175 const String &batchName );
182 void _setInstancesPerBatch(
size_t instancesPerBatch );
195 void _updateBounds(
void);
207 virtual size_t calculateMaxNumInstances(
const SubMesh *baseSubMesh,
uint16 flags )
const = 0;
247 bool isBatchUnused(
void)
const {
return mUnusedEntities.size() == mInstancedEntities.size(); }
252 void getInstancedEntitiesInUse( InstancedEntityVec &outEntities, CustomParamsVec &outParams );
267 void _defragmentBatch(
bool optimizeCulling, InstancedEntityVec &usedEntities,
268 CustomParamsVec &usedParams );
275 void _defragmentBatchDiscard(
void);
280 virtual void _boundsDirty(
void);
338 Real getSquaredViewDepth(
const Camera* cam )
const;
340 const LightList& getLights(
void )
const;
345 const String& getMovableType(
void)
const;
347 void _notifyCurrentCamera(
Camera* cam );
351 Real getBoundingRadius(
void)
const;
353 virtual void _updateRenderQueue(
RenderQueue* queue);
364 #endif // __InstanceBatch_H__
void _markTransformSharingDirty()
Tells that the list of entity instances with shared transforms has changed.
bool isBatchUnused(void) const
Returns true if it no instanced entity has been requested or all of them have been removed...
Abstract class defining the interface all renderable objects must implement.
Abstract class defining a movable object in a scene.
virtual bool isStatic() const
Returns true if this batch was set as static.
4-dimensional homogeneous vector.
InstancedEntityVec mUnusedEntities
float Real
Software floating point type.
virtual OGRE_DEPRECATED void setUserAny(const Any &anything)
Mesh::IndexMap const * mIndexToBoneMap
Class to manage the scene object rendering queue.
bool mTechnSupportsSkeletal
False if a technique doesn't support skeletal animation.
virtual OGRE_DEPRECATED const Any & getUserAny(void) const
Defines a part of a complete mesh.
const Ogre::MeshPtr & _getMeshReference(void) const
bool mRemoveOwnIndexData
When true remove the memory of the IndexData we've created because no one else will.
virtual void setStaticAndUpdate(bool bStatic)
Tells this batch to stop updating animations, positions, rotations, and display all it's active insta...
Visitor object that can be used to iterate over a collection of Renderable instances abstractly...
bool isBatchFull(void) const
This is the main starting point for the new instancing system.
bool _supportsSkeletalAnimation() const
Returns true if this technique supports skeletal animation.
InstanceManager * mCreator
size_t mInstancesPerBatch
A viewpoint from which the scene will be rendered.
unsigned short mMaterialLodIndex
InstanceBatch forms part of the new Instancing system This is an abstract class that must be derived ...
const Camera * mCachedCamera
The camera for which the cached distance is valid.
vector< InstancedEntity * >::type InstancedEntityVec
const MaterialPtr & getMaterial(void) const
vector< Vector4 >::type CustomParamsVec
const Mesh::IndexMap * _getIndexToBoneMap() const
RenderOperation mRenderOperation
virtual bool useBoneWorldMatrices() const
Tells whether world bone matrices need to be calculated.
'New' rendering operation using vertex buffers.
Class representing an approach to rendering this particular Material.
bool mTransformSharingDirty
Tells that the list of entity instances with shared transforms has changed.
bool mRemoveOwnVertexData
When true remove the memory of the VertexData we've created because no one else will.
CustomParamsVec mCustomParams
vector< unsigned short >::type IndexMap
InstancedEntityVec mInstancedEntities
Real mCachedCameraDist
Cached distance to last camera for getSquaredViewDepth.
A 3D box aligned with the x/y/z axes.
void getRenderOperation(RenderOperation &op)
AxisAlignedBox mFullBoundingBox
This bbox contains all (visible) instanced entities.