Changeset 4674 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 23, 2005, 10:02:31 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/collision_detection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/lin_alg.h
r4630 r4674 27 27 int i,j,ip,iq; 28 28 29 void *vmblock1 = NULL;29 // void *vmblock1 = NULL; 30 30 31 31 //allocate vectors B, Z -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4673 r4674 149 149 Vector t1, t2; //!< temporary values 150 150 float covariance[3][3]; //!< the covariance matrix 151 int mode = 3; //!< mode = 0: vertex soup, no connections, mode = 1: 3 following verteces build a triangle151 int mode = 0; //!< mode = 0: vertex soup, no connections, mode = 1: 3 following verteces build a triangle 152 152 153 153 this->numOfVertices = length; … … 305 305 306 306 307 // PRINTF(3)("\nCovariance Matrix:\n"); 308 // for(int j = 0; j < 3; ++j) 309 // { 310 // PRINTF(3)(" |"); 311 // for(int k = 0; k < 3; ++k) 312 // { 313 // PRINTF(3)(" \b%f ", covariance[j][k]); 314 // } 315 // PRINTF(3)(" |\n"); 316 // } 307 PRINTF(0)("\nCovariance Matrix:\n"); 308 for(int j = 0; j < 3; ++j) 309 { 310 PRINT(0)(" |"); 311 for(int k = 0; k < 3; ++k) 312 { 313 PRINT(0)(" \b%f ", covariance[j][k]); 314 } 315 PRINT(0)(" |\n"); 316 } 317 317 318 PRINTF(3)("center: %f, %f, %f\n", center.x, center.y, center.z); 318 319 319 320 320 //for(int i = 0; i < 3; ++i)321 //{322 //box->covarianceMatrix[i][0] = covariance[i][0];323 //box->covarianceMatrix[i][1] = covariance[i][1];324 // box->covarianceMatrix[i][3] = covariance[i][2];325 //}321 for(int i = 0; i < 3; ++i) 322 { 323 box->covarianceMatrix[i][0] = covariance[i][0]; 324 box->covarianceMatrix[i][1] = covariance[i][1]; 325 box->covarianceMatrix[i][2] = covariance[i][2]; 326 } 326 327 *box->center = center; 327 328 PRINTF(3)("-- Written Result to obb\n"); … … 368 369 PRINTF(3)("-- Got Axis\n"); 369 370 370 PRINTF( 3)("eigenvector: %f, %f, %f\n", box->axis[0].x, box->axis[0].y, box->axis[0].z);371 PRINTF( 3)("eigenvector: %f, %f, %f\n", box->axis[1].x, box->axis[1].y, box->axis[1].z);372 PRINTF( 3)("eigenvector: %f, %f, %f\n", box->axis[2].x, box->axis[2].y, box->axis[2].z);371 PRINTF(0)("eigenvector: %f, %f, %f\n", box->axis[0].x, box->axis[0].y, box->axis[0].z); 372 PRINTF(0)("eigenvector: %f, %f, %f\n", box->axis[1].x, box->axis[1].y, box->axis[1].z); 373 PRINTF(0)("eigenvector: %f, %f, %f\n", box->axis[2].x, box->axis[2].y, box->axis[2].z); 373 374 } 374 375 … … 455 456 for(int i = 0; i < 3; ++i) 456 457 { 457 PRINTF( 0)("max: %f, min: %f \n", maxLength[i], minLength[i]);458 PRINTF(3)("max: %f, min: %f \n", maxLength[i], minLength[i]); 458 459 centerOffset[i] = (maxLength[i] + minLength[i]) / 2.0f; // min length is negatie 459 460 newHalfLength[i] = (maxLength[i] - minLength[i]) / 2.0f; // min length is negative 460 //PRINTF(0)("Center Orig: %f, %f, %f ---- new: %f, %f, %f", box->center[]);461 461 *box->center += (box->axis[i] * centerOffset[i]); // update the new center vector 462 //PRINTF(0)("Center Translation Operation: halfLength old: %f, new: %f\n", halfLength[i], center[i]);463 462 halfLength[i] = newHalfLength[i]; 464 463 } … … 638 637 639 638 /* draw world axes */ 640 //glBegin(GL_LINES);641 //glColor3f(0.0, 0.4, 0.3);642 //glVertex3f(0.0, 0.0, 0.0);643 //glVertex3f(3.0, 0.0, 0.0);644 // 645 //glVertex3f(0.0, 0.0, 0.0);646 //glVertex3f(0.0, 3.0, 0.0);647 // 648 //glVertex3f(0.0, 0.0, 0.0);649 //glVertex3f(0.0, 0.0, 3.0);650 //glEnd();639 glBegin(GL_LINES); 640 glColor3f(0.0, 0.4, 0.3); 641 glVertex3f(0.0, 0.0, 0.0); 642 glVertex3f(3.0, 0.0, 0.0); 643 644 glVertex3f(0.0, 0.0, 0.0); 645 glVertex3f(0.0, 3.0, 0.0); 646 647 glVertex3f(0.0, 0.0, 0.0); 648 glVertex3f(0.0, 0.0, 3.0); 649 glEnd(); 651 650 652 651 … … 677 676 678 677 678 /* DRAW POLYGONS */ 679 679 if( drawMode & DRAW_BV_POLYGON || drawMode & DRAW_ALL || drawMode & DRAW_BV_BLENDED) 680 680 { … … 802 802 } 803 803 804 /* DRAW SEPARATING PLANE */ 804 805 if( drawMode & DRAW_SEPARATING_PLANE || drawMode & DRAW_ALL) 805 806 {
Note: See TracChangeset
for help on using the changeset viewer.