Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 4, 2006, 3:30:35 AM (18 years ago)
Author:
patrick
Message:

collision reaction works again

File:
1 edited

Legend:

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

    r9083 r9096  
    7070
    7171
    72   float CR_MAX_WALK_HEIGHT = 2.0f;
     72  float CR_MAX_WALK_HEIGHT = 10.0f;
    7373  float CR_THRESHOLD = 0.2f;
    7474
     
    7777  float side = 0;
    7878
    79   //PRINTF(0)("collision raction======================================\n");
    8079
    8180  const std::vector<CollisionEvent*>* collisionEvents = &(collision->getCollisionEvents());
     
    117116
    118117        // object is beneath the plane (ground)
    119         if( front <= 0.0f )
     118        if( front <= 0.0f)
    120119        {
    121120          Vector dirX = entity->getAbsDirX(); dirX.y = 0.0f; dirX.normalize();
    122           Vector backoff = dirX * front * -1.0f;
     121          Vector backoff = dirX * front;
    123122
    124123          entity->setAbsCoor(entity->getLastAbsCoor());
     
    134133
    135134        // collision in the y-axis
    136       case COLLISION_TYPE_AXIS_Y:
     135      case COLLISION_TYPE_AXIS_Y_NEG:
    137136        // calulate the height above ground
    138137        height = collPos.y - box->halfLength[1];
     
    141140        // object is beneath the plane (ground)
    142141//         if(height >= 0.0f && height <= 0.0001f) break ;// Do nothing
    143         if( height < 0.0f )
     142        if( height < 0.0f /*&& height < -CR_MAX_WALK_HEIGHT*/)
    144143        {
    145144          entity->shiftCoor(Vector(0.0f, -height + 0.00001, 0.0f));
Note: See TracChangeset for help on using the changeset viewer.