|
| | ObjectMemoryManager () |
| |
| virtual | ~ObjectMemoryManager () |
| |
| SceneNode * | _getDummyNode () const |
| | Returns the pointer to the dummy node (useful when detaching) More...
|
| |
| size_t | _getTotalRenderQueues () const |
| |
| void | _setTwin (SceneMemoryMgrTypes memoryManagerType, ObjectMemoryManager *twinMemoryManager) |
| | mMemoryManagerType More...
|
| |
| virtual void | applyRebase (uint16 level, const MemoryPoolVec &newBasePtrs, const ArrayMemoryManager::PtrdiffVec &diffsList) |
| | Called when the manager already grew it's memory pool to honour more node requests. More...
|
| |
| virtual void | buildDiffList (uint16 level, const MemoryPoolVec &basePtrs, ArrayMemoryManager::PtrdiffVec &outDiffsList) |
| | Called when the manager needs to grow it's memory pool to honour more node requests. More...
|
| |
| size_t | calculateTotalNumObjectDataIncludingFragmentedSlots () const |
| | This is the opposite of getTotalNumObjects. More...
|
| |
| void | defragment (void) |
| | Triggers on demand a defragmentation of the pools, so that all slots become contiguous in memory. More...
|
| |
| size_t | getFirstObjectData (ObjectData &outObjectData, size_t renderQueue) |
| | Retrieves a ObjectData pointing to the first MovableObject in the given render queue. More...
|
| |
| SceneMemoryMgrTypes | getMemoryManagerType () const |
| |
| size_t | getNumRenderQueues () const |
| | Retrieves the number of render queues that have been created. More...
|
| |
| size_t | getTotalNumObjects () const |
| | Retrieves the sum of the number of objects in all render queues. More...
|
| |
| ObjectMemoryManager * | getTwin () const |
| | Note the return value can be null. More...
|
| |
| void | migrateTo (ObjectData &inOutTransform, size_t renderQueue, ObjectMemoryManager *dstObjectMemoryManager) |
| | Releases memory belonging to us, not before copying it into another manager. More...
|
| |
| void | objectCreated (ObjectData &outObjectData, size_t renderQueue) |
| | Requests memory for the given ObjectData, initializing values. More...
|
| |
| void | objectDestroyed (ObjectData &outObjectData, size_t renderQueue) |
| | Releases current memory. More...
|
| |
| void | objectMoved (ObjectData &inOutObjectData, size_t oldRenderQueue, size_t newRenderQueue) |
| | Requests memory for the given ObjectData to be moved to a different render queue, transferring existing values inside to the new memory slot. More...
|
| |
| virtual void | performCleanup (uint16 level, const MemoryPoolVec &basePtrs, size_t const *elementsMemSizes, size_t startInstance, size_t diffInstances) |
| | Called when too many nodes were destroyed in a non-LIFO fashion. More...
|
| |
| void | shrinkToFit (void) |
| | Defragments memory, then reallocates a smaller pool that tightly fits the current number of objects. More...
|
| |
Wrap-around class that contains multiple ArrayMemoryManager, one per render queue.
- Note that some SceneManager implementations (i.e. Octree like) may want to have more than one ObjectMemoryManager, for example one per octant.
| virtual void Ogre::ObjectMemoryManager::performCleanup |
( |
uint16 |
level, |
|
|
const MemoryPoolVec & |
basePtrs, |
|
|
size_t const * |
elementsMemSizes, |
|
|
size_t |
startInstance, |
|
|
size_t |
diffInstances |
|
) |
| |
|
virtual |
Called when too many nodes were destroyed in a non-LIFO fashion.
Without cleaning up, the scene manager will waste CPU & bandwidth on processing vectors & matrices that are not in use. The more fragmented/unordered those removals were, the worst it is. Try to create everything static first, then dynamic content.
In a way, it's very similar to vector::remove(), as removing an element from the middle means we need to shift everything past that point one place (or more).
- Parameters
-
| level | The hierarchy depth level |
| basePtrs | The base ptrs. |
| startInstance | The instance to which past that we need to shift |
| diffInstances | How many places we need to shift backwards. |
Implements Ogre::ArrayMemoryManager::RebaseListener.