22w43a
This commit is contained in:
1 parent
1c2b1dfa2a
commit
e0b6aae07b
9 files changed
+30
-30
No files matched your search
@@ -1,7 +1,7 @@
|
||||
package carpet.script.utils.shapes;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Vector3f;
|
||||
import com.mojang.math.Axis;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
@@ -34,11 +34,11 @@ public enum ShapeDirection {
|
||||
public static void rotatePoseStackByShapeDirection(PoseStack poseStack, ShapeDirection shapeDirection, Camera camera, Vec3 objectPos) {
|
||||
switch (shapeDirection) {
|
||||
case NORTH -> {}
|
||||
case SOUTH -> poseStack.mulPose(Vector3f.YP.rotationDegrees(180));
|
||||
case EAST -> poseStack.mulPose(Vector3f.YP.rotationDegrees(270));
|
||||
case WEST -> poseStack.mulPose(Vector3f.YP.rotationDegrees(90));
|
||||
case UP -> poseStack.mulPose(Vector3f.XP.rotationDegrees(90));
|
||||
case DOWN -> poseStack.mulPose(Vector3f.XP.rotationDegrees(-90));
|
||||
case SOUTH -> poseStack.mulPose(Axis.YP.rotationDegrees(180));
|
||||
case EAST -> poseStack.mulPose(Axis.YP.rotationDegrees(270));
|
||||
case WEST -> poseStack.mulPose(Axis.YP.rotationDegrees(90));
|
||||
case UP -> poseStack.mulPose(Axis.XP.rotationDegrees(90));
|
||||
case DOWN -> poseStack.mulPose(Axis.XP.rotationDegrees(-90));
|
||||
case CAMERA -> poseStack.mulPose(camera.rotation());
|
||||
case PLAYER -> {
|
||||
final Vec3 vector = objectPos.subtract(camera.getPosition());
|
||||
@@ -52,8 +52,8 @@ public enum ShapeDirection {
|
||||
// that should work somehow but it doesn't for some reason
|
||||
//matrices.mulPose(new Quaternion( -rotY, rotX, 0, false));
|
||||
|
||||
poseStack.mulPose(Vector3f.YP.rotation(rotX));
|
||||
poseStack.mulPose(Vector3f.XP.rotation(-rotY));
|
||||
poseStack.mulPose(Axis.YP.rotation(rotX));
|
||||
poseStack.mulPose(Axis.XP.rotation(-rotY));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user