navcat docs
    Preparing search index...
    • Attempts to optimize the path if the specified point is visible from the current position.

      Inaccurate locomotion or dynamic obstacle avoidance can force the agent 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 the target.

      The corridor will change only if the target 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 of the agent.

      This function is not suitable for long distance searches.

      Parameters

      • corridor: PathCorridor

        the path corridor

      • next: Vec3

        the point to search toward

      • pathOptimizationRange: number

        the maximum range to search

      • navMesh: NavMesh

        the navigation mesh

      • filter: QueryFilter

        the query filter

      Returns void