Changeset 4480 in orxonox.OLD for orxonox/trunk/src/lib/physics/physics_interface.cc
- Timestamp:
- Jun 2, 2005, 5:10:03 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 {
Note: See TracChangeset
for help on using the changeset viewer.