00001 #ifndef VECTRACER_PHYSICS_MANAGER_H 00002 #define VECTRACER_PHYSICS_MANAGER_H 00003 00004 #include "common.h" 00005 #include <list> 00006 00007 class PhysicsManager 00008 { 00009 public: 00010 00011 PhysicsManager(); 00012 ~PhysicsManager(); 00013 00014 void setDebug(bool _val); 00015 00016 // temp 00017 void createGroundPlane(); 00018 00019 Ogre::Vector3 getGravity(); 00020 void setGravity(Ogre::Vector3 _val); 00021 00022 void update(Ogre::Real _time); 00023 00024 void addPair(OgreBulletDynamics::RigidBody* _rigid, OgreBulletCollisions::CollisionShape* _shape); 00025 void addRigidBody(OgreBulletDynamics::RigidBody* _val); 00026 void addCollisionShape(OgreBulletCollisions::CollisionShape* _val); 00027 void addConstraint(btTypedConstraint* _val); 00028 00029 OgreBulletDynamics::RigidBody* createRigidBody(std::string _val); 00030 00031 OgreBulletCollisions::CollisionShape* createCollisionShape(const Ogre::Real& _radius, const Ogre::Real& _height, const Ogre::Vector3& _axis); 00032 OgreBulletCollisions::CollisionShape* createCollisionShape(Ogre::Entity* _val); 00033 00034 void boxWall(); 00035 00036 OgreBulletDynamics::DynamicsWorld* getDynamicsWorld(); 00037 00038 protected: 00039 00040 Ogre::Vector3 m_gravity; 00041 Ogre::AxisAlignedBox m_worldBoundary; 00042 Ogre::Real m_boundarySize; 00043 00044 OgreBulletDynamics::DynamicsWorld* m_dynamicsWorld; 00045 OgreBulletCollisions::DebugDrawer* m_debugDrawer; 00046 00047 std::list<OgreBulletDynamics::RigidBody*> m_rigidBodies; 00048 std::list<OgreBulletCollisions::CollisionShape*> m_collisionShapes; 00049 std::list<btTypedConstraint*> m_constraints; 00050 }; 00051 00052 #endif