- Timestamp:
- Dec 4, 2005, 10:17:39 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc
r5884 r5920 98 98 PRINTF(3)("\n==============================Creating OBB Tree Node==================\n"); 99 99 PRINT(3)(" OBB Tree Infos: \n"); 100 PRINT(3)("\tDepth: %i \n\tTree Index: %i \n\tNumber of Vertices: %i\n", depth, treeIndex, length);100 PRINT(3)("\tDepth: %i \n\tTree Index: %i \n\tNumber of Triangles: %i\n", depth, treeIndex, length); 101 101 this->depth = depth; 102 102 … … 290 290 291 291 /* get a bad bounding box axis */ 292 halfLength[0] = -1.0f;293 for( int j = 0; j < length; ++j)294 {295 for( int i = 0; i < 3; ++i)296 {297 tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);298 tmpLength = fabs(p0.distancePoint(*tmpVec));299 if( tmpLength > halfLength[0])300 halfLength[0] = tmpLength;301 }302 }303 304 halfLength[1] = -1.0f;305 for( int j = 0; j < length; ++j)306 {307 for( int i = 0; i < 3; ++i)308 {309 tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);310 tmpLength = fabs(p0.distancePoint(*tmpVec));311 if( tmpLength > halfLength[1])312 halfLength[1] = tmpLength;313 }314 }315 316 halfLength[2] = -1.0f;317 for( int j = 0; j < length; ++j)318 {319 for( int i = 0; i < 3; ++i)320 {321 tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]);322 tmpLength = fabs(p0.distancePoint(*tmpVec));323 if( tmpLength > halfLength[2])324 halfLength[2] = tmpLength;325 }326 }292 // halfLength[0] = -1.0f; 293 // for( int j = 0; j < length; ++j) 294 // { 295 // for( int i = 0; i < 3; ++i) 296 // { 297 // tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]); 298 // tmpLength = fabs(p0.distancePoint(*tmpVec)); 299 // if( tmpLength > halfLength[0]) 300 // halfLength[0] = tmpLength; 301 // } 302 // } 303 // 304 // halfLength[1] = -1.0f; 305 // for( int j = 0; j < length; ++j) 306 // { 307 // for( int i = 0; i < 3; ++i) 308 // { 309 // tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]); 310 // tmpLength = fabs(p0.distancePoint(*tmpVec)); 311 // if( tmpLength > halfLength[1]) 312 // halfLength[1] = tmpLength; 313 // } 314 // } 315 // 316 // halfLength[2] = -1.0f; 317 // for( int j = 0; j < length; ++j) 318 // { 319 // for( int i = 0; i < 3; ++i) 320 // { 321 // tmpVec = (sVec3D*)(&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]]); 322 // tmpLength = fabs(p0.distancePoint(*tmpVec)); 323 // if( tmpLength > halfLength[2]) 324 // halfLength[2] = tmpLength; 325 // } 326 // } 327 327 328 328 … … 382 382 383 383 /* calculate the real centre of the body by using the axis length */ 384 float centerOffset[3]; 385 float newHalfLength[3]; 384 float centerOffset[3]; 385 float newHalfLength[3]; 386 386 387 for(int i = 0; i < 3; ++i) 387 388 { … … 392 393 } 393 394 PRINTF(3)("\n"); 394 PRINT(3)("\t max: %11.2f, \tmin: %11.2f\n", maxLength[0], minLength[0]);395 PRINT(3)("\t max: %11.2f, \tmin: %11.2f\n", maxLength[1], minLength[1]);396 PRINT(3)("\t max: %11.2f, \tmin: %11.2f\n", maxLength[2], minLength[2]);395 PRINT(3)("\tAxis Length x: %f (max: %11.2f, \tmin: %11.2f)\n", halfLength[0], maxLength[0], minLength[0]); 396 PRINT(3)("\tAxis Length x: %f (max: %11.2f, \tmin: %11.2f)\n", halfLength[1], maxLength[1], minLength[1]); 397 PRINT(3)("\tAxis Length x: %f (max: %11.2f, \tmin: %11.2f)\n", halfLength[2], maxLength[2], minLength[2]); 397 398 398 399 … … 450 451 const float* b; //!< triangle edge b 451 452 const float* c; //!< triangle edge c 453 454 455 ./* find the center of the box */ 452 456 453 457 this->separationPlane = Plane(box.axis[longestAxisIndex], box.center);
Note: See TracChangeset
for help on using the changeset viewer.