|
|
|
@ -5,8 +5,10 @@
|
|
|
|
|
#include <OgreResourceManager.h>
|
|
|
|
|
#include <btBulletCollisionCommon.h>
|
|
|
|
|
#include <OgreVector3.h>
|
|
|
|
|
//For some reason, Ogre Singleton cannot be used in another namespace, that's why there is no namespace here.
|
|
|
|
|
//But the risk of name collision seems pretty low here.
|
|
|
|
|
|
|
|
|
|
namespace OEngine {
|
|
|
|
|
namespace Physic
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*Define a new resource which describe a Shape usable by bullet.See BulletShapeManager for how to get/use them.
|
|
|
|
@ -107,7 +109,7 @@ public:
|
|
|
|
|
*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!
|
|
|
|
|
*/
|
|
|
|
|
class BulletShapeManager : public Ogre::ResourceManager, public Ogre::Singleton<BulletShapeManager>
|
|
|
|
|
class BulletShapeManager : public Ogre::ResourceManager
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
@ -116,6 +118,8 @@ protected:
|
|
|
|
|
const Ogre::String &group, bool isManual, Ogre::ManualResourceLoader *loader,
|
|
|
|
|
const Ogre::NameValuePairList *createParams);
|
|
|
|
|
|
|
|
|
|
static BulletShapeManager *sThis;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
BulletShapeManager();
|
|
|
|
@ -139,4 +143,7 @@ public:
|
|
|
|
|
virtual void load(const std::string &name,const std::string &group);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|