Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 30, 2006, 1:12:57 AM (18 years ago)
Author:
patrick
Message:

front collision alg should work

File:
1 edited

Legend:

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

    r8932 r8933  
    9696        // collision in the x-axis
    9797      case COLLISION_TYPE_AXIS_X:
    98         front = collPos.x - box->halfLength[0];
     98        front = collPos.x - box->halfLength[2]; // should be [0]
    9999
    100100        // object is beneath the plane (ground)
     
    134134      case COLLISION_TYPE_AXIS_Z:
    135135
    136         side = collPos.z - box->halfLength[2];
     136        side = collPos.z - box->halfLength[0]; // should be [2]
    137137
    138138        // object is beneath the plane (ground)
    139139        if( side <= 0.0f )
    140140        {
    141           entity->shiftCoor(Vector(0.0f, 0.0f, side));
     141          Vector backoff = entity->getAbsDirX() * side;
     142          entity->shiftCoor(backoff);
     143//           entity->shiftCoor(Vector(0.0f, 0.0f, side));
    142144        }
    143145        // object is already in the wall
Note: See TracChangeset for help on using the changeset viewer.