use of org.asassecreations.voxelgame.world.chunk.Chunk in project Voxel_Game by ASasseCreations.
the class ChunkGeneratorQueue method queue.
private static final void queue() {
for (int i = 0; i < LIST.size(); i++) {
final ChunkGeneratorQueue queue = LIST.get(i);
if (queue == null)
continue;
if (!Chunk.CHUNKS.contains(queue.chunk)) {
LIST.remove(queue);
continue;
}
final Chunk chunk = queue.chunk;
if (chunk == null)
continue;
if (chunk.operation == null)
chunk.operation = ChunkOperation.GENERATING;
if (chunk.generate())
LIST.remove(queue);
}
}
use of org.asassecreations.voxelgame.world.chunk.Chunk in project Voxel_Game by ASasseCreations.
the class ChunkGeneratorQueue method contains.
private static final boolean contains(final Chunk chunk) {
if (chunk == null)
return false;
for (int i = 0; i < LIST.size(); i++) {
final ChunkGeneratorQueue queue = LIST.get(i);
if (queue == null)
continue;
final Chunk temp = queue.chunk;
if (temp == null)
continue;
if (temp.x == chunk.x && temp.z == chunk.z)
return true;
}
return false;
}
use of org.asassecreations.voxelgame.world.chunk.Chunk in project Voxel_Game by ASasseCreations.
the class ChunkModelQueue method contains.
private static final boolean contains(final Chunk chunk) {
if (chunk == null)
return false;
for (int i = 0; i < LIST.size(); i++) {
final ChunkModelQueue queue = LIST.get(i);
if (queue == null)
continue;
final Chunk temp = queue.chunk;
if (temp == null)
continue;
if (temp.x == chunk.x && temp.z == chunk.z)
return true;
}
return false;
}
use of org.asassecreations.voxelgame.world.chunk.Chunk in project Voxel_Game by ASasseCreations.
the class ChunkOccludeQueue method queue.
private static final void queue() {
for (int i = 0; i < LIST.size(); i++) {
final ChunkOccludeQueue queue = LIST.get(i);
if (queue == null)
continue;
if (!Chunk.CHUNKS.contains(queue.chunk)) {
LIST.remove(queue);
continue;
}
final Chunk chunk = queue.chunk;
if (chunk == null)
continue;
if (chunk.operation == null)
chunk.operation = ChunkOperation.OCCLUDING;
if (chunk.occlude())
LIST.remove(queue);
}
}
use of org.asassecreations.voxelgame.world.chunk.Chunk in project Voxel_Game by ASasseCreations.
the class ChunkMinimapRenderer method render.
public static final void render() {
shader.start();
Renderer.blendFunction(BlendFunction.NONE);
for (final Chunk chunk : Chunk.CHUNKS) {
if (chunk.model == null || !chunk.render)
continue;
GL30.glBindVertexArray(chunk.model.id);
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
shader.loadTransformationMatrix(MatrixCreation.createTransformationMatrix(new Vec3(chunk.x * Chunk.H_SIZE, 0, chunk.z * Chunk.H_SIZE), new Vec3(), new Vec3(1, 1, 1)));
GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, chunk.model.vertexCount);
GL20.glDisableVertexAttribArray(0);
GL20.glDisableVertexAttribArray(1);
GL20.glDisableVertexAttribArray(2);
GL30.glBindVertexArray(0);
}
shader.stop();
}
Aggregations