Changeset 8524 in orxonox.OLD for branches/bsp_model/src
- Timestamp:
- Jun 16, 2006, 11:40:03 AM (19 years ago)
- Location:
- branches/bsp_model/src
- Files:
-
- 5 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 -
branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc
r8490 r8524 942 942 this->outputFraction = 1.0f; 943 943 944 Vector position = worldEntity->getAbsCoor(); 944 945 945 946 946 … … 958 958 dest.z += forwardDir.z; 959 959 */ 960 961 dest = worldEntity->getAbsCoor() - upDir*40.0 ;960 Vector position = worldEntity->getAbsCoor() + upDir*5.0f ; 961 dest = worldEntity->getAbsCoor() - upDir*40.0f; // 962 962 Vector out = dest; 963 963 … … 986 986 // position1.debug(); 987 987 988 if(!this->outputStartsOut ) 989 { 990 this->collPlane = new plane; 991 this->collPlane->x = 0.0f; 992 this->collPlane->y = 0.0f; 993 this->collPlane->z = 0.0f; 994 collision = true; 995 } 996 else 997 { 998 999 1000 1001 988 1002 if( this->outputFraction == 1.0f) 989 1003 { 990 if(this->outputAllSolid )1004 if(this->outputAllSolid ) 991 1005 { 992 1006 this->collPlane = new plane; 993 this->collPlane->x = 1.0f;1007 this->collPlane->x = 0.0f; 994 1008 this->collPlane->y = 0.0f; 995 1009 this->collPlane->z = 0.0f; … … 1013 1027 } 1014 1028 1029 1030 } 1015 1031 // Return the normal here: Normal's stored in this->collPlane; 1016 1032 if( collision) { … … 1018 1034 worldEntity->registerCollision(this->parent, worldEntity, Vector(this->collPlane->x, this->collPlane->y, this->collPlane->z), out); 1019 1035 } 1036 else worldEntity->registerCollision(this->parent, worldEntity, Vector(0.0, 1.0, 0.0), dest); 1020 1037 1021 1038 } -
branches/bsp_model/src/world_entities/creatures/md2_creature.cc
r8507 r8524 124 124 cycle = 0.0; 125 125 126 travelSpeed = 15.0;126 travelSpeed =300.0; 127 127 this->velocity = Vector(0.0,0.0,0.0); 128 128 … … 293 293 Vector accel(0.0, 0.0, 0.0); 294 294 /* 295 Vector rot(0.0, 0.0, 0.0); // wird ben ötigt für Helicopter295 Vector rot(0.0, 0.0, 0.0); // wird ben�igt fr Helicopter 296 296 */ 297 297 //float rotVal = 0.0; -
branches/bsp_model/src/world_entities/space_ships/collision_probe.cc
r8490 r8524 67 67 this->loadModel("models/dr_freak.md2"); 68 68 69 this->localVelocity = Vector(0, -4,0);69 this->localVelocity = Vector(0,0,0); 70 70 } 71 71
Note: See TracChangeset
for help on using the changeset viewer.