mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-26 15:06:28 +01:00
Fix models being backwards
- Regression in ModelUtil#rotateToFace
This commit is contained in:
parent
d78f030264
commit
c3bc231d0a
3 changed files with 16 additions and 2 deletions
|
@ -99,7 +99,7 @@ public class ModelUtil {
|
|||
PoseStack stack = new PoseStack();
|
||||
TransformStack.cast(stack)
|
||||
.centre()
|
||||
.rotateToFace(facing)
|
||||
.rotateToFace(facing.getOpposite())
|
||||
.unCentre();
|
||||
return stack;
|
||||
};
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.jozufozu.flywheel.util.transform;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Matrix3f;
|
||||
import com.mojang.math.Matrix4f;
|
||||
import com.mojang.math.Quaternion;
|
||||
|
||||
public class MatrixTransformStack implements TransformStack {
|
||||
|
@ -64,4 +66,16 @@ public class MatrixTransformStack implements TransformStack {
|
|||
internal.popPose();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransformStack mulPose(Matrix4f pose) {
|
||||
internal.last().pose().multiply(pose);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransformStack mulNormal(Matrix3f normal) {
|
||||
internal.last().normal().mul(normal);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.jozufozu.flywheel.util.transform;
|
|||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
|
||||
public interface TransformStack extends Scale<TransformStack>, Translate<TransformStack>, Rotate<TransformStack>, TStack<TransformStack> {
|
||||
public interface TransformStack extends Transform<TransformStack>, TStack<TransformStack> {
|
||||
static TransformStack cast(PoseStack stack) {
|
||||
return (TransformStack) stack;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue