Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/cr/src/lib/physics/physics_engine.h @ 7944

Last change on this file since 7944 was 7221, checked in by bensch, 19 years ago

orxonox/trunk: merged the std-branche back, it runs on windows and Linux

svn merge https://svn.orxonox.net/orxonox/branches/std . -r7202:HEAD

File size: 1.8 KB
Line 
1/*!
2 * @file physics_engine.h
3  *  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#include <list>
16
17// Forward Declaration
18template<class T> class tList;
19class TiXmlElement;
20
21//! A class, that brings things into motion through Physics.
22class PhysicsEngine : public BaseObject {
23
24 public:
25  virtual ~PhysicsEngine();
26  /** @returns a Pointer to the only object of this Class */
27  inline static PhysicsEngine* getInstance() { if (!singletonRef) singletonRef = new PhysicsEngine();  return singletonRef; };
28
29  virtual void loadParams(const TiXmlElement* root);
30  void loadFields(const TiXmlElement* root);
31  void loadConnections(const TiXmlElement* root);
32
33  PhysicsInterface*      getPhysicsInterfaceByName(const std::string& physicsInterfaceName) const;
34
35  void                   addField(Field* field);
36  void                   removeField(Field* field);
37  Field*                 getFieldByName(const std::string& fieldName) const;
38
39  void                   addConnection(PhysicsConnection* connection);
40  void                   removeConnection(PhysicsConnection* connection);
41  PhysicsConnection*     getPhysicsConnectionByName(const std::string& physicsConnectionName) const;
42
43
44  void                   tick(float dt);
45
46  void                   debug() const;
47
48 private:
49  PhysicsEngine();
50
51 private:
52  static PhysicsEngine*         singletonRef;         //!< the singleton reference of the PhysicsEngine
53
54  std::list<Field*>             fields;               //!< a list of physicsl fields.
55  std::list<PhysicsConnection*> connections;          //!< a list of physical connections.
56  const std::list<BaseObject*>* interfaces;           //!< The list of physical interfaces.
57};
58
59
60
61#endif /* _PHYSICS_ENGINE_H */
Note: See TracBrowser for help on using the repository browser.