Class ScenePoint

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

public class ScenePoint extends Object
Represents a point within the locally loaded scene.

The game loads a scene (typically 104x104 tiles) around the player. A ScenePoint specifies a location relative to the scene's origin (southwest corner), making it useful for operations that need local coordinates rather than absolute world coordinates.

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

Scene coordinates change as the player moves and the scene is reloaded, while representing the same world location.

See Also:
  • Constructor Details

    • ScenePoint

      public ScenePoint()
  • Method Details

    • fromRegion

      public static ScenePoint fromRegion(RegionPoint regionPoint)
      Creates a ScenePoint from region coordinates.

      Conversion path: Region -> World -> Scene

      Parameters:
      regionPoint - the region point to convert
      Returns:
      the equivalent ScenePoint, or null if not in the current scene
    • fromWorld

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

      Returns null if the world point is not within the currently loaded scene.

      Parameters:
      worldPoint - the world point to convert
      Returns:
      the equivalent ScenePoint, or null if not in the current scene
    • toWorld

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

      public RegionPoint toRegion()
      Converts this ScenePoint to region coordinates.

      Conversion path: Scene -> World -> Region

      Returns:
      the equivalent RegionPoint
    • distanceTo

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

      Returns Integer.MAX_VALUE if the points are on different planes.

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