Package net.storm.sdk.coords
Class ScenePoint
java.lang.Object
net.storm.sdk.coords.ScenePoint
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 coordinatesScenePoint- Coordinates relative to the loaded sceneRegionPoint- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdistanceTo(ScenePoint other) Calculates the distance to another ScenePoint.static ScenePointfromRegion(RegionPoint regionPoint) Creates a ScenePoint from region coordinates.static ScenePointfromWorld(net.runelite.api.coords.WorldPoint worldPoint) Creates a ScenePoint from world coordinates.toRegion()Converts this ScenePoint to region coordinates.net.runelite.api.coords.WorldPointtoWorld()Converts this ScenePoint to world coordinates.
-
Constructor Details
-
ScenePoint
public ScenePoint()
-
-
Method Details
-
fromRegion
Creates a ScenePoint from region coordinates.Conversion path: Region -> World -> Scene
- Parameters:
regionPoint- the region point to convert- Returns:
- the equivalent ScenePoint, or
nullif not in the current scene
-
fromWorld
Creates a ScenePoint from world coordinates.Returns
nullif the world point is not within the currently loaded scene.- Parameters:
worldPoint- the world point to convert- Returns:
- the equivalent ScenePoint, or
nullif not in the current scene
-
toWorld
public net.runelite.api.coords.WorldPoint toWorld()Converts this ScenePoint to world coordinates.- Returns:
- the equivalent WorldPoint
-
toRegion
Converts this ScenePoint to region coordinates.Conversion path: Scene -> World -> Region
- Returns:
- the equivalent RegionPoint
-
distanceTo
Calculates the distance to another ScenePoint.Returns
Integer.MAX_VALUEif the points are on different planes.- Parameters:
other- the other point to measure distance to- Returns:
- the Euclidean distance, or
Integer.MAX_VALUEif on different planes
-