NavigationServer2D

    A server interface for low-level 2D navigation access.

    NavigationServer2D.swift:38
    class NavigationServer2D

    NavigationServer2D is the server that handles navigation maps, regions and agents. It does not handle A* navigation from AStar2D or AStarGrid2D.

    Maps are divided into regions, which are composed of navigation polygons. Together, they define the traversable areas in the 2D world.

    For two regions to be connected to each other, they must share a similar edge. An edge is considered connected to another if both of its two vertices are at a distance less than edge_connection_margin to the respective other edge’s vertex.

    You may assign navigation layers to regions with regionSetNavigationLayers(region:navigationLayers:), which then can be checked upon when requesting a path with mapGetPath(map:origin:destination:optimize:navigationLayers:). This can be used to allow or deny certain areas for some objects.

    To use the collision avoidance system, you may use agents. You can set an agent’s target velocity, then the servers will emit a callback with a modified velocity.

    This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying.

    This object emits the following signals:

    Superclasses

    Citizens in SwiftGodot

    Conformances

    • protocol CustomStringConvertible

      A type with a customized textual representation.

    • protocol Equatable

      A type that can be compared for value equality.

    • protocol Hashable

      A type that can be hashed into a Hasher to produce an integer hash value.

    • protocol Identifiable<ID>

      A class of types whose instances hold the value of an entity with stable identity.

    • protocol VariantRepresentable

      Types that conform to VariantRepresentable can be stored directly in Variant with no conversion. These include all of the Variant types from Godot (for example GString, Rect, Plane), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.

    • protocol VariantStorable

      Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.

    Types

    Type members

    Instance members