Interface ICalculationsAPI


public interface ICalculationsAPI
  • Field Details

    • SINE

      static final int[] SINE
    • COSINE

      static final int[] COSINE
    • VIEW_RADIUS

      static final int VIEW_RADIUS
      See Also:
    • TILE_BITS

      static final int TILE_BITS
      See Also:
    • TILE_MASK

      static final int TILE_MASK
      See Also:
    • TILE_SIZE

      static final int TILE_SIZE
      See Also:
    • SCENE_SIZE

      static final int SCENE_SIZE
      See Also:
    • MINIMAP_DISTANCE

      static final int MINIMAP_DISTANCE
      The minimap culling radius in tiles. Derived from the game's internal distance check:
      square(distance / 32) < 6400
      Solving: sqrt(6400) * 32 = 2560 local units, 2560 / 128 = 20 tiles.
      See Also:
    • MAX_Z

      static final int MAX_Z
      The max allowed plane by the game
      See Also:
    • TILE_FLAG_BRIDGE

      static final int TILE_FLAG_BRIDGE
      See Also:
    • MAX_WALKABLE_DIST

      static final double MAX_WALKABLE_DIST
      See Also:
  • Method Details

    • isOnScreen

      boolean isOnScreen(Point point)
      Returns whether or not the given point is on screen (the entire width and height of the game client).
      Parameters:
      point - the point
      Returns:
      true if the point is on screen, otherwise false
    • isOnScreen

      boolean isOnScreen(int x, int y)
      Returns whether or not the given point is on screen (the entire width and height of the game client).
      Parameters:
      x - the x-coordinate
      y - the y-coordinate
      Returns:
      true if the point is on screen, otherwise false
    • isClickable

      boolean isClickable(int x, int y)
      Returns whether or not the given point is clickable on the viewport of the game (see IGameAPI.getViewportWidth() and IGameAPI.getViewportHeight()). Primarily used to check if objects are clickable and are not blocked by the UI (minimap and chat).
      Parameters:
      x - the x-coordinate
      y - the y-coordinate
      Returns:
      true if the point is clickable, otherwise false
    • isClickable

      boolean isClickable(Point point)
      Returns whether or not the given point is clickable on the viewport of the game (see IGameAPI.getViewportWidth() and IGameAPI.getViewportWidth()). Primarily used to check if objects are clickable and are not blocked by the UI (minimap and chat).
      Parameters:
      point - the point
      Returns:
      true if the point is clickable, otherwise false
    • isOnMap

      boolean isOnMap(Locatable locatable)
    • tileToScreen

      Point tileToScreen(Tile tile, int height)
    • tileToScreen

      Point tileToScreen(Tile tile, double dX, double dY, int height)
    • distanceTo

      double distanceTo(int x, int y)
      Gets the Euclidean distance between the local player and the given coordinates.
      Parameters:
      x - the x-coordinate
      y - the y-coordinate
      Returns:
      distance
    • distanceTo

      double distanceTo(int x, int y, int plane)
      Gets the Euclidean distance between the local player and the given coordinates.
      Parameters:
      x - the x-coordinate
      y - the y-coordinate
      plane - the plane
      Returns:
      distance
    • distanceTo

      double distanceTo(Locatable locatable)
      Gets the Euclidean distance between the local player and the given locatable.
      Parameters:
      locatable - the locatable
      Returns:
      distance
    • distanceBetween

      double distanceBetween(Locatable locatable1, Locatable locatable2)
      Gets the Euclidean distance between two locatables.
      Parameters:
      locatable1 - the first locatable
      locatable2 - the second locatable
      Returns:
      distance
    • distanceBetween

      double distanceBetween(Point point1, Point point2)
      Gets the Euclidean distance between two points.
      Parameters:
      point1 - the first point
      point2 - the second point
      Returns:
      distance
    • distanceBetween

      double distanceBetween(int x, int y, int x1, int y1)
      Gets the Euclidean distance between two points.
      Parameters:
      x - the x-coordinate of the first point
      y - the y-coordinate of the first point
      x1 - the x-coordinate of the second point
      y1 - the y-coordinate of the second point
      Returns:
      distance
    • tileDistanceTo

      int tileDistanceTo(Locatable locatable)
      Gets the Chebyshev distance (tile distance) between the local player and the given locatable.
      Parameters:
      locatable - the locatable
      Returns:
      tile distance
    • tileDistanceBetween

      int tileDistanceBetween(Locatable locatable1, Locatable locatable2)
      Gets the Chebyshev distance (tile distance) between the two locatables.
      Parameters:
      locatable1 - the first locatable
      locatable2 - the second locatable
      Returns:
      tile distance
    • tileDistanceBetween

      int tileDistanceBetween(int x, int y, int x1, int y1)
      Gets the Chebyshev distance (tile distance) between two points.
      Parameters:
      x - the x-coordinate of the first point
      y - the y-coordinate of the first point
      x1 - the x-coordinate of the second point
      y1 - the y-coordinate of the second point
      Returns:
      tile distance
    • worldToScreen

      Point worldToScreen(int x, int y, int plane, int zOffset)
    • worldToScreen

      Point worldToScreen(int x, int y, int z)
    • worldToMap

      Point worldToMap(double x, double y)
    • tileToMap

      Point tileToMap(Locatable locatable)
    • getTileHeight

      int getTileHeight(int x, int z, int plane)
    • getTileBits

      int getTileBits()
    • getTileMask

      int getTileMask()
    • getTileSize

      int getTileSize()
    • getSceneSize

      int getSceneSize()