diff options
author | makamys <makamys@outlook.com> | 2021-05-09 08:06:01 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2021-05-10 08:53:38 +0200 |
commit | a908bdd46decf73c44e17d93844a9bacdf219595 (patch) | |
tree | 02d2fda013480c7aa325082e05e1816b75ff5bcf /src/main/java/makamys/lodmod/renderer/Mesh.java | |
parent | ecec76b081029e706390b74f06198250da43905d (diff) | |
download | Neodymium-a908bdd46decf73c44e17d93844a9bacdf219595.tar.gz Neodymium-a908bdd46decf73c44e17d93844a9bacdf219595.tar.bz2 Neodymium-a908bdd46decf73c44e17d93844a9bacdf219595.zip |
Reduce RAM usage by storing invisible chunk meshes in NBT form
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer/Mesh.java')
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/Mesh.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/Mesh.java b/src/main/java/makamys/lodmod/renderer/Mesh.java index 7c7e6c2..3f8b0fe 100644 --- a/src/main/java/makamys/lodmod/renderer/Mesh.java +++ b/src/main/java/makamys/lodmod/renderer/Mesh.java @@ -19,8 +19,17 @@ public abstract class Mesh { int x, y, z; public abstract int getStride(); + public void onVisibilityChanged() {} public double distSq(double x2, double y2, double z2) { return Util.distSq(x, y, z, x2, y2, z2); } + + public int bufferSize() { + int bufferSize = quadCount * 6 * getStride(); + if(buffer != null) { + assert buffer.limit() == bufferSize; + } + return bufferSize; + } } |