From 62a65df532639cfbc2dd03808a1ddd625c45cd0c Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:39:36 +0200 Subject: [PATCH] Recast: always show the actual mesh bounds When loading from .gset, the editor would clip anything outside the stored bounds, but we still need the outer bounds as otherwise editing the existing bounds would be a lot harder. --- src/naveditor/Editor_Common.cpp | 4 ++-- src/naveditor/main.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/naveditor/Editor_Common.cpp b/src/naveditor/Editor_Common.cpp index 3ca911e6..95efb68f 100644 --- a/src/naveditor/Editor_Common.cpp +++ b/src/naveditor/Editor_Common.cpp @@ -35,8 +35,8 @@ static void EditorCommon_DrawInputGeometry(duDebugDraw* const dd, const InputGeo static void EditorCommon_DrawBoundingBox(duDebugDraw* const dd, const InputGeom* const geom) { // Draw bounds - const float* const origBmin = geom->getOriginalNavMeshBoundsMin(); - const float* const origBmax = geom->getOriginalNavMeshBoundsMax(); + const float* const origBmin = geom->getMeshBoundsMin(); + const float* const origBmax = geom->getMeshBoundsMax(); duDebugDrawBoxWire(dd, origBmin[0], origBmin[1], origBmin[2], origBmax[0], origBmax[1], origBmax[2], duRGBA(255, 255, 255, 170), 1.0f, nullptr); const float* const navBmin = geom->getNavMeshBoundsMin(); diff --git a/src/naveditor/main.cpp b/src/naveditor/main.cpp index b6d20c19..5404e961 100644 --- a/src/naveditor/main.cpp +++ b/src/naveditor/main.cpp @@ -530,8 +530,8 @@ int not_main(int argc, char** argv) const float* bmax = 0; if (geom) { - bmin = geom->getNavMeshBoundsMin(); - bmax = geom->getNavMeshBoundsMax(); + bmin = geom->getOriginalNavMeshBoundsMin(); + bmax = geom->getOriginalNavMeshBoundsMax(); } if (!commandLine) { @@ -1068,8 +1068,8 @@ int not_main(int argc, char** argv) const float* bmax = 0; if (geom) { - bmin = geom->getNavMeshBoundsMin(); - bmax = geom->getNavMeshBoundsMax(); + bmin = geom->getMeshBoundsMin(); + bmax = geom->getMeshBoundsMax(); } // Reset camera and fog to match the mesh bounds. update_camera(bmin, bmax, cameraPos, cameraEulers, camr); @@ -1141,8 +1141,8 @@ int not_main(int argc, char** argv) const float* bmax = 0; if (geom) { - bmin = geom->getNavMeshBoundsMin(); - bmax = geom->getNavMeshBoundsMax(); + bmin = geom->getMeshBoundsMin(); + bmax = geom->getMeshBoundsMax(); } // Reset camera and fog to match the mesh bounds. update_camera(bmin, bmax, cameraPos, cameraEulers, camr);