Changeset 4392 in orxonox.OLD for orxonox/trunk/src/lib/physics
- Timestamp:
- May 30, 2005, 1:30:23 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/physics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/physics/Makefile.in
r4375 r4392 218 218 esac; \ 219 219 done; \ 220 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- foreignsrc/lib/physics/Makefile'; \220 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/physics/Makefile'; \ 221 221 cd $(top_srcdir) && \ 222 $(AUTOMAKE) -- foreignsrc/lib/physics/Makefile222 $(AUTOMAKE) --gnu src/lib/physics/Makefile 223 223 .PRECIOUS: Makefile 224 224 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
orxonox/trunk/src/lib/physics/physics_engine.cc
r4381 r4392 33 33 34 34 this->connections = new tList<PhysicsConnection>; 35 this->interfaces = new tList<PhysicsInterface>; 35 36 } 36 37 … … 57 58 { 58 59 PhysicsEngine::singletonRef = NULL; 60 } 61 62 63 /** 64 \brief adds a PhysicsInterface to the list of handeled physicsInterfaces 65 \param physicsInterface the interface to add 66 67 this is normally done in the constructor of any PhysicsInterface 68 */ 69 void PhysicsEngine::addPhysicsInterface(PhysicsInterface* physicsInterface) 70 { 71 this->interfaces->add(physicsInterface); 72 } 73 74 /** 75 \brief removes a PhysicsInterface from the list of handeled physicsInterfaces 76 \param physicsInterface the interface to remove 77 78 this is normally done in the destructor of any PhysicsInterface 79 */ 80 void PhysicsEngine::removePhysicsInterface(PhysicsInterface* physicsInterface) 81 { 82 this->interfaces->remove(physicsInterface); 59 83 } 60 84 … … 114 138 PRINT(0)("====================================\n"); 115 139 PRINT(0)(" reference: %p\n", this); 116 PRINT(0)(" numbers of Connections: %d\n", this->connections->getSize()); 140 PRINT(0)(" number of Interfaces: %d\n", this->interfaces->getSize()); 141 PRINT(0)(" number of Connections: %d\n", this->connections->getSize()); 117 142 118 143 PRINT(0)("==============================PHYS==\n"); -
orxonox/trunk/src/lib/physics/physics_engine.h
r4378 r4392 9 9 10 10 #include "base_object.h" 11 11 12 #include "physics_connection.h" 13 #include "physics_interface.h" 12 14 13 15 // Forward Declaration … … 22 24 virtual ~PhysicsEngine(void); 23 25 26 void addPhysicsInterface(PhysicsInterface* physicsInterface); 27 void removePhysicsInterface(PhysicsInterface* physicsInterface); 28 29 24 30 void addConnection(PhysicsConnection* connection); 25 31 void removeConnection(PhysicsConnection* connection); 26 27 28 32 29 33 void tick(float dt); … … 33 37 private: 34 38 PhysicsEngine(void); 35 static PhysicsEngine* singletonRef; 39 static PhysicsEngine* singletonRef; //!< the singleton reference of the PhysicsEngine 36 40 37 tList<PhysicsConnection>* connections; 41 tList<PhysicsInterface>* interfaces; //!< a list of physically based objects 42 tList<PhysicsConnection>* connections; //!< a list of physical connections 38 43 }; 39 44 -
orxonox/trunk/src/lib/physics/physics_interface.cc
r4377 r4392 21 21 22 22 #include "physics_interface.h" 23 #include "physics_engine.h" 23 24 24 25 #include "field.h" … … 41 42 this->massChildren = 0; 42 43 this->forceSum = Vector(0, 0, 0); 44 45 PhysicsEngine::getInstance()->addPhysicsInterface(this); 43 46 } 44 47 … … 50 53 PhysicsInterface::~PhysicsInterface () 51 54 { 52 // delete what has to be deleted here55 PhysicsEngine::getInstance()->removePhysicsInterface(this); 53 56 } 54 57
Note: See TracChangeset
for help on using the changeset viewer.