1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

Remove redundant getPolyHeight wrapper

This commit is contained in:
elsid 2021-06-30 20:04:16 +02:00
parent cc08a45c31
commit 7e1630a7ad
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

View File

@ -142,15 +142,6 @@ namespace DetourNavigator
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>
Status makeSmoothPath(const dtNavMesh& navMesh, const dtNavMeshQuery& navMeshQuery,
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.
iterPos = endPos;
const auto height = getPolyHeight(navMeshQuery, polygonPath.front(), iterPos);
if (!height)
if (dtStatusFailed(navMeshQuery.getPolyHeight(polygonPath.front(), endPos.ptr(), &iterPos.y())))
return Status::GetPolyHeightFailed;
iterPos.y() = *height;
iterPos.x() = endPos.x();
iterPos.z() = endPos.z();
}
}