Changeset 2446 for code/branches/physics_merge/src/orxonox/objects/Scene.h
- Timestamp:
- Dec 14, 2008, 7:08:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics_merge/src/orxonox/objects/Scene.h
r2442 r2446 22 22 * Author: 23 23 * Fabian 'x3n' Landau 24 * Reto Grieder (physics) 24 25 * Co-authors: 25 26 * ... … … 53 54 { return this->rootSceneNode_; } 54 55 55 inline btDiscreteDynamicsWorld* getPhysicalWorld() const56 { return this->physicalWorld_; }57 58 56 void setSkybox(const std::string& skybox); 59 57 inline const std::string& getSkybox() const … … 68 66 { return this->bShadows_; } 69 67 70 inline bool hasPhysics()71 { return this->physicalWorld_ != 0; }72 void setPhysicalWorld(bool wantsPhysics);//, const Vector3& worldAabbMin, const Vector3& worldAabbMax);73 74 void addRigidBody(btRigidBody* body);75 void removeRigidBody(btRigidBody* body);76 77 68 virtual void tick(float dt); 78 69 … … 85 76 void networkcallback_applyAmbientLight() 86 77 { this->setAmbientLight(this->ambientLight_); } 87 void networkcallback_hasPhysics()88 { this->setPhysicalWorld(this->bHasPhysics_); }89 78 90 79 Ogre::SceneManager* sceneManager_; 91 80 Ogre::SceneNode* rootSceneNode_; 92 93 btDiscreteDynamicsWorld* physicalWorld_;94 std::set<btRigidBody*> physicsQueue_;95 bool bHasPhysics_;96 81 97 82 std::string skybox_; … … 99 84 std::list<BaseObject*> objects_; 100 85 bool bShadows_; 86 87 88 ///////////// 89 // Physics // 90 ///////////// 91 92 public: 93 inline bool hasPhysics() 94 { return this->physicalWorld_ != 0; } 95 void setPhysicalWorld(bool wantsPhysics); 96 97 void setNegativeWorldRange(const Vector3& range); 98 inline const Vector3& getNegativeWorldRange() const 99 { return this->negativeWorldRange_; } 100 101 void setPositiveWorldRange(const Vector3& range); 102 inline const Vector3& getPositiveWorldRange() const 103 { return this->positiveWorldRange_; } 104 105 void setGravity(const Vector3& gravity); 106 inline const Vector3& getGravity() const 107 { return this->gravity_; } 108 109 void addPhysicalObject(WorldEntity* object); 110 void removePhysicalObject(WorldEntity* object); 111 112 private: 113 inline void networkcallback_hasPhysics() 114 { this->setPhysicalWorld(this->bHasPhysics_); } 115 inline void networkcallback_negativeWorldRange() 116 { this->setNegativeWorldRange(this->negativeWorldRange_); } 117 inline void networkcallback_positiveWorldRange() 118 { this->setPositiveWorldRange(this->positiveWorldRange_); } 119 inline void networkcallback_gravity() 120 { this->setGravity(this->gravity_); } 121 122 // Bullet objects 123 btDiscreteDynamicsWorld* physicalWorld_; 124 bt32BitAxisSweep3* broadphase_; 125 btDefaultCollisionConfiguration* collisionConfig_; 126 btCollisionDispatcher* dispatcher_; 127 btSequentialImpulseConstraintSolver* solver_; 128 129 std::set<WorldEntity*> physicalObjectQueue_; 130 std::set<WorldEntity*> physicalObjects_; 131 bool bHasPhysics_; 132 Vector3 negativeWorldRange_; 133 Vector3 positiveWorldRange_; 134 Vector3 gravity_; 101 135 }; 102 136 }
Note: See TracChangeset
for help on using the changeset viewer.