Changeset 4629 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jun 14, 2005, 2:20:56 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4628 r4629 73 73 void OBBTreeNode::spawnBVTree(const int depth, sVec3D *verticesList, const int length) 74 74 { 75 printf("OBB Depth: %i \n", depth);75 printf("OBB Depth: %i, numVertices: %i\n", depth, length); 76 76 this->depth = depth; 77 77 … … 159 159 // } 160 160 161 printf("\nCovariance Matrix:\n");162 for(int j = 0; j < 3; ++j)163 {164 printf(" |");165 for(int k = 0; k < 3; ++k)166 {167 printf(" \b%f ", covariance[j][k]);168 }169 printf(" |\n");170 }171 printf("center: %f, %f, %f\n\n", center.x, center.y, center.z);161 // printf("\nCovariance Matrix:\n"); 162 // for(int j = 0; j < 3; ++j) 163 // { 164 // printf(" |"); 165 // for(int k = 0; k < 3; ++k) 166 // { 167 // printf(" \b%f ", covariance[j][k]); 168 // } 169 // printf(" |\n"); 170 // } 171 // printf("center: %f, %f, %f\n\n", center.x, center.y, center.z); 172 172 173 173 … … 188 188 vectors 189 189 */ 190 Matrix V(3,3);//!< for eigenvectors191 DiagonalMatrix D(3);//!< for eigenvalues192 SymmetricMatrix C(3);//!< for the covariance symmetrical matrix190 /* Matrix V(3,3); */ //!< for eigenvectors 191 /* DiagonalMatrix D(3); */ //!< for eigenvalues 192 /* SymmetricMatrix C(3); */ //!< for the covariance symmetrical matrix 193 193 Vector** axis = new Vector*[3]; //!< the references to the obb axis 194 195 196 C(1,1) = covariance[0][0];197 C(1,2) = covariance[0][1];198 C(1,3) = covariance[0][2];199 C(2,1) = covariance[1][0];200 C(2,2) = covariance[1][1];201 C(2,3) = covariance[1][2];202 C(3,1) = covariance[2][0];203 C(3,2) = covariance[2][1];204 C(3,3) = covariance[2][2];205 206 Jacobi(C, D, V); /* do the jacobi decomposition */207 PRINTF(0)("-- Done Jacobi Decomposition\n");208 194 209 195 … … 231 217 232 218 233 // EVJacobi jac;234 // jac.setMatrix(2, covariance, 0, 0);235 // jac.getEigenVector(eigenvectors);236 //237 238 219 JacobI(a, 3, eigval, b, rot); 239 240 printf("Old Jacobi\n"); 241 for(int j = 1; j < 4; ++j) 242 { 243 printf(" |"); 244 for(int k = 1; k < 4; ++k) 245 { 246 printf(" \b%f ", V(j, k)); 247 } 248 printf(" |\n"); 249 } 250 251 printf("New Jacobi\n"); 252 for(int j = 1; j < 4; ++j) 253 { 254 printf(" |"); 255 for(int k = 1; k < 4; ++k) 256 { 257 printf(" \b%f ", b[j][k]); 258 } 259 printf(" |\n"); 260 } 261 262 axis[0] = new Vector(V(1, 1), V(2, 1), V(3, 1)); 263 axis[1] = new Vector(V(1, 2), V(2, 2), V(3, 2)); 264 axis[2] = new Vector(V(1, 3), V(2, 3), V(3, 3)); 220 PRINTF(0)("-- Done Jacobi Decomposition\n"); 221 222 223 224 // printf("Jacobi\n"); 225 // for(int j = 1; j < 4; ++j) 226 // { 227 // printf(" |"); 228 // for(int k = 1; k < 4; ++k) 229 // { 230 // printf(" \b%f ", b[j][k]); 231 // } 232 // printf(" |\n"); 233 // } 234 235 axis[0] = new Vector(b[1][1], b[2][1], b[3][1]); 236 axis[1] = new Vector(b[1][2], b[2][2], b[3][2]); 237 axis[2] = new Vector(b[1][3], b[2][3], b[3][3]); 265 238 box->axis = axis; 266 239 PRINTF(0)("-- Got Axis\n"); 267 240 268 // delete &V; 269 // delete &D; 270 // delete &V; 241 delete [] a[0]; 242 delete [] a[1]; 243 delete [] a[2]; 244 delete [] a[3]; 245 delete [] a; 246 247 delete [] b[0]; 248 delete [] b[1]; 249 delete [] b[2]; 250 delete [] b[3]; 251 delete [] b; 252 271 253 272 254 // printf("\neigenvector: %f, %f, %f\n", box->axis[0]->x, box->axis[0]->y, box->axis[0]->z); … … 339 321 } 340 322 341 printf("\nlongest axis is: nr %i with a half-length of: %f\n", axisIndex, aLength);323 // printf("\nlongest axis is: nr %i with a half-length of: %f\n", axisIndex, aLength); 342 324 343 325 … … 358 340 } 359 341 360 printf("\nthe clostest vertex is nr: %i, with a dist of: %f\n", vertexIndex ,dist);342 // printf("\nthe clostest vertex is nr: %i, with a dist of: %f\n", vertexIndex ,dist); 361 343 362 344 … … 377 359 partition1.add(&box->vertices[vertexIndex]); 378 360 379 printf("\npartition1: got %i vertices/ partition 2: got %i vertices\n", partition1.getSize(), partition2.getSize());361 // printf("\npartition1: got %i vertices/ partition 2: got %i vertices\n", partition1.getSize(), partition2.getSize()); 380 362 381 363
Note: See TracChangeset
for help on using the changeset viewer.