dtPathCorridor::optimizePathVisibility

Attempts to optimize the path if the specified point is visible from the current position.

Windows
MacOS
Linux

References

Module

Navmesh

Header

/Engine/Source/Runtime/Navmesh/Public/DetourCrowd/DetourPathCorridor.h

Include

#include "DetourCrowd/DetourPathCorridor.h"

Source

/Engine/Source/Runtime/Navmesh/Private/DetourCrowd/DetourPathCorridor.cpp

Syntax

bool optimizePathVisibility
(
    const float * next,
    const float pathOptimizationRange,
    dtNavMeshQuery * navquery,
    const dtQueryFilter * filter
)

Remarks

Attempts to optimize the path if the specified point is visible from the current position.

Inaccurate locomotion or dynamic obstacle avoidance can force the argent position significantly outside the original corridor. Over time this can result in the formation of a non-optimal corridor. Non-optimal paths can also form near the corners of tiles.

This function uses an efficient local visibility search to try to optimize the corridor between the current position and `next_.

The corridor will change only if `next_ is visible from the current position and moving directly toward the point is better than following the existing path.

The more inaccurate the agent movement, the more beneficial this function becomes. Simply adjust the frequency of the call to match the needs to the agent.

This function is not suitable for long distance searches.

Parameters

Parameter

Description

next

The point to search toward. [(x, y, z])

pathOptimizationRange

The maximum range to search. [Limit: > 0]

navquery

The query object used to build the corridor.

filter

The filter to apply to the operation.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss