Package net.minecraft.client.util.math
Class MatrixStack
java.lang.Object
net.minecraft.client.util.math.MatrixStack
A stack of transformation matrices used to specify how 3D objects are
 translated, scaled or
 rotated in 3D space. Each entry consists of a
 position matrix and its
 corresponding normal matrix.
 
By putting matrices in a stack, a transformation can be expressed relative to another. You can push, transform, render and pop, which allows you to restore the original matrix after rendering.
An entry of identity matrix is pushed when a stack is created. This means that a stack is empty if and only if the stack contains exactly one entry.
- Mappings:
- Namespace - Name - official - eij- intermediary - net/minecraft/class_4587- named - net/minecraft/client/util/math/MatrixStack
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanisEmpty()Returns whether this stack contains exactly one entry.voidSets the top entry to be the identity matrix.voidmultiply(Quaternionf quaternion) Applies the rotation transformation to the top entry.voidmultiply(Quaternionf quaternion, float originX, float originY, float originZ) voidmultiplyPositionMatrix(Matrix4f matrix) Multiplies the top position matrix with the given matrix.peek()Returns the entry at the top of this stack.voidpop()Removes the entry at the top of this stack.voidpush()Pushes a copy of the top entry onto this stack.voidscale(float x, float y, float z) Applies the scale transformation to the top entry.voidtranslate(double x, double y, double z) Applies the translation transformation to the top entry.voidtranslate(float x, float y, float z) 
- 
Field Details- 
stack- Mappings:
- Namespace - Name - Mixin selector - official - a- Leij;a:Ljava/util/Deque;- intermediary - field_20898- Lnet/minecraft/class_4587;field_20898:Ljava/util/Deque;- named - stack- Lnet/minecraft/client/util/math/MatrixStack;stack:Ljava/util/Deque;
 
 
- 
- 
Constructor Details- 
MatrixStackpublic MatrixStack()
 
- 
- 
Method Details- 
translatepublic void translate(double x, double y, double z) Applies the translation transformation to the top entry.- Mappings:
- Namespace - Name - Mixin selector - official - a- Leij;a(DDD)V- intermediary - method_22904- Lnet/minecraft/class_4587;method_22904(DDD)V- named - translate- Lnet/minecraft/client/util/math/MatrixStack;translate(DDD)V
 
- 
translatepublic void translate(float x, float y, float z) - Mappings:
- Namespace - Name - Mixin selector - official - a- Leij;a(FFF)V- intermediary - method_46416- Lnet/minecraft/class_4587;method_46416(FFF)V- named - translate- Lnet/minecraft/client/util/math/MatrixStack;translate(FFF)V
 
- 
scalepublic void scale(float x, float y, float z) Applies the scale transformation to the top entry.- Implementation Note:
- This does not scale the normal matrix correctly when the scaling is uniform and the scaling factor is negative.
- Mappings:
- Namespace - Name - Mixin selector - official - b- Leij;b(FFF)V- intermediary - method_22905- Lnet/minecraft/class_4587;method_22905(FFF)V- named - scale- Lnet/minecraft/client/util/math/MatrixStack;scale(FFF)V
 
- 
multiplyApplies the rotation transformation to the top entry.- Mappings:
- Namespace - Name - Mixin selector - official - a- Leij;a(Lorg/joml/Quaternionf;)V- intermediary - method_22907- Lnet/minecraft/class_4587;method_22907(Lorg/joml/Quaternionf;)V- named - multiply- Lnet/minecraft/client/util/math/MatrixStack;multiply(Lorg/joml/Quaternionf;)V
 
- 
multiply- Mappings:
- Namespace - Name - Mixin selector - official - a- Leij;a(Lorg/joml/Quaternionf;FFF)V- intermediary - method_49278- Lnet/minecraft/class_4587;method_49278(Lorg/joml/Quaternionf;FFF)V- named - multiply- Lnet/minecraft/client/util/math/MatrixStack;multiply(Lorg/joml/Quaternionf;FFF)V
 
- 
pushpublic void push()Pushes a copy of the top entry onto this stack.- Mappings:
- Namespace - Name - Mixin selector - official - a- Leij;a()V- intermediary - method_22903- Lnet/minecraft/class_4587;method_22903()V- named - push- Lnet/minecraft/client/util/math/MatrixStack;push()V
 
- 
poppublic void pop()Removes the entry at the top of this stack.- Mappings:
- Namespace - Name - Mixin selector - official - b- Leij;b()V- intermediary - method_22909- Lnet/minecraft/class_4587;method_22909()V- named - pop- Lnet/minecraft/client/util/math/MatrixStack;pop()V
 
- 
peekReturns the entry at the top of this stack.- Returns:
- the entry at the top of this stack
- Mappings:
- Namespace - Name - Mixin selector - official - c- Leij;c()Leij$a;- intermediary - method_23760- Lnet/minecraft/class_4587;method_23760()Lnet/minecraft/class_4587$class_4665;- named - peek- Lnet/minecraft/client/util/math/MatrixStack;peek()Lnet/minecraft/client/util/math/MatrixStack$Entry;
 
- 
isEmptypublic boolean isEmpty()Returns whether this stack contains exactly one entry.- Returns:
- whether this stack contains exactly one entry
- Mappings:
- Namespace - Name - Mixin selector - official - d- Leij;d()Z- intermediary - method_22911- Lnet/minecraft/class_4587;method_22911()Z- named - isEmpty- Lnet/minecraft/client/util/math/MatrixStack;isEmpty()Z
 
- 
loadIdentitypublic void loadIdentity()Sets the top entry to be the identity matrix.- Mappings:
- Namespace - Name - Mixin selector - official - e- Leij;e()V- intermediary - method_34426- Lnet/minecraft/class_4587;method_34426()V- named - loadIdentity- Lnet/minecraft/client/util/math/MatrixStack;loadIdentity()V
 
- 
multiplyPositionMatrixMultiplies the top position matrix with the given matrix.This does not update the normal matrix unlike other transformation methods. - Mappings:
- Namespace - Name - Mixin selector - official - a- Leij;a(Lorg/joml/Matrix4f;)V- intermediary - method_34425- Lnet/minecraft/class_4587;method_34425(Lorg/joml/Matrix4f;)V- named - multiplyPositionMatrix- Lnet/minecraft/client/util/math/MatrixStack;multiplyPositionMatrix(Lorg/joml/Matrix4f;)V
 
 
-