Changeset 8922 in orxonox.OLD for branches/single_player_map/src/lib/graphics/importer
- Timestamp:
- Jun 29, 2006, 9:48:25 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/lib/graphics/importer/bsp_manager.cc
r8912 r8922 1 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 4 4 Copyright (C) 2006 orx 5 5 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 8 the Free Software Foundation; either version 2, or (at your option) 9 9 any later version. 10 10 11 11 ### File Specific: 12 12 main-programmer: bottac@ee.ethz.ch 13 13 14 14 Inspired by: 15 15 Rendering Q3 Maps by Morgan McGuire http://graphics.cs.brown.edu/games/quake/quake3.html 16 16 Unofficial Quake 3 Map Specs by Kekoa Proudfoot http://graphics.stanford.edu/~kekoa/q3/ 17 17 18 18 Collision detection adapted from: 19 19 Quake 3 Collision Detection by Nathan Ostgard http://www.devmaster.net/articles/quake3collision/ … … 69 69 BspManager::BspManager(const TiXmlElement* root) 70 70 { 71 72 71 72 73 73 if( root != NULL) 74 74 this->loadParams(root); 75 75 76 76 CDEngine::getInstance()->setBSPModel(this); 77 77 } */ … … 111 111 this->root = this->bspFile->get_root(); 112 112 this->alreadyVisible = new bool [this->bspFile->numFaces]; 113 113 114 114 CDEngine::getInstance()->setBSPModel(this); 115 115 } … … 986 986 987 987 if( box != NULL) { 988 position = worldEntity->getAbsCoor() + box->center ; //+ box->axis[1] * box->halfLength[1];988 position = worldEntity->getAbsCoor() + box->center + box->axis[1] * box->halfLength[1]; 989 989 dest = worldEntity->getAbsCoor() + box->center - box->axis[1] * box->halfLength[1] * 40.0; 990 990 … … 998 998 } else { 999 999 // Init positions and destinations to anything useful! 1000 1000 1001 1001 } 1002 1002 … … 1049 1049 bool xCollision = false; 1050 1050 bool zCollision = false; 1051 1051 1052 1052 1053 1053 // 2nd Collision Detection … … 1070 1070 //out.z = this->outputFraction; 1071 1071 1072 1072 1073 1073 1074 1074 // 3rd Collision Detection … … 1078 1078 this->inputStart = position2; 1079 1079 this->inputEnd = dest2; 1080 1080 1081 1081 this->checkCollisionRayN(this->root,0.0f,1.0f, &position2, &dest2 ); 1082 1082 //out.x = this->outputFraction; … … 1092 1092 zCollision = true; 1093 1093 } 1094 1094 1095 1095 //end if 1096 1096 /* … … 1102 1102 1103 1103 // Return the normal here: Normal's stored in this->collPlane; 1104 /* if( collision) { 1105 PRINTF(5)("We got a collision!! Are you sure: outputFraction = %f\n", this->outputFraction); 1104 if( collision) { 1106 1105 worldEntity->registerCollision(COLLISION_TYPE_AXIS_Y , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), out, SolidFlag); 1107 } */1106 } 1108 1107 if(xCollision) { 1109 1108 worldEntity->registerCollision(COLLISION_TYPE_AXIS_X , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), out, SolidFlag);
Note: See TracChangeset
for help on using the changeset viewer.