From 6ea3fbc8aa180d8520e06fa4f6d333b05b9f3fe2 Mon Sep 17 00:00:00 2001 From: EmaMaker Date: Mon, 22 Aug 2022 16:32:20 +0200 Subject: [PATCH] world benchmark --- .../voxeltest/intervaltrees/world/WorldManager.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/emamaker/voxeltest/intervaltrees/world/WorldManager.java b/src/main/java/com/emamaker/voxeltest/intervaltrees/world/WorldManager.java index 3ddf6d8..562c576 100644 --- a/src/main/java/com/emamaker/voxeltest/intervaltrees/world/WorldManager.java +++ b/src/main/java/com/emamaker/voxeltest/intervaltrees/world/WorldManager.java @@ -124,4 +124,15 @@ public class WorldManager { return vx >= Math.min(0, chunkX - Config.RENDER_DISTANCE ) && vx < Math.min(0, chunkX + Config.RENDER_DISTANCE) && vy >= chunkY - Config.RENDER_DISTANCE && vy < Math.min(0, chunkY + Config.RENDER_DISTANCE) && vz >= chunkZ - Config.RENDER_DISTANCE && vz < Math.min(0, chunkZ + Config.RENDER_DISTANCE); } + public void benchmark(){ + for(int i = 0; i < Config.RENDER_DISTANCE*2; i++) + for(int j = 0; j < Config.RENDER_DISTANCE*2; j++) + for(int k = 0; k < Config.RENDER_DISTANCE*2; k++){ + Chunk c = new Chunk(new Vector3f(i,j,k)); + c.arrayGenerateCorner(); + chunkRenderer.greedyMeshing(this, c); + game.getRootNode().attachChild(c.chunkNode); + } + } + }