48template<
class T>
inline void dtSwap(T& a, T& b) { T t = a; a = b; b = t; }
54template<
class T>
inline T
dtMin(T a, T b) {
return a < b ? a : b; }
63template<
class T>
inline T
dtMax(T a, T b) {
return a > b ? a : b; }
71template<
class T>
inline T
dtAbs(T a) {
return a < 0 ? -a : a; }
76template<
class T>
inline T
dtSqr(T a) {
return a*a; }
158inline float dtLerp(
float a,
float b,
float t)
173 dest[0] = v1[1]*v2[2] - v1[2]*v2[1];
174 dest[1] = v1[2]*v2[0] - v1[0]*v2[2];
175 dest[2] = v1[0]*v2[1] - v1[1]*v2[0];
184 return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
194 dest[0] = v1[0]+v2[0]*s;
195 dest[1] = v1[1]+v2[1]*s;
196 dest[2] = v1[2]+v2[2]*s;
206 dest[0] = v1[0]+(v2[0]-v1[0])*t;
207 dest[1] = v1[1]+(v2[1]-v1[1])*t;
208 dest[2] = v1[2]+(v2[2]-v1[2])*t;
217 dest[0] = v1[0]+v2[0];
218 dest[1] = v1[1]+v2[1];
219 dest[2] = v1[2]+v2[2];
228 dest[0] = v1[0]-v2[0];
229 dest[1] = v1[1]-v2[1];
230 dest[2] = v1[2]-v2[2];
297 return v[0]*
v[0] +
v[1]*
v[1] +
v[2]*
v[2];
361inline bool dtVisEqual(
const unsigned short* a,
const unsigned short* b)
363 return a[0] == b[0] && a[1] == b[1] && a[2] == b[2];
388 return u[0]*
v[0] + u[2]*
v[2];
399 return u[2]*
v[0] - u[0]*
v[2];
428 const unsigned short bmin[3],
const unsigned short bmax[3])
431 overlap = (
amin[0] > bmax[0] ||
amax[0] < bmin[0]) ?
false : overlap;
432 overlap = (
amin[1] > bmax[1] ||
amax[1] < bmin[1]) ?
false : overlap;
433 overlap = (
amin[2] > bmax[2] ||
amax[2] < bmin[2]) ?
false : overlap;
448 overlap = (
amin[0] > bmax[0] ||
amax[0] < bmin[0]) ?
false : overlap;
449 overlap = (
amin[1] > bmax[1] ||
amax[1] < bmin[1]) ?
false : overlap;
450 overlap = (
amin[2] > bmax[2] ||
amax[2] < bmin[2]) ?
false : overlap;
472 const dtReal* verts,
int nverts,
529 r = (
v > 0xffff) << 4;
v >>= r;
540#if DT_LARGE_WORLD_COORDINATES_DISABLED
552 unsigned char tmp = *a;
559 unsigned char* x = (
unsigned char*)
v;
565 unsigned char* x = (
unsigned char*)
v;
571 unsigned char* x = (
unsigned char*)
v;
577 unsigned char* x = (
unsigned char*)
v;
583 unsigned char* x = (
unsigned char*)
v;
592 unsigned char* x = (
unsigned char*)
v;
601 unsigned char* x = (
unsigned char*)
v;
608 unsigned char* x = (
unsigned char*)
v;
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
bool dtVisEqual(const unsigned short *a, const unsigned short *b)
Definition DetourCommon.h:361
void dtVnormalize(dtReal *v)
Definition DetourCommon.h:350
void dtVmax(dtReal *mx, const dtReal *v)
Definition DetourCommon.h:257
void dtSwapEndian(unsigned short *v)
Definition DetourCommon.h:557
dtReal dtDistancePtSegSqr2D(const dtReal *pt, const dtReal *p, const dtReal *q, dtReal &t)
Definition DetourCommon.cpp:173
T dtMin(T a, T b)
Definition DetourCommon.h:54
void dtVlerp(dtReal *dest, const dtReal *v1, const dtReal *v2, const dtReal t)
Definition DetourCommon.h:204
void dtCalcPolyCenter(dtReal *tc, const unsigned short *idx, int nidx, const dtReal *verts)
Definition DetourCommon.cpp:216
void dtVset(dtReal *dest, const dtReal x, const dtReal y, const dtReal z)
Definition DetourCommon.h:269
void dtVadd(dtReal *dest, const dtReal *v1, const dtReal *v2)
Definition DetourCommon.h:215
float dtFloor(float x)
Definition DetourCommon.h:88
bool dtClosestHeightPointTriangle(const dtReal *p, const dtReal *a, const dtReal *b, const dtReal *c, dtReal &h)
Definition DetourCommon.cpp:234
bool dtDistancePtPolyEdgesSqr(const dtReal *pt, const dtReal *verts, const int nverts, dtReal *ed, dtReal *et)
Definition DetourCommon.cpp:283
bool dtPointInPolygon(const dtReal *pt, const dtReal *verts, const int nverts)
Definition DetourCommon.cpp:267
void dtVsub(dtReal *dest, const dtReal *v1, const dtReal *v2)
Definition DetourCommon.h:226
T dtClamp(T v, T mn, T mx)
Definition DetourCommon.h:83
dtReal dtVdist2DSqr(const dtReal *v1, const dtReal *v2)
Definition DetourCommon.h:341
float dtfMod(float x, float y)
Definition DetourCommon.h:148
dtRotation
Definition DetourCommon.h:618
@ DT_ROTATE_270
Definition DetourCommon.h:622
@ DT_ROTATE_0
Definition DetourCommon.h:619
@ DT_ROTATE_90
Definition DetourCommon.h:620
@ DT_ROTATE_180
Definition DetourCommon.h:621
float dtCeil(float x)
Definition DetourCommon.h:98
T dtAbs(T a)
Definition DetourCommon.h:71
void dtVmin(dtReal *mn, const dtReal *v)
Definition DetourCommon.h:247
void dtClosestPtPointTriangle(dtReal *closest, const dtReal *p, const dtReal *a, const dtReal *b, const dtReal *c)
Definition DetourCommon.cpp:27
dtReal dtVdistSqr(const dtReal *v1, const dtReal *v2)
Definition DetourCommon.h:316
T dtMax(T a, T b)
Definition DetourCommon.h:63
float dtSqrt(float x)
Definition DetourCommon.h:138
void dtVcopy(dtReal *dest, const dtReal *a)
Definition DetourCommon.h:277
bool dtIntersectSegSeg2D(const dtReal *ap, const dtReal *aq, const dtReal *bp, const dtReal *bq, dtReal &s, dtReal &t)
Definition DetourCommon.cpp:501
unsigned int dtIlog2(unsigned int v)
Definition DetourCommon.h:525
dtReal dtTriArea2D(const dtReal *a, const dtReal *b, const dtReal *c)
Definition DetourCommon.h:411
float dtCos(float x)
Definition DetourCommon.h:118
float dtSin(float x)
Definition DetourCommon.h:108
void dtVcross(dtReal *dest, const dtReal *v1, const dtReal *v2)
Definition DetourCommon.h:171
dtReal dtDistancePtSegSqr(const dtReal *pt, const dtReal *p, const dtReal *q)
Definition DetourCommon.cpp:191
void dtRandomPointInConvexPoly(const dtReal *pts, const int npts, dtReal *areas, const dtReal s, const dtReal t, dtReal *out)
Definition DetourCommon.cpp:361
int dtOppositeTile(int side)
Definition DetourCommon.h:548
int dtAlign(int x)
Definition DetourCommon.h:538
void dtVRot90(dtReal *dest, const dtReal *v, const dtRotation rot)
Definition DetourCommon.cpp:423
float dtLerp(float a, float b, float t)
Definition DetourCommon.h:158
dtRotation dtSelectRotation(dtReal rotationDeg)
Definition DetourCommon.cpp:405
void dtSwapByte(unsigned char *a, unsigned char *b)
Definition DetourCommon.h:550
bool dtOverlapBounds(const dtReal *amin, const dtReal *amax, const dtReal *bmin, const dtReal *bmax)
Definition DetourCommon.h:444
dtReal dtVdot2D(const dtReal *u, const dtReal *v)
Definition DetourCommon.h:386
bool dtIntersectSegmentPoly2D(const dtReal *p0, const dtReal *p1, const dtReal *verts, int nverts, dtReal &tmin, dtReal &tmax, int &segMin, int &segMax)
Definition DetourCommon.cpp:113
dtReal dtVdist2D(const dtReal *v1, const dtReal *v2)
Definition DetourCommon.h:330
unsigned int dtNextPow2(unsigned int v)
Definition DetourCommon.h:513
bool dtOverlapQuantBounds(const unsigned short amin[3], const unsigned short amax[3], const unsigned short bmin[3], const unsigned short bmax[3])
Definition DetourCommon.h:427
dtReal dtVperp2D(const dtReal *u, const dtReal *v)
Definition DetourCommon.h:397
float dtAtan2(float x, float y)
Definition DetourCommon.h:128
dtReal dtVlen(const dtReal *v)
Definition DetourCommon.h:287
bool dtVequal(const dtReal *p0, const dtReal *p1)
Definition DetourCommon.h:373
void dtVmad(dtReal *dest, const dtReal *v1, const dtReal *v2, const dtReal s)
Definition DetourCommon.h:192
dtReal dtVdist(const dtReal *v1, const dtReal *v2)
Definition DetourCommon.h:304
T dtSqr(T a)
Definition DetourCommon.h:76
void dtVscale(dtReal *dest, const dtReal *v, const dtReal t)
Definition DetourCommon.h:237
void dtSwap(T &a, T &b)
Definition DetourCommon.h:48
dtReal dtVdot(const dtReal *v1, const dtReal *v2)
Definition DetourCommon.h:182
dtReal dtVlenSqr(const dtReal *v)
Definition DetourCommon.h:295
bool dtOverlapPolyPoly2D(const dtReal *polya, const int npolya, const dtReal *polyb, const int npolyb)
Definition DetourCommon.cpp:323
void dtRotate90(dtReal *dest, const dtReal *v, const dtReal *center, const dtRotation rot)
Definition DetourCommon.cpp:475
double dtReal
Definition DetourLargeWorldCoordinates.h:15
float shift(float inValue, float expShift)
Definition RenderCore.cpp:859
char * dest
Definition lz4.h:709
float v
Definition radaudio_mdct.cpp:62