navcat docs
    Preparing search index...

    Function findRandomPointAroundCircle

    • Finds a random point within a circle around a center position on the navigation mesh.

      Uses Dijkstra-like search to explore reachable polygons within the circle, then selects a random polygon weighted by area, and finally generates a random point within that polygon.

      Parameters

      • navMesh: NavMesh

        The navigation mesh

      • startNodeRef: number

        Reference to the polygon to start the search from

      • position: Vec3

        Center position of the search circle

      • maxRadius: number

        Maximum radius of the search circle

      • filter: QueryFilter

        Query filter to apply to polygons

      • rand: () => number

        Function that returns random values [0,1]

      Returns FindRandomPointAroundCircleResult

      The result object with success flag, random point, and polygon reference