mooball
    Preparing search index...

    Interface Query

    interface Query {
        getDiscAtMapCoord(roomState: RoomState, p: Point): Disc | null;
        getDiscIndexAtMapCoord(roomState: RoomState, p: Point): number;
        getGoalAtMapCoord(
            roomState: RoomState,
            p: Point,
            threshold: number,
        ): Goal | null;
        getGoalIndexAtMapCoord(
            roomState: RoomState,
            p: Point,
            threshold: number,
        ): number;
        getJointAtMapCoord(
            roomState: RoomState,
            p: Point,
            threshold: number,
        ): Joint | null;
        getJointIndexAtMapCoord(
            roomState: RoomState,
            p: Point,
            threshold: number,
        ): number;
        getPlaneAtMapCoord(
            roomState: RoomState,
            p: Point,
            threshold: number,
        ): Plane | null;
        getPlaneIndexAtMapCoord(
            roomState: RoomState,
            p: Point,
            threshold: number,
        ): number;
        getSegmentAtMapCoord(
            roomState: RoomState,
            p: Point,
            threshold: number,
        ): Segment | null;
        getSegmentIndexAtMapCoord(
            roomState: RoomState,
            p: Point,
            threshold: number,
        ): number;
        getSpawnPointIndexAtMapCoord(
            roomState: RoomState,
            p: Point,
            threshold: number,
        ): number;
        getVertexAtMapCoord(
            roomState: RoomState,
            p: Point,
            threshold: number,
        ): Vertex | null;
        getVertexIndexAtMapCoord(
            roomState: RoomState,
            p: Point,
            threshold: number,
        ): number;
    }
    Index

    Methods

    • Finds the first Disc that includes any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns Disc | null

      The found Disc, or undefined if it is not found.

    • Finds the index of the first Disc that includes any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns number

      Index of the found Disc, or -1 if it is not found.

    • Finds the first Goal that is near enough to any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.
      • threshold: number

        The maximum allowed distance to the point. The unit is not in pixels, but in Mooball's units. You can use transformPixelDistanceToMapDistance(distance) and transformMapDistanceToPixelDistance(distance) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns Goal | null

      The found Goal, or undefined if it is not found.

    • Finds the first Goal that is near enough to any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.
      • threshold: number

        The maximum allowed distance to the point. The unit is not in pixels, but in Mooball's units. You can use transformPixelDistanceToMapDistance(distance) and transformMapDistanceToPixelDistance(distance) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns number

      The found Goal, or undefined if it is not found.

    • Finds the first Joint that is near enough to any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.
      • threshold: number

        The maximum allowed distance to the point. The unit is not in pixels, but in Mooball's units. You can use transformPixelDistanceToMapDistance(distance) and transformMapDistanceToPixelDistance(distance) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns Joint | null

      The found Joint, or undefined if it is not found.

    • Finds the first Joint that is near enough to any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.
      • threshold: number

        The maximum allowed distance to the point. The unit is not in pixels, but in Mooball's units. You can use transformPixelDistanceToMapDistance(distance) and transformMapDistanceToPixelDistance(distance) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns number

      The found Joint, or undefined if it is not found.

    • Finds the first Plane that is near enough to any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.
      • threshold: number

        The maximum allowed distance to the point. The unit is not in pixels, but in Mooball's units. You can use transformPixelDistanceToMapDistance(distance) and transformMapDistanceToPixelDistance(distance) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns Plane | null

      The found Plane, or undefined if it is not found.

    • Finds the first Plane that is near enough to any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.
      • threshold: number

        The maximum allowed distance to the point. The unit is not in pixels, but in Mooball's units. You can use transformPixelDistanceToMapDistance(distance) and transformMapDistanceToPixelDistance(distance) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns number

      The found Plane, or undefined if it is not found.

    • Finds the first Segment that is near enough to any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.
      • threshold: number

        The maximum allowed distance to the point. The unit is not in pixels, but in Mooball's units. You can use transformPixelDistanceToMapDistance(distance) and transformMapDistanceToPixelDistance(distance) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns Segment | null

      The found Segment, or -1 if it is not found.

    • Finds the index of the first Segment that is near enough to any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.
      • threshold: number

        The maximum allowed distance to the point. The unit is not in pixels, but in Mooball's units. You can use transformPixelDistanceToMapDistance(distance) and transformMapDistanceToPixelDistance(distance) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns number

      Index of the found Segment, or -1 if it is not found.

    • Finds the first spawn point that is near enough to any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.
      • threshold: number

        The maximum allowed distance to the point. The unit is not in pixels, but in Mooball's units. You can use transformPixelDistanceToMapDistance(distance) and transformMapDistanceToPixelDistance(distance) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns number

      The found spawn point's index and team id, or [-1, -1] if it is not found.

    • Finds the first Vertex that is near enough to any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.
      • threshold: number

        The maximum allowed distance to the point. The unit is not in pixels, but in Mooball's units. You can use transformPixelDistanceToMapDistance(distance) and transformMapDistanceToPixelDistance(distance) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns Vertex | null

      The found Vertex, or undefined if it is not found.

    • Finds the index of the first Vertex that is near enough to any given point.

      Parameters

      • roomState: RoomState

        The state object to be queried. This object must come from inside a Room object. There are two ways of obtaining it:

        • Normal room state: room.state.
        • Extrapolated room state: room.stateExt.
      • p: Point

        The point's coordinates. This is an object that should have the following keys:

        • x: number: The x coordinate.
        • y: number: The y coordinate. The coordinates should be converted into Mooball's coordinate system before being used here. You can use transformPixelCoordToMapCoord(x, y) and transformMapCoordToPixelCoord(x, y) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.
      • threshold: number

        The maximum allowed distance to the point. The unit is not in pixels, but in Mooball's units. You can use transformPixelDistanceToMapDistance(distance) and transformMapDistanceToPixelDistance(distance) functions defined in both DefaultRenderer and SandboxRenderer for transformations between Mooball's and browser's coordinate systems.

      Returns number

      Index of the found Vertex, or -1 if it is not found.