Changeset 4555 in orxonox.OLD for orxonox/trunk/src/lib/physics
- Timestamp:
- Jun 8, 2005, 2:17:00 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/physics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/physics/physics_interface.cc
r4480 r4555 1 1 2 2 3 /* 3 /* 4 4 orxonox - the future of 3D-vertical-scrollers 5 5 … … 14 14 main-programmer: Patrick Boenzli 15 15 co-programmer: Benjamin Grauer 16 16 17 17 bensch: renamed the file 18 18 */ … … 36 36 \brief standard constructor 37 37 */ 38 PhysicsInterface::PhysicsInterface (void* objectPointer) 38 PhysicsInterface::PhysicsInterface (void* objectPointer) 39 39 { 40 40 this->objectPointer = objectPointer; … … 50 50 /** 51 51 \brief standard deconstructor 52 53 52 */ 54 PhysicsInterface::~PhysicsInterface () 53 PhysicsInterface::~PhysicsInterface () 55 54 { 56 55 PhysicsEngine::getInstance()->removePhysicsInterface(this); … … 67 66 PNode* massCalcPNode = dynamic_cast<PNode*>(this); //! \todo not sure if this will work .... 68 67 float massSum = 0; 69 68 70 69 tIterator<PNode>* iterator = massCalcPNode->children->getIterator(); 71 70 PNode* pn = iterator->nextElement(); 72 while( pn != NULL) 73 { 71 while( pn != NULL) 72 { 74 73 // todo: find out if children are PhysicsInterface in an efficient way 75 74 if (strcmp( pn->getClassName(), "PhysicsInterface")) { … … 79 78 } 80 79 delete iterator; 81 80 82 81 if (massSum != this->massChildren ) { 83 82 this->massChildren = massSum; … … 89 88 */ 90 89 } 91 90 92 91 /** 93 92 \brief applyes a field to this Object … … 97 96 { 98 97 PNode* tmp = (PNode*) objectPointer; 99 this->forceSum += field->calcForce(tmp->getAbsCoor()); 98 this->forceSum += field->calcForce(tmp->getAbsCoor()); 100 99 } 101 100 -
orxonox/trunk/src/lib/physics/physics_interface.h
r4480 r4555 1 /*! 1 /*! 2 2 \file physics_interface.h 3 3 \brief a physics interface simulating a body with a mass … … 45 45 virtual void recalcMass(); 46 46 47 47 48 48 private: 49 49 void* objectPointer; //!< A Pointer to the object we handel (actually should be this) 50 float mass; //!< Mass of this object 51 float massChildren; //!< Sum of the masses of the children nodes 52 Vector forceSum; //!< Total central force for this tick 53 Quaternion momentumSum; //!< Total momentum in this tick 54 55 50 float mass; //!< Mass of this object 51 float massChildren; //!< Sum of the masses of the children nodes 52 Vector forceSum; //!< Total central force for this tick 53 Quaternion momentumSum; //!< Total momentum in this tick 56 54 }; 57 55
Note: See TracChangeset
for help on using the changeset viewer.