From dbf95000e6467bbbebc8b9f62ef6d25c5bf7d602 Mon Sep 17 00:00:00 2001 From: Mikko Mononen Date: Sat, 20 Feb 2010 17:53:04 +0000 Subject: [PATCH] fix for issues 48 and 49. --- Recast/Include/Recast.h | 6 +++--- Recast/Source/RecastMesh.cpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Recast/Include/Recast.h b/Recast/Include/Recast.h index d117394..f4d2d1e 100644 --- a/Recast/Include/Recast.h +++ b/Recast/Include/Recast.h @@ -448,7 +448,7 @@ void rcRasterizeTriangle(const float* v0, const float* v1, const float* v2, unsigned char flags, rcHeightfield& solid, const int flagMergeThr = 1); -// Rasterizes the triangles into heightfield spans. +// Rasterizes indexed triangle mesh into heightfield spans. // Params: // verts - (in) array of vertices // nv - (in) vertex count @@ -461,7 +461,7 @@ void rcRasterizeTriangles(const float* verts, int nv, const int* tris, const unsigned char* flags, int nt, rcHeightfield& solid, const int flagMergeThr = 1); -// Rasterizes the triangles into heightfield spans. +// Rasterizes indexed triangle mesh into heightfield spans. // Params: // verts - (in) array of vertices // nv - (in) vertex count @@ -481,7 +481,7 @@ void rcRasterizeTriangles(const float* verts, int nv, // nt - (in) triangle count // solid - (in) heighfield where the triangles are rasterized void rcRasterizeTriangles(const float* verts, const unsigned char* flags, int nt, - rcHeightfield& solid); + rcHeightfield& solid, const int flagMergeThr = 1); // Marks non-walkable low obstacles as walkable if they are closer than walkableClimb // from a walkable surface. Applying this filter allows to step over low hanging diff --git a/Recast/Source/RecastMesh.cpp b/Recast/Source/RecastMesh.cpp index 124e9b4..e1fc80e 100644 --- a/Recast/Source/RecastMesh.cpp +++ b/Recast/Source/RecastMesh.cpp @@ -1075,6 +1075,7 @@ bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh) rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.flags' (%d).", mesh.npolys); return false; } + memset(mesh.flags, 0, sizeof(unsigned short) * mesh.npolys); rcTimeVal endTime = rcGetPerformanceTimer();