Package net.storm.sdk.coords
Class RegionPoint
java.lang.Object
net.storm.sdk.coords.RegionPoint
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 coordinatesScenePoint- Coordinates relative to the loaded sceneRegionPoint- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdistanceTo(RegionPoint other) Calculates the distance to another RegionPoint.static RegionPointfromScene(ScenePoint scenePoint) Creates a RegionPoint from scene coordinates.static RegionPointfromWorld(net.runelite.api.coords.WorldPoint worldPoint) Creates a RegionPoint from world coordinates.toScene()Converts this RegionPoint to scene coordinates.net.runelite.api.coords.WorldPointtoWorld()Converts this RegionPoint to world coordinates.
-
Constructor Details
-
RegionPoint
public RegionPoint()
-
-
Method Details
-
fromScene
Creates a RegionPoint from scene coordinates.Conversion path: Scene -> World -> Region
- Parameters:
scenePoint- the scene point to convert- Returns:
- the equivalent RegionPoint
-
fromWorld
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
Converts this RegionPoint to scene coordinates.Conversion path: Region -> World -> Scene
- Returns:
- the equivalent ScenePoint, or
nullif not in the current scene
-
distanceTo
Calculates the distance to another RegionPoint.Returns
Integer.MAX_VALUEif 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_VALUEif incompatible
-