Changeset 5257 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Sep 25, 2005, 7:04:28 PM (19 years ago)
- Location:
- trunk/src/lib/physics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/physics/physics_connection.h
r5039 r5257 1 1 /*! 2 2 * @file physics_connection.h 3 * Definition of The Physical Connection Class. 3 * Definition of The Physical Connection Class. 4 * @todo 4 5 */ 5 6 -
trunk/src/lib/physics/physics_interface.cc
r5255 r5257 99 99 } 100 100 101 void PhysicsInterface::applyForce(const Vector& force) 102 { 103 PNode* tmp = dynamic_cast<PNode*>((BaseObject*)this); 104 this->forceSum += force; 105 this->bForceApplied = true; 106 } 107 101 108 /** 102 109 * ticks the PhysicsEffect … … 107 114 // Vector acc = this->forceSum / ( this->massChildren + this->mass ); 108 115 PNode* coorTick = dynamic_cast<PNode*>((BaseObject*)this); 109 if (this->bForceApplied && coorTick) 116 if (coorTick != NULL ) 117 coorTick->shiftCoor((coorTick->getVelocity()+ this->forceSum/this->mass*dt)*dt); 118 119 if (this->bForceApplied) 110 120 { 111 coorTick->shiftCoor((coorTick->getVelocity()+ this->forceSum/this->mass * dt)*dt);112 113 121 this->bForceApplied = false; 122 this->forceSum = Vector(0,0,0); 114 123 } 115 this->forceSum = Vector(0,0,0);116 124 } -
trunk/src/lib/physics/physics_interface.h
r5143 r5257 39 39 inline float getTotalMass( void ) const { return mass + massChildren; }; 40 40 41 virtual void applyForce(const Vector& force); 41 42 virtual void applyField(Field* field); 42 43 virtual void tickPhys( float dt );
Note: See TracChangeset
for help on using the changeset viewer.