diff options
author | makamys <makamys@outlook.com> | 2022-06-03 12:29:09 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-03 12:29:09 +0200 |
commit | d5b0ec39fda8bc53ecb44ff491eba6e0b096b296 (patch) | |
tree | b3f77eda80638e22b239f44e46793db247351174 /src/main/java/makamys/lodmod/renderer/MeshQuad.java | |
parent | 310007e1395cca1a0147c84fd7aa695592285be3 (diff) | |
download | Neodymium-d5b0ec39fda8bc53ecb44ff491eba6e0b096b296.tar.gz Neodymium-d5b0ec39fda8bc53ecb44ff491eba6e0b096b296.tar.bz2 Neodymium-d5b0ec39fda8bc53ecb44ff491eba6e0b096b296.zip |
Make it work with fast render
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer/MeshQuad.java')
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/MeshQuad.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/MeshQuad.java b/src/main/java/makamys/lodmod/renderer/MeshQuad.java index dfd5f0d..48f0a12 100644 --- a/src/main/java/makamys/lodmod/renderer/MeshQuad.java +++ b/src/main/java/makamys/lodmod/renderer/MeshQuad.java @@ -19,6 +19,7 @@ public class MeshQuad { public int[] xs = new int[4]; public int[] ys = new int[4]; public int[] zs = new int[4]; + public int baseX = -1, baseY, baseZ; public int minX = Integer.MAX_VALUE; public int minY = Integer.MAX_VALUE; public int minZ = Integer.MAX_VALUE; @@ -56,7 +57,7 @@ public class MeshQuad { } } - public MeshQuad(int[] rawBuffer, int offset, ChunkMesh.Flags flags) { + public MeshQuad(int[] rawBuffer, int offset, ChunkMesh.Flags flags, int offsetX, int offsetY, int offsetZ) { this.offset = offset; this.flags = flags; int i = offset; @@ -89,9 +90,9 @@ public class MeshQuad { } else { spriteName = sprite.getIconName(); for(int vertexI = 0; vertexI < 4; vertexI++) { - float x = Float.intBitsToFloat(rawBuffer[i + 0]); - float y = Float.intBitsToFloat(rawBuffer[i + 1]); - float z = Float.intBitsToFloat(rawBuffer[i + 2]); + float x = Float.intBitsToFloat(rawBuffer[i + 0]) - offsetX; + float y = Float.intBitsToFloat(rawBuffer[i + 1]) - offsetY; + float z = Float.intBitsToFloat(rawBuffer[i + 2]) - offsetZ; int simpleX = (int)(x * 16); //if(simpleX == 256) simpleX = 255; |