Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8933 in orxonox.OLD for branches/single_player_map


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

front collision alg should work

Location:
branches/single_player_map/src/lib
Files:
2 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
  • branches/single_player_map/src/lib/graphics/importer/bsp_manager.cc

    r8932 r8933  
    993993
    994994
    995     position2 = worldEntity->getAbsCoor() +  box->center + box->axis[2] * box->halfLength[2] * 2.0f;
    996     dest2     = worldEntity->getAbsCoor() +  box->center - box->axis[2] * box->halfLength[2] * 2.0f;
     995    position2 = worldEntity->getAbsCoor() +  box->center + box->axis[2] * box->halfLength[2] * 0.0f;
     996    dest2     = worldEntity->getAbsCoor() +  box->center - box->axis[2] * box->halfLength[2] * 0.0f;
    997997
    998998  } else {
     
    11201120}
    11211121  if(xCollision) {
    1122     worldEntity->registerCollision(COLLISION_TYPE_AXIS_Z , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z),dest1 , SolidFlag);
     1122    worldEntity->registerCollision(COLLISION_TYPE_AXIS_X , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z),dest1 , SolidFlag);
    11231123  }
    11241124  if(zCollision) {
    1125     worldEntity->registerCollision(COLLISION_TYPE_AXIS_X , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), dest2 , SolidFlag);
     1125    worldEntity->registerCollision(COLLISION_TYPE_AXIS_Z , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), dest2 , SolidFlag);
    11261126  }
    11271127
Note: See TracChangeset for help on using the changeset viewer.