[Changes] Some changes needed for BetterEnd

This commit is contained in:
Frank 2022-12-09 15:59:08 +01:00
parent a533d501cd
commit cd6587101c
4 changed files with 17 additions and 1 deletions

View file

@ -1,6 +1,8 @@
package org.betterx.bclib.sdf.operator;
import com.mojang.math.Axis;
import org.joml.Quaternionf;
import org.joml.Vector3f;
@ -8,6 +10,11 @@ public class SDFRotation extends SDFUnary {
private final Vector3f pos = new Vector3f();
private Quaternionf rotation;
public SDFRotation setRotation(Axis axis, float rotationAngle) {
rotation = axis.rotation(rotationAngle);
return this;
}
public SDFRotation setRotation(Vector3f axis, float rotationAngle) {
rotation = new Quaternionf().setAngleAxis(rotationAngle, axis.x, axis.y, axis.z);
return this;