diff --git a/r5dev/thirdparty/recast/Detour/Source/DetourCommon.cpp b/r5dev/thirdparty/recast/Detour/Source/DetourCommon.cpp index c12c3b68..4d5f89ee 100644 --- a/r5dev/thirdparty/recast/Detour/Source/DetourCommon.cpp +++ b/r5dev/thirdparty/recast/Detour/Source/DetourCommon.cpp @@ -368,7 +368,7 @@ void dtRandomPointInConvexPoly(const float* pts, const int npts, float* areas, out[2] = a*pa[2] + b*pb[2] + c*pc[2]; } -inline float vperpXZ(const float* a, const float* b) { return a[0]*b[2] - a[2]*b[0]; } +inline float vperpXY(const float* a, const float* b) { return a[0]*b[1] - a[1]*b[0]; } bool dtIntersectSegSeg2D(const float* ap, const float* aq, const float* bp, const float* bq, @@ -378,10 +378,10 @@ bool dtIntersectSegSeg2D(const float* ap, const float* aq, dtVsub(u,aq,ap); dtVsub(v,bq,bp); dtVsub(w,ap,bp); - float d = vperpXZ(u,v); + float d = vperpXY(u,v); if (fabsf(d) < 1e-6f) return false; - s = vperpXZ(v,w) / d; - t = vperpXZ(u,w) / d; + s = vperpXY(v,w) / d; + t = vperpXY(u,w) / d; return true; }