Changeset 4183 in orxonox.OLD for orxonox/branches/physics/src/util/physics/physics_engine.cc
- Timestamp:
- May 14, 2005, 2:50:25 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/util/physics/physics_engine.cc
r4121 r4183 1 2 3 1 /* 4 2 orxonox - the future of 3D-vertical-scrollers … … 16 14 */ 17 15 18 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY 19 17 20 18 #include "physics_engine.h" 21 19 22 #include " stdincl.h" // maybe20 #include "list.h" 23 21 24 22 using namespace std; … … 27 25 /** 28 26 \brief standard constructor 29 \todo this constructor is not jet implemented - do it30 27 */ 31 PhysicsEngine::PhysicsEngine 28 PhysicsEngine::PhysicsEngine() 32 29 { 33 30 this->setClassName ("PhysicsEngine"); 31 32 this->connections = new tList<PhysicsConnection>; 34 33 } 35 34 35 /** 36 \brief the singleton reference to this class 37 */ 38 PhysicsEngine* PhysicsEngine::singletonRef = NULL; 39 40 /** 41 \returns a Pointer to this Class 42 */ 43 PhysicsEngine* PhysicsEngine::getInstance(void) 44 { 45 if (!PhysicsEngine::singletonRef) 46 PhysicsEngine::singletonRef = new PhysicsEngine(); 47 return PhysicsEngine::singletonRef; 48 } 36 49 37 50 /** … … 41 54 PhysicsEngine::~PhysicsEngine () 42 55 { 43 // delete what has to be deleted here56 PhysicsEngine::singletonRef = NULL; 44 57 } 45 58 46 59 /** 47 \brief nonsense - delete this method 48 \param realy nothing to give 49 \returns true or false - probably nothing? 60 \brief adds A Physical Connection to the List of Connections 61 \param connection the Connection to add 62 63 Usually this is done through the constructor of PhysicshConnections 64 */ 65 void PhysicsEngine::addConnection(PhysicsConnection* connection) 66 { 67 this->connections->add(connection); 68 } 50 69 51 this is just to show the doxygen abilities (this for example is an extension for a long comment) 70 /** 71 \brief removes A Physical Connection from the List of Connections 72 \param connection the Connection to remove 73 74 Usually this is done through the destructor of PhysicsConnections 52 75 */ 53 bool PhysicsEngine::doNonSense (int nothing) {} 76 void PhysicsEngine::removeConnection(PhysicsConnection* connection) 77 { 78 this->connections->remove(connection); 79 } 80 81 82 83 84 85 /** 86 \brief Steps through all the Connections and Ticks them 87 \param dt The time Passed in Seconds 88 89 This function brings a flow into the whole animation 90 */ 91 void PhysicsEngine::tick(float dt) 92 { 93 tIterator<PhysicsConnection>* iterator = this->connections->getIterator(); 94 PhysicsConnection* enumConn = iterator->nextElement(); 95 while (enumConn) 96 { 97 enumConn->apply(); 98 enumConn = iterator->nextElement(); 99 } 100 delete iterator; 101 }
Note: See TracChangeset
for help on using the changeset viewer.