Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/test/src/lib/physics/physics_engine.h @ 10230

Last change on this file since 10230 was 9869, checked in by bensch, 18 years ago

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File size: 1.9 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 "fields/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  ObjectListDeclaration(PhysicsEngine);
25public:
26  virtual ~PhysicsEngine();
27  /** @returns a Pointer to the only object of this Class */
28  inline static PhysicsEngine* getInstance() { if (!singletonRef) singletonRef = new PhysicsEngine();  return singletonRef; };
29
30  virtual void loadParams(const TiXmlElement* root);
31  void loadFields(const TiXmlElement* root);
32  void loadConnections(const TiXmlElement* root);
33
34  PhysicsInterface*      getPhysicsInterfaceByName(const std::string& physicsInterfaceName) const;
35
36  void                   addField(Field* field);
37  void                   removeField(Field* field);
38  Field*                 getFieldByName(const std::string& fieldName) const;
39
40  void                   addConnection(PhysicsConnection* connection);
41  void                   removeConnection(PhysicsConnection* connection);
42  PhysicsConnection*     getPhysicsConnectionByName(const std::string& physicsConnectionName) const;
43
44
45  void                   tick(float dt);
46
47  void                   debug() const;
48
49private:
50  PhysicsEngine();
51
52private:
53  static PhysicsEngine*         singletonRef;         //!< the singleton reference of the PhysicsEngine
54
55  std::list<Field*>             fields;               //!< a list of physicsl fields.
56  std::list<PhysicsConnection*> connections;          //!< a list of physical connections.
57  const std::list<BaseObject*>* interfaces;           //!< The list of physical interfaces.
58};
59
60
61
62#endif /* _PHYSICS_ENGINE_H */
Note: See TracBrowser for help on using the repository browser.