aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-08-14 07:52:53 +0200
committermakamys <makamys@outlook.com>2022-08-14 07:56:15 +0200
commitb79dcda1d2d7d268373bd5c298c17de3cddbab93 (patch)
treed5b59557ee96c1cd8e9194f89e2987daac6a682f /src/main/java/makamys
parentaea8d637ea3e14255fdd011ef1ae38b4b7066b9e (diff)
downloadNeodymium-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')
-rw-r--r--src/main/java/makamys/neodymium/renderer/QuadNormal.java12
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;
}
}