Changeset 8323 in orxonox.OLD for branches/bsp_model/src/lib/collision_reaction/cr_physics_ground_walk.cc
- Timestamp:
- Jun 12, 2006, 12:10:51 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/collision_reaction/cr_physics_ground_walk.cc
r8288 r8323 53 53 void CRPhysicsGroundWalk::reactToCollision(Collision* collision) 54 54 { 55 CollisionEvent* ce = collision->getCollisionEvents().front(); 56 Vector normal = ce->getGroundNormal(); 57 normal.normalize(); 58 59 // put it back 60 PRINTF(0)("putting it back\n"); 61 collision->getEntityB()->setVelocity(Vector()); 62 // collision->getEntityB()->setAbsCoorSoft(this->lastPosition, 0.1); 63 // collision->getEntityB()->setAbsCoor(this->lastPosition/* + normal * (-5.0f)*/); 55 // CollisionEvent* ce = collision->getCollisionEvents().front(); 56 // Vector normal = ce->getGroundNormal(); 57 // normal.normalize(); 58 // 59 // Vector position = ce->getCollisionPosition(); 64 60 65 61 62 if( this->lastPosition != collision->getEntityB()->getAbsCoor()) 63 { 64 // put it back 65 PRINTF(0)("putting it back to: \n"); 66 this->lastPosition.debug(); 66 67 68 collision->getEntityB()->setVelocity(Vector()); 69 // collision->getEntityB()->setAbsCoorSoft(this->lastPosition, 0.1); 70 collision->getEntityB()->setAbsCoor(this->lastPosition); 71 } 67 72 } 68 73 … … 76 81 this->lastPosition = owner->getAbsCoor(); 77 82 this->lastDirection = owner->getAbsDir(); 83 PRINTF(0)("no collision: saving location: \n"); 84 this->lastPosition.debug(); 78 85 } 79 86
Note: See TracChangeset
for help on using the changeset viewer.