mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 09:45:36 +00:00
Make Navigator::findPath independent from class fields
This commit is contained in:
parent
a0ed981a7c
commit
d63881e054
2 changed files with 18 additions and 6 deletions
|
@ -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…
Reference in a new issue