|
|
| template<class T > |
| void | dtSwap (T &a, T &b) |
| |
| template<class T > |
| T | dtMin (T a, T b) |
| |
| dtReal | dtMin (dtReal a, dtReal b) |
| |
| template<class T > |
| T | dtMax (T a, T b) |
| |
| dtReal | dtMax (dtReal a, dtReal b) |
| |
| template<class T > |
| T | dtAbs (T a) |
| |
| template<class T > |
| T | dtSqr (T a) |
| |
| template<class T > |
| T | dtClamp (T v, T mn, T mx) |
| |
| dtReal | dtClamp (dtReal v, dtReal mn, dtReal mx) |
| |
| float | dtFloor (float x) |
| |
| double | dtFloor (double x) |
| |
| float | dtCeil (float x) |
| |
| double | dtCeil (double x) |
| |
| float | dtSin (float x) |
| |
| double | dtSin (double x) |
| |
| float | dtCos (float x) |
| |
| double | dtCos (double x) |
| |
| float | dtAtan2 (float x, float y) |
| |
| double | dtAtan2 (double x, double y) |
| |
| float | dtSqrt (float x) |
| |
| double | dtSqrt (double x) |
| |
| float | dtfMod (float x, float y) |
| |
| double | dtfMod (double x, double y) |
| |
| float | dtLerp (float a, float b, float t) |
| |
|
| void | dtVcross (dtReal *dest, const dtReal *v1, const dtReal *v2) |
| |
| dtReal | dtVdot (const dtReal *v1, const dtReal *v2) |
| |
| void | dtVmad (dtReal *dest, const dtReal *v1, const dtReal *v2, const dtReal s) |
| |
| void | dtVlerp (dtReal *dest, const dtReal *v1, const dtReal *v2, const dtReal t) |
| |
| void | dtVadd (dtReal *dest, const dtReal *v1, const dtReal *v2) |
| |
| void | dtVsub (dtReal *dest, const dtReal *v1, const dtReal *v2) |
| |
| void | dtVscale (dtReal *dest, const dtReal *v, const dtReal t) |
| |
| void | dtVmin (dtReal *mn, const dtReal *v) |
| |
| void | dtVmax (dtReal *mx, const dtReal *v) |
| |
| void | dtVset (dtReal *dest, const dtReal x, const dtReal y, const dtReal z) |
| |
| void | dtVcopy (dtReal *dest, const dtReal *a) |
| |
| dtReal | dtVlen (const dtReal *v) |
| |
| dtReal | dtVlenSqr (const dtReal *v) |
| |
| dtReal | dtVdist (const dtReal *v1, const dtReal *v2) |
| |
| dtReal | dtVdistSqr (const dtReal *v1, const dtReal *v2) |
| |
| dtReal | dtVdist2D (const dtReal *v1, const dtReal *v2) |
| |
| dtReal | dtVdist2DSqr (const dtReal *v1, const dtReal *v2) |
| |
| void | dtVnormalize (dtReal *v) |
| |
| bool | dtVisEqual (const unsigned short *a, const unsigned short *b) |
| |
| bool | dtVequal (const dtReal *p0, const dtReal *p1) |
| |
| dtReal | dtVdot2D (const dtReal *u, const dtReal *v) |
| |
| dtReal | dtVperp2D (const dtReal *u, const dtReal *v) |
| |
|
| dtReal | dtTriArea2D (const dtReal *a, const dtReal *b, const dtReal *c) |
| |
| bool | dtOverlapQuantBounds (const unsigned short amin[3], const unsigned short amax[3], const unsigned short bmin[3], const unsigned short bmax[3]) |
| |
| bool | dtOverlapBounds (const dtReal *amin, const dtReal *amax, const dtReal *bmin, const dtReal *bmax) |
| |
| void | dtClosestPtPointTriangle (dtReal *closest, const dtReal *p, const dtReal *a, const dtReal *b, const dtReal *c) |
| |
| bool | dtClosestHeightPointTriangle (const dtReal *p, const dtReal *a, const dtReal *b, const dtReal *c, dtReal &h) |
| |
| bool | dtIntersectSegmentPoly2D (const dtReal *p0, const dtReal *p1, const dtReal *verts, int nverts, dtReal &tmin, dtReal &tmax, int &segMin, int &segMax) |
| |
| bool | dtIntersectSegSeg2D (const dtReal *ap, const dtReal *aq, const dtReal *bp, const dtReal *bq, dtReal &s, dtReal &t) |
| |
| bool | dtPointInPolygon (const dtReal *pt, const dtReal *verts, const int nverts) |
| |
| bool | dtDistancePtPolyEdgesSqr (const dtReal *pt, const dtReal *verts, const int nverts, dtReal *ed, dtReal *et) |
| |
| dtReal | dtDistancePtSegSqr2D (const dtReal *pt, const dtReal *p, const dtReal *q, dtReal &t) |
| |
| dtReal | dtDistancePtSegSqr (const dtReal *pt, const dtReal *p, const dtReal *q) |
| |
| void | dtCalcPolyCenter (dtReal *tc, const unsigned short *idx, int nidx, const dtReal *verts) |
| |
| bool | dtOverlapPolyPoly2D (const dtReal *polya, const int npolya, const dtReal *polyb, const int npolyb) |
| |
Derives the signed xz-plane area of the triangle ABC, or the relationship of line AB to point C.
- Parameters
-
| [in] | a | Vertex A. [(x, y, z)] |
| [in] | b | Vertex B. [(x, y, z)] |
| [in] | c | Vertex C. [(x, y, z)] |
- Returns
- The signed xz-plane area of the triangle.
The vertices are projected onto the xz-plane, so the y-values are ignored.
This is a low cost function than can be used for various purposes. Its main purpose is for point/line relationship testing.
In all cases: A value of zero indicates that all vertices are collinear or represent the same point. (On the xz-plane.)
When used for point/line relationship tests, AB usually represents a line against which the C point is to be tested. In this case:
A positive value indicates that point C is to the left of line AB, looking from A toward B.
A negative value indicates that point C is to the right of lineAB, looking from A toward B.
When used for evaluating a triangle:
The absolute value of the return value is two times the area of the triangle when it is projected onto the xz-plane.
A positive return value indicates:
-
The vertices are wrapped in the normal Detour wrap direction.
-
The triangle's 3D face normal is in the general up direction.
A negative return value indicates:
-
The vertices are reverse wrapped. (Wrapped opposite the normal Detour wrap direction.)
-
The triangle's 3D face normal is in the general down direction.