Changeset 4394 in orxonox.OLD for orxonox/trunk/src/lib/physics
- Timestamp:
- May 30, 2005, 2:05:21 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/physics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/physics/fields/field.cc
r4338 r4394 18 18 #include "field.h" 19 19 20 #include "physics_engine.h" 21 20 22 using namespace std; 21 23 … … 30 32 this->setMagnitude(1); 31 33 this->setAttenuation(0); 34 35 PhysicsEngine::getInstance()->addField(this); 32 36 } 33 37 … … 39 43 Field::~Field () 40 44 { 41 // delete what has to be deleted here45 PhysicsEngine::getInstance()->removeField(this); 42 46 } 43 47 -
orxonox/trunk/src/lib/physics/physics_connection.h
r4381 r4394 21 21 22 22 //! A class that Handles Physical Connection between subjects 23 class PhysicsConnection : virtualpublic BaseObject23 class PhysicsConnection : public BaseObject 24 24 { 25 25 -
orxonox/trunk/src/lib/physics/physics_engine.cc
r4392 r4394 34 34 this->connections = new tList<PhysicsConnection>; 35 35 this->interfaces = new tList<PhysicsInterface>; 36 this->fields = new tList<Field>; 36 37 } 37 38 … … 81 82 { 82 83 this->interfaces->remove(physicsInterface); 84 } 85 86 /** 87 \brief adds a Field to the list of handeled fields 88 \param field the field to add 89 90 this is normally done in the constructor of any Field 91 */ 92 void PhysicsEngine::addField(Field* field) 93 { 94 this->fields->add(field); 95 } 96 97 /** 98 \brief removes a Field from the list of handeled fields 99 \param field the field to remove 100 101 this is normally done in the destructor of any Field 102 */ 103 void PhysicsEngine::removeField(Field* field) 104 { 105 this->fields->remove(field); 83 106 } 84 107 -
orxonox/trunk/src/lib/physics/physics_engine.h
r4392 r4394 12 12 #include "physics_connection.h" 13 13 #include "physics_interface.h" 14 #include "field.h" 14 15 15 16 // Forward Declaration … … 27 28 void removePhysicsInterface(PhysicsInterface* physicsInterface); 28 29 30 void addField(Field* field); 31 void removeField(Field* field); 29 32 30 33 void addConnection(PhysicsConnection* connection); … … 40 43 41 44 tList<PhysicsInterface>* interfaces; //!< a list of physically based objects 45 tList<Field>* fields; //!< a list of physicsl fields. 42 46 tList<PhysicsConnection>* connections; //!< a list of physical connections 43 47 };
Note: See TracChangeset
for help on using the changeset viewer.