diff --git a/src/main/java/ru/bclib/sdf/operator/SDFCoordModify.java b/src/main/java/ru/bclib/sdf/operator/SDFCoordModify.java index 42f56f87..e742060a 100644 --- a/src/main/java/ru/bclib/sdf/operator/SDFCoordModify.java +++ b/src/main/java/ru/bclib/sdf/operator/SDFCoordModify.java @@ -5,7 +5,7 @@ import java.util.function.Consumer; public class SDFCoordModify extends SDFUnary { - private static Vector3f pos = new Vector3f(); + private final Vector3f pos = new Vector3f(); private Consumer function; public SDFCoordModify setFunction(Consumer function) { diff --git a/src/main/java/ru/bclib/sdf/operator/SDFRotation.java b/src/main/java/ru/bclib/sdf/operator/SDFRotation.java index 67e65ebf..a4474993 100644 --- a/src/main/java/ru/bclib/sdf/operator/SDFRotation.java +++ b/src/main/java/ru/bclib/sdf/operator/SDFRotation.java @@ -4,7 +4,7 @@ import com.mojang.math.Vector3f; public class SDFRotation extends SDFUnary { - private static final Vector3f POS = new Vector3f(); + private final Vector3f pos = new Vector3f(); private Quaternion rotation; public SDFRotation setRotation(Vector3f axis, float rotationAngle) { @@ -14,8 +14,8 @@ public SDFRotation setRotation(Vector3f axis, float rotationAngle) { @Override public float getDistance(float x, float y, float z) { - POS.set(x, y, z); - POS.transform(rotation); - return source.getDistance(POS.x(), POS.y(), POS.z()); + pos.set(x, y, z); + pos.transform(rotation); + return source.getDistance(pos.x(), pos.y(), pos.z()); } }