Changeset 4573 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Jun 10, 2005, 1:41:48 AM (19 years ago)
- Location:
- orxonox/trunk/src/lib/collision_detection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4553 r4573 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 28 28 \brief standard constructor 29 29 */ 30 OBBTree::OBBTree () 30 OBBTree::OBBTree () 31 31 { 32 this->setClassID(CL_OBB_TREE, "OBBTree"); 32 this->setClassID(CL_OBB_TREE, "OBBTree"); 33 33 34 34 } … … 39 39 40 40 */ 41 OBBTree::~OBBTree () 41 OBBTree::~OBBTree () 42 42 { 43 43 // delete what has to be deleted here … … 91 91 PRINT(0)("\n==============================| OBBTree::debug() |===\n"); 92 92 PRINT(0)("= Spawning Tree: Start\n"); 93 93 94 94 /* generate some test vertices */ 95 95 sVec3D* vertList = new sVec3D[3]; … … 106 106 107 107 PRINT(0)("= Spawning Tree: Finished\n"); 108 PRINT(0)("=======================================================\n"); 108 PRINT(0)("=======================================================\n"); 109 109 110 110 } -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4572 r4573 166 166 vectors 167 167 */ 168 169 SymmetricMatrix C(3); 170 171 C(1,1) = 1; 172 C(1,2) = 4; 173 C(1,3) = 4; 174 C(2,1) = 4; 175 C(2,2) = 2; 176 C(2,3) = 4; 177 C(3,1) = 4; 178 C(3,2) = 4; 179 C(3,3) = 3; 180 181 // cout << "The symmetrix matrix C" << endl; 182 //cout << setw(5) << setprecision(0) << C << endl; 183 184 Matrix V(3,3); // for eigenvectors 185 DiagonalMatrix D(3); // for eigenvalues 186 187 // the decomposition 188 Jacobi(C, D, V); 189 190 191 // Print the result 192 /* cout << "The eigenvalues matrix:" << endl; 193 cout << setw(10) << setprecision(5) << D << endl; 194 cout << "The eigenvectors matrix:" << endl;*/ 195 168 169 Matrix V(3,3); //!< for eigenvectors 170 DiagonalMatrix D(3); //!< for eigenvalues 171 SymmetricMatrix C(3); //!< for the covariance symmetrical matrix 172 Vector** axis; //!< the references to the obb axis 173 174 C(1,1) = covariance[0][0]; 175 C(1,2) = covariance[0][1]; 176 C(1,3) = covariance[0][2]; 177 C(2,1) = covariance[1][0]; 178 C(2,2) = covariance[1][1]; 179 C(2,3) = covariance[1][2]; 180 C(3,1) = covariance[2][0]; 181 C(3,2) = covariance[2][1]; 182 C(3,3) = covariance[2][2]; 183 184 Jacobi(C, D, V); /* do the jacobi decomposition */ 185 186 printf("we got a result! YES: \n"); 187 188 for(int j = 1; j < 4; ++j) 189 { 190 printf(" |"); 191 for(int k = 1; k < 4; ++k) 192 { 193 printf(" \b%f ", V(j, k)); 194 } 195 printf(" |\n"); 196 } 197 198 //axis1 = 196 199 197 200 }
Note: See TracChangeset
for help on using the changeset viewer.