Changeset 4628 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
- Timestamp:
- Jun 14, 2005, 2:02:35 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4627 r4628 103 103 Vector p, q, r; //!< holder of the polygon data, much more conveniant to work with Vector than sVec3d 104 104 Vector t1, t2; //!< temporary values 105 doublecovariance[3][3]; //!< the covariance matrix105 float covariance[3][3]; //!< the covariance matrix 106 106 107 107 this->numOfVertices = length; … … 194 194 195 195 196 double a[4][4]; 197 198 a[0][0] = C(1,1) = covariance[0][0]; 199 a[0][1] = C(1,2) = covariance[0][1]; 200 a[0][2] = C(1,3) = covariance[0][2]; 201 a[1][0] = C(2,1) = covariance[1][0]; 202 a[1][1] = C(2,2) = covariance[1][1]; 203 a[1][2] = C(2,3) = covariance[1][2]; 204 a[2][0] = C(3,1) = covariance[2][0]; 205 a[2][1] = C(3,2) = covariance[2][1]; 206 a[2][2] = C(3,3) = covariance[2][2]; 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]; 207 205 208 206 Jacobi(C, D, V); /* do the jacobi decomposition */ … … 211 209 212 210 /* new jacobi tests */ 213 double eigenvectors[3][3]; 214 double eigval[3]; 215 216 EVJacobi jac; 217 jac.setMatrix(2, covariance, 0, 0); 218 jac.getEigenVector(eigenvectors); 219 211 float** a = new float*[4]; 212 a[0] = new float[4]; a[1] = new float[4]; a[2] = new float[4]; a[3] = new float[4]; 213 214 float** b = new float*[4]; 215 b[0] = new float[4]; b[1] = new float[4]; b[2] = new float[4]; b[3] = new float[4]; 216 217 float eigval[3]; 218 219 int* rot = new int; 220 221 222 a[1][1] = covariance[0][0]; 223 a[1][2] = covariance[0][1]; 224 a[1][3] = covariance[0][2]; 225 a[2][1] = covariance[1][0]; 226 a[2][2] = covariance[1][1]; 227 a[2][3] = covariance[1][2]; 228 a[3][1] = covariance[2][0]; 229 a[3][2] = covariance[2][1]; 230 a[3][3] = covariance[2][2]; 231 232 233 // EVJacobi jac; 234 // jac.setMatrix(2, covariance, 0, 0); 235 // jac.getEigenVector(eigenvectors); 236 // 237 238 JacobI(a, 3, eigval, b, rot); 220 239 221 240 printf("Old Jacobi\n"); … … 231 250 232 251 printf("New Jacobi\n"); 233 for(int j = 0; j < 3; ++j)252 for(int j = 1; j < 4; ++j) 234 253 { 235 254 printf(" |"); 236 for(int k = 0; k < 3; ++k)255 for(int k = 1; k < 4; ++k) 237 256 { 238 printf(" \b%f ", eigenvectors[j][k]);257 printf(" \b%f ", b[j][k]); 239 258 } 240 259 printf(" |\n");
Note: See TracChangeset
for help on using the changeset viewer.