Changeset 3317
- Timestamp:
- 01/26/10 10:55:08 (8 weeks ago)
- Location:
- plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src
- Files:
-
- 2 modified
-
PhysicsZone.cpp (modified) (2 diffs)
-
PhysicsZone.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsZone.cpp
r3294 r3317 37 37 #include <Zen/Core/Math/Vector4.hpp> 38 38 39 //#include <dVector.h> //no likey. recheck40 41 39 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 42 40 namespace Zen { 43 41 namespace ZBullet { 44 42 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 43 //refnote: http://bulletphysics.org/mediawiki-1.5.8/index.php/Hello_World 45 44 PhysicsZone::PhysicsZone() 46 45 : m_pScriptModule(Engine::Physics::I_PhysicsManager::getSingleton().getDefaultScriptModule()) 47 46 , m_pScriptObject(NULL) 48 47 { 49 m_pZone = NewtonCreate(NULL, NULL); 50 51 m_vGravity = Math::Vector3(0.0f, -9.8f, 0.0f); 48 52 49 m_bDefaultMaterialCreated = false; 53 50 54 NewtonSetFrictionModel(m_pZone, 1); 55 NewtonSetSolverModel(m_pZone, 2); 51 // Build the broadphase 52 int maxProxies = 1024; 53 btVector3 worldAabbMin(-10000,-10000,-10000); 54 btVector3 worldAabbMax(10000,10000,10000); 55 m_pBroadphase = new btAxisSweep3(worldAabbMin,worldAabbMax,maxProxies); 56 57 // Set up the collision configuration and dispatcher 58 m_pCollisionConfiguration = new btDefaultCollisionConfiguration(); 59 m_pDispatcher = new btCollisionDispatcher(collisionConfiguration); 60 61 // The actual physics solver 62 m_pSolver = new btSequentialImpulseConstraintSolver; 63 64 // The world. 65 m_pZone = new btDiscreteDynamicsWorld(m_pDispatcher,m_pBroadphase,m_pSolver,m_pCollisionConfiguration); 66 m_pZone->setGravity(btVector3(0.0f, -9.8f, 0.0f)); 56 67 } 57 68 … … 59 70 PhysicsZone::~PhysicsZone() 60 71 { 61 NewtonDestroy(m_pZone); 72 delete m_pDynamicsWorld; 73 delete m_pSolver; 74 delete m_pDispatcher; 75 delete m_pCollisionConfiguration; 76 delete m_pBroadphase; 62 77 } 63 78 -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsZone.hpp
r3294 r3317 159 159 /// @{ 160 160 private: 161 btDiscreteDynamicsWorld* m_pZone; 161 btDiscreteDynamicsWorld* m_pZone; 162 btAxisSweep3* m_pBroadphase; 163 btCollisionDispatcher* m_pDispatcher; 164 btDefaultCollisionConfiguration* m_pCollisionConfiguration; 165 btSequentialImpulseConstraintSolver* m_pSolver; 162 166 Math::Vector3 m_vGravity; 163 167 bool m_bDefaultMaterialCreated;
