Recast { public static void clearUnwalkableTriangles(Context ctx, float walkableSlopeAngle, float[] verts, int nv, int[] tris, int nt, int[] areas) { float walkableThr = (float) Math.cos(walkableSlopeAngle / 180.0f * Math.PI); float norm[] = new float[3]; for (int i = 0; i < nt; ++i) { int tri = i * 3; calcTriNormal(verts, tris[tri], tris[tri + 1], tris[tri + 2], norm); if (norm[1] <= walkableThr) areas[i] = RC_NULL_AREA; } }  static int[] calcGridSize(float[] bmin, float[] bmax, float cs); static int[] calcTileCount(float[] bmin, float[] bmax, float cs, int tileSize); static int[] markWalkableTriangles(Context ctx, float walkableSlopeAngle, float[] verts, int[] tris, int nt,
            AreaModification areaMod); static void clearUnwalkableTriangles(Context ctx, float walkableSlopeAngle, float[] verts, int nv,
            int[] tris, int nt, int[] areas); static CompactHeightfield buildCompactHeightfield(Context ctx, int walkableHeight, int walkableClimb,
            Heightfield hf);  }
@Test public void textClearUnwalkableTriangles() { float walkableSlopeAngle = 45; float verts[] = { 0, 0, 0, 1, 0, 0, 0, 0, -1 }; int nv = 3; int walkable_tri[] = { 0, 1, 2 }; int unwalkable_tri[] = { 0, 2, 1 }; int nt = 1; Context ctx = new Context(); { int areas[] = { 42 }; Recast.clearUnwalkableTriangles(ctx, walkableSlopeAngle, verts, nv, unwalkable_tri, nt, areas); assertEquals("Sets area ID of unwalkable triangle to RC_NULL_AREA", RC_NULL_AREA, areas[0]); } { int areas[] = { 42 }; Recast.clearUnwalkableTriangles(ctx, walkableSlopeAngle, verts, nv, walkable_tri, nt, areas); assertEquals("Does not modify walkable triangle aread ID's", 42, areas[0]); } { int areas[] = { 42 }; walkableSlopeAngle = 0; Recast.clearUnwalkableTriangles(ctx, walkableSlopeAngle, verts, nv, walkable_tri, nt, areas); assertEquals("Slopes equal to the max slope are considered unwalkable.", RC_NULL_AREA, areas[0]); } }