Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 4, 2006, 4:14:59 AM (18 years ago)
Author:
patrick
Message:

best cr ever. straifing in the wall works also

File:
1 edited

Legend:

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

    r9099 r9100  
    104104          Vector backoff = dirX * front;
    105105
    106           entity->setAbsCoor(entity->getLastAbsCoor());
    107          // entity->shiftCoor(backoff);
     106          //entity->setAbsCoor(entity->getLastAbsCoor());
     107          entity->shiftCoor(backoff);
    108108        }
    109109        // object is already in the wall
     
    117117        back = collPos.len() - box->halfLength[0];
    118118
    119         PRINTF(0)("back: %f\n", back);
     119        PRINTF(0)("backward: back = %f\n", back);
     120
    120121        // object is beneath the plane (ground)
    121122        if( back <= 0.0f)
    122123        {
    123124          Vector dirX = entity->getAbsDirX(); dirX.y = 0.0f; dirX.normalize();
    124           Vector backoff = dirX * front;
    125 
    126           entity->setAbsCoor(entity->getLastAbsCoor());
    127          // entity->shiftCoor(backoff);
    128         }
    129         // object is already in the wall
    130         else if( ce->isInWall())
    131         {
    132           entity->setAbsCoor(entity->getLastAbsCoor());
     125          Vector backoff = dirX * back * -1.0f;
     126
     127           //entity->setAbsCoor(entity->getLastAbsCoor());
     128           entity->shiftCoor(backoff);
     129        }
     130        // object is already in the wall
     131        else if( ce->isInWall())
     132        {
     133           entity->setAbsCoor(entity->getLastAbsCoor());
    133134        }
    134135        break;
     
    138139      case COLLISION_TYPE_AXIS_Y_NEG:
    139140        // calulate the height above ground
    140         height = collPos.y - box->halfLength[1];
     141        height = collPos.len() - box->halfLength[1];
    141142
    142143
Note: See TracChangeset for help on using the changeset viewer.