Package net.runelite.api.coords
Class Angle
- java.lang.Object
-
- net.runelite.api.coords.Angle
-
public final class Angle extends Object
Represents an in-game orientation that uses fixed point arithmetic.Angles are represented as an int value ranging from 0-2047, where the following is true:
- 0 is true South
- 512 is true West
- 1024 is true North
- 1536 is true East
-
-
Constructor Summary
Constructors Constructor Description Angle(int angle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetAngle()The raw angle value.DirectiongetNearestDirection()Converts the angle value to the nearest cardinal direction.inthashCode()StringtoString()
-
-
-
Method Detail
-
getNearestDirection
public Direction getNearestDirection()
Converts the angle value to the nearest cardinal direction.Each cardinal direction contains 512 angles, ranging between -256 and +256 of it's true value. Negative values and values above 2047 are wrapped accordingly.
- Returns:
- Nearest cardinal direction to the angle
-
getAngle
public int getAngle()
The raw angle value.
-
-