Skip to content

Commit c9bacf3

Browse files
committed
Unit tests for a good number of Recast functions.
These are by no means complete coverage of the functions they test, but are at least a start. For consistency, all floating point comparisons use Approx(), regardless of whether they need to or not. Removed unnecessary C++11 unique_ptr stuff, now that rcHeightfield has a constructor and destructor.
1 parent 69895b4 commit c9bacf3

File tree

3 files changed

+819
-2
lines changed

3 files changed

+819
-2
lines changed

Recast/Include/Recast.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ bool rcRasterizeTriangles(rcContext* ctx, const float* verts, const int nv,
894894
bool rcRasterizeTriangles(rcContext* ctx, const float* verts, const unsigned char* areas, const int nt,
895895
rcHeightfield& solid, const int flagMergeThr = 1);
896896

897-
/// Marks non-walkable spans as walkable if their maximum is within @p walkableClimp of a walkable neihbor.
897+
/// Marks non-walkable spans as walkable if their maximum is within @p walkableClimp of a walkable neighbor.
898898
/// @ingroup recast
899899
/// @param[in,out] ctx The build context to use during the operation.
900900
/// @param[in] walkableClimb Maximum ledge height that is considered to still be traversable.

Recast/Source/Recast.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,12 @@ static void calcTriNormal(const float* v0, const float* v1, const float* v2, flo
261261
///
262262
/// @see rcHeightfield, rcClearUnwalkableTriangles, rcRasterizeTriangles
263263
void rcMarkWalkableTriangles(rcContext* ctx, const float walkableSlopeAngle,
264-
const float* verts, int /*nv*/,
264+
const float* verts, int nv,
265265
const int* tris, int nt,
266266
unsigned char* areas)
267267
{
268268
rcIgnoreUnused(ctx);
269+
rcIgnoreUnused(nv);
269270

270271
const float walkableThr = cosf(walkableSlopeAngle/180.0f*RC_PI);
271272

0 commit comments

Comments
 (0)