Change vperpXZ to vperpXY

This commit is contained in:
Kawe Mazidjatari 2022-10-22 21:57:44 +02:00
parent 8709a256d9
commit edd1c62352

View File

@ -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]; 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, bool dtIntersectSegSeg2D(const float* ap, const float* aq,
const float* bp, const float* bq, const float* bp, const float* bq,
@ -378,10 +378,10 @@ bool dtIntersectSegSeg2D(const float* ap, const float* aq,
dtVsub(u,aq,ap); dtVsub(u,aq,ap);
dtVsub(v,bq,bp); dtVsub(v,bq,bp);
dtVsub(w,ap,bp); dtVsub(w,ap,bp);
float d = vperpXZ(u,v); float d = vperpXY(u,v);
if (fabsf(d) < 1e-6f) return false; if (fabsf(d) < 1e-6f) return false;
s = vperpXZ(v,w) / d; s = vperpXY(v,w) / d;
t = vperpXZ(u,w) / d; t = vperpXY(u,w) / d;
return true; return true;
} }