- Timestamp:
- Jun 29, 2006, 2:10:27 PM (18 years ago)
- Location:
- branches/single_player_map/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/lib/collision_reaction/cr_physics_ground_walk.cc
r8894 r8907 23 23 #include "world_entity.h" 24 24 #include "cr_physics_ground_walk.h" 25 #include "collision_reaction.h" 25 26 26 27 #include <vector> … … 72 73 WorldEntity* entity = collision->getEntityB(); 73 74 74 // collision position maths75 Vector collPos = collision->getEntityB()->getAbsCoor() + box->center - ce->getCollisionPosition();76 77 float CR_MAX_WALK_HEIGHT = 2.0f;78 float CR_THRESHOLD = 0.2f;79 80 75 if( box == NULL) 81 76 { … … 83 78 return; 84 79 } 80 81 82 // collision position maths 83 Vector collPos = collision->getEntityB()->getAbsCoor() + box->center - ce->getCollisionPosition(); 84 85 float CR_MAX_WALK_HEIGHT = 2.0f; 86 float CR_THRESHOLD = 0.2f; 87 85 88 86 89 … … 89 92 case COLLISION_TYPE_AXIS_Y: 90 93 91 height = collPos.y - box->halfLength[1];92 //PRINTF(0)("height: %f , model height: %f\n", height, box->halfLength[1]);93 //PRINTF(0)(" ground normal: %f, %f, %f\n", normal.x, normal.y, normal.z);94 95 // object is beneath the plane (ground)96 if( height <= 0.0f )97 {98 entity->shiftCoor(Vector(0, -height, 0));99 }100 // object is already in the wall101 else if( ce->isInWall())102 {103 entity->setAbsCoor(entity->getLastAbsCoor());104 }105 break;106 94 // height = collPos.y - box->halfLength[1]; 95 // PRINTF(0)("height: %f , model height: %f\n", height, box->halfLength[1]); 96 // PRINTF(0)(" ground normal: %f, %f, %f\n", normal.x, normal.y, normal.z); 97 // 98 // // object is beneath the plane (ground) 99 // if( height <= 0.0f ) 100 // { 101 // entity->shiftCoor(Vector(0, -height, 0)); 102 // } 103 // // object is already in the wall 104 // else if( ce->isInWall()) 105 // { 106 // entity->setAbsCoor(entity->getLastAbsCoor()); 107 // } 108 // break; 109 // 107 110 108 111 case COLLISION_TYPE_AXIS_X: -
branches/single_player_map/src/lib/graphics/importer/bsp_manager.cc
r8904 r8907 91 91 this->bspFile->scale = scale; 92 92 if(this->bspFile->read(ResourceManager::getFullName(fileName).c_str()) == -1) 93 return -1; 93 return -1; 94 94 95 this->bspFile->build_tree(); 95 96 this->root = this->bspFile->get_root(); -
branches/single_player_map/src/world_entities/bsp_entity.cc
r8904 r8907 39 39 BspEntity::~BspEntity () 40 40 { 41 if( this->bspManager )41 if( this->bspManager != NULL) 42 42 delete this->bspManager; 43 43 } … … 51 51 void BspEntity::init() 52 52 { 53 this->setClassID(CL_BSP_ENTITY, "BspEntity"); 53 54 54 this->bspManager = NULL; 55 55 /** … … 64 64 65 65 // Check wether file exists.... 66 if ( File(ResourceManager::getFullName(name)).exists() ){ 67 // War das Laden erfolgreich? 66 if ( File(ResourceManager::getFullName(name)).exists() ) { 67 68 this->setClassID(CL_BSP_ENTITY, "BspEntity"); 68 69 this->bspManager = new BspManager(this); 70 69 71 if(this->bspManager->load(name.c_str(), 0.1f) == -1 ) { 70 72 this->bspManager = NULL; 71 // Dont do anything 73 72 74 } else { 73 74 75 75 this->toList(OM_ENVIRON); // Success!!! 76 76 } 77 77 } else { 78 this->bspManager = NULL; 78 79 this->toList(OM_DEAD); 79 80 }
Note: See TracChangeset
for help on using the changeset viewer.