- Timestamp:
- Nov 4, 2005, 6:14:13 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
r5490 r5491 32 32 33 33 //allocate vectors B, Z 34 35 //B = (float *) calloc(100, 32); 36 //Z = (float *) calloc(100, 32); 37 B = new float[N+1]; 38 Z = new float[N+1]; 34 B = new float[N]; 35 Z = new float[N]; 39 36 40 37 // initialize V to identity matrix … … 70 67 // just adjust this on the first 3 sweeps 71 68 if( i < 4) 72 tresh = 0.2 * sm / (N *N) ;69 tresh = 0.2 * sm / (N * N) ; 73 70 else 74 71 tresh = 0.0f; … … 94 91 s = t * c; 95 92 tau = s / (1.0f + c); 96 h =t*A[ip][iq];93 h = t * A[ip][iq]; 97 94 Z[ip] -= h; 98 95 Z[iq] += h; 99 96 D[ip] -= h; 100 97 D[iq] += h; 101 A[ip][iq]=0; 102 for (j=0; j<ip; j++) { 103 g=A[j][ip]; 104 h=A[j][iq]; 105 A[j][ip] = g-s*(h+g*tau); 106 A[j][iq] = h+s*(g-h*tau); 98 A[ip][iq] = 0.0f; 99 100 for( j = 0; j < (ip - 1); j++) { 101 g = A[j][ip]; 102 h = A[j][iq]; 103 A[j][ip] = g - s * (h + g * tau); 104 A[j][iq] = h + s * (g - h * tau); 107 105 } 108 for (j=ip+1; j<iq; j++) {109 g =A[ip][j];110 h =A[j][iq];111 A[ip][j] = g -s*(h+g*tau);112 A[j][iq] = h +s*(g-h*tau);106 for( j = (ip + 1); j < (iq - 1); j++) { 107 g = A[ip][j]; 108 h = A[j][iq]; 109 A[ip][j] = g - s * (h + g * tau); 110 A[j][iq] = h + s * (g - h * tau); 113 111 } 114 for (j=iq+1; j<=N; j++) {115 g =A[ip][j];116 h =A[iq][j];117 A[ip][j] = g -s*(h+g*tau);118 A[iq][j] = h +s*(g-h*tau);112 for( j = (iq + 1); j < N; j++) { 113 g = A[ip][j]; 114 h = A[iq][j]; 115 A[ip][j] = g - s * (h + g * tau); 116 A[iq][j] = h + s * (g - h * tau); 119 117 } 120 for (j=0; j<3; j++) {121 g =V[j][ip];122 h =V[j][iq];123 V[j][ip] = g -s*(h+g*tau);124 V[j][iq] = h +s*(g-h*tau);118 for( j = 0; j < N; j++) { 119 g = V[j][ip]; 120 h = V[j][iq]; 121 V[j][ip] = g - s * (h + g * tau); 122 V[j][iq] = h + s * (g - h * tau); 125 123 } 126 *NROT =*NROT+1;124 *NROT += 1; 127 125 } //end ((i.gt.4)...else if 128 126 } // main iq loop 129 127 } // main ip loop 130 for (ip=0; ip<3; ip++) {128 for( ip = 0; ip < N; ip++) { 131 129 B[ip] += Z[ip]; 132 D[ip] =B[ip];133 Z[ip] =0;130 D[ip] = B[ip]; 131 Z[ip] = 0.0f; 134 132 } 135 133 } //end of main i loop 136 // printf("\n 50 iterations !\n");137 //free(B);138 //free(Z);139 134 delete[] B; 140 135 delete[] Z; -
trunk/src/lib/collision_detection/obb_tree_node.cc
r5488 r5491 390 390 391 391 392 // PRINTF( 3)("Jacobi\n");393 // for(int j = 1; j < 4; ++j)392 // PRINTF(0)("Jacobi\n"); 393 // for(int j = 0; j < 3; ++j) 394 394 // { 395 // PRINTF(3)(" |");396 // for(int k = 1; k < 4; ++k)395 // printf(" |"); 396 // for(int k = 0; k < 3; ++k) 397 397 // { 398 // PRINTF(3)(" \b%f ", OBBTreeNode::OBBTreeNode::eigvMat[j][k]);398 // printf(" \t%f ", OBBTreeNode::OBBTreeNode::eigvMat[j][k]); 399 399 // } 400 // PRINTF(3)(" |\n");400 // printf(" |\n"); 401 401 // } 402 402 … … 409 409 box->axis = axis; 410 410 411 PRINTF( 3)("-- Got Axis\n");412 413 PRINTF( 3)("eigenvector: %f, %f, %f\n", box->axis[0].x, box->axis[0].y, box->axis[0].z);414 PRINTF( 3)("eigenvector: %f, %f, %f\n", box->axis[1].x, box->axis[1].y, box->axis[1].z);415 PRINTF( 3)("eigenvector: %f, %f, %f\n", box->axis[2].x, box->axis[2].y, box->axis[2].z);411 PRINTF(0)("-- Got Axis\n"); 412 413 PRINTF(0)("eigenvector: %f, %f, %f\n", box->axis[0].x, box->axis[0].y, box->axis[0].z); 414 PRINTF(0)("eigenvector: %f, %f, %f\n", box->axis[1].x, box->axis[1].y, box->axis[1].z); 415 PRINTF(0)("eigenvector: %f, %f, %f\n", box->axis[2].x, box->axis[2].y, box->axis[2].z); 416 416 } 417 417
Note: See TracChangeset
for help on using the changeset viewer.