navcat docs
    Preparing search index...

    Function findStraightPath

    • This method peforms what is often called 'string pulling'.

      The start position is clamped to the first polygon node in the path, and the end position is clamped to the last. So the start and end positions should normally be within or very near the first and last polygons respectively.

      Parameters

      • navMesh: NavMesh

        The navigation mesh to use for the search.

      • start: Vec3

        The start position in world space.

      • end: Vec3

        The end position in world space.

      • pathNodeRefs: number[]

        The list of polygon node references that form the path, generally obtained from findNodePath

      • maxPoints: number | null = null

        The maximum number of points to return in the straight path. If null, no limit is applied.

      • straightPathOptions: number = 0

      Returns FindStraightPathResult

      The straight path

      FindStraightPathOptions