Changeset 7983 for code/branches/kicklib/src/external/bullet/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp
- Timestamp:
- Feb 27, 2011, 7:43:24 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib/src/external/bullet/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp
r5781 r7983 1 2 1 /* 3 2 * Box-Box collision detection re-distributed under the ZLib license with permission from Russell L. Smith … … 213 212 } else 214 213 { 215 a= 1e30f;214 a=BT_LARGE_FLOAT; 216 215 } 217 216 cx = a*(cx + q*(p[n*2-2]+p[0])); … … 268 267 { 269 268 const btScalar fudge_factor = btScalar(1.05); 270 btVector3 p,pp,normalC ;269 btVector3 p,pp,normalC(0.f,0.f,0.f); 271 270 const btScalar *normalR = 0; 272 271 btScalar A[3],B[3],R11,R12,R13,R21,R22,R23,R31,R32,R33, … … 334 333 #define TST(expr1,expr2,n1,n2,n3,cc) \ 335 334 s2 = btFabs(expr1) - (expr2); \ 336 if (s2 > 0) return 0; \335 if (s2 > SIMD_EPSILON) return 0; \ 337 336 l = btSqrt((n1)*(n1) + (n2)*(n2) + (n3)*(n3)); \ 338 if (l > 0) { \337 if (l > SIMD_EPSILON) { \ 339 338 s2 /= l; \ 340 339 if (s2*fudge_factor > s) { \ … … 346 345 } \ 347 346 } 347 348 btScalar fudge2 (1.0e-5f); 349 350 Q11 += fudge2; 351 Q12 += fudge2; 352 Q13 += fudge2; 353 354 Q21 += fudge2; 355 Q22 += fudge2; 356 Q23 += fudge2; 357 358 Q31 += fudge2; 359 Q32 += fudge2; 360 Q33 += fudge2; 348 361 349 362 // separating axis = u1 x (v1,v2,v3) … … 425 438 #else 426 439 output.addContactPoint(-normal,pb,-*depth); 440 427 441 #endif // 428 442 *return_code = code; … … 594 608 595 609 if (cnum <= maxc) { 610 611 if (code<4) 612 { 596 613 // we have less contacts than we need, so we use them all 597 for (j=0; j < cnum; j++) { 598 599 //AddContactPoint... 600 601 //dContactGeom *con = CONTACT(contact,skip*j); 602 //for (i=0; i<3; i++) con->pos[i] = point[j*3+i] + pa[i]; 603 //con->depth = dep[j]; 604 614 for (j=0; j < cnum; j++) 615 { 605 616 btVector3 pointInWorld; 606 617 for (i=0; i<3; i++) … … 609 620 610 621 } 622 } else 623 { 624 // we have less contacts than we need, so we use them all 625 for (j=0; j < cnum; j++) 626 { 627 btVector3 pointInWorld; 628 for (i=0; i<3; i++) 629 pointInWorld[i] = point[j*3+i] + pa[i]-normal[i]*dep[j]; 630 //pointInWorld[i] = point[j*3+i] + pa[i]; 631 output.addContactPoint(-normal,pointInWorld,-dep[j]); 632 } 633 } 611 634 } 612 635 else { … … 633 656 for (i=0; i<3; i++) 634 657 posInWorld[i] = point[iret[j]*3+i] + pa[i]; 635 output.addContactPoint(-normal,posInWorld,-dep[iret[j]]); 658 if (code<4) 659 { 660 output.addContactPoint(-normal,posInWorld,-dep[iret[j]]); 661 } else 662 { 663 output.addContactPoint(-normal,posInWorld-normal*dep[iret[j]],-dep[iret[j]]); 664 } 636 665 } 637 666 cnum = maxc;
Note: See TracChangeset
for help on using the changeset viewer.