mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-29 05:17:58 +03:00
Remove redundant getPolyHeight wrapper
This commit is contained in:
parent
cc08a45c31
commit
7e1630a7ad
1 changed files with 3 additions and 13 deletions
|
@ -142,15 +142,6 @@ namespace DetourNavigator
|
||||||
return {std::move(result)};
|
return {std::move(result)};
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::optional<float> getPolyHeight(const dtNavMeshQuery& navMeshQuery, const dtPolyRef ref, const osg::Vec3f& pos)
|
|
||||||
{
|
|
||||||
float result = 0.0f;
|
|
||||||
const auto status = navMeshQuery.getPolyHeight(ref, pos.ptr(), &result);
|
|
||||||
if (!dtStatusSucceed(status))
|
|
||||||
return {};
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class OutputIterator>
|
template <class OutputIterator>
|
||||||
Status makeSmoothPath(const dtNavMesh& navMesh, const dtNavMeshQuery& navMeshQuery,
|
Status makeSmoothPath(const dtNavMesh& navMesh, const dtNavMeshQuery& navMeshQuery,
|
||||||
const dtQueryFilter& filter, const osg::Vec3f& start, const osg::Vec3f& end, const float stepSize,
|
const dtQueryFilter& filter, const osg::Vec3f& start, const osg::Vec3f& end, const float stepSize,
|
||||||
|
@ -243,11 +234,10 @@ namespace DetourNavigator
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move position at the other side of the off-mesh link.
|
// Move position at the other side of the off-mesh link.
|
||||||
iterPos = endPos;
|
if (dtStatusFailed(navMeshQuery.getPolyHeight(polygonPath.front(), endPos.ptr(), &iterPos.y())))
|
||||||
const auto height = getPolyHeight(navMeshQuery, polygonPath.front(), iterPos);
|
|
||||||
if (!height)
|
|
||||||
return Status::GetPolyHeightFailed;
|
return Status::GetPolyHeightFailed;
|
||||||
iterPos.y() = *height;
|
iterPos.x() = endPos.x();
|
||||||
|
iterPos.z() = endPos.z();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue