diff options
author | makamys <makamys@outlook.com> | 2022-08-14 07:52:53 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-08-14 07:56:15 +0200 |
commit | b79dcda1d2d7d268373bd5c298c17de3cddbab93 (patch) | |
tree | d5b59557ee96c1cd8e9194f89e2987daac6a682f /src/main/java/makamys/neodymium/renderer/QuadNormal.java | |
parent | aea8d637ea3e14255fdd011ef1ae38b4b7066b9e (diff) | |
download | Neodymium-b79dcda1d2d7d268373bd5c298c17de3cddbab93.tar.gz Neodymium-b79dcda1d2d7d268373bd5c298c17de3cddbab93.tar.bz2 Neodymium-b79dcda1d2d7d268373bd5c298c17de3cddbab93.zip |
Fix small quads (e.g. snow) having incorrect normals
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer/QuadNormal.java')
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/QuadNormal.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/QuadNormal.java b/src/main/java/makamys/neodymium/renderer/QuadNormal.java index 9ef32ac..99d1a45 100644 --- a/src/main/java/makamys/neodymium/renderer/QuadNormal.java +++ b/src/main/java/makamys/neodymium/renderer/QuadNormal.java @@ -8,23 +8,23 @@ public enum QuadNormal { public static QuadNormal fromVector(Vector3f normal) { if(normal.getX() == 0f) { if(normal.getY() == 0f) { - if(normal.getZ() == 1f) { + if(normal.getZ() > 0) { return POSITIVE_Z; - } else if(normal.getZ() == -1f) { + } else if(normal.getZ() < 0) { return NEGATIVE_Z; } } else if(normal.getZ() == 0f) { - if(normal.getY() == 1f) { + if(normal.getY() > 0) { return POSITIVE_Y; - } else if(normal.getY() == -1f) { + } else if(normal.getY() < 0) { return NEGATIVE_Y; } } } else if(normal.getY() == 0f) { if(normal.getZ() == 0f) { - if(normal.getX() == 1f) { + if(normal.getX() > 0) { return POSITIVE_X; - } else if(normal.getX() == -1f) { + } else if(normal.getX() < 0) { return NEGATIVE_X; } } |