Changeset 8693 in orxonox.OLD for branches/bsp_model
- Timestamp:
- Jun 21, 2006, 11:33:10 PM (19 years ago)
- Location:
- branches/bsp_model/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/collision_reaction/cr_physics_ground_walk.cc
r8524 r8693 55 55 CollisionEvent* ce = collision->getCollisionEvents().front(); 56 56 Vector normal = ce->getGroundNormal(); 57 // normal.normalize();58 57 59 // put it back 60 // PRINTF(0)("putting it back to lastPos: \n"); 61 // this->lastPositions[0].debug(); 62 // PRINTF(0)("current pos:\n"); 63 // collision->getEntityB()->getAbsCoor().debug(); 64 65 58 66 59 Vector height = ce->getCollisionPosition() - collision->getEntityB()->getAbsCoor(); 67 60 if(ce->getGroundNormal().len() <= 0.1f) … … 74 67 downspeed++; 75 68 collision->getEntityB()->setAbsCoor(collision->getEntityB()->getAbsCoor() + Vector(0.0,-0.03*downspeed,0.0)); 76 69 77 70 } 78 71 else … … 81 74 { 82 75 //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)); 76 collision->getEntityB()->setAbsCoor(collision->getEntityB()->getAbsCoor() + Vector(0.0,height.y+3.55,0.0)); 77 //collision->getEntityB()->setVelocity(Vector(0.0,0.0,0.0)); 85 78 } 86 79 downspeed = 0; 87 80 } 88 81 89 82 90 83 /* … … 93 86 collision->getEntityB()->setVelocity(Vector()); 94 87 collision->getEntityB()->setAbsCoor(this->lastPositions[1]); 95 88 96 89 */ 97 90 } -
branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc
r8534 r8693 41 41 #include "world_entity.h" 42 42 43 #include "aabb.h" 44 43 45 #include "util/loading/load_param.h" 44 46 #include "util/loading/factory.h" … … 942 944 this->outputFraction = 1.0f; 943 945 944 945 946 947 Vector forwardDir = worldEntity->getAbsDirX(); 948 forwardDir = forwardDir * 8.0f; 949 950 Vector upDir = worldEntity->getAbsDirY(); 951 upDir.x = 0.0; 952 upDir.y = 1.0; 953 upDir.z = 0.0; 946 AABB* box = worldEntity->getModelAABB(); 947 948 949 Vector forwardDir; 950 Vector upDir; 954 951 Vector dest; 955 /* 956 dest.x += forwardDir.x; 957 dest.y += forwardDir.y; 958 dest.z += forwardDir.z; 959 */ 960 Vector position = worldEntity->getAbsCoor() + upDir*5.0f ; 961 dest = worldEntity->getAbsCoor() - upDir*40.0f; // 962 Vector out = dest; 952 Vector position; 953 Vector out; 954 955 if( box != NULL) 956 { 957 forwardDir = worldEntity->getAbsDirX(); 958 forwardDir = forwardDir * 8.0f; 959 960 upDir = worldEntity->getAbsDirY(); 961 upDir.x = 0.0; 962 upDir.y = 1.0; 963 upDir.z = 0.0; 964 dest; 965 966 position = worldEntity->getAbsCoor() + box->center + box->axis[1] * box->halfLength[1]; 967 dest = worldEntity->getAbsCoor() + box->center - box->axis[1] * box->halfLength[1]; 968 out = dest; 969 970 } 971 else 972 { 973 forwardDir = worldEntity->getAbsDirX(); 974 forwardDir = forwardDir * 8.0f; 975 976 upDir = worldEntity->getAbsDirY(); 977 upDir.x = 0.0; 978 upDir.y = 1.0; 979 upDir.z = 0.0; 980 dest; 981 982 position = worldEntity->getAbsCoor() + upDir*5.0f; 983 dest = worldEntity->getAbsCoor() - upDir*40.0f; // 984 out = dest; 985 986 } 963 987 964 988 -
branches/bsp_model/src/world_entities/creatures/fps_player.cc
r8687 r8693 104 104 105 105 // collision reaction registration 106 //this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);106 this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY); 107 107 } 108 108 … … 210 210 211 211 212 //if( likely(this->getModel(0) != NULL) && this->getModel(0)->isA(CL_INTERACTIVE_MODEL))213 //{214 //((InteractiveModel*)this->getModel(0))->tick(time);212 if( likely(this->getModel(0) != NULL) && this->getModel(0)->isA(CL_INTERACTIVE_MODEL)) 213 { 214 ((InteractiveModel*)this->getModel(0))->tick(time); 215 215 // 216 216 // // handle animations differently … … 234 234 // ((InteractiveModel*)this->getModel(0))->setAnimation(STAND); 235 235 // } 236 //}236 } 237 237 238 238 } … … 246 246 { 247 247 // only draw if this entity is not the player since the player nevers sees himself 248 if( this->getCurrentPlayer() == NULL)248 // if( this->getCurrentPlayer() == NULL) 249 249 WorldEntity::draw(); 250 250 }
Note: See TracChangeset
for help on using the changeset viewer.