Changeset 9065 in orxonox.OLD for branches/presentation/src/lib/graphics
- Timestamp:
- Jul 3, 2006, 7:22:44 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/lib/graphics/importer/bsp_manager.cc
r9061 r9065 985 985 986 986 987 plane* testPlane; 988 989 bool xCollision = false; 990 bool zCollision = false; 991 987 992 988 993 float height = 40; … … 998 1003 dest1 = worldEntity->getAbsCoor() + box->center + dirX * (box->halfLength[0] + BSP_X_OFFSET); 999 1004 dest2 = worldEntity->getAbsCoor() - box->center + dirX * (box->halfLength[0] + BSP_X_OFFSET); 1000 1005 1001 1006 Vector dirZ = worldEntity->getAbsDirZ(); dirX.y = 0.0f; dirZ.normalize(); 1002 1007 //position2 = worldEntity->getAbsCoor() + box->center - dirZ * (box->halfLength[2] + BSP_Z_OFFSET); … … 1009 1014 1010 1015 1011 // PRINTF(0)("x and v\n"); 1012 // worldEntity->getAbsDirX().debug(); 1013 // worldEntity->getAbsDirV().debug(); 1014 1015 1016 // 1st Ray 1016 1017 // 1st Ray: Y RAY 1017 1018 this->inputStart = position; 1018 1019 this->inputEnd = dest; … … 1052 1053 this->out = out; 1053 1054 } 1054 1055 1056 } 1057 1058 plane* testPlane = this->collPlane; 1059 1060 bool xCollision = false; 1061 bool zCollision = false; 1055 } 1056 testPlane = this->collPlane; 1057 1058 1062 1059 bool xCollisionNeg = false; 1063 1060 bool zCollisionNeg = false; 1064 1065 1066 1067 // 2nd Collision Detection 1061 1062 1063 1064 // 2nd Collision Detection X-RAY 1068 1065 this->outputStartsOut = true; 1069 1066 this->outputAllSolid = false; … … 1093 1090 1094 1091 1095 // 3rd Collision Detection 1092 // 3rd Collision Detection Z-RAY 1096 1093 this->outputStartsOut = true; 1097 1094 this->outputAllSolid = false; … … 1121 1118 } 1122 1119 1123 //end if1124 /*1125 This is how you would calculate the Coordinates where worldEntity Collided with the BSP world.1126 out.x = position1.x + (dest.x -position1.x) * this->outputFraction;1127 out.z = position1.z + (dest.z -position1.z) * this->outputFraction;1128 */1129 1130 1120 1131 1121 // Return the normal here: Normal's stored in this->collPlane; 1132 1122 if( collision) { 1133 worldEntity->registerCollision(COLLISION_TYPE_AXIS_Y _NEG, this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), out, SolidFlag);1123 worldEntity->registerCollision(COLLISION_TYPE_AXIS_Y , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), out, SolidFlag); 1134 1124 } 1135 1125 if(xCollision) { 1136 1126 worldEntity->registerCollision(COLLISION_TYPE_AXIS_X , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z),dest1 , SolidFlag); 1137 1127 } 1138 1128 1139 1129 if(zCollision) { 1140 1130 worldEntity->registerCollision(COLLISION_TYPE_AXIS_Z , this->parent, worldEntity, Vector(testPlane->x, testPlane->y, testPlane->z), dest2 , SolidFlag); 1141 1131 } 1142 1132 1143 1144 //else worldEntity->registerCollision(COLLISION_TYPE_AXIS_Y, this->parent, worldEntity, Vector(0.0, 2.0, 0.0), dest, false);1145 1133 1146 1134 }
Note: See TracChangeset
for help on using the changeset viewer.