From da4ec31cd86b1765690ba0aa973fd52280a9b875 Mon Sep 17 00:00:00 2001 From: elsid Date: Wed, 14 Jul 2021 21:39:39 +0200 Subject: [PATCH] Remove redundant RecastMeshManager::Water --- components/detournavigator/cachedrecastmeshmanager.cpp | 2 +- components/detournavigator/cachedrecastmeshmanager.hpp | 2 +- components/detournavigator/recastmeshmanager.cpp | 2 +- components/detournavigator/recastmeshmanager.hpp | 7 +------ components/detournavigator/tilecachedrecastmeshmanager.cpp | 4 ++-- components/detournavigator/tilecachedrecastmeshmanager.hpp | 2 +- 6 files changed, 7 insertions(+), 12 deletions(-) diff --git a/components/detournavigator/cachedrecastmeshmanager.cpp b/components/detournavigator/cachedrecastmeshmanager.cpp index 4666b66a83..38bc954342 100644 --- a/components/detournavigator/cachedrecastmeshmanager.cpp +++ b/components/detournavigator/cachedrecastmeshmanager.cpp @@ -42,7 +42,7 @@ namespace DetourNavigator return true; } - std::optional CachedRecastMeshManager::removeWater(const osg::Vec2i& cellPosition) + std::optional CachedRecastMeshManager::removeWater(const osg::Vec2i& cellPosition) { const auto water = mImpl.removeWater(cellPosition); if (water) diff --git a/components/detournavigator/cachedrecastmeshmanager.hpp b/components/detournavigator/cachedrecastmeshmanager.hpp index 96604c3628..e4a262bc6a 100644 --- a/components/detournavigator/cachedrecastmeshmanager.hpp +++ b/components/detournavigator/cachedrecastmeshmanager.hpp @@ -18,7 +18,7 @@ namespace DetourNavigator bool addWater(const osg::Vec2i& cellPosition, const int cellSize, const btTransform& transform); - std::optional removeWater(const osg::Vec2i& cellPosition); + std::optional removeWater(const osg::Vec2i& cellPosition); std::optional removeObject(const ObjectId id); diff --git a/components/detournavigator/recastmeshmanager.cpp b/components/detournavigator/recastmeshmanager.cpp index 69f16df509..267c3ee9a3 100644 --- a/components/detournavigator/recastmeshmanager.cpp +++ b/components/detournavigator/recastmeshmanager.cpp @@ -56,7 +56,7 @@ namespace DetourNavigator return true; } - std::optional RecastMeshManager::removeWater(const osg::Vec2i& cellPosition) + std::optional RecastMeshManager::removeWater(const osg::Vec2i& cellPosition) { const auto water = mWater.find(cellPosition); if (water == mWater.end()) diff --git a/components/detournavigator/recastmeshmanager.hpp b/components/detournavigator/recastmeshmanager.hpp index d67f287dfc..a1d6123062 100644 --- a/components/detournavigator/recastmeshmanager.hpp +++ b/components/detournavigator/recastmeshmanager.hpp @@ -4,6 +4,7 @@ #include "oscillatingrecastmeshobject.hpp" #include "objectid.hpp" #include "version.hpp" +#include "recastmesh.hpp" #include @@ -29,12 +30,6 @@ namespace DetourNavigator class RecastMeshManager { public: - struct Water - { - int mCellSize = 0; - btTransform mTransform; - }; - RecastMeshManager(const Settings& settings, const TileBounds& bounds, std::size_t generation); bool addObject(const ObjectId id, const btCollisionShape& shape, const btTransform& transform, diff --git a/components/detournavigator/tilecachedrecastmeshmanager.cpp b/components/detournavigator/tilecachedrecastmeshmanager.cpp index 42ae93e806..c19e43c498 100644 --- a/components/detournavigator/tilecachedrecastmeshmanager.cpp +++ b/components/detournavigator/tilecachedrecastmeshmanager.cpp @@ -102,12 +102,12 @@ namespace DetourNavigator return result; } - std::optional TileCachedRecastMeshManager::removeWater(const osg::Vec2i& cellPosition) + std::optional TileCachedRecastMeshManager::removeWater(const osg::Vec2i& cellPosition) { const auto object = mWaterTilesPositions.find(cellPosition); if (object == mWaterTilesPositions.end()) return std::nullopt; - std::optional result; + std::optional result; for (const auto& tilePosition : object->second) { const auto tiles = mTiles.lock(); diff --git a/components/detournavigator/tilecachedrecastmeshmanager.hpp b/components/detournavigator/tilecachedrecastmeshmanager.hpp index 23ecc77634..087e3e1f36 100644 --- a/components/detournavigator/tilecachedrecastmeshmanager.hpp +++ b/components/detournavigator/tilecachedrecastmeshmanager.hpp @@ -78,7 +78,7 @@ namespace DetourNavigator bool addWater(const osg::Vec2i& cellPosition, const int cellSize, const btTransform& transform); - std::optional removeWater(const osg::Vec2i& cellPosition); + std::optional removeWater(const osg::Vec2i& cellPosition); std::shared_ptr getMesh(const TilePosition& tilePosition);