recast-navigation-js
    Preparing search index...

    Class NavMesh

    Index
    • Constructs a new NavMesh

      Returns NavMesh

    • Creates a wrapper around a raw NavMesh object

      Parameters

      Returns NavMesh

    • Adds a tile to the NavMesh.

      Parameters

      • navMeshData: UnsignedCharArray

        the nav mesh data

      • flags: number

        the flags to use when building the nav mesh

      • lastRef: number

      Returns { status: number; tileRef: number }

      the status of the operation and the reference of the added tile

    • Decodes a standard polygon reference.

      Parameters

      • polyRef: number

        The polygon reference to decode

      Returns NavMeshDecodePolyIdResult

      the decoded polygon reference

    • Destroys the NavMesh.

      Returns void

    • Derives a standard polygon reference.

      Parameters

      • salt: number

        The tile's salt value.

      • tileIndex: number

        The index of the tile. it in the C++ api.

      • tilePolygonIndex: number

        The index of the polygon within the tile. ip in the C++ api.

      Returns number

      the derived polygon reference

    • Returns the maximum number of tiles supported by the navigation mesh.

      Returns number

    • Gets the specified off-mesh connection.

      Parameters

      • ref: number

        The polygon reference of the off-mesh connection.

      Returns DetourOffMeshConnection

    • Gets the endpoints for an off-mesh connection, ordered by "direction of travel".

      Parameters

      • prevRef: number

        The reference of the polygon before the connection.

      • polyRef: number

        The reference of the off-mesh connection polygon.

      Returns {
          end: { x: number; y: number; z: number };
          start: { x: number; y: number; z: number };
          status: number;
          success: boolean;
      }

    • Gets the user defined area for the specified polygon.

      Parameters

      • ref: number

        The polygon reference.

      Returns { area: number; status: number }

    • Gets the user defined flags for the specified polygon.

      Parameters

      • ref: number

        The polygon reference.

      Returns { flags: number; status: number }

    • Gets the polygon reference for the tile's base polygon.

      Parameters

      Returns number

    • Gets the tile at the specified index.

      Parameters

      • i: number

        the tile index. [Limit: 0 >= index < #getMaxTiles()]

      Returns DetourMeshTile

    • Gets the tile and polygon for the specified polygon reference.

      Parameters

      • ref: number

        The reference for the a polygon.

      Returns { poly: DetourPoly; status: number; success: boolean; tile: DetourMeshTile }

    • Gets the tile and polygon for the specified polygon reference.

      Parameters

      • ref: number

        A known valid reference for a polygon.

      Returns { poly: DetourPoly; tile: DetourMeshTile }

    • Gets the tile at the specified grid location.

      Parameters

      • x: number

        The tile's x-location. (x, y, layer)

      • y: number

        The tile's y-location. (x, y, layer)

      • layer: number

        The tile's layer. (x, y, layer)

      Returns DetourMeshTile | null

      The tile, or null if the tile does not exist.

    • Gets the tile for the specified tile reference.

      Parameters

      • ref: number

        The tile reference of the tile to retrieve.

      Returns DetourMeshTile | null

      The tile for the specified reference, or null if the reference is invalid.

    • Gets the tile reference for the specified tile.

      Parameters

      Returns number

    • Gets the tile reference for the tile at specified grid location.

      Parameters

      • x: number

        The tile's x-location. (x, y, layer)

      • y: number

        The tile's y-location. (x, y, layer)

      • layer: number

        The tile's layer. (x, y, layer)

      Returns number

      The tile reference of the tile, or 0 if there is none.

    • Gets all tiles at the specified grid location. (All layers.)

      Parameters

      • x: number

        The tile's x-location. (x, y)

      • y: number

        The tile's y-location. (x, y)

      • maxTiles: number

        The maximum tiles the tiles parameter can hold.

      Returns NavMeshGetTilesAtResult

    • Gets the size of the buffer required by #storeTileState to store the specified tile's state.

      Parameters

      Returns number

      The size of the buffer required to store the state.

    • Initializes the NavMesh for use with a single tile.

      Parameters

      Returns boolean

      the status of the operation

    • Initializes the NavMesh for use with multiple tiles.

      Parameters

      Returns boolean

      the status of the operation

    • Checks the validity of a polygon reference.

      Parameters

      • ref: number

      Returns boolean

    • Removes a tile from the NavMesh

      Parameters

      • ref: number

        the tile ref

      Returns NavMeshRemoveTileResult

      the nav mesh data, so it can be added back later

    • Restores the state of the tile.

      Parameters

      • tile: DetourMeshTile

        The tile.

      • data: number[]

        The new state. (Obtained from

      • maxDataSize: number

        The size of the state within the data buffer.

      Returns number

      storeTileState)

    • Sets the user defined area for the specified polygon.

      Parameters

      • ref: number

        The polygon reference.

      • area: number

      Returns number

    • Sets the user defined flags for the specified polygon.

      Parameters

      • ref: number

        The polygon reference.

      • flags: number

        The new flags for the polygon.

      Returns number

    • Stores the non-structural state of the tile in the specified buffer. (Flags, area ids, etc.)

      Parameters

      • tile: DetourMeshTile

        The tile.

      • maxDataSize: number

        The size of the data buffer. [Limit: >= #getTileStateSize]

      Returns NavMeshStoreTileStateResult