Changeset 9100 in orxonox.OLD for branches/presentation/src/lib/collision_reaction
- Timestamp:
- Jul 4, 2006, 4:14:59 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/lib/collision_reaction/cr_physics_ground_walk.cc
r9099 r9100 104 104 Vector backoff = dirX * front; 105 105 106 entity->setAbsCoor(entity->getLastAbsCoor());107 //entity->shiftCoor(backoff);106 //entity->setAbsCoor(entity->getLastAbsCoor()); 107 entity->shiftCoor(backoff); 108 108 } 109 109 // object is already in the wall … … 117 117 back = collPos.len() - box->halfLength[0]; 118 118 119 PRINTF(0)("back: %f\n", back); 119 PRINTF(0)("backward: back = %f\n", back); 120 120 121 // object is beneath the plane (ground) 121 122 if( back <= 0.0f) 122 123 { 123 124 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()); 133 134 } 134 135 break; … … 138 139 case COLLISION_TYPE_AXIS_Y_NEG: 139 140 // calulate the height above ground 140 height = collPos. y- box->halfLength[1];141 height = collPos.len() - box->halfLength[1]; 141 142 142 143
Note: See TracChangeset
for help on using the changeset viewer.