navcat docs
    Preparing search index...

    Type Alias QueryFilter

    A query filter used in navigation queries.

    This allows for customization of what nodes are considered traversable, and the cost of traversing between nodes.

    If you are getting started, you can use the built-in

    • DEFAULT_QUERY_FILTER or
    • ANY_QUERY_FILTER
    type QueryFilter = {
        getCost(
            pa: Vec3,
            pb: Vec3,
            navMesh: NavMesh,
            prevRef: number | undefined,
            curRef: number,
            nextRef: number | undefined,
        ): number;
        passFilter(nodeRef: number, navMesh: NavMesh): boolean;
    }
    Index

    Methods

    • Calculates the cost of moving from one point to another.

      Parameters

      • pa: Vec3

        The start position on the edge of the previous and current node. [(x, y, z)]

      • pb: Vec3

        The end position on the edge of the current and next node. [(x, y, z)]

      • navMesh: NavMesh

        The navigation mesh

      • prevRef: number | undefined

        The reference id of the previous node. [opt]

      • curRef: number

        The reference id of the current node.

      • nextRef: number | undefined

        The reference id of the next node. [opt]

      Returns number

      The cost of moving from the start to the end position.

    • Checks if a NavMesh node passes the filter.

      Parameters

      • nodeRef: number

        The node reference.

      • navMesh: NavMesh

        The navmesh

      Returns boolean

      Whether the node reference passes the filter.