Class TransformationMatrix


  • public final class TransformationMatrix
    extends java.lang.Object
    Represents a more precise way to represent Camera properties than using just heading, pitch and roll. The quaternion is used to describe the camera angles and the translation vector is used to describe the camera position.
    Since:
    100.6.0
    • Method Detail

      • createIdentityMatrix

        public static TransformationMatrix createIdentityMatrix()
        Creates a TransformationMatrix object with an identity transform. Subtracting another TransformationMatrix from an identity matrix is useful for getting the inverse of that TransformationMatrix, i.e., identity matrix - other matrix = inverse(other matrix)
        Returns:
        an identity TransformationMatrix
        Since:
        100.6.0
      • createWithQuaternionAndTranslation

        public static TransformationMatrix createWithQuaternionAndTranslation​(double quaternionX,
                                                                              double quaternionY,
                                                                              double quaternionZ,
                                                                              double quaternionW,
                                                                              double translationX,
                                                                              double translationY,
                                                                              double translationZ)
        Creates a TransformationMatrix with the given arguments.
        Parameters:
        quaternionX - the X quaternion
        quaternionY - the Y quaternion
        quaternionZ - the Z quaternion
        quaternionW - the W quaternion
        translationX - the X translation
        translationY - the Y translation
        translationZ - the Z translation
        Returns:
        a TransformationMatrix with the given arguments
        Since:
        100.6.0
      • getQuaternionX

        public double getQuaternionX()
        Gets the quaternion x value.
        Returns:
        the quaternion x value
        Since:
        100.6.0
      • getQuaternionY

        public double getQuaternionY()
        Gets the quaternion y value.
        Returns:
        the quaternion y value
        Since:
        100.6.0
      • getQuaternionZ

        public double getQuaternionZ()
        Gets the quaternion z value.
        Returns:
        the quaternion z value
        Since:
        100.6.0
      • getQuaternionW

        public double getQuaternionW()
        Gets the quaternion W value.
        Returns:
        the quaternion W value
        Since:
        100.6.0
      • getTranslationX

        public double getTranslationX()
        Gets the translation x value.
        Returns:
        the translation x value
        Since:
        100.6.0
      • getTranslationY

        public double getTranslationY()
        Gets the translation y value.
        Returns:
        the translation y value
        Since:
        100.6.0
      • getTranslationZ

        public double getTranslationZ()
        Gets the translation z value.
        Returns:
        the translation z value
        Since:
        100.6.0
      • addTransformation

        public TransformationMatrix addTransformation​(TransformationMatrix transformation)
        Creates a TransformationMatrix that is the sum of this instance and the provided one.
        Parameters:
        transformation - the TransformationMatrix to sum with
        Returns:
        a new TransformationMatrix that represents the calculated TransformationMatrix
        Throws:
        java.lang.IllegalArgumentException - if transformation is null
        Since:
        100.6.0
      • subtractTransformation

        public TransformationMatrix subtractTransformation​(TransformationMatrix transformation)
        Creates a TransformationMatrix that equals the provided transformation subtracted from this instance.
        Parameters:
        transformation - the TransformationMatrix to subtract from this instance
        Returns:
        a new TransformationMatrix that represents the calculated TransformationMatrix
        Throws:
        java.lang.IllegalArgumentException - if transformation is null
        Since:
        100.6.0