Changeset 7587 in orxonox.OLD for branches/cd
- Timestamp:
- May 11, 2006, 1:29:04 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cd/src/lib/collision_detection/obb_tree_node.cc
r7584 r7587 121 121 this->calculateBoxEigenvectors(*this->bvElement, modelInf, triangleIndexes, length); 122 122 this->calculateBoxAxis(*this->bvElement, modelInf, triangleIndexes, length); 123 this->calculateBoxAxis(*this->bvElement, modelInf, triangleIndexes, length); 124 this->calculateBoxAxis(*this->bvElement, modelInf, triangleIndexes, length); 123 125 124 126 /* do we need to descent further in the obb tree?*/ … … 163 165 for( int i = 0; i < length ; ++i) 164 166 { 165 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[0]]); 166 p = tmpVec; 167 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[1]]); 168 q = tmpVec; 169 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[2]]); 170 r = tmpVec; 167 p = &modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[0]]; 168 q = &modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[1]]; 169 r = &modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[2]]; 171 170 172 171 /* finding the facelet surface via cross-product */ … … 195 194 for( int i = 0; i < length; ++i) 196 195 { 197 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[0]]); 198 p = tmpVec; 199 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[1]]); 200 q = tmpVec; 201 tmpVec = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[2]]); 202 r = tmpVec; 196 p = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[0]]); 197 q = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[1]]); 198 r = (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[2]]); 203 199 204 200 covariance[j][k] = facelet[i] * (9.0f * centroid[i][j] * centroid[i][k] + p[j] * p[k] + … … 215 211 } 216 212 box.center = center; 217 218 219 std::vector<int> vertIndexVector; //!< vertex indexes list220 int vertIndex; //!< index to vertex221 bool vertexFound; //!< vertex found flag222 Vector arithCenter; //!< aritmetical center223 213 224 214 … … 363 353 } 364 354 // FIXME: += anstatt -= ????????? verwirr 365 box.center.x -= centerOffset[0];366 box.center.y -= centerOffset[1];367 box.center.z -= centerOffset[2];355 box.center.x += centerOffset[0]; 356 box.center.y += centerOffset[1]; 357 box.center.z += centerOffset[2]; 368 358 369 359 PRINTF(3)("\n"); 370 360 PRINT(3)("\tAxis halflength x: %11.2f (max: %11.2f, \tmin: %11.2f), offset: %11.2f\n", box.halfLength[0], maxLength[0], minLength[0], centerOffset[0]); 371 PRINT(3)("\tAxis halflength x: %11.2f (max: %11.2f, \tmin: %11.2f), offset: %11.2f\n", box.halfLength[1], maxLength[1], minLength[1], centerOffset[1] );372 PRINT(3)("\tAxis halflength x: %11.2f (max: %11.2f, \tmin: %11.2f), offset: %11.2f\n", box.halfLength[2], maxLength[2], minLength[2], centerOffset[2]);361 PRINT(3)("\tAxis halflength y: %11.2f (max: %11.2f, \tmin: %11.2f), offset: %11.2f\n", box.halfLength[1], maxLength[1], minLength[1], centerOffset[1] ); 362 PRINT(3)("\tAxis halflength z: %11.2f (max: %11.2f, \tmin: %11.2f), offset: %11.2f\n", box.halfLength[2], maxLength[2], minLength[2], centerOffset[2]); 373 363 } 374 364
Note: See TracChangeset
for help on using the changeset viewer.