Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 13, 2006, 12:34:33 AM (18 years ago)
Author:
patrick
Message:

bsp: better collision ground reaction: now it jumps back. but there are still bugs and freezes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/collision_reaction/cr_physics_ground_walk.cc

    r8334 r8336  
    5858
    5959  // put it back
    60   PRINTF(0)("putting it back to lastPos: \n");
    61   this->lastPosition.debug();
    62   PRINTF(0)("current pos:\n");
    63   collision->getEntityB()->getAbsCoor().debug();
     60//   PRINTF(0)("putting it back to lastPos: \n");
     61//   this->lastPositions[0].debug();
     62//   PRINTF(0)("current pos:\n");
     63//   collision->getEntityB()->getAbsCoor().debug();
    6464
    6565  collision->getEntityB()->setVelocity(Vector());
    66   collision->getEntityB()->setAbsCoor(this->lastPosition);
     66  collision->getEntityB()->setAbsCoor(this->lastPositions[9]);
    6767}
    6868
     
    7474void CRPhysicsGroundWalk::update(WorldEntity* owner)
    7575{
    76   this->afterLastPosition = this->lastPosition;
    77   this->lastPosition = owner->getAbsCoor();
     76//   this->afterLastPosition = this->lastPosition;
     77//   this->lastPosition = owner->getAbsCoor();
     78
     79  for( int i = 9; i > 0; i--)
     80    this->lastPositions[i] = this->lastPositions[i-1];
     81  this->lastPositions[0] = owner->getAbsCoor();
     82
    7883
    7984  this->lastDirection = owner->getAbsDir();
    80   PRINTF(0)("no collision: saving location: \n");
    81   this->lastPosition.debug();
     85//   this->lastPosition.debug();
    8286}
    8387
Note: See TracChangeset for help on using the changeset viewer.