Changeset 8524 in orxonox.OLD for branches/bsp_model/src/lib/collision_reaction
- Timestamp:
- Jun 16, 2006, 11:40:03 AM (19 years ago)
- Location:
- branches/bsp_model/src/lib/collision_reaction
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/collision_reaction/cr_physics_ground_walk.cc
r8490 r8524 23 23 #include "world_entity.h" 24 24 #include "cr_physics_ground_walk.h" 25 26 #include "debug.h"27 25 28 26 #include <vector> … … 57 55 CollisionEvent* ce = collision->getCollisionEvents().front(); 58 56 Vector normal = ce->getGroundNormal(); 59 normal.normalize();57 // normal.normalize(); 60 58 61 59 // put it back … … 64 62 // PRINTF(0)("current pos:\n"); 65 63 // collision->getEntityB()->getAbsCoor().debug(); 64 65 66 Vector height = ce->getCollisionPosition() - collision->getEntityB()->getAbsCoor(); 67 if(ce->getGroundNormal().len() <= 0.1f) 68 { 69 collision->getEntityB()->setAbsCoor(collision->getEntityB()->getLastAbsCoor()); 70 return; 71 } 72 if(height.y < -3.6) 73 { 74 downspeed++; 75 collision->getEntityB()->setAbsCoor(collision->getEntityB()->getAbsCoor() + Vector(0.0,-0.03*downspeed,0.0)); 76 77 } 78 else 79 { 80 if(height.y > -3.5 && height.y < 3.9) 81 { 82 //if(downspeed <= 0) downspeed =1; 83 collision->getEntityB()->setAbsCoor(collision->getEntityB()->getAbsCoor() + Vector(0.0,height.y+3.55,0.0)); 84 //collision->getEntityB()->setVelocity(Vector(0.0,0.0,0.0)); 85 } 86 downspeed = 0; 87 } 88 66 89 90 /* 67 91 PRINTF(0)("Collision with Ground: \n"); 68 92 collision->getEntityB()->getAbsCoor().debug(); 93 collision->getEntityB()->setVelocity(Vector()); 94 collision->getEntityB()->setAbsCoor(this->lastPositions[1]); 95 96 */ 97 } 69 98 70 //collision->getEntityB()->setVelocity(Vector());71 //collision->getEntityB()->setAbsCoor(this->lastPositions[5]);72 }73 99 74 100 -
branches/bsp_model/src/lib/collision_reaction/cr_physics_ground_walk.h
r8490 r8524 29 29 30 30 Vector lastPositions[10]; //!< last 10 positions 31 float downspeed; 31 32 }; 32 33
Note: See TracChangeset
for help on using the changeset viewer.