OpenMW
|
#include <BulletShapeLoader.h>
Public Member Functions | |
BulletShapeManager () | |
virtual | ~BulletShapeManager () |
virtual BulletShapePtr | load (const Ogre::String &name, const Ogre::String &group) |
Static Public Member Functions | |
static BulletShapeManager & | getSingleton () |
static BulletShapeManager * | getSingletonPtr () |
Protected Member Functions | |
Ogre::Resource * | createImpl (const Ogre::String &name, Ogre::ResourceHandle handle, const Ogre::String &group, bool isManual, Ogre::ManualResourceLoader *loader, const Ogre::NameValuePairList *createParams) |
Static Protected Attributes | |
static BulletShapeManager * | sThis = 0 |
Private Member Functions | |
BulletShapeManager (const BulletShapeManager &) | |
Explicit private copy constructor. This is a forbidden operation. | |
BulletShapeManager & | operator= (const BulletShapeManager &) |
Private operator= . This is a forbidden operation. |
Hold any BulletShape that was created by the ManualBulletShapeLoader.
To get a bulletShape, you must load it first. First, create a manualBulletShapeLoader. Then call ManualBulletShapeManager->load(). This create an "empty" resource. Then use BulletShapeManager->load(). This will fill the resource with the required info. To get the resource,use BulletShapeManager::getByName. When you use the resource no more, just use BulletShapeManager->unload(). It won't completly delete the resource, but it will "empty" it.This allow a better management of memory: when you are leaving a cell, just unload every useless shape.
Alternatively, you can call BulletShape->load() in order to actually load the resource. When you are finished with it, just call BulletShape->unload().
IMO: prefere the first methode, i am not completly sure about the 2nd.
Important Note: i have no idea of what happen if you try to load two time the same resource without unloading. It won't crash, but it might lead to memory leaks(I don't know how Ogre handle this). So don't do it!
OEngine::Physic::BulletShapeManager::BulletShapeManager | ( | const BulletShapeManager & | ) | [private] |
Explicit private copy constructor. This is a forbidden operation.
OEngine::Physic::BulletShapeManager::~BulletShapeManager | ( | ) | [virtual] |
Ogre::Resource * OEngine::Physic::BulletShapeManager::createImpl | ( | const Ogre::String & | name, |
Ogre::ResourceHandle | handle, | ||
const Ogre::String & | group, | ||
bool | isManual, | ||
Ogre::ManualResourceLoader * | loader, | ||
const Ogre::NameValuePairList * | createParams | ||
) | [protected] |
BulletShapePtr OEngine::Physic::BulletShapeManager::load | ( | const Ogre::String & | name, |
const Ogre::String & | group | ||
) | [virtual] |
BulletShapeManager& OEngine::Physic::BulletShapeManager::operator= | ( | const BulletShapeManager & | ) | [private] |
Private operator= . This is a forbidden operation.
BulletShapeManager * OEngine::Physic::BulletShapeManager::sThis = 0 [static, protected] |