Last change
on this file since 4558 was
4558,
checked in by bensch, 19 years ago
|
orxonox/trunk: PhysicsEngine looks better (it speeds up things… but i do not exactly know if it works
|
File size:
1.4 KB
|
Rev | Line | |
---|
[4558] | 1 | /*! |
---|
[4121] | 2 | \file physics_engine.h |
---|
[4558] | 3 | \brief Definition of the PhysicsEngine-singleton Class |
---|
| 4 | |
---|
[3954] | 5 | */ |
---|
| 6 | |
---|
[4121] | 7 | #ifndef _PHYSICS_ENGINE_H |
---|
| 8 | #define _PHYSICS_ENGINE_H |
---|
[3954] | 9 | |
---|
| 10 | #include "base_object.h" |
---|
[4392] | 11 | |
---|
[4183] | 12 | #include "physics_connection.h" |
---|
[4392] | 13 | #include "physics_interface.h" |
---|
[4394] | 14 | #include "field.h" |
---|
[3954] | 15 | |
---|
[4183] | 16 | // Forward Declaration |
---|
| 17 | template<class T> class tList; |
---|
[3954] | 18 | |
---|
| 19 | |
---|
[4558] | 20 | //! A class, that brings things into motion through Physics. |
---|
[4121] | 21 | class PhysicsEngine : public BaseObject { |
---|
[3954] | 22 | |
---|
| 23 | public: |
---|
[4183] | 24 | virtual ~PhysicsEngine(void); |
---|
[4519] | 25 | /** \returns a Pointer to the only object of this Class */ |
---|
| 26 | inline static PhysicsEngine* getInstance(void) { if (!singletonRef) singletonRef = new PhysicsEngine(); return singletonRef; }; |
---|
[3954] | 27 | |
---|
[4392] | 28 | void addPhysicsInterface(PhysicsInterface* physicsInterface); |
---|
| 29 | void removePhysicsInterface(PhysicsInterface* physicsInterface); |
---|
| 30 | |
---|
[4394] | 31 | void addField(Field* field); |
---|
| 32 | void removeField(Field* field); |
---|
[4392] | 33 | |
---|
[4183] | 34 | void addConnection(PhysicsConnection* connection); |
---|
| 35 | void removeConnection(PhysicsConnection* connection); |
---|
[3954] | 36 | |
---|
[4183] | 37 | void tick(float dt); |
---|
| 38 | |
---|
[4378] | 39 | void debug(void) const; |
---|
| 40 | |
---|
[3954] | 41 | private: |
---|
[4183] | 42 | PhysicsEngine(void); |
---|
[3954] | 43 | |
---|
[4558] | 44 | private: |
---|
| 45 | static PhysicsEngine* singletonRef; //!< the singleton reference of the PhysicsEngine |
---|
| 46 | |
---|
| 47 | tList<PhysicsInterface>* interfaces; //!< a list of physically based objects |
---|
| 48 | tList<Field>* fields; //!< a list of physicsl fields. |
---|
| 49 | tList<PhysicsConnection>* connections; //!< a list of physical connections |
---|
[3954] | 50 | }; |
---|
| 51 | |
---|
[4183] | 52 | |
---|
| 53 | |
---|
[4121] | 54 | #endif /* _PHYSICS_ENGINE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.