int collide_recursive(box *b1, box *b2, double R[3][3], double T[3], double s) { double d[3]; // temp storage for scaled dimensions of box b2. int rc; // return codes if (1) { #if TRACE1 PrintInfo(("Next collision: b1, b2, R, T, s\n"); PrintInfo(("b1=%x, b2=%x\n", b1, b2); Mprint(R); Vprint(T); PrintInfo(("%lf\n", s); #endif if (RAPID_first_contact && (RAPID_num_contacts > 0)) return RAPID_OK; // test top level RAPID_num_box_tests++; int f1; d[0] = s * b2->d[0]; d[1] = s * b2->d[1]; d[2] = s * b2->d[2]; f1 = obb_disjoint(R, T, b1->d, d); #if TRACE1 if (f1 != 0) { PrintInfo(("BOX TEST %d DISJOINT! (code %d)\n", RAPID_num_box_tests, f1); }
int BV_Overlap(CKL_REAL R[3][3], CKL_REAL T[3], BV *b1, BV *b2) { #if CKL_BV_TYPE & OBB_TYPE return (obb_disjoint(R, T, b1->d, b2->d) == 0); #else CKL_REAL dist = RectDist(R, T, b1->l, b2->l); if(dist <= (b1->r + b2->r)) return 1; return 0; #endif }