Package dev.kitteh.factions.util
Class Morton
java.lang.Object
dev.kitteh.factions.util.Morton
Simple two-ints-in-a-long Morton code.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Morton
public Morton()
-
-
Method Details
-
of
-
of
public static long of(int x, int z) Gets a Morton code for the given coordinates.- Parameters:
x- x coordinatez- z coordinate- Returns:
- Morton code for the coordinates
-
getX
public static int getX(long mortonCode) Gets the X value from a given Morton code.- Parameters:
mortonCode- Morton code- Returns:
- x coordinate
-
getZ
public static int getZ(long mortonCode) Gets the Z value from a given Morton code.- Parameters:
mortonCode- Morton code- Returns:
- z coordinate
-