28 #ifndef __InstanceManager_H__
29 #define __InstanceManager_H__
72 InstancingTechniquesCount
90 bool setting[NUM_SETTINGS];
94 setting[CAST_SHADOWS] =
true;
95 setting[SHOW_BOUNDINGBOX] =
false;
160 size_t instancesPerBatch,
unsigned short subMeshIdx,
bool useBoneMatrixLookup =
false);
172 void setInstancesPerBatch(
size_t instancesPerBatch );
182 void setMaxLookupTableInstances(
size_t maxLookupTableInstances );
202 void setNumCustomParams(
unsigned char numCustomParams );
205 {
return mNumCustomParams; }
209 {
return mInstancingTechnique; }
222 size_t getMaxOrBestNumInstancesPerBatch(
String materialName,
size_t suggestedSize,
uint16 flags );
233 void cleanupEmptyBatches(
void);
258 void defragmentBatches(
bool optimizeCulling );
278 bool getSetting( BatchSettingId
id,
const String &materialName )
const;
284 {
return mBatchSettings.find( materialName ) != mBatchSettings.end(); }
287 void setBatchesAsStaticAndUpdate(
bool bStatic );
295 void _updateDirtyBatches(
void);
312 InstanceBatchMap::const_iterator it = mInstanceBatches.find( materialName );
313 if(it != mInstanceBatches.end())
317 "Material " + materialName +
" cannot be found.",
"InstanceManager::getInstanceBatchIterator");
324 #endif // __InstanceManager_H__
unsigned char mNumCustomParams
BatchSettingsMap mBatchSettings
size_t mMaxLookupTableInstances
size_t mInstancesPerBatch
bool hasSettings(const String &materialName) const
Returns true if settings were already created for the given material name.
map< String, BatchSettings >::type BatchSettingsMap
Manages the organisation and rendering of a 'scene' i.e.
ConstVectorIterator< InstanceBatchVec > InstanceBatchIterator
InstanceBatchVec mDirtyBatches
Needs Vertex Texture Fetch & SM 3.0+.
InstanceBatchIterator getInstanceBatchIterator(const String &materialName) const
Get non-updateable iterator over instance batches for given material.
InstanceBatchMapIterator getInstanceBatchMapIterator(void) const
Get non-updateable iterator over instance batches per material.
SceneManager * mSceneManager
unsigned short mSubMeshIdx
unsigned char getNumCustomParams() const
InstanceBatchMap mInstanceBatches
ConstMapIterator< InstanceBatchMap > InstanceBatchMapIterator
RenderOperation mSharedRenderOperation
InstancingTechnique getInstancingTechnique() const
Concrete IteratorWrapper for const access to the underlying container.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
InstanceBatch forms part of the new Instancing system This is an abstract class that must be derived ...
#define OGRE_EXCEPT(code, desc, src)
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
'New' rendering operation using vertex buffers.
const String & getName() const
Concrete IteratorWrapper for const access to the underlying key-value container.
This is the main starting point for the new instancing system.
BatchSettingId
Values to be used in setSetting() & BatchSettings::setting.
map< String, InstanceBatchVec >::type InstanceBatchMap
vector< InstanceBatch * >::type InstanceBatchVec
Makes each batch to display it's bounding box. Useful for debugging or profiling. ...
SceneManager * getSceneManager() const
Needs SM 3.0+, HW instancing support & VTF.
InstancingTechnique mInstancingTechnique
Needs SM 3.0+ and HW instancing support.