#include "navigator.hpp" #include "navigatorimpl.hpp" #include "navigatorstub.hpp" #include "recastglobalallocator.hpp" #include #include namespace DetourNavigator { std::unique_ptr makeNavigator(const Settings& settings, const std::filesystem::path& userDataPath) { DetourNavigator::RecastGlobalAllocator::init(); std::unique_ptr db; if (settings.mEnableNavMeshDiskCache) { const std::string path = Files::pathToUnicodeString(userDataPath / "navmesh.db"); Log(Debug::Info) << "Using " << path << " to store navigation mesh cache"; try { db = std::make_unique(path, settings.mMaxDbFileSize); } catch (const std::exception& e) { Log(Debug::Error) << e.what() << ", navigation mesh disk cache will be disabled"; } } return std::make_unique(settings, std::move(db)); } std::unique_ptr makeNavigatorStub() { return std::make_unique(); } }