Changeset 2150 for code/branches/physics
- Timestamp:
- Nov 6, 2008, 12:54:29 PM (16 years ago)
- Location:
- code/branches/physics/src/orxonox/objects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/HelloBullet.cc
r2124 r2150 57 57 58 58 59 btVector3 worldAabbMin(-10000,-10000,-10000);60 btVector3 worldAabbMax(10000,10000,10000);61 btAxisSweep3* broadphase = new btAxisSweep3(worldAabbMin,worldAabbMax,maxProxies);59 // btVector3 worldAabbMin(-10000,-10000,-10000); 60 // btVector3 worldAabbMax(10000,10000,10000); 61 // btAxisSweep3* broadphase = new btAxisSweep3(worldAabbMin,worldAabbMax,maxProxies); 62 62 63 btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();64 btCollisionDispatcher* dispatcher = new btCollisionDispatcher(collisionConfiguration);63 // btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration(); 64 // btCollisionDispatcher* dispatcher = new btCollisionDispatcher(collisionConfiguration); 65 65 66 btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver;66 // btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver; 67 67 68 dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher,broadphase,solver,collisionConfiguration);68 // dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher,broadphase,solver,collisionConfiguration); 69 69 70 dynamicsWorld->setGravity(btVector3(0,-10,0)); 70 dynamicsWorld = creator->getScene()->getPhysicalWorld(); 71 dynamicsWorld-> setGravity(btVector3(0,-10,0)); 71 72 72 73 … … 180 181 void HelloBullet::tick(float dt) 181 182 { 182 dynamicsWorld->stepSimulation( 1/60.f,10);183 dynamicsWorld->stepSimulation(dt,10); 183 184 btTransform trans; 184 185 fallRigidBody->getMotionState()->getWorldTransform(trans); 185 COUT(0) << "sphere height: " << trans.getOrigin().getY() << std::endl;186 // COUT(0) << "sphere height: " << trans.getOrigin().getY() << std::endl; 186 187 sceneNode_ -> setPosition(Vector3(0,trans.getOrigin().getY(),0)); 187 188 // msleep(20); -
code/branches/physics/src/orxonox/objects/Scene.cc
r2087 r2150 62 62 this->rootSceneNode_ = 0; 63 63 } 64 // create bullet world; bullet solver etc. 65 66 // int maxProxies = 1024; 67 68 btVector3 worldAabbMin(-10000,-10000,-10000); 69 btVector3 worldAabbMax(10000,10000,10000); 70 bt32BitAxisSweep3* broadphase = new bt32BitAxisSweep3(worldAabbMin,worldAabbMax); 71 72 this -> collisionConfiguration_ = new btDefaultCollisionConfiguration(); 73 this -> dispatcher_ = new btCollisionDispatcher(collisionConfiguration_); 74 75 this -> solver_ = new btSequentialImpulseConstraintSolver; 76 77 this -> dynamicsWorld_ = new btDiscreteDynamicsWorld(dispatcher_,broadphase,solver_,collisionConfiguration_); 78 79 // dynamicsWorld->setGravity(btVector3(0,-10,0)); 80 64 81 } 65 82 else -
code/branches/physics/src/orxonox/objects/Scene.h
r2087 r2150 36 36 #include "util/Math.h" 37 37 38 #include "ogrebullet/Dynamics/OgreBulletDynamics.h" 39 38 40 namespace orxonox 39 41 { … … 51 53 inline Ogre::SceneNode* getRootSceneNode() const 52 54 { return this->rootSceneNode_; } 55 56 inline btDiscreteDynamicsWorld* getPhysicalWorld() const 57 { return this->dynamicsWorld_; } 53 58 54 59 void setSkybox(const std::string& skybox); … … 75 80 Ogre::SceneManager* sceneManager_; 76 81 Ogre::SceneNode* rootSceneNode_; 82 83 btDiscreteDynamicsWorld* dynamicsWorld_; 84 btSequentialImpulseConstraintSolver* solver_; 85 btDefaultCollisionConfiguration* collisionConfiguration_; 86 btCollisionDispatcher* dispatcher_; 87 // Point auf Bullet btDynamics world && solver 88 77 89 std::string skybox_; 78 90 ColourValue ambientLight_;
Note: See TracChangeset
for help on using the changeset viewer.