2020-01-20 23:06:47 +01:00
|
|
|
#include "navigator.hpp"
|
2021-11-06 00:14:41 +01:00
|
|
|
#include "navigatorimpl.hpp"
|
|
|
|
#include "navigatorstub.hpp"
|
|
|
|
#include "recastglobalallocator.hpp"
|
2020-01-20 23:06:47 +01:00
|
|
|
|
|
|
|
namespace DetourNavigator
|
|
|
|
{
|
2021-07-09 22:51:42 +02:00
|
|
|
std::unique_ptr<Navigator> makeNavigator(const Settings& settings, const std::string& userDataPath)
|
2021-11-06 00:14:41 +01:00
|
|
|
{
|
|
|
|
DetourNavigator::RecastGlobalAllocator::init();
|
2021-07-09 22:51:42 +02: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-06 00:14:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
std::unique_ptr<Navigator> makeNavigatorStub()
|
|
|
|
{
|
|
|
|
return std::make_unique<NavigatorStub>();
|
|
|
|
}
|
2020-01-20 23:06:47 +01:00
|
|
|
}
|