Add FindRandomPoint and FindRandomPointAroundCircle to the navigation utilities

This commit is contained in:
Wojtek Figat
2021-03-01 14:32:35 +01:00
parent 31d1932d55
commit 99bc3289e8
4 changed files with 114 additions and 1 deletions

View File

@@ -315,6 +315,20 @@ bool Navigation::ProjectPoint(const Vector3& point, Vector3& result)
return NavMeshes.First()->ProjectPoint(point, result);
}
bool Navigation::FindRandomPoint(Vector3& result)
{
if (NavMeshes.IsEmpty())
return false;
return NavMeshes.First()->FindRandomPoint(result);
}
bool Navigation::FindRandomPointAroundCircle(const Vector3& center, float radius, Vector3& result)
{
if (NavMeshes.IsEmpty())
return false;
return NavMeshes.First()->FindRandomPointAroundCircle(center, radius, result);
}
bool Navigation::RayCast(const Vector3& startPosition, const Vector3& endPosition, NavMeshHit& hitInfo)
{
if (NavMeshes.IsEmpty())