Skip to main content

VoxelChunk

class VoxelChunk

The Chunks for the Voxel system, a Chunk is a piece of a set of blocks that are rendered according to the distance from the player, thus avoiding fps drops.


public class VoxelChunk
extends Component

— Constructors (1) —

ConstructorDescription
VoxelChunk()Creates a new VoxelChunk.

— Methods (19) —

NameDescription
int getWidth()Returns the current width of the VoxelChunk.
void setWidth(int value)Sets the current width of the VoxelChunk.
int getHeight()Returns the current height of the VoxelChunk.
void setHeight(int value)Sets the current height of the VoxelChunk.
boolean isUsePositionAsCoordinatesOffset()Returns true if the position is being used as a coordinate offset, false if not.
void setUsePositionAsCoordinatesOffset(boolean value)Sets whether the position will be used as a coordinate offset or not.
Vector2 getOffset()Returns the current offset value of the VoxelChunk.
void setOffset(Vector2 value)Sets the current VoxelChunk offset value.
void apply()Applies the modifications to the VoxelChunk.
void invalidateBlocks()invalidates VoxelChunk blocks.
int getBlock(int worldX, int worldY, int worldZ)Returns the VoxelChunk block according to its position.
void setBlock(int worldX, int worldY, int worldZ, int blockType)Defines the VoxelChunk block according to its position.
int getBlockLocal(int localX, int localY, int localZ)Returns the block of the current VoxelChunk(local chunk) according to its position.
void setLocalBlock(int localX, int localY, int localZ, int blockType)Defines the block of the current VoxelChunk(local chunk) according to its position and block type.
boolean containsBlock(int worldX, int worldY, int worldZ)Returns true if the VoxelChunk contains a block at the defined positions, false if not.
boolean containsLocalBlock(int localX, int localY, int localZ)Returns true if the current VoxelChunk(local chunk) contains a block at the defined positions, false if not.
boolean isReady()Returns true if the VoxelChunk is generated, false if not.
[OH3LevelIntArray] getBlocksMatrixCritical()Returns the VoxelChunk's critical block array.
void setBlocksMatrix([OH3LevelIntArray] value)Sets the array of VoxelChunk blocks.