Class AffineTransformation

java.lang.Object
net.minecraft.util.math.AffineTransformation

public final class AffineTransformation extends Object
An affine transformation is a decomposition of a 4×4 real matrix into a rotation quaternion, a scale 3-vector, a second rotation quaternion, and a translation 3-vector. It is also known as "TRSR" transformation, meaning "translation rotation scale rotation".

This class is immutable; its matrix is lazily decomposed upon demand.

Mappings:
Namespace Name
official i
intermediary net/minecraft/class_4590
named net/minecraft/util/math/AffineTransformation
  • Field Details

    • IDENTITY

      private static final AffineTransformation IDENTITY
      Mappings:
      Namespace Name Mixin selector
      official g Li;g:Li;
      intermediary field_20906 Lnet/minecraft/class_4590;field_20906:Lnet/minecraft/class_4590;
      named IDENTITY Lnet/minecraft/util/math/AffineTransformation;IDENTITY:Lnet/minecraft/util/math/AffineTransformation;
    • matrix

      private final Matrix4f matrix
      Mappings:
      Namespace Name Mixin selector
      official a Li;a:Ld;
      intermediary field_20900 Lnet/minecraft/class_4590;field_20900:Lnet/minecraft/class_1159;
      named matrix Lnet/minecraft/util/math/AffineTransformation;matrix:Lnet/minecraft/util/math/Matrix4f;
    • initialized

      private boolean initialized
      Mappings:
      Namespace Name Mixin selector
      official b Li;b:Z
      intermediary field_20901 Lnet/minecraft/class_4590;field_20901:Z
      named initialized Lnet/minecraft/util/math/AffineTransformation;initialized:Z
    • translation

      @Nullable private @Nullable Vec3f translation
      Mappings:
      Namespace Name Mixin selector
      official c Li;c:Lk;
      intermediary field_20902 Lnet/minecraft/class_4590;field_20902:Lnet/minecraft/class_1160;
      named translation Lnet/minecraft/util/math/AffineTransformation;translation:Lnet/minecraft/util/math/Vec3f;
    • rotation2

      @Nullable private @Nullable Quaternion rotation2
      Mappings:
      Namespace Name Mixin selector
      official d Li;d:Lg;
      intermediary field_20903 Lnet/minecraft/class_4590;field_20903:Lnet/minecraft/class_1158;
      named rotation2 Lnet/minecraft/util/math/AffineTransformation;rotation2:Lnet/minecraft/util/math/Quaternion;
    • scale

      @Nullable private @Nullable Vec3f scale
      Mappings:
      Namespace Name Mixin selector
      official e Li;e:Lk;
      intermediary field_20904 Lnet/minecraft/class_4590;field_20904:Lnet/minecraft/class_1160;
      named scale Lnet/minecraft/util/math/AffineTransformation;scale:Lnet/minecraft/util/math/Vec3f;
    • rotation1

      @Nullable private @Nullable Quaternion rotation1
      Mappings:
      Namespace Name Mixin selector
      official f Li;f:Lg;
      intermediary field_20905 Lnet/minecraft/class_4590;field_20905:Lnet/minecraft/class_1158;
      named rotation1 Lnet/minecraft/util/math/AffineTransformation;rotation1:Lnet/minecraft/util/math/Quaternion;
  • Constructor Details

    • AffineTransformation

      public AffineTransformation(@Nullable @Nullable Matrix4f matrix)
      Mappings:
      Namespace Name Mixin selector
      official <init> Li;<init>(Ld;)V
      intermediary <init> Lnet/minecraft/class_4590;<init>(Lnet/minecraft/class_1159;)V
      named <init> Lnet/minecraft/util/math/AffineTransformation;<init>(Lnet/minecraft/util/math/Matrix4f;)V
    • AffineTransformation

      public AffineTransformation(@Nullable @Nullable Vec3f translation, @Nullable @Nullable Quaternion rotation2, @Nullable @Nullable Vec3f scale, @Nullable @Nullable Quaternion rotation1)
      Mappings:
      Namespace Name Mixin selector
      official <init> Li;<init>(Lk;Lg;Lk;Lg;)V
      intermediary <init> Lnet/minecraft/class_4590;<init>(Lnet/minecraft/class_1160;Lnet/minecraft/class_1158;Lnet/minecraft/class_1160;Lnet/minecraft/class_1158;)V
      named <init> Lnet/minecraft/util/math/AffineTransformation;<init>(Lnet/minecraft/util/math/Vec3f;Lnet/minecraft/util/math/Quaternion;Lnet/minecraft/util/math/Vec3f;Lnet/minecraft/util/math/Quaternion;)V
  • Method Details

    • identity

      public static AffineTransformation identity()
      Mappings:
      Namespace Name Mixin selector
      official a Li;a()Li;
      intermediary method_22931 Lnet/minecraft/class_4590;method_22931()Lnet/minecraft/class_4590;
      named identity Lnet/minecraft/util/math/AffineTransformation;identity()Lnet/minecraft/util/math/AffineTransformation;
    • multiply

      public AffineTransformation multiply(AffineTransformation other)
      Mappings:
      Namespace Name Mixin selector
      official a Li;a(Li;)Li;
      intermediary method_22933 Lnet/minecraft/class_4590;method_22933(Lnet/minecraft/class_4590;)Lnet/minecraft/class_4590;
      named multiply Lnet/minecraft/util/math/AffineTransformation;multiply(Lnet/minecraft/util/math/AffineTransformation;)Lnet/minecraft/util/math/AffineTransformation;
    • invert

      Mappings:
      Namespace Name Mixin selector
      official b Li;b()Li;
      intermediary method_22935 Lnet/minecraft/class_4590;method_22935()Lnet/minecraft/class_4590;
      named invert Lnet/minecraft/util/math/AffineTransformation;invert()Lnet/minecraft/util/math/AffineTransformation;
    • init

      private void init()
      Mappings:
      Namespace Name Mixin selector
      official h Li;h()V
      intermediary method_22938 Lnet/minecraft/class_4590;method_22938()V
      named init Lnet/minecraft/util/math/AffineTransformation;init()V
    • setup

      private static Matrix4f setup(@Nullable @Nullable Vec3f translation, @Nullable @Nullable Quaternion rotation2, @Nullable @Nullable Vec3f scale, @Nullable @Nullable Quaternion rotation1)
      Mappings:
      Namespace Name Mixin selector
      official a Li;a(Lk;Lg;Lk;Lg;)Ld;
      intermediary method_22934 Lnet/minecraft/class_4590;method_22934(Lnet/minecraft/class_1160;Lnet/minecraft/class_1158;Lnet/minecraft/class_1160;Lnet/minecraft/class_1158;)Lnet/minecraft/class_1159;
      named setup Lnet/minecraft/util/math/AffineTransformation;setup(Lnet/minecraft/util/math/Vec3f;Lnet/minecraft/util/math/Quaternion;Lnet/minecraft/util/math/Vec3f;Lnet/minecraft/util/math/Quaternion;)Lnet/minecraft/util/math/Matrix4f;
    • getLinearTransformationAndTranslationFromAffine

      public static com.mojang.datafixers.util.Pair<Matrix3f,​Vec3f> getLinearTransformationAndTranslationFromAffine(Matrix4f affineTransform)
      Mappings:
      Namespace Name Mixin selector
      official a Li;a(Ld;)Lcom/mojang/datafixers/util/Pair;
      intermediary method_22932 Lnet/minecraft/class_4590;method_22932(Lnet/minecraft/class_1159;)Lcom/mojang/datafixers/util/Pair;
      named getLinearTransformationAndTranslationFromAffine Lnet/minecraft/util/math/AffineTransformation;getLinearTransformationAndTranslationFromAffine(Lnet/minecraft/util/math/Matrix4f;)Lcom/mojang/datafixers/util/Pair;
    • getMatrix

      public Matrix4f getMatrix()
      Mappings:
      Namespace Name Mixin selector
      official c Li;c()Ld;
      intermediary method_22936 Lnet/minecraft/class_4590;method_22936()Lnet/minecraft/class_1159;
      named getMatrix Lnet/minecraft/util/math/AffineTransformation;getMatrix()Lnet/minecraft/util/math/Matrix4f;
    • getTranslation

      public Vec3f getTranslation()
      Mappings:
      Namespace Name Mixin selector
      official d Li;d()Lk;
      intermediary method_35865 Lnet/minecraft/class_4590;method_35865()Lnet/minecraft/class_1160;
      named getTranslation Lnet/minecraft/util/math/AffineTransformation;getTranslation()Lnet/minecraft/util/math/Vec3f;
    • getRotation2

      public Quaternion getRotation2()
      Mappings:
      Namespace Name Mixin selector
      official e Li;e()Lg;
      intermediary method_22937 Lnet/minecraft/class_4590;method_22937()Lnet/minecraft/class_1158;
      named getRotation2 Lnet/minecraft/util/math/AffineTransformation;getRotation2()Lnet/minecraft/util/math/Quaternion;
    • getScale

      public Vec3f getScale()
      Mappings:
      Namespace Name Mixin selector
      official f Li;f()Lk;
      intermediary method_35866 Lnet/minecraft/class_4590;method_35866()Lnet/minecraft/class_1160;
      named getScale Lnet/minecraft/util/math/AffineTransformation;getScale()Lnet/minecraft/util/math/Vec3f;
    • getRotation1

      public Quaternion getRotation1()
      Mappings:
      Namespace Name Mixin selector
      official g Li;g()Lg;
      intermediary method_35867 Lnet/minecraft/class_4590;method_35867()Lnet/minecraft/class_1158;
      named getRotation1 Lnet/minecraft/util/math/AffineTransformation;getRotation1()Lnet/minecraft/util/math/Quaternion;
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      Mappings:
      Namespace Name Mixin selector
      official equals Li;equals(Ljava/lang/Object;)Z
      intermediary equals Lnet/minecraft/class_4590;equals(Ljava/lang/Object;)Z
      named equals Lnet/minecraft/util/math/AffineTransformation;equals(Ljava/lang/Object;)Z
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • method_35864

      public AffineTransformation method_35864(AffineTransformation affineTransformation, float float2)
      Mappings:
      Namespace Name Mixin selector
      official a Li;a(Li;F)Li;
      intermediary method_35864 Lnet/minecraft/class_4590;method_35864(Lnet/minecraft/class_4590;F)Lnet/minecraft/class_4590;
      named method_35864 Lnet/minecraft/util/math/AffineTransformation;method_35864(Lnet/minecraft/util/math/AffineTransformation;F)Lnet/minecraft/util/math/AffineTransformation;