#ifndef OPENMW_BULLET_SHAPE_LOADER_H_ #define OPENMW_BULLET_SHAPE_LOADER_H_ #include #include #include #include #include #include namespace OEngine { namespace Physic { /** *Define a new resource which describe a Shape usable by bullet.See BulletShapeManager for how to get/use them. */ class BulletShape : public Ogre::Resource { protected: void loadImpl(); void unloadImpl(); size_t calculateSize() const; void deleteShape(btCollisionShape* shape); public: BulletShape(Ogre::ResourceManager *creator, const Ogre::String &name, Ogre::ResourceHandle handle, const Ogre::String &group, bool isManual = false, Ogre::ManualResourceLoader *loader = 0); virtual ~BulletShape(); // Stores animated collision shapes. If any collision nodes in the NIF are animated, then mCollisionShape // will be a btCompoundShape (which consists of one or more child shapes). // In this map, for each animated collision shape, // we store the node's record index mapped to the child index of the shape in the btCompoundShape. std::map mAnimatedShapes; btCollisionShape* mCollisionShape; // Does this .nif have an autogenerated collision mesh? bool mAutogenerated; osg::Vec3f mBoxTranslation; osg::Quat mBoxRotation; }; /** * */ typedef Ogre::SharedPtr BulletShapePtr; } } #endif