Documentation - v19.16.0-dev
    Preparing search index...

    A graph of nodes and edges describing the walkable paths of a scene, used to compute navigation routes between two points.

    Index

    Constructors

    • Creates an empty navigation graph.

      Parameters

      • id: string = ...

        Graph identifier, generated automatically when omitted.

      Returns NavigationGraph

    Properties

    edges: Map<string, NavigationEdge> = ...

    Edges indexed by their identifiers.

    id: string = ...

    Graph identifier, generated automatically when omitted.

    nodes: Map<string, NavigationNode> = ...

    Nodes indexed by their identifiers.

    formatVersion: 1

    Current JSON serialization format version.

    Methods

    • Adds an edge between two existing nodes.

      Parameters

      • fromNodeId: string

        Identifier of the edge's source node.

      • toNodeId: string

        Identifier of the edge's target node.

      • options: CreateNavigationEdgeOptions = {}

        Optional identifier and initial edge state.

      Returns NavigationEdge

      The created edge.

    • Creates an independent deep copy of this graph.

      Returns NavigationGraph

    • Deletes the connected component containing the supplied node or edge.

      Parameters

      • elementId: string

      Returns Set<string>

    • Deletes an edge and removes it from both endpoint nodes.

      Parameters

      • edgeId: string

      Returns NavigationEdge

    • Deletes a node and all of its incident edges.

      Parameters

      • nodeId: string

      Returns NavigationNode

    • Finds the edge connecting two nodes, regardless of its direction.

      Parameters

      • firstNodeId: string
      • secondNodeId: string

      Returns NavigationEdge | undefined

    • Returns every node in the connected component containing the supplied node or edge.

      Parameters

      • elementId: string

      Returns Set<string>

    • Combines nodes into the first node while preserving their external connections.

      Parameters

      • nodeIds: readonly string[]

        Identifiers of at least two nodes to merge.

      • positionMode: NavigationMergePosition

        How to choose the merged node position.

      Returns NavigationNode

      The surviving node.

    • Moves a node and records whether its new position is geometrically valid.

      Parameters

      • nodeId: string
      • position: Vector3
      • positionValid: boolean = true

      Returns void

    • Returns an edge or throws when its identifier is absent.

      Parameters

      • edgeId: string

      Returns NavigationEdge

    • Returns a node or throws when its identifier is absent.

      Parameters

      • nodeId: string

      Returns NavigationNode

    • Exchanges an edge's source and target nodes.

      Parameters

      • edgeId: string

      Returns void