2020-01-20 22:06:47 +00:00
|
|
|
#include "navigator.hpp"
|
2021-11-05 23:14:41 +00:00
|
|
|
#include "navigatorimpl.hpp"
|
|
|
|
#include "navigatorstub.hpp"
|
|
|
|
#include "recastglobalallocator.hpp"
|
2020-01-20 22:06:47 +00:00
|
|
|
|
|
|
|
namespace DetourNavigator
|
|
|
|
{
|
2021-07-09 20:51:42 +00:00
|
|
|
std::unique_ptr<Navigator> makeNavigator(const Settings& settings, const std::string& userDataPath)
|
2021-11-05 23:14:41 +00:00
|
|
|
{
|
|
|
|
DetourNavigator::RecastGlobalAllocator::init();
|
2021-07-09 20:51:42 +00:00
|
|
|
|
|
|
|
std::unique_ptr<NavMeshDb> db;
|
|
|
|
if (settings.mEnableNavMeshDiskCache)
|
|
|
|
db = std::make_unique<NavMeshDb>(userDataPath + "/navmesh.db");
|
|
|
|
|
|
|
|
return std::make_unique<NavigatorImpl>(settings, std::move(db));
|
2021-11-05 23:14:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
std::unique_ptr<Navigator> makeNavigatorStub()
|
|
|
|
{
|
|
|
|
return std::make_unique<NavigatorStub>();
|
|
|
|
}
|
2020-01-20 22:06:47 +00:00
|
|
|
}
|