Changeset 5428 in orxonox.OLD for trunk/src/lib/collision_detection
- Timestamp:
- Oct 24, 2005, 7:07:00 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
r5398 r5428 24 24 void JacobI(float **A,int N,float *D, float **V, int *NROT) { 25 25 float *B, *Z; 26 double c,g,h,s,sm,t,tau,theta,tresh; 27 int i,j,ip,iq; 28 29 // void *vmblock1 = NULL; 26 double c=0.0f, g=0.0f, h=0.0f, s=0.0f, sm=0.0f, t=0.0f, tau=0.0f, theta=0.0f, tresh=0.0f; 27 int i=0,j=0,ip=0,iq=0; 30 28 31 29 //allocate vectors B, Z 32 //vmblock1 = vminit(); 30 33 31 B = (float *) calloc(100, 32); 34 32 Z = (float *) calloc(100, 32); 35 33 36 for 34 for(ip=1; ip<=N; ip++) { //initialize V to identity matrix 37 35 for (iq=1; iq<=N; iq++) V[ip][iq]=0; 38 36 V[ip][ip]=1; … … 118 116 } //end of main i loop 119 117 // printf("\n 50 iterations !\n"); 118 free(B); 119 free(Z); 120 120 return; //too many iterations 121 121 } -
trunk/src/lib/collision_detection/obb_tree_node.cc
r5210 r5428 160 160 { 161 161 float facelet[length]; //!< surface area of the i'th triangle of the convex hull 162 float face ;//!< surface area of the entire convex hull162 float face = 0.0f; //!< surface area of the entire convex hull 163 163 Vector centroid[length]; //!< centroid of the i'th convex hull 164 164 Vector center; //!< the center of the entire hull … … 175 175 { 176 176 /* fist compute all the convex hull face/facelets and centroids */ 177 for( int i = 0; i+3 < length ; i+=3) /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/177 for( int i = 0; i+3 < length ; i+=3) /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/ 178 178 { 179 179 p = verticesList[i]; … … 199 199 200 200 /* now calculate the covariance matrix - if not written in three for-loops, it would compute faster: minor */ 201 for( int j = 0; j < 3; ++j)202 { 203 for( int k = 0; k < 3; ++k)201 for( int j = 0; j < 3; ++j) 202 { 203 for( int k = 0; k < 3; ++k) 204 204 { 205 for( int i = 0; i< length; i+=3)205 for( int i = 0; i + 3 < length; i+=3) 206 206 { 207 207 p = verticesList[i]; … … 218 218 else if( mode == 1) 219 219 { 220 for( int i = 0; i < length; i+=3) /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/220 for( int i = 0; i + 3 < length; i+=3) /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/ 221 221 { 222 222 p = verticesList[i]; … … 233 233 for( int k = 0; k < 3; ++k) 234 234 { 235 for( int i = 0; i < length; i+=3)235 for( int i = 0; i + 3 < length; i+=3) 236 236 { 237 237 p = verticesList[i]; … … 249 249 { 250 250 /* fist compute all the convex hull face/facelets and centroids */ 251 for(int i = 0; i < length; i+=3) /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/251 for(int i = 0; i + 3 < length; i+=3) /* FIX-ME-QUICK: hops of 3, array indiscontinuity*/ 252 252 { 253 253 p = verticesList[i]; … … 275 275 for( int k = 0; k < 3; ++k) 276 276 { 277 for( int i = 0; i < length; i+=3)277 for( int i = 0; i + 3 < length; i+=3) 278 278 { 279 279 p = verticesList[i]; … … 300 300 for( int k = 0; k < 3; ++k) 301 301 { 302 for( int i = 0; i < length; i+=3)302 for( int i = 0; i + 3 < length; i+=3) 303 303 { 304 304 p = verticesList[i];
Note: See TracChangeset
for help on using the changeset viewer.