
Go to the source code of this file.
Defines | |
| #define | EDGE_AGAINST_TRI_EDGES(V0, V1, U0, U1, U2) |
| TO BE DOCUMENTED. | |
| #define | EDGE_EDGE_TEST(V0, U0, U1) |
| Edge to edge test based on Franlin Antonio's gem: "Faster Line Segment Intersection", in Graphics Gems III, pp. 199-202. | |
| #define | LOCAL_EPSILON 0.000001f |
| if OPC_TRITRI_EPSILON_TEST is true then we do a check (if |dv|<EPSILON then dv=0.0;) else no check is done (which is less robust, but faster) | |
| #define | NEWCOMPUTE_INTERVALS(VV0, VV1, VV2, D0, D1, D2, D0D1, D0D2, A, B, C, X0, X1) |
| TO BE DOCUMENTED. | |
| #define | POINT_IN_TRI(V0, U0, U1, U2) |
| TO BE DOCUMENTED. | |
| #define | SORT(a, b) |
| sort so that a<=b | |
Functions | |
| BOOL | CoplanarTriTri (const Point &n, const Point &v0, const Point &v1, const Point &v2, const Point &u0, const Point &u1, const Point &u2) |
| TO BE DOCUMENTED. | |
| #define EDGE_AGAINST_TRI_EDGES | ( | V0, | |
| V1, | |||
| U0, | |||
| U1, | |||
| U2 | |||
| ) |
{ \
float Bx,By,Cx,Cy,d,f; \
const float Ax = V1[i0] - V0[i0]; \
const float Ay = V1[i1] - V0[i1]; \
/* test edge U0,U1 against V0,V1 */ \
EDGE_EDGE_TEST(V0, U0, U1); \
/* test edge U1,U2 against V0,V1 */ \
EDGE_EDGE_TEST(V0, U1, U2); \
/* test edge U2,U1 against V0,V1 */ \
EDGE_EDGE_TEST(V0, U2, U0); \
}
TO BE DOCUMENTED.
Definition at line 36 of file OPC_TriTriOverlap.h.
| #define EDGE_EDGE_TEST | ( | V0, | |
| U0, | |||
| U1 | |||
| ) |
Bx = U0[i0] - U1[i0]; \
By = U0[i1] - U1[i1]; \
Cx = V0[i0] - U0[i0]; \
Cy = V0[i1] - U0[i1]; \
f = Ay*Bx - Ax*By; \
d = By*Cx - Bx*Cy; \
if((f>0.0f && d>=0.0f && d<=f) || (f<0.0f && d<=0.0f && d>=f)) \
{ \
const float e=Ax*Cy - Ay*Cx; \
if(f>0.0f) \
{ \
if(e>=0.0f && e<=f) return TRUE; \
} \
else \
{ \
if(e<=0.0f && e>=f) return TRUE; \
} \
}
Edge to edge test based on Franlin Antonio's gem: "Faster Line Segment Intersection", in Graphics Gems III, pp. 199-202.
Definition at line 15 of file OPC_TriTriOverlap.h.
| #define LOCAL_EPSILON 0.000001f |
if OPC_TRITRI_EPSILON_TEST is true then we do a check (if |dv|<EPSILON then dv=0.0;) else no check is done (which is less robust, but faster)
Definition at line 3 of file OPC_TriTriOverlap.h.
TO BE DOCUMENTED.
Definition at line 124 of file OPC_TriTriOverlap.h.
| #define POINT_IN_TRI | ( | V0, | |
| U0, | |||
| U1, | |||
| U2 | |||
| ) |
{ \
/* is T1 completly inside T2? */ \
/* check if V0 is inside tri(U0,U1,U2) */ \
float a = U1[i1] - U0[i1]; \
float b = -(U1[i0] - U0[i0]); \
float c = -a*U0[i0] - b*U0[i1]; \
float d0 = a*V0[i0] + b*V0[i1] + c; \
\
a = U2[i1] - U1[i1]; \
b = -(U2[i0] - U1[i0]); \
c = -a*U1[i0] - b*U1[i1]; \
const float d1 = a*V0[i0] + b*V0[i1] + c; \
\
a = U0[i1] - U2[i1]; \
b = -(U0[i0] - U2[i0]); \
c = -a*U2[i0] - b*U2[i1]; \
const float d2 = a*V0[i0] + b*V0[i1] + c; \
if(d0*d1>0.0f) \
{ \
if(d0*d2>0.0f) return TRUE; \
} \
}
TO BE DOCUMENTED.
Definition at line 50 of file OPC_TriTriOverlap.h.