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

Function between

Source/ThirdParty/recastnavigation/RecastMesh.cpp:212–221  ·  view source on GitHub ↗

Returns T iff (a,b,c) are collinear and point c lies on the closed segement ab.

Source from the content-addressed store, hash-verified

210// Returns T iff (a,b,c) are collinear and point c lies
211// on the closed segement ab.
212static bool between(const int* a, const int* b, const int* c)
213{
214 if (!collinear(a, b, c))
215 return false;
216 // If ab not vertical, check betweenness on x; else on y.
217 if (a[0] != b[0])
218 return ((a[0] <= c[0]) && (c[0] <= b[0])) || ((a[0] >= c[0]) && (c[0] >= b[0]));
219 else
220 return ((a[2] <= c[2]) && (c[2] <= b[2])) || ((a[2] >= c[2]) && (c[2] >= b[2]));
221}
222
223// Returns true iff segments ab and cd intersect, properly or improperly.
224static bool intersect(const int* a, const int* b, const int* c, const int* d)

Callers 1

intersectFunction · 0.70

Calls 1

collinearFunction · 0.70

Tested by

no test coverage detected