Make Navigator::findPath independent from class fields

pull/541/head
elsid 6 years ago
parent a0ed981a7c
commit d63881e054
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -122,12 +122,17 @@ namespace DetourNavigator
mNavMeshManager.wait();
}
SharedNavMeshCacheItem Navigator::getNavMesh(const osg::Vec3f& agentHalfExtents) const
{
return mNavMeshManager.getNavMesh(agentHalfExtents);
}
std::map<osg::Vec3f, SharedNavMeshCacheItem> Navigator::getNavMeshes() const
{
return mNavMeshManager.getNavMeshes();
}
const Settings& Navigator::getSettings() const
Settings Navigator::getSettings() const
{
return mSettings;
}

@ -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<osg::Vec3f, SharedNavMeshCacheItem> getNavMeshes() const;
const Settings& getSettings() const;
Settings getSettings() const;
private:
Settings mSettings;

Loading…
Cancel
Save