diff options
| author | Subv <subv2112@gmail.com> | 2013-12-29 22:59:00 -0500 |
|---|---|---|
| committer | Subv <subv2112@gmail.com> | 2013-12-29 22:59:00 -0500 |
| commit | 71f856daa6c1dd9e71903b400ae33aeaa96fe913 (patch) | |
| tree | 53658ff41f09aeacc2698ba5386f9c6421616736 /dep/recastnavigation/Recast/RecastMeshDetail.cpp | |
| parent | 15d66d19b42759ccbb1900082c736a3953fcd3c9 (diff) | |
Tools/MeshExtractor: Updated RecastNavigation to the latest version from git
Diffstat (limited to 'dep/recastnavigation/Recast/RecastMeshDetail.cpp')
| -rw-r--r-- | dep/recastnavigation/Recast/RecastMeshDetail.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dep/recastnavigation/Recast/RecastMeshDetail.cpp b/dep/recastnavigation/Recast/RecastMeshDetail.cpp index f49d67400c2..77438fd8f58 100644 --- a/dep/recastnavigation/Recast/RecastMeshDetail.cpp +++ b/dep/recastnavigation/Recast/RecastMeshDetail.cpp @@ -200,8 +200,8 @@ static unsigned short getHeight(const float fx, const float fy, const float fz, { int ix = (int)floorf(fx*ics + 0.01f); int iz = (int)floorf(fz*ics + 0.01f); - ix = rcClamp(ix-hp.xmin, 0, hp.width); - iz = rcClamp(iz-hp.ymin, 0, hp.height); + ix = rcClamp(ix-hp.xmin, 0, hp.width - 1); + iz = rcClamp(iz-hp.ymin, 0, hp.height - 1); unsigned short h = hp.data[ix+iz*hp.width]; if (h == RC_UNSET_HEIGHT) { @@ -554,7 +554,7 @@ static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin, float dx = vi[0] - vj[0]; float dy = vi[1] - vj[1]; float dz = vi[2] - vj[2]; - float d = rcSqrt(dx*dx + dz*dz); + float d = sqrtf(dx*dx + dz*dz); int nn = 1 + (int)floorf(d/sampleDist); if (nn >= MAX_VERTS_PER_EDGE) nn = MAX_VERTS_PER_EDGE-1; if (nverts+nn >= MAX_VERTS) |
