Add NavMeshPathFlags to navmesh for partial paths info
This commit is contained in:
@@ -78,9 +78,10 @@ bool NavMeshRuntime::FindDistanceToWall(const Vector3& startPosition, NavMeshHit
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NavMeshRuntime::FindPath(const Vector3& startPosition, const Vector3& endPosition, Array<Vector3, HeapAllocation>& resultPath) const
|
||||
bool NavMeshRuntime::FindPath(const Vector3& startPosition, const Vector3& endPosition, Array<Vector3, HeapAllocation>& resultPath, NavMeshPathFlags& resultFlags) const
|
||||
{
|
||||
resultPath.Clear();
|
||||
resultFlags = NavMeshPathFlags::None;
|
||||
ScopeLock lock(Locker);
|
||||
const auto query = GetNavMeshQuery();
|
||||
if (!query || !_navMesh)
|
||||
@@ -120,6 +121,7 @@ bool NavMeshRuntime::FindPath(const Vector3& startPosition, const Vector3& endPo
|
||||
|
||||
if (pathSize == 1 && dtStatusDetail(findPathStatus, DT_PARTIAL_RESULT))
|
||||
{
|
||||
resultFlags |= NavMeshPathFlags::PartialPath;
|
||||
// TODO: skip adding 2nd end point if it's not reachable (use navmesh raycast check? or physics check? or local Z distance check?)
|
||||
resultPath.Resize(2);
|
||||
resultPath[0] = startPosition;
|
||||
|
||||
Reference in New Issue
Block a user