Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/physics/physics_engine.h @ 4730

Last change on this file since 4730 was 4728, checked in by bensch, 19 years ago

orxonox/trunk: more loading (especially for physics)

File size: 1.9 KB
Line 
1/*!
2    \file physics_engine.h
3    \brief Definition of the PhysicsEngine-singleton Class
4
5*/
6
7#ifndef _PHYSICS_ENGINE_H
8#define _PHYSICS_ENGINE_H
9
10#include "base_object.h"
11
12#include "physics_connection.h"
13#include "physics_interface.h"
14#include "field.h"
15
16// Forward Declaration
17template<class T> class tList;
18class TiXmlElement;
19
20//! A class, that brings things into motion through Physics.
21class PhysicsEngine : public BaseObject {
22
23 public:
24  virtual ~PhysicsEngine(void);
25  /** \returns a Pointer to the only object of this Class */
26  inline static PhysicsEngine* getInstance(void) { if (!singletonRef) singletonRef = new PhysicsEngine();  return singletonRef; };
27
28  void loadParams(const TiXmlElement* root);
29
30  void                   addPhysicsInterface(PhysicsInterface* physicsInterface);
31  void                   removePhysicsInterface(PhysicsInterface* physicsInterface);
32  PhysicsInterface*      getPhysicsInterfaceByName(const char* physicsInterfaceName) const;
33
34  void                   addField(Field* field);
35  void                   removeField(Field* field);
36  Field*                 getFieldByName(const char* FieldName) const;
37
38  void                   addConnection(PhysicsConnection* connection);
39  void                   removeConnection(PhysicsConnection* connection);
40  PhysicsConnection*     getPhysicsConnectionByName(const char* physicsConnectionName) const;
41
42
43  void                   tick(float dt);
44
45  void                   debug(void) const;
46
47 private:
48  PhysicsEngine(void);
49
50 private:
51  static PhysicsEngine*         singletonRef;         //!< the singleton reference of the PhysicsEngine
52
53  tList<PhysicsInterface>*      interfaces;           //!< a list of physically based objects
54  tList<Field>*                 fields;               //!< a list of physicsl fields.
55  tList<PhysicsConnection>*     connections;          //!< a list of physical connections
56};
57
58
59
60#endif /* _PHYSICS_ENGINE_H */
Note: See TracBrowser for help on using the repository browser.