Changeset 5449 in orxonox.OLD for trunk/src/lib/collision_detection
- Timestamp:
- Oct 29, 2005, 2:38:25 PM (19 years ago)
- Location:
- trunk/src/lib/collision_detection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_detection/lin_alg.h
r5428 r5449 32 32 Z = (float *) calloc(100, 32); 33 33 34 for(ip= 1; ip<=N; ip++) { //initialize V to identity matrix35 for (iq= 1; iq<=N; iq++) V[ip][iq]=0;34 for(ip=0; ip<3; ip++) { //initialize V to identity matrix 35 for (iq=0; iq<3; iq++) V[ip][iq]=0; 36 36 V[ip][ip]=1; 37 37 } … … 44 44 for (i=1; i<=50; i++) { 45 45 sm=0; 46 for (ip= 1; ip<N; ip++) //sum off-diagonal elements47 for (iq=ip+1; iq< =N; iq++)46 for (ip=0; ip<2; ip++) //sum off-diagonal elements 47 for (iq=ip+1; iq<3; iq++) 48 48 sm=sm+fabs(A[ip][iq]); 49 49 if (sm==0) … … 53 53 return; //normal return 54 54 } 55 if (i < 4)56 55 tresh=0.2*sm*sm; 57 else 58 tresh=0; 59 for (ip=1; ip<N; ip++) { 60 for (iq=ip+1; iq<=N; iq++) { 56 for (ip=0; ip<2; ip++) { 57 for (iq=ip+1; iq<3; iq++) { 61 58 g=100*fabs(A[ip][iq]); 62 59 // after 4 sweeps, skip the rotation if the off-diagonal element is small … … 81 78 D[iq] += h; 82 79 A[ip][iq]=0; 83 for (j= 1; j<ip; j++) {80 for (j=0; j<ip; j++) { 84 81 g=A[j][ip]; 85 82 h=A[j][iq]; … … 99 96 A[iq][j] = h+s*(g-h*tau); 100 97 } 101 for (j= 1; j<=N; j++) {98 for (j=0; j<3; j++) { 102 99 g=V[j][ip]; 103 100 h=V[j][iq]; … … 109 106 } // main iq loop 110 107 } // main ip loop 111 for (ip= 1; ip<=N; ip++) {108 for (ip=0; ip<3; ip++) { 112 109 B[ip] += Z[ip]; 113 110 D[ip]=B[ip]; -
trunk/src/lib/collision_detection/obb_tree_node.cc
r5431 r5449 360 360 Vector* axis = new Vector[3]; //!< the references to the obb axis 361 361 362 OBBTreeNode::coMat[1][1] = box->covarianceMatrix[0][0]; OBBTreeNode::coMat[1][2] = box->covarianceMatrix[0][1]; OBBTreeNode::coMat[1][3] = box->covarianceMatrix[0][2]; 363 OBBTreeNode::coMat[2][1] = box->covarianceMatrix[1][0]; OBBTreeNode::coMat[2][2] = box->covarianceMatrix[1][1]; OBBTreeNode::coMat[2][3] = box->covarianceMatrix[1][2]; 364 OBBTreeNode::coMat[3][1] = box->covarianceMatrix[2][0]; OBBTreeNode::coMat[3][2] = box->covarianceMatrix[2][1]; OBBTreeNode::coMat[3][3] = box->covarianceMatrix[2][2]; 362 OBBTreeNode::coMat[0][0] = box->covarianceMatrix[0][0]; 363 OBBTreeNode::coMat[0][1] = box->covarianceMatrix[0][1]; 364 OBBTreeNode::coMat[0][2] = box->covarianceMatrix[0][2]; 365 366 OBBTreeNode::coMat[1][0] = box->covarianceMatrix[1][0]; 367 OBBTreeNode::coMat[1][1] = box->covarianceMatrix[1][1]; 368 OBBTreeNode::coMat[1][2] = box->covarianceMatrix[1][2]; 369 370 OBBTreeNode::coMat[2][0] = box->covarianceMatrix[2][0]; 371 OBBTreeNode::coMat[2][1] = box->covarianceMatrix[2][1]; 372 OBBTreeNode::coMat[2][2] = box->covarianceMatrix[2][2]; 365 373 366 374 // OBBTreeNode::coMat[0][0] = box->covarianceMatrix[0][0]; … … 393 401 // } 394 402 395 axis[0].x = OBBTreeNode::eigvMat[ 1][1]; axis[0].y = OBBTreeNode::eigvMat[2][1]; axis[0].z = OBBTreeNode::eigvMat[3][1];396 axis[1].x = OBBTreeNode::eigvMat[ 1][2]; axis[1].y = OBBTreeNode::eigvMat[2][2]; axis[1].z = OBBTreeNode::eigvMat[3][2];397 axis[2].x = OBBTreeNode::eigvMat[ 1][3]; axis[2].y = OBBTreeNode::eigvMat[2][3]; axis[2].z = OBBTreeNode::eigvMat[3][3];403 axis[0].x = OBBTreeNode::eigvMat[0][0]; axis[0].y = OBBTreeNode::eigvMat[1][0]; axis[0].z = OBBTreeNode::eigvMat[2][0]; 404 axis[1].x = OBBTreeNode::eigvMat[0][1]; axis[1].y = OBBTreeNode::eigvMat[1][1]; axis[1].z = OBBTreeNode::eigvMat[2][1]; 405 axis[2].x = OBBTreeNode::eigvMat[0][2]; axis[2].y = OBBTreeNode::eigvMat[1][2]; axis[2].z = OBBTreeNode::eigvMat[2][2]; 398 406 axis[0].normalize(); 399 407 axis[1].normalize();
Note: See TracChangeset
for help on using the changeset viewer.