mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Lots of rendering related changes, specifically for BackedQuad and IQuadTransformers. Removed our deprecated model generators, modders should have been using vanilla's for a while.
32 lines
1.1 KiB
Diff
32 lines
1.1 KiB
Diff
--- a/com/mojang/math/Transformation.java
|
|
+++ b/com/mojang/math/Transformation.java
|
|
@@ -16,7 +_,7 @@
|
|
import org.joml.Vector3fc;
|
|
import org.jspecify.annotations.Nullable;
|
|
|
|
-public final class Transformation {
|
|
+public final class Transformation implements net.minecraftforge.common.extensions.IForgeTransformation {
|
|
private final Matrix4fc matrix;
|
|
public static final Codec<Transformation> CODEC = RecordCodecBuilder.create(
|
|
p_269604_ -> p_269604_.group(
|
|
@@ -168,5 +_,19 @@
|
|
this.getScale().lerp(p_175938_.getScale(), p_175939_, new Vector3f()),
|
|
this.getRightRotation().slerp(p_175938_.getRightRotation(), p_175939_, new Quaternionf())
|
|
);
|
|
+ }
|
|
+
|
|
+ private Matrix3f normalTransform = null;
|
|
+ public Matrix3f getNormalMatrix() {
|
|
+ checkNormalTransform();
|
|
+ return normalTransform;
|
|
+ }
|
|
+
|
|
+ private void checkNormalTransform() {
|
|
+ if (normalTransform == null) {
|
|
+ normalTransform = new Matrix3f(matrix);
|
|
+ normalTransform.invert();
|
|
+ normalTransform.transpose();
|
|
+ }
|
|
}
|
|
}
|