Changeset 4762 in orxonox.OLD for orxonox/trunk/src/lib/physics
- Timestamp:
- Jul 2, 2005, 1:34:42 AM (20 years ago)
- Location:
- orxonox/trunk/src/lib/physics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/physics/physics_interface.cc
r4597 r4762 36 36 \brief standard constructor 37 37 */ 38 PhysicsInterface::PhysicsInterface ( void* objectPointer)38 PhysicsInterface::PhysicsInterface () 39 39 { 40 40 this->setClassID(CL_PHYSICS_INTERFACE, "PhysicsInterface"); 41 this->objectPointer = objectPointer;42 41 43 42 this->mass = 1; … … 96 95 void PhysicsInterface::applyField(Field* field) 97 96 { 98 PNode* tmp = (PNode*) objectPointer;97 PNode* tmp = dynamic_cast<PNode*>((BaseObject*)this); 99 98 this->forceSum += field->calcForce(tmp->getAbsCoor()); 100 99 this->bForceApplied = true; … … 108 107 { 109 108 // Vector acc = this->forceSum / ( this->massChildren + this->mass ); 110 PNode* coorTick = (PNode*)(this->objectPointer);109 PNode* coorTick = dynamic_cast<PNode*>((BaseObject*)this); 111 110 if (this->bForceApplied && coorTick) 112 111 { -
orxonox/trunk/src/lib/physics/physics_interface.h
r4597 r4762 29 29 { 30 30 public: 31 PhysicsInterface( void* objectPointer);31 PhysicsInterface(); 32 32 virtual ~PhysicsInterface(); 33 33 /** \param mass the mass to set for this node. */ … … 46 46 47 47 private: 48 void* objectPointer; //!< A Pointer to the object we handel (actually should be this)49 50 51 48 float mass; //!< Mass of this object 52 49 float massChildren; //!< Sum of the masses of the children nodes
Note: See TracChangeset
for help on using the changeset viewer.