Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 30, 2005, 3:27:36 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: now Objects should be affected by the PhysicsEngine too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/physics/physics_interface.cc

    r4395 r4396  
    3939{
    4040  //   this->setClassName ("PhysicsInterface");
    41    this->mass = 0;
     41   this->mass = 1;
    4242   this->massChildren = 0;
    4343   this->forceSum = Vector(0, 0, 0);
     
    9090void PhysicsInterface::applyField(Field* field)
    9191{
    92   //  this->forceSum += force;
     92  this->forceSum += field->calcForce(dynamic_cast<PNode*>(this)->getAbsCoor());
    9393}
    9494
     
    9696{
    9797  Vector acc = this->forceSum / ( this->massChildren + this->mass );
     98  PNode* coorTick =  (PNode*) this;
     99  coorTick->setRelCoor(coorTick->getRelCoor() + (this->forceSum / this->mass * dt));
     100
     101  this->forceSum = Vector(0,0,0);
    98102  // todo: introduce kinematics
    99103}
Note: See TracChangeset for help on using the changeset viewer.