Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 29, 2006, 2:10:27 PM (18 years ago)
Author:
bottac
Message:

further bugs fixed.

File:
1 edited

Legend:

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

    r8894 r8907  
    2323#include "world_entity.h"
    2424#include "cr_physics_ground_walk.h"
     25#include "collision_reaction.h"
    2526
    2627#include <vector>
     
    7273  WorldEntity* entity = collision->getEntityB();
    7374
    74   // collision position maths
    75   Vector collPos =  collision->getEntityB()->getAbsCoor()  + box->center - ce->getCollisionPosition();
    76 
    77   float CR_MAX_WALK_HEIGHT = 2.0f;
    78   float CR_THRESHOLD = 0.2f;
    79 
    8075  if( box == NULL)
    8176  {
     
    8378    return;
    8479  }
     80 
     81 
     82  // collision position maths
     83  Vector collPos =  collision->getEntityB()->getAbsCoor()  + box->center - ce->getCollisionPosition();
     84
     85  float CR_MAX_WALK_HEIGHT = 2.0f;
     86  float CR_THRESHOLD = 0.2f;
     87
    8588
    8689
     
    8992    case COLLISION_TYPE_AXIS_Y:
    9093
    91       height = collPos.y - box->halfLength[1];
    92      // PRINTF(0)("height: %f          , model height: %f\n", height, box->halfLength[1]);
    93      // PRINTF(0)(" ground normal: %f, %f, %f\n", normal.x, normal.y, normal.z);
    94 
    95       // object is beneath the plane (ground)
    96       if( height <= 0.0f )
    97       {
    98         entity->shiftCoor(Vector(0, -height, 0));
    99       }
    100       // object is already in the wall
    101       else if( ce->isInWall())
    102       {
    103         entity->setAbsCoor(entity->getLastAbsCoor());
    104       }
    105       break;
    106 
     94//       height = collPos.y - box->halfLength[1];
     95//      PRINTF(0)("height: %f          , model height: %f\n", height, box->halfLength[1]);
     96//      PRINTF(0)(" ground normal: %f, %f, %f\n", normal.x, normal.y, normal.z);
     97//
     98//       // object is beneath the plane (ground)
     99//       if( height <= 0.0f )
     100//       {
     101//         entity->shiftCoor(Vector(0, -height, 0));
     102//       }
     103//       // object is already in the wall
     104//       else if( ce->isInWall())
     105//       {
     106//         entity->setAbsCoor(entity->getLastAbsCoor());
     107//       }
     108//       break;
     109//
    107110
    108111    case COLLISION_TYPE_AXIS_X:
Note: See TracChangeset for help on using the changeset viewer.