From 404491901a60fe1e652ecc680a87da86e0e344df Mon Sep 17 00:00:00 2001 From: Mikko Mononen Date: Fri, 4 Sep 2009 06:47:42 +0000 Subject: [PATCH] Fixed Issue 10: clipping during rasterization. --- Recast/Source/RecastRasterization.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Recast/Source/RecastRasterization.cpp b/Recast/Source/RecastRasterization.cpp index 658b0e1..7f63074 100644 --- a/Recast/Source/RecastRasterization.cpp +++ b/Recast/Source/RecastRasterization.cpp @@ -256,8 +256,8 @@ static void rasterizeTri(const float* v0, const float* v1, const float* v2, if (smax < 0.0f) continue; if (smin > by) continue; // Clamp the span to the heightfield bbox. - if (smin < 0.0f) smin = bmin[1]; - if (smax > by) smax = bmax[1]; + if (smin < 0.0f) smin = 0; + if (smax > by) smax = by; // Snap the span to the heightfield height grid. unsigned short ismin = (unsigned short)rcClamp((int)floorf(smin * ich), 0, 0x7fff);