Static fix
This commit is contained in:
parent
de7e7eb4ce
commit
39d5f58f0c
2 changed files with 5 additions and 5 deletions
|
@ -5,7 +5,7 @@ import com.mojang.math.Vector3f;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class SDFCoordModify extends SDFUnary {
|
public class SDFCoordModify extends SDFUnary {
|
||||||
private static Vector3f pos = new Vector3f();
|
private final Vector3f pos = new Vector3f();
|
||||||
private Consumer<Vector3f> function;
|
private Consumer<Vector3f> function;
|
||||||
|
|
||||||
public SDFCoordModify setFunction(Consumer<Vector3f> function) {
|
public SDFCoordModify setFunction(Consumer<Vector3f> function) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import com.mojang.math.Quaternion;
|
||||||
import com.mojang.math.Vector3f;
|
import com.mojang.math.Vector3f;
|
||||||
|
|
||||||
public class SDFRotation extends SDFUnary {
|
public class SDFRotation extends SDFUnary {
|
||||||
private static final Vector3f POS = new Vector3f();
|
private final Vector3f pos = new Vector3f();
|
||||||
private Quaternion rotation;
|
private Quaternion rotation;
|
||||||
|
|
||||||
public SDFRotation setRotation(Vector3f axis, float rotationAngle) {
|
public SDFRotation setRotation(Vector3f axis, float rotationAngle) {
|
||||||
|
@ -14,8 +14,8 @@ public class SDFRotation extends SDFUnary {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getDistance(float x, float y, float z) {
|
public float getDistance(float x, float y, float z) {
|
||||||
POS.set(x, y, z);
|
pos.set(x, y, z);
|
||||||
POS.transform(rotation);
|
pos.transform(rotation);
|
||||||
return source.getDistance(POS.x(), POS.y(), POS.z());
|
return source.getDistance(pos.x(), pos.y(), pos.z());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue