MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / intersectProp

Function intersectProp

Source/ThirdParty/recastnavigation/RecastMesh.cpp:200–208  ·  view source on GitHub ↗

Returns true iff ab properly intersects cd: they share a point interior to both segments. The properness of the intersection is ensured by using strict leftness.

Source from the content-addressed store, hash-verified

198// a point interior to both segments. The properness of the
199// intersection is ensured by using strict leftness.
200static bool intersectProp(const int* a, const int* b, const int* c, const int* d)
201{
202 // Eliminate improper cases.
203 if (collinear(a,b,c) || collinear(a,b,d) ||
204 collinear(c,d,a) || collinear(c,d,b))
205 return false;
206
207 return xorb(left(a,b,c), left(a,b,d)) && xorb(left(c,d,a), left(c,d,b));
208}
209
210// Returns T iff (a,b,c) are collinear and point c lies
211// on the closed segement ab.

Callers 2

intersectFunction · 0.70
diagonalieLooseFunction · 0.70

Calls 3

collinearFunction · 0.70
xorbFunction · 0.70
leftFunction · 0.70

Tested by

no test coverage detected