recast-navigation-js
    Preparing search index...

    Variable floodFillPruneNavMeshConst

    floodFillPruneNavMesh: (navMesh: NavMesh, startPolyRefs: number[]) => void

    Disables all polys not connected to provided start poly refs.

    Type Declaration

      • (navMesh: NavMesh, startPolyRefs: number[]): void
      • Parameters

        • navMesh: NavMesh

          the nav mesh to prune

        • startPolyRefs: number[]

          poly refs to start the flood fill from, can be retrieved with navMeshQuery.findNearestPoly

        Returns void

    const navMeshQuery = new NavMeshQuery(navMesh);

    const nearestPolyResult = navMeshQuery.findNearestPoly(point, {
    halfExtents: { x: 2, y: 2, z: 2 },
    });

    if (!nearestPolyResult.success) return;

    floodFillPruneNavMesh(navMesh, [nearestPolyResult.nearestRef]);