Changeset 4480 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 2, 2005, 5:10:03 AM (20 years ago)
- Location:
- orxonox/trunk/src/lib/physics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/physics/physics_connection.cc
r4395 r4480 26 26 using namespace std; 27 27 28 /** 29 \brief creates a PhysicsConnection 30 */ 28 31 PhysicsConnection::PhysicsConnection(PhysicsInterface* subject, Field* field) 29 32 { … … 47 50 /** 48 51 \brief applies the Force to some Object. 49 \param dt The time to apply in Seconds50 52 */ 51 53 void PhysicsConnection::apply(void) const -
orxonox/trunk/src/lib/physics/physics_connection.h
r4395 r4480 26 26 public: 27 27 PhysicsConnection(PhysicsInterface* subject, Field* field); 28 PhysicsConnection(PhysicsInterface* partnerOne, PhysicsInterface* partnerTwo);28 // PhysicsConnection(PhysicsInterface* partnerOne, PhysicsInterface* partnerTwo); 29 29 30 30 virtual ~PhysicsConnection(); -
orxonox/trunk/src/lib/physics/physics_interface.cc
r4440 r4480 48 48 } 49 49 50 51 50 /** 52 51 \brief standard deconstructor … … 66 65 { 67 66 /* 68 PNode* massCalcPNode = dynamic_cast<PNode*>(this); //! \todo not sure if this will work ....69 float massSum = 0;70 71 tIterator<PNode>* iterator = massCalcPNode->children->getIterator();72 PNode* pn = iterator->nextElement();73 while( pn != NULL)67 PNode* massCalcPNode = dynamic_cast<PNode*>(this); //! \todo not sure if this will work .... 68 float massSum = 0; 69 70 tIterator<PNode>* iterator = massCalcPNode->children->getIterator(); 71 PNode* pn = iterator->nextElement(); 72 while( pn != NULL) 74 73 { 75 // todo: find out if children are PhysicsInterface in an efficient way 76 if (strcmp( pn->getClassName(), "PhysicsInterface")) { 77 massSum += ((PhysicsInterface*)pn)->getTotalMass(); 78 } 79 pn = iterator->nextElement(); 74 // todo: find out if children are PhysicsInterface in an efficient way 75 if (strcmp( pn->getClassName(), "PhysicsInterface")) { 76 massSum += ((PhysicsInterface*)pn)->getTotalMass(); 80 77 } 81 delete iterator; 82 83 if (massSum != this->massChildren ) { 78 pn = iterator->nextElement(); 79 } 80 delete iterator; 81 82 if (massSum != this->massChildren ) { 84 83 this->massChildren = massSum; 85 84 if (strcmp( massCalcPNode->parent->getClassName(), "PhysicsInterface")) 86 87 } else {85 ((PhysicsInterface*)massCalcPNode->parent)->recalcMass(); 86 } else { 88 87 this->massChildren = massSum; 89 }88 } 90 89 */ 91 90 } 92 91 93 92 /** 93 \brief applyes a field to this Object 94 \param field the field to apply 95 */ 94 96 void PhysicsInterface::applyField(Field* field) 95 97 { … … 98 100 } 99 101 100 102 /** 103 \brief ticks the PhysicsEffect 104 \param dt: the value about which to tick 105 */ 101 106 void PhysicsInterface::tickPhys( float dt ) 102 107 { -
orxonox/trunk/src/lib/physics/physics_interface.h
r4397 r4480 11 11 12 12 #ifndef NULL 13 #define NULL 0 13 #define NULL 0 //!< NULL 14 14 #endif 15 15 … … 47 47 48 48 private: 49 void* objectPointer;50 float mass; //!< Mass of this object51 float massChildren; //!< Sum of the masses of the children nodes52 Vector forceSum; //!< Total central force for this tick53 Quaternion momentumSum;//!< Total momentum in this tick49 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 54 55 55
Note: See TracChangeset
for help on using the changeset viewer.