Interface MatrixStack

All Known Implementing Classes:
PoseStackMixin

public interface MatrixStack
Utility extension for PoseStack with extra utilities.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default 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
    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
    Copies the current transformation of the specified stack into the current transformation of this stack.
    boolean
     
    boolean
     
    void
    Restores a previous position and normal set with matrixPush().
    void
    Saves the current position and normal transformation for restoring later with matrixPop().
    default org.joml.Matrix3f
     
    com.mojang.blaze3d.vertex.PoseStack.Pose
     
    default org.joml.Matrix4f
     
    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 amount
      y - The y amount
      z - The z amount
    • translate

      void translate(float x, float y, float z)
      Translates the position by the specified amount.
      Parameters:
      x - The x amount
      y - The y amount
      z - 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) or rotateZYX(double, double, double).

      Parameters:
      angle - The amount to rotate in radians
      x - The x normal
      y - The y normal
      z - 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) or rotateZYX(float, float, float).

      Parameters:
      angle - The amount to rotate in radians
      x - The x normal
      y - The y normal
      z - 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 radians
      y - The amount to rotate in the y in radians
      z - 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 radians
      y - The amount to rotate in the y in radians
      z - 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 radians
      y - The amount to rotate in the y in radians
      x - 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 radians
      y - The amount to rotate in the y in radians
      z - 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 use
      x - The rotation point X
      y - The rotation point Y
      z - 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 use
      x - The rotation point X
      y - The rotation point Y
      z - 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 factor
      y - The y scale factor
      z - 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 factor
      y - The y scale factor
      z - 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

      default void copy(MatrixStack other)
      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() and normal() 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 with matrixPop().
    • matrixPop

      void matrixPop()
      Restores a previous position and normal set with matrixPush().
      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