Package foundry.veil.api.client.render
Interface MatrixStack
- All Known Implementing Classes:
PoseStackMixin
public interface MatrixStack
Utility extension for
PoseStack
with extra utilities.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
applyScale
(double xyz) Scales the position and normal by the specified amount in the x, y, and z.default void
applyScale
(double x, double y, double z) Scales the position and normal by the specified amount in the x, y, and z.default void
applyScale
(float xyz) Scales the position and normal by the specified amount in the x, y, and z.void
applyScale
(float x, float y, float z) Scales the position and normal by the specified amount in the x, y, and z.void
clear()
Clears all transformations.default void
copy
(com.mojang.blaze3d.vertex.PoseStack other) Copies the current transformation of the specified stack into the current transformation of this stack.default void
copy
(com.mojang.blaze3d.vertex.PoseStack.Pose other) Copies the current transformation of the specified pose into the current transformation of this stack.default void
copy
(MatrixStack other) Copies the current transformation of the specified stack into the current transformation of this stack.boolean
isEmpty()
boolean
void
Restores a previous position and normal set withmatrixPush()
.void
Saves the current position and normal transformation for restoring later withmatrixPop()
.default org.joml.Matrix3f
normal()
com.mojang.blaze3d.vertex.PoseStack.Pose
pose()
default org.joml.Matrix4f
position()
default void
rotate
(double angle, double x, double y, double z) Rotates the position and normal by the specified angle about the line specified by x, y, z.void
rotate
(float angle, float x, float y, float z) Rotates the position and normal by the specified angle about the line specified by x, y, z.void
rotate
(org.joml.Quaterniondc rotation) Rotates the position and normal by the specified quaternion rotation.void
rotate
(org.joml.Quaternionfc rotation) Rotates the position and normal by the specified quaternion rotation.void
rotateAround
(org.joml.Quaterniondc rotation, double x, double y, double z) Rotates the position and normal by the specified quaternion rotation about the specified rotation point.void
rotateAround
(org.joml.Quaternionfc rotation, float x, float y, float z) Rotates the position and normal by the specified quaternion rotation about the specified rotation point.default void
rotateXYZ
(double x, double y, double z) Rotates about the x, y, then z planes the specified angles.void
rotateXYZ
(float x, float y, float z) Rotates about the x, y, then z planes the specified angles.default void
rotateZYX
(double z, double y, double x) Rotates about the z, y, then x planes the specified angles.void
rotateZYX
(float x, float y, float z) Rotates about the z, y, then x planes the specified angles.default void
Sets the current transformation and normal to identity.com.mojang.blaze3d.vertex.PoseStack
default void
translate
(double x, double y, double z) Translates the position by the specified amount.void
translate
(float x, float y, float z) Translates the position by the specified amount.
-
Method Details
-
clear
void clear()Clears all transformations. -
translate
default void translate(double x, double y, double z) Translates the position by the specified amount.- Parameters:
x
- The x amounty
- The y amountz
- The z amount
-
translate
void translate(float x, float y, float z) Translates the position by the specified amount.- Parameters:
x
- The x amounty
- The y amountz
- The z amount
-
rotate
void rotate(org.joml.Quaterniondc rotation) Rotates the position and normal by the specified quaternion rotation.- Parameters:
rotation
- The rotation to use
-
rotate
void rotate(org.joml.Quaternionfc rotation) Rotates the position and normal by the specified quaternion rotation.- Parameters:
rotation
- The rotation to use
-
rotate
default void rotate(double angle, double x, double y, double z) Rotates the position and normal by the specified angle about the line specified by x, y, z.
For rotating along all 3 axes, use
rotateXYZ(double, double, double)
orrotateZYX(double, double, double)
.- Parameters:
angle
- The amount to rotate in radiansx
- The x normaly
- The y normalz
- The z normal
-
rotate
void rotate(float angle, float x, float y, float z) Rotates the position and normal by the specified angle about the line specified by x, y, z.
For rotating along all 3 axes, use
rotateXYZ(float, float, float)
orrotateZYX(float, float, float)
.- Parameters:
angle
- The amount to rotate in radiansx
- The x normaly
- The y normalz
- The z normal
-
rotateXYZ
default void rotateXYZ(double x, double y, double z) Rotates about the x, y, then z planes the specified angles.- Parameters:
x
- The amount to rotate in the x in radiansy
- The amount to rotate in the y in radiansz
- The amount to rotate in the z in radians
-
rotateXYZ
void rotateXYZ(float x, float y, float z) Rotates about the x, y, then z planes the specified angles.- Parameters:
x
- The amount to rotate in the x in radiansy
- The amount to rotate in the y in radiansz
- The amount to rotate in the z in radians
-
rotateZYX
default void rotateZYX(double z, double y, double x) Rotates about the z, y, then x planes the specified angles.- Parameters:
z
- The amount to rotate in the z in radiansy
- The amount to rotate in the y in radiansx
- The amount to rotate in the x in radians
-
rotateZYX
void rotateZYX(float x, float y, float z) Rotates about the z, y, then x planes the specified angles.- Parameters:
x
- The amount to rotate in the x in radiansy
- The amount to rotate in the y in radiansz
- The amount to rotate in the z in radians
-
rotateAround
void rotateAround(org.joml.Quaterniondc rotation, double x, double y, double z) Rotates the position and normal by the specified quaternion rotation about the specified rotation point.- Parameters:
rotation
- The rotation to usex
- The rotation point Xy
- The rotation point Yz
- The rotation point Z
-
rotateAround
void rotateAround(org.joml.Quaternionfc rotation, float x, float y, float z) Rotates the position and normal by the specified quaternion rotation about the specified rotation point.- Parameters:
rotation
- The rotation to usex
- The rotation point Xy
- The rotation point Yz
- The rotation point Z
-
applyScale
default void applyScale(double xyz) Scales the position and normal by the specified amount in the x, y, and z.- Parameters:
xyz
- The scale factor
-
applyScale
default void applyScale(float xyz) Scales the position and normal by the specified amount in the x, y, and z.- Parameters:
xyz
- The scale factor
-
applyScale
default void applyScale(double x, double y, double z) Scales the position and normal by the specified amount in the x, y, and z.- Parameters:
x
- The x scale factory
- The y scale factorz
- The z scale factor
-
applyScale
void applyScale(float x, float y, float z) Scales the position and normal by the specified amount in the x, y, and z.- Parameters:
x
- The x scale factory
- The y scale factorz
- The z scale factor
-
copy
default void copy(com.mojang.blaze3d.vertex.PoseStack other) Copies the current transformation of the specified stack into the current transformation of this stack.- Parameters:
other
- The stack to copy
-
copy
Copies the current transformation of the specified stack into the current transformation of this stack.- Parameters:
other
- The stack to copy
-
copy
default void copy(com.mojang.blaze3d.vertex.PoseStack.Pose other) Copies the current transformation of the specified pose into the current transformation of this stack.- Parameters:
other
- The pose to copy
-
setIdentity
default void setIdentity()Sets the current transformation and normal to identity. -
isIdentity
boolean isIdentity()- Returns:
- Whether the
position()
andnormal()
are identity matrices
-
isEmpty
boolean isEmpty()- Returns:
- Whether there are no more transformations to pop
-
matrixPush
void matrixPush()Saves the current position and normal transformation for restoring later withmatrixPop()
. -
matrixPop
void matrixPop()Restores a previous position and normal set withmatrixPush()
.- Throws:
IllegalStateException
- If there are no more matrix transformations to pop
-
pose
com.mojang.blaze3d.vertex.PoseStack.Pose pose()- Returns:
- The last pose in the stack
-
position
default org.joml.Matrix4f position()- Returns:
- The current position matrix
-
normal
default org.joml.Matrix3f normal()- Returns:
- The computed normal matrix from the position
-
toPoseStack
com.mojang.blaze3d.vertex.PoseStack toPoseStack()- Returns:
- This matrix stack as a vanilla mc
PoseStack
-