aboutsummaryrefslogtreecommitdiff
path: root/dep/recastnavigation/Recast/RecastMeshDetail.cpp
diff options
context:
space:
mode:
authorVincent_Michael <Vincent_Michael@gmx.de>2014-01-18 01:36:12 +0100
committerVincent_Michael <Vincent_Michael@gmx.de>2014-01-18 01:36:12 +0100
commitad8c046916262918b88917cbe4194a943ce75d16 (patch)
tree1bdf4a3995b184377229a767278771f4e533b828 /dep/recastnavigation/Recast/RecastMeshDetail.cpp
parent3276a786cc35f4dddcceedcab84fba5e77b78e58 (diff)
Core/Revert: ...
Diffstat (limited to 'dep/recastnavigation/Recast/RecastMeshDetail.cpp')
-rw-r--r--dep/recastnavigation/Recast/RecastMeshDetail.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/dep/recastnavigation/Recast/RecastMeshDetail.cpp b/dep/recastnavigation/Recast/RecastMeshDetail.cpp
index 77438fd8f58..f49d67400c2 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 - 1);
- iz = rcClamp(iz-hp.ymin, 0, hp.height - 1);
+ ix = rcClamp(ix-hp.xmin, 0, hp.width);
+ iz = rcClamp(iz-hp.ymin, 0, hp.height);
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 = sqrtf(dx*dx + dz*dz);
+ float d = rcSqrt(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)