Class RegionPoint

java.lang.Object
net.storm.sdk.coords.RegionPoint

public class RegionPoint extends Object
Represents a point within a static 64x64 game region.

The game world is divided into regions, each 64x64 tiles in size. A RegionPoint specifies a location relative to the origin of its containing region, along with the region ID and plane (height level).

This class provides conversion methods between different coordinate systems:

  • WorldPoint - Absolute world coordinates
  • ScenePoint - Coordinates relative to the loaded scene
  • RegionPoint - Coordinates relative to a region origin

Region coordinates are useful for locations that remain constant within a region, such as specific tiles in a dungeon or building.

See Also:
  • Constructor Details

    • RegionPoint

      public RegionPoint()
  • Method Details

    • fromScene

      public static RegionPoint fromScene(ScenePoint scenePoint)
      Creates a RegionPoint from scene coordinates.

      Conversion path: Scene -> World -> Region

      Parameters:
      scenePoint - the scene point to convert
      Returns:
      the equivalent RegionPoint
    • fromWorld

      public static RegionPoint fromWorld(net.runelite.api.coords.WorldPoint worldPoint)
      Creates a RegionPoint from world coordinates.

      Extracts the region-relative coordinates and region ID from the world point.

      Parameters:
      worldPoint - the world point to convert
      Returns:
      the equivalent RegionPoint
    • toWorld

      public net.runelite.api.coords.WorldPoint toWorld()
      Converts this RegionPoint to world coordinates.
      Returns:
      the equivalent WorldPoint
    • toScene

      public ScenePoint toScene()
      Converts this RegionPoint to scene coordinates.

      Conversion path: Region -> World -> Scene

      Returns:
      the equivalent ScenePoint, or null if not in the current scene
    • distanceTo

      public int distanceTo(RegionPoint other)
      Calculates the distance to another RegionPoint.

      Returns Integer.MAX_VALUE if the points are in different regions or on different planes.

      Parameters:
      other - the other point to measure distance to
      Returns:
      the Euclidean distance, or Integer.MAX_VALUE if incompatible