Changeset 7734 in orxonox.OLD for trunk/src/lib/collision_detection
- Timestamp:
- May 19, 2006, 5:02:48 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_detection/obb_tree_node.cc
r7733 r7734 107 107 void OBBTreeNode::spawnBVTree(const modelInfo& modelInf, const int* triangleIndexes, int length) 108 108 { 109 PRINTF( 3)("\n==============================Creating OBB Tree Node==================\n");110 PRINT( 3)(" OBB Tree Infos: \n");111 PRINT( 3)("\tDepth: %i \n\tTree Index: %i \n\tNumber of Triangles: %i\n", depth, this->treeIndex, length);109 PRINTF(4)("\n==============================Creating OBB Tree Node==================\n"); 110 PRINT(4)(" OBB Tree Infos: \n"); 111 PRINT(4)("\tDepth: %i \n\tTree Index: %i \n\tNumber of Triangles: %i\n", depth, this->treeIndex, length); 112 112 this->depth = depth; 113 113 … … 239 239 240 240 /* debug output section*/ 241 PRINTF( 3)("\nOBB Covariance Matrix:\n");241 PRINTF(4)("\nOBB Covariance Matrix:\n"); 242 242 for(int j = 0; j < 3; ++j) 243 243 { 244 PRINT( 3)("\t\t");244 PRINT(4)("\t\t"); 245 245 for(int k = 0; k < 3; ++k) 246 246 { 247 PRINT(3)("%11.4f\t", covariance[j][k]); 248 } 249 PRINT(3)("\n"); 250 } 251 PRINTF(3)("\nWeighteed OBB Center:\n\t\t%11.4f\t %11.4f\t %11.4f\n", center.x, center.y, center.z); 252 // PRINTF(3)("\nArithmetical OBB Center:\n\t\t%11.4f\t %11.4f\t %11.4f\n", box.arithCenter.x, box.arithCenter.y, box.arithCenter.z); 253 254 /* write back the covariance matrix data to the object oriented bouning box */ 247 PRINT(4)("%11.4f\t", covariance[j][k]); 248 } 249 PRINT(4)("\n"); 250 } 251 PRINTF(4)("\nWeighteed OBB Center:\n\t\t%11.4f\t %11.4f\t %11.4f\n", center.x, center.y, center.z); 255 252 } 256 253 … … 289 286 // box.axis[2] = Vector(0,0,1); 290 287 291 PRINTF( 3)("Eigenvectors:\n");292 PRINT( 3)("\t\t%11.2f \t%11.2f \t%11.2f\n", box.axis[0].x, box.axis[0].y, box.axis[0].z);293 PRINT( 3)("\t\t%11.2f \t%11.2f \t%11.2f\n", box.axis[1].x, box.axis[1].y, box.axis[1].z);294 PRINT( 3)("\t\t%11.2f \t%11.2f \t%11.2f\n", box.axis[2].x, box.axis[2].y, box.axis[2].z);288 PRINTF(4)("Eigenvectors:\n"); 289 PRINT(4)("\t\t%11.2f \t%11.2f \t%11.2f\n", box.axis[0].x, box.axis[0].y, box.axis[0].z); 290 PRINT(4)("\t\t%11.2f \t%11.2f \t%11.2f\n", box.axis[1].x, box.axis[1].y, box.axis[1].z); 291 PRINT(4)("\t\t%11.2f \t%11.2f \t%11.2f\n", box.axis[2].x, box.axis[2].y, box.axis[2].z); 295 292 } 296 293 … … 308 305 { 309 306 310 PRINTF( 3)("Calculate Box Axis\n");307 PRINTF(4)("Calculate Box Axis\n"); 311 308 /* now get the axis length */ 312 309 float halfLength[3]; //!< half length of the axis … … 368 365 369 366 370 PRINTF( 3)("\n");371 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]);372 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] );373 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]);367 PRINTF(4)("\n"); 368 PRINT(4)("\tAxis halflength x: %11.2f (max: %11.2f, \tmin: %11.2f), offset: %11.2f\n", box.halfLength[0], maxLength[0], minLength[0], centerOffset[0]); 369 PRINT(4)("\tAxis halflength y: %11.2f (max: %11.2f, \tmin: %11.2f), offset: %11.2f\n", box.halfLength[1], maxLength[1], minLength[1], centerOffset[1] ); 370 PRINT(4)("\tAxis halflength z: %11.2f (max: %11.2f, \tmin: %11.2f), offset: %11.2f\n", box.halfLength[2], maxLength[2], minLength[2], centerOffset[2]); 374 371 } 375 372 … … 385 382 { 386 383 387 PRINTF( 3)("Fork Box\n");384 PRINTF(4)("Fork Box\n"); 388 385 PRINTF(4)("Calculating the longest Axis\n"); 389 386 /* get the longest axis of the box */ … … 401 398 } 402 399 } 403 PRINTF( 3)("\nLongest Axis is: Nr %i with a half-length of:%11.2f\n", longestAxisIndex, longestAxis);400 PRINTF(4)("\nLongest Axis is: Nr %i with a half-length of:%11.2f\n", longestAxisIndex, longestAxis); 404 401 405 402 … … 452 449 } 453 450 } 454 PRINTF( 3)("\nPartition1: got \t%i Vertices \nPartition2: got \t%i Vertices\n", partition1.size(), partition2.size());451 PRINTF(4)("\nPartition1: got \t%i Vertices \nPartition2: got \t%i Vertices\n", partition1.size(), partition2.size()); 455 452 456 453 … … 514 511 void OBBTreeNode::collideWithOBB(OBBTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB) 515 512 { 516 if( this->overlapTest(this->bvElement, (OBB*)treeNode->bvElement, nodeA, nodeB)) 513 514 if( this->overlapTest(this->bvElement, treeNode->bvElement, nodeA, nodeB)) 517 515 { 518 516 PRINTF(5)("collision @ lvl %i, object %s vs. %s, (%p, %p)\n", this->depth, nodeA->getClassName(), nodeB->getClassName(), this->nodeLeft, this->nodeRight);
Note: See TracChangeset
for help on using the changeset viewer.