Package org.joml

Class Matrix3fStack

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, Matrix3fc

    public class Matrix3fStack
    extends Matrix3f
    A stack of many Matrix3f instances. This resembles the matrix stack known from legacy OpenGL.

    This Matrix3fStack class inherits from Matrix3f, so the current/top matrix is always the Matrix3fStack/Matrix3f itself. This affects all operations in Matrix3f that take another Matrix3f as parameter. If a Matrix3fStack is used as argument to those methods, the effective argument will always be the current matrix of the matrix stack.

    Author:
    Kai Burjack
    See Also:
    Serialized Form
    • Constructor Detail

      • Matrix3fStack

        public Matrix3fStack​(int stackSize)
        Create a new Matrix3fStack of the given size.

        Initially the stack pointer is at zero and the current matrix is set to identity.

        Parameters:
        stackSize - the size of the stack. This must be at least 1, in which case the Matrix3fStack simply only consists of this Matrix3f
      • Matrix3fStack

        public Matrix3fStack()
        Do not invoke manually! Only meant for serialization.

        Invoking this constructor from client code will result in an inconsistent state of the created Matrix3fStack instance.

    • Method Detail

      • clear

        public Matrix3fStack clear()
        Set the stack pointer to zero and set the current/bottom matrix to identity.
        Returns:
        this
      • pushMatrix

        public Matrix3fStack pushMatrix()
        Increment the stack pointer by one and set the values of the new current matrix to the one directly below it.
        Returns:
        this
      • popMatrix

        public Matrix3fStack popMatrix()
        Decrement the stack pointer by one.

        This will effectively dispose of the current matrix.

        Returns:
        this
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Matrix3f
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Overrides:
        writeExternal in class Matrix3f
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException
        Specified by:
        readExternal in interface java.io.Externalizable
        Overrides:
        readExternal in class Matrix3f
        Throws:
        java.io.IOException
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class Matrix3f
        Throws:
        java.lang.CloneNotSupportedException