mirror of
https://github.com/recastnavigation/recastnavigation.git
synced 2026-11-18 13:56:00 +00:00
Changed the polygon merging so that it does not generate parallel neighbor edges.
Added first version of Detour. Changed the demo to use Detour.
This commit is contained in:
@@ -384,10 +384,10 @@ static int countPolyVerts(const unsigned short* p, const int nvp)
|
||||
return nvp;
|
||||
}
|
||||
|
||||
inline bool uleftOn(const unsigned short* a, const unsigned short* b, const unsigned short* c)
|
||||
inline bool uleft(const unsigned short* a, const unsigned short* b, const unsigned short* c)
|
||||
{
|
||||
return ((int)b[0] - (int)a[0]) * ((int)c[2] - (int)a[2]) -
|
||||
((int)c[0] - (int)a[0]) * ((int)b[2] - (int)a[2]) <= 0;
|
||||
((int)c[0] - (int)a[0]) * ((int)b[2] - (int)a[2]) < 0;
|
||||
}
|
||||
|
||||
static int getPolyMergeValue(unsigned short* pa, unsigned short* pb,
|
||||
@@ -436,13 +436,13 @@ static int getPolyMergeValue(unsigned short* pa, unsigned short* pb,
|
||||
va = pa[(ea+na-1) % na];
|
||||
vb = pa[ea];
|
||||
vc = pb[(eb+2) % nb];
|
||||
if (!uleftOn(&verts[va*3], &verts[vb*3], &verts[vc*3]))
|
||||
if (!uleft(&verts[va*3], &verts[vb*3], &verts[vc*3]))
|
||||
return -1;
|
||||
|
||||
va = pb[(eb+nb-1) % nb];
|
||||
vb = pb[eb];
|
||||
vc = pa[(ea+2) % na];
|
||||
if (!uleftOn(&verts[va*3], &verts[vb*3], &verts[vc*3]))
|
||||
if (!uleft(&verts[va*3], &verts[vb*3], &verts[vc*3]))
|
||||
return -1;
|
||||
|
||||
va = pa[ea];
|
||||
|
||||
Reference in New Issue
Block a user