OGRE-Next: Ogre::BoneArrayMemoryManager Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::BoneArrayMemoryManager Class Referencefinal
Core » Memory

Implementation to create the Transform variables needed by Bones. More...

`#include <OgreBoneArrayMemoryManager.h>`

Inheritance diagram for Ogre::BoneArrayMemoryManager:
[legend]

## Public Types
enum | MemoryTypes { Owner = 0 , Position , Orientation , Scale , ParentMat , ParentNode , WorldMat , FinalMat , InheritOrientation , InheritScale , NumMemoryTypes }
Public Types inherited from Ogre::ArrayMemoryManager
typedef std::vector< ptrdiff_t > | PtrdiffVec

## Public Member Functions
| BoneArrayMemoryManager (uint16 depthLevel, size_t hintMaxNodes, size_t cleanupThreshold=100, size_t maxHardLimit=MAX_MEMORY_SLOTS, RebaseListener *rebaseListener=0)
| Constructor.
void | createNewNode (BoneTransform &outTransform)
| Requests memory for a new Bone (for the Array vectors & matrices) May be also be used for a new Entity, etc.
void | destroyNode (BoneTransform &inOutTransform)
| Releases memory acquired through.
size_t | getFirstNode (BoneTransform &outTransform)
| Retrieves a BoneTransform pointing to the first Bone.
Public Member Functions inherited from Ogre::ArrayMemoryManager
| ArrayMemoryManager (size_t const *elementsMemSize, CleanupRoutines const *initRoutines, CleanupRoutines const *cleanupRoutines, size_t numElementsSize, uint16 depthLevel, size_t hintMaxNodes, size_t cleanupThreshold=100, size_t maxHardLimit=MAX_MEMORY_SLOTS, RebaseListener *rebaseListener=0)
| Constructor.
virtual | ~ArrayMemoryManager ()
void | defragment ()
| Triggers on demand a defragmentation of the pools, so that all slots become contiguous in memory.
void | destroy ()
| Destroys the memory ptrs.
size_t | getAllMemory () const
| Gets all memory reserved for this manager.
size_t | getFreeMemory () const
| Gets available memory in bytes.
size_t | getNumUsedSlotsIncludingFragmented () const
| Returns mUsedMemory.
size_t | getUsedMemory () const
| Gets used memory in bytes (not including waste).
size_t | getWastedMemory () const
| Gets wasted memory (perform a cleanup to fix).
void | initialize ()
| Initializes mMemoryPools.
void | neverDefragment ()
| Prevent defragmentation from ever happening.
void | shrinkToFit ()
| Defragments memory, then reallocates a smaller pool that tightly fits the current number of objects.

## Static Public Attributes
static const CleanupRoutines | BoneCleanupRoutines [NumMemoryTypes]
static const CleanupRoutines | BoneInitRoutines [NumMemoryTypes]
static const size_t | ElementsMemSize [NumMemoryTypes]
Static Public Attributes inherited from Ogre::ArrayMemoryManager
static const size_t | MAX_MEMORY_SLOTS

## Detailed Description

Implementation to create the Transform variables needed by Bones.

Author
  Matias N. Goldberg

Version
  1.0

## Member Enumeration Documentation

## ◆ MemoryTypes

enum Ogre::BoneArrayMemoryManager::MemoryTypes

Enumerator
Owner |
Position |
Orientation |
Scale |
ParentMat |
ParentNode |
WorldMat |
FinalMat |
InheritOrientation |
InheritScale |
NumMemoryTypes |

## Constructor & Destructor Documentation

## ◆ BoneArrayMemoryManager()

Ogre::BoneArrayMemoryManager::BoneArrayMemoryManager | ( | uint16 | depthLevel,
|  | size_t | hintMaxNodes,
|  | size_t | cleanupThreshold = 100,
|  | size_t | maxHardLimit = MAX_MEMORY_SLOTS,
|  | RebaseListener * | rebaseListener = 0 )

Constructor.

See intialize(). See destroy().

Parameters

  elementsMemSize | Array containing the size in bytes of each element type (i.e. NodeElementsMemSize)
  initRoutines | Array containing the cleanup function that will be called when default initializing memory. Unlike cleanupRoutines, just leave the function pointer null if all you want is just to initialize to 0.
  cleanupRoutines | Array containing the cleanup function that will be called when performing cleanups. Many pointers can use the flatCleaner and is the fastest. However Array variables (i.e. ArrayVector3) have a layout where flatCleaner won't work correctly because the data is interleaved (rather than flat).
  numElementsSize | Number of entries in elementsMemSize
  depthLevel | Value only used to pass to the listener. Identifies to which hierarchy depth level this memory manager belongs to.
  hintMaxNodes | Hint on how many SceneNodes we'll be creating.
  cleanupThreshold | The threshold at which a cleanup is triggered after too many nodes have been destroyed in a non-LIFO order or without being created again. -1 to disable cleanups.
  maxHardLimit | Maximum amount of SceneNodes. The manager is not allowed to grow and consume more memory past that limit. MAX_MEMORY_SLOTS for no limit. This is useful when target architecture has much less memory than the dev machine.

  Note that if hintMaxNodes < maxHardLimit, the manager may be forced to do temporary allocations (to do the reallocs) thus during a brief perdiod of time it may consume more memory than the established hard limit (up to 2x).

Parameters

  rebaseListener | The listener to be called when cleaning up or growing the memory pool. If null, cleanupThreshold is set to -1 & maxHardLimit will be set to hintMaxNodes

References Ogre::ArrayMemoryManager::MAX_MEMORY_SLOTS.

## Member Function Documentation

## ◆ createNewNode()

void Ogre::BoneArrayMemoryManager::createNewNode | ( | BoneTransform & | outTransform | ) |

Requests memory for a new Bone (for the Array vectors & matrices) May be also be used for a new Entity, etc.

Parameters

  outTransform | Out: The transform with filled memory pointers

## ◆ destroyNode()

void Ogre::BoneArrayMemoryManager::destroyNode | ( | BoneTransform & | inOutTransform | ) |

Releases memory acquired through.

See also
  createNewNode

Remarks
  For optimal results, try to respect LIFO order in the removals

Parameters

  inOutTransform | Out: Transform to destroy. Pointers are nullified

## ◆ getFirstNode()

size_t Ogre::BoneArrayMemoryManager::getFirstNode | ( | BoneTransform & | outTransform | ) |

Retrieves a BoneTransform pointing to the first Bone.

Remarks

See also
  BoneMemoryManager::getStart

Parameters

  outTransform | [out] Transform with filled pointers to the first Node in this depth

Returns
  Number of Nodes in this depth level

## Member Data Documentation

## ◆ BoneCleanupRoutines

const CleanupRoutines Ogre::BoneArrayMemoryManager::BoneCleanupRoutines[NumMemoryTypes]
| static

## ◆ BoneInitRoutines

const CleanupRoutines Ogre::BoneArrayMemoryManager::BoneInitRoutines[NumMemoryTypes]
| static

## ◆ ElementsMemSize

const size_t Ogre::BoneArrayMemoryManager::ElementsMemSize[NumMemoryTypes]
| static

The documentation for this class was generated from the following file:

- OgreBoneArrayMemoryManager.h