From d58d0e895c6e22bcf40be5c38ff828c98a7600e6 Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Wed, 17 Jun 2020 20:20:26 +0000 Subject: Handle different slopes in mmaps (#24765) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Tools/MMAPs: Remove input argument --maxAngle Remove input argument --maxAngle . This should be just hardcoded in MapBuilder::GetMapSpecificConfig() so all settings are easily found in the same place instead of being spread around. * Tools/MMAPs: Add new area type NAV_AREA_GROUND_STEEP Add new area type NAV_AREA_GROUND_STEEP for ground with slope in the range (55, 70] . NAV_AREA_GROUND is used for ground with range [0, 55] . NAV_AREA_GROUND_STEEP takes priority over NAV_AREA_GROUND. * Tools/MMAPs: Fix NAV_GROUND_STEEP flag not being saved in the mmtile * Core/PathFinding: Implement NAV_GROUND_STEEP flag Implement NAV_GROUND_STEEP flag, used only by Creatures that are in combat or evading. * Distinguish between RC_WALKABLE_AREA and NAV_AREA_GROUND. * Allow mobs in combat to walk on steeps up to 80° * Allow mobs in combat to walk on steeps up to 85°. Disable rcFilterLedgeSpans() filter as it removed long steep spans. * Increase cost of steep spans to try making creatures walk around obstacles instead of walking on them * Revert last commit (cherry picked from commit 995a443da219ec773febd7dd29d18f3cefaa1f3b) --- dep/recastnavigation/Recast/Source/Recast.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dep/recastnavigation/Recast/Source/Recast.cpp') diff --git a/dep/recastnavigation/Recast/Source/Recast.cpp b/dep/recastnavigation/Recast/Source/Recast.cpp index 1b71710cdc8..a33ca5cf2fc 100644 --- a/dep/recastnavigation/Recast/Source/Recast.cpp +++ b/dep/recastnavigation/Recast/Source/Recast.cpp @@ -334,7 +334,7 @@ static void calcTriNormal(const float* v0, const float* v1, const float* v2, flo void rcMarkWalkableTriangles(rcContext* ctx, const float walkableSlopeAngle, const float* verts, int nv, const int* tris, int nt, - unsigned char* areas) + unsigned char* areas, unsigned char areaType) { rcIgnoreUnused(ctx); rcIgnoreUnused(nv); @@ -349,7 +349,7 @@ void rcMarkWalkableTriangles(rcContext* ctx, const float walkableSlopeAngle, calcTriNormal(&verts[tri[0]*3], &verts[tri[1]*3], &verts[tri[2]*3], norm); // Check if the face is walkable. if (norm[1] > walkableThr) - areas[i] = RC_WALKABLE_AREA; + areas[i] = areaType; } } -- cgit v1.2.3