Changeset 8907 in orxonox.OLD for branches/single_player_map/src/lib/collision_reaction
- Timestamp:
- Jun 29, 2006, 2:10:27 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/lib/collision_reaction/cr_physics_ground_walk.cc
r8894 r8907 23 23 #include "world_entity.h" 24 24 #include "cr_physics_ground_walk.h" 25 #include "collision_reaction.h" 25 26 26 27 #include <vector> … … 72 73 WorldEntity* entity = collision->getEntityB(); 73 74 74 // collision position maths75 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 80 75 if( box == NULL) 81 76 { … … 83 78 return; 84 79 } 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 85 88 86 89 … … 89 92 case COLLISION_TYPE_AXIS_Y: 90 93 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 wall101 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 // 107 110 108 111 case COLLISION_TYPE_AXIS_X:
Note: See TracChangeset
for help on using the changeset viewer.