UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DetourCommon.cpp File Reference

Functions

void dtClosestPtPointTriangle (dtReal *closest, const dtReal *p, const dtReal *a, const dtReal *b, const dtReal *c)
 
bool dtIntersectSegmentPoly2D (const dtReal *p0, const dtReal *p1, const dtReal *verts, int nverts, dtReal &tmin, dtReal &tmax, int &segMin, int &segMax)
 
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 dtClosestHeightPointTriangle (const dtReal *p, const dtReal *a, const dtReal *b, const dtReal *c, dtReal &h)
 
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)
 
bool overlapRange (const dtReal amin, const dtReal amax, const dtReal bmin, const dtReal bmax, const dtReal eps)
 
bool dtOverlapPolyPoly2D (const dtReal *polya, const int npolya, const dtReal *polyb, const int npolyb)
 
void dtRandomPointInConvexPoly (const dtReal *pts, const int npts, dtReal *areas, const dtReal s, const dtReal t, dtReal *out)
 
dtRotation dtSelectRotation (dtReal rotationDeg)
 
void dtVRot90 (dtReal *dest, const dtReal *v, const dtRotation rot)
 
void dtVRot90 (unsigned short *dest, const unsigned short *v, const dtRotation rot)
 
void dtRotate90 (dtReal *dest, const dtReal *v, const dtReal *center, const dtRotation rot)
 
void dtRotate90 (unsigned short *dest, const unsigned short *v, const unsigned short *center, const dtRotation rot)
 
dtReal vperpXZ (const dtReal *a, const dtReal *b)
 
bool dtIntersectSegSeg2D (const dtReal *ap, const dtReal *aq, const dtReal *bp, const dtReal *bq, dtReal &s, dtReal &t)
 

Function Documentation

◆ dtCalcPolyCenter()

void dtCalcPolyCenter ( dtReal tc,
const unsigned short idx,
int  nidx,
const dtReal verts 
)

Derives the centroid of a convex polygon.

Parameters
[out]tcThe centroid of the polgyon. [(x, y, z)]
[in]idxThe polygon indices. [(vertIndex) * nidx]
[in]nidxThe number of indices in the polygon. [Limit: >= 3]
[in]vertsThe polygon vertices. [(x, y, z) * vertCount]

◆ dtClosestHeightPointTriangle()

bool dtClosestHeightPointTriangle ( const dtReal p,
const dtReal a,
const dtReal b,
const dtReal c,
dtReal h 
)

Derives the y-axis height of the closest point on the triangle from the specified reference point.

Parameters
[in]pThe reference point from which to test. [(x, y, z)]
[in]aVertex A of triangle ABC. [(x, y, z)]
[in]bVertex B of triangle ABC. [(x, y, z)]
[in]cVertex C of triangle ABC. [(x, y, z)]
[out]hThe resulting height.

◆ dtClosestPtPointTriangle()

void dtClosestPtPointTriangle ( dtReal closest,
const dtReal p,
const dtReal a,
const dtReal b,
const dtReal c 
)

Derives the closest point on a triangle from the specified reference point.

Parameters
[out]closestThe closest point on the triangle.
[in]pThe reference point from which to test. [(x, y, z)]
[in]aVertex A of triangle ABC. [(x, y, z)]
[in]bVertex B of triangle ABC. [(x, y, z)]
[in]cVertex C of triangle ABC. [(x, y, z)]

◆ dtDistancePtPolyEdgesSqr()

bool dtDistancePtPolyEdgesSqr ( const dtReal pt,
const dtReal verts,
const int  nverts,
dtReal ed,
dtReal et 
)

◆ dtDistancePtSegSqr()

dtReal dtDistancePtSegSqr ( const dtReal pt,
const dtReal p,
const dtReal q 
)

◆ dtDistancePtSegSqr2D()

dtReal dtDistancePtSegSqr2D ( const dtReal pt,
const dtReal p,
const dtReal q,
dtReal t 
)

◆ dtIntersectSegmentPoly2D()

bool dtIntersectSegmentPoly2D ( const dtReal p0,
const dtReal p1,
const dtReal verts,
int  nverts,
dtReal tmin,
dtReal tmax,
int &  segMin,
int &  segMax 
)

◆ dtIntersectSegSeg2D()

bool dtIntersectSegSeg2D ( const dtReal ap,
const dtReal aq,
const dtReal bp,
const dtReal bq,
dtReal s,
dtReal t 
)

◆ dtOverlapPolyPoly2D()

bool dtOverlapPolyPoly2D ( const dtReal polya,
const int  npolya,
const dtReal polyb,
const int  npolyb 
)

All vertices are projected onto the xz-plane, so the y-values are ignored.

◆ dtPointInPolygon()

bool dtPointInPolygon ( const dtReal pt,
const dtReal verts,
const int  nverts 
)

All points are projected onto the xz-plane, so the y-values are ignored.

◆ dtRandomPointInConvexPoly()

void dtRandomPointInConvexPoly ( const dtReal pts,
const int  npts,
dtReal areas,
const dtReal  s,
const dtReal  t,
dtReal out 
)

◆ dtRotate90() [1/2]

void dtRotate90 ( dtReal dest,
const dtReal v,
const dtReal center,
const dtRotation  rot 
)

Rotate vector around center position by increments of 90 degrees.

Parameters
[out]destThe result position. [(x, y, z)]
[in]vThe vector to rotate. [(x, y, z)]
[in]centerThe center point. [(x, y, z)]
[in]rotThe rotation enum value.

◆ dtRotate90() [2/2]

void dtRotate90 ( unsigned short dest,
const unsigned short v,
const unsigned short center,
const dtRotation  rot 
)

Rotate vector around center position by increments of 90 degrees.

Parameters
[out]destThe result position. [(x, y, z)]
[in]vThe vector to rotate. [(x, y, z)]
[in]centerThe center point. [(x, y, z)]
[in]rotThe rotation enum value.

◆ dtSelectRotation()

dtRotation dtSelectRotation ( dtReal  rotationDeg)

Select a 90 degree increment value from an input angle in degree.

Parameters
[in]rotationDegThe desired rotation in degree.
Returns
The rotation enum value.

◆ dtVRot90() [1/2]

void dtVRot90 ( dtReal dest,
const dtReal v,
const dtRotation  rot 
)

Rotate by 90 degree increments.

Parameters
[out]destThe result position. [(x, y, z)]
[in]vThe vector to rotate. [(x, y, z)]
[in]rotThe rotation enum value.

◆ dtVRot90() [2/2]

void dtVRot90 ( unsigned short dest,
const unsigned short v,
const dtRotation  rot 
)

Rotate by 90 degree increments.

Parameters
[out]destThe result position. [(x, y, z)]
[in]vThe vector to rotate. [(x, y, z)]
[in]rotThe rotation enum value.

◆ overlapRange()

bool overlapRange ( const dtReal  amin,
const dtReal  amax,
const dtReal  bmin,
const dtReal  bmax,
const dtReal  eps 
)
inline

◆ vperpXZ()

dtReal vperpXZ ( const dtReal a,
const dtReal b 
)
inline