diff --git a/components/detournavigator/navigator.cpp b/components/detournavigator/navigator.cpp index 73537ff6f..ddd985021 100644 --- a/components/detournavigator/navigator.cpp +++ b/components/detournavigator/navigator.cpp @@ -122,12 +122,17 @@ namespace DetourNavigator mNavMeshManager.wait(); } + SharedNavMeshCacheItem Navigator::getNavMesh(const osg::Vec3f& agentHalfExtents) const + { + return mNavMeshManager.getNavMesh(agentHalfExtents); + } + std::map Navigator::getNavMeshes() const { return mNavMeshManager.getNavMeshes(); } - const Settings& Navigator::getSettings() const + Settings Navigator::getSettings() const { return mSettings; } diff --git a/components/detournavigator/navigator.hpp b/components/detournavigator/navigator.hpp index 351e0f9f8..0bdc79e8a 100644 --- a/components/detournavigator/navigator.hpp +++ b/components/detournavigator/navigator.hpp @@ -175,19 +175,26 @@ namespace DetourNavigator >::value, "out is not an OutputIterator" ); - const auto navMesh = mNavMeshManager.getNavMesh(agentHalfExtents); - return findSmoothPath(navMesh.lock()->getValue(), toNavMeshCoordinates(mSettings, agentHalfExtents), - toNavMeshCoordinates(mSettings, start), toNavMeshCoordinates(mSettings, end), includeFlags, - mSettings, out); + const auto navMesh = getNavMesh(agentHalfExtents); + const auto settings = getSettings(); + return findSmoothPath(navMesh.lock()->getValue(), toNavMeshCoordinates(settings, agentHalfExtents), + toNavMeshCoordinates(settings, start), toNavMeshCoordinates(settings, end), includeFlags, + settings, out); } + /** + * @brief getNavMesh returns navmesh for specific agent half extents + * @return navmesh + */ + SharedNavMeshCacheItem getNavMesh(const osg::Vec3f& agentHalfExtents) const; + /** * @brief getNavMeshes returns all current navmeshes * @return map of agent half extents to navmesh */ std::map getNavMeshes() const; - const Settings& getSettings() const; + Settings getSettings() const; private: Settings mSettings;