public abstract static class Utils.ChunkUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CHUNK_SIZE_X
Horizontal (x) size of a chunk (amount of blocks)
|
static int |
CHUNK_SIZE_Y
Vertical (y) size of a chunk (amount of blocks)
|
static int |
CHUNK_SIZE_Z
Horizontal (z) size of a chunk (amount of blocks)
|
| Constructor and Description |
|---|
ChunkUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getBlockPositionX(float x,
int chunkPositionX)
Calculates the x block position within a given chunk position.
|
static int |
getBlockPositionY(float y,
int chunkPositionY)
Calculates the y block position within a given chunk position.
|
static int |
getBlockPositionZ(float z,
int chunkPositionZ)
Calculates the z block position within a given chunk position.
|
static void |
getChunkAndBlockPosition(float x,
float y,
float z,
Vector3i chunkPositionStore,
Vector3i blockPositionStore)
Calculates a chunk offset and the according block position (within this
chunk) from a given global position and stores the results in the provided
Vector3i's. |
static void |
getChunkAndBlockPosition(Vector3f globalPosition,
Vector3i chunkPositionStore,
Vector3i blockPositionStore)
Calculates a chunk offset and the according block position (within this
chunk) from a given global position and stores the results in the provided
Vector3i's. |
static Vector3i |
getChunkPosition(float x,
float y,
float z)
Calculates a chunk offset from a given global position and stores the
result in a
Vector3i. |
static Vector3i |
getChunkPosition(float x,
float y,
float z,
Vector3i storeTo)
Calculates a chunk offset from a given global position and stores the
result in the provided
Vector3i. |
static Vector3i |
getChunkPosition(Vector3f globalPosition)
Calculates a chunk offset from a given global position and stores the
result in a
Vector3i. |
static Vector3i |
getChunkPosition(Vector3f globalPosition,
Vector3i storeTo)
Calculates a chunk offset from a given global position and stores the
result in the provided
Vector3i. |
static int |
getChunkPositionX(float x)
Calculates the x chunk offset from a given global position (x).
|
static int |
getChunkPositionY(float y)
Calculates the y chunk offset from a given global position (y).
|
static int |
getChunkPositionZ(float z)
Calculates the z chunk offset from a given global position (z).
|
static Vector3f |
getGlobalPosition(Vector3i chunkPosition,
Vector3i blockPosition) |
static Vector3f |
getGlobalPosition(Vector3i chunkPosition,
Vector3i blockPosition,
Vector3f storeTo) |
public static final int CHUNK_SIZE_X
public static final int CHUNK_SIZE_Y
public static final int CHUNK_SIZE_Z
public static Vector3i getChunkPosition(Vector3f globalPosition)
Vector3i.globalPosition - the global position.Vector3i containing the chunk offset.public static Vector3i getChunkPosition(Vector3f globalPosition, Vector3i storeTo)
Vector3i.globalPosition - the global position.storeTo - the Vector3i you want to store the result in.Vector3i containing the chunk offset.public static Vector3i getChunkPosition(float x, float y, float z)
Vector3i.x - the global x position.y - the global y position.z - the global z position.Vector3i containing the chunk offset.public static Vector3i getChunkPosition(float x, float y, float z, Vector3i storeTo)
Vector3i.x - the global x position.y - the global y position.z - the global z position.storeTo - the Vector3i you want to store the result in.Vector3i containing the chunk offset.public static int getChunkPositionX(float x)
x - the global x position.public static int getChunkPositionY(float y)
y - the global y position.public static int getChunkPositionZ(float z)
z - the global z position.public static void getChunkAndBlockPosition(Vector3f globalPosition, Vector3i chunkPositionStore, Vector3i blockPositionStore)
Vector3i's.globalPosition - the global position.chunkPositionStore - Vector3i you want to store the
chunk offset in.blockPositionStore - Vector3i you want to store the
block position in.public static void getChunkAndBlockPosition(float x,
float y,
float z,
Vector3i chunkPositionStore,
Vector3i blockPositionStore)
Vector3i's.x - the global x position.y - the global y position.z - the global z position.chunkPositionStore - Vector3i you want to store the
chunk offset in.blockPositionStore - Vector3i you want to store the
block position in.public static int getBlockPositionX(float x,
int chunkPositionX)
x - the global x position.chunkPositionX - the x chunk position, see getChunkPositionX(float)public static int getBlockPositionY(float y,
int chunkPositionY)
y - the global y position.chunkPositionY - the y chunk position, see getChunkPositionY(float)public static int getBlockPositionZ(float z,
int chunkPositionZ)
z - the global y position.chunkPositionZ - the z chunk position, see getChunkPositionZ(float)public static Vector3f getGlobalPosition(Vector3i chunkPosition, Vector3i blockPosition)