Record Class AffineTransform

java.lang.Object
java.lang.Record
com.sk89q.worldedit.math.transform.AffineTransform
All Implemented Interfaces:
Transform

public record AffineTransform(double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23) extends Record implements Transform
An affine transform.

This class is based on the one from the JavaGeom project, which is licensed under LGPL v2.1.

  • Constructor Details

    • AffineTransform

      public AffineTransform()
      Creates a new affine transform3D set to the identity.
    • AffineTransform

      @Deprecated public AffineTransform(double[] coefs)
      Creates a new affine transform from the given coefficients.
      Parameters:
      coefs - array of 9 to 12 coefficients
    • AffineTransform

      public AffineTransform(double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23)
      Creates an instance of a AffineTransform record class.
      Parameters:
      m00 - the value for the m00 record component
      m01 - the value for the m01 record component
      m02 - the value for the m02 record component
      m03 - the value for the m03 record component
      m10 - the value for the m10 record component
      m11 - the value for the m11 record component
      m12 - the value for the m12 record component
      m13 - the value for the m13 record component
      m20 - the value for the m20 record component
      m21 - the value for the m21 record component
      m22 - the value for the m22 record component
      m23 - the value for the m23 record component
  • Method Details

    • isIdentity

      public boolean isIdentity()
      Description copied from interface: Transform
      Return whether this transform is an identity.

      If it is not known, then false must be returned.

      Specified by:
      isIdentity in interface Transform
      Returns:
      true if identity
    • coefficients

      public double[] coefficients()
      Returns the affine coefficients of the transform. Result is an array of 12 double.
    • inverse

      public AffineTransform inverse()
      Computes the inverse affine transform.
      Specified by:
      inverse in interface Transform
      Returns:
      a new inverse transform
    • concatenate

      public AffineTransform concatenate(double o00, double o01, double o02, double o03, double o10, double o11, double o12, double o13, double o20, double o21, double o22, double o23)
      Returns the affine transform created by applying first the affine transform given by the parameters, then this affine transform.
      Returns:
      the composition this * that
    • concatenate

      public AffineTransform concatenate(AffineTransform that)
      Returns the affine transform created by applying first the affine transform given by that, then this affine transform.
      Parameters:
      that - the transform to apply first
      Returns:
      the composition this * that
    • preConcatenate

      public AffineTransform preConcatenate(AffineTransform that)
      Return the affine transform created by applying first this affine transform, then the affine transform given by that.
      Parameters:
      that - the transform to apply in a second step
      Returns:
      the composition that * this
    • translate

      public AffineTransform translate(Vector3 vec)
    • translate

      public AffineTransform translate(BlockVector3 vec)
    • translate

      public AffineTransform translate(double x, double y, double z)
    • rotateX

      public AffineTransform rotateX(double theta)
    • rotateY

      public AffineTransform rotateY(double theta)
    • rotateZ

      public AffineTransform rotateZ(double theta)
    • scale

      public AffineTransform scale(double s)
    • scale

      public AffineTransform scale(double sx, double sy, double sz)
    • scale

      public AffineTransform scale(Vector3 vec)
    • apply

      public Vector3 apply(Vector3 vector)
      Description copied from interface: Transform
      Returns the result of applying the function to the input.
      Specified by:
      apply in interface Transform
      Parameters:
      vector - the input
      Returns:
      the result
    • combine

      public AffineTransform combine(AffineTransform other)
    • combine

      public Transform combine(Transform other)
      Description copied from interface: Transform
      Create a new Transform that combines this transform with another.
      Specified by:
      combine in interface Transform
      Parameters:
      other - the other transform to occur second
      Returns:
      a new transform
    • isHorizontalFlip

      public boolean isHorizontalFlip()
      Returns if this affine transform represents a horizontal flip.
    • isVerticalFlip

      public boolean isVerticalFlip()
      Returns if this affine transform represents a vertical flip.
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • m00

      public double m00()
      Returns the value of the m00 record component.
      Returns:
      the value of the m00 record component
    • m01

      public double m01()
      Returns the value of the m01 record component.
      Returns:
      the value of the m01 record component
    • m02

      public double m02()
      Returns the value of the m02 record component.
      Returns:
      the value of the m02 record component
    • m03

      public double m03()
      Returns the value of the m03 record component.
      Returns:
      the value of the m03 record component
    • m10

      public double m10()
      Returns the value of the m10 record component.
      Returns:
      the value of the m10 record component
    • m11

      public double m11()
      Returns the value of the m11 record component.
      Returns:
      the value of the m11 record component
    • m12

      public double m12()
      Returns the value of the m12 record component.
      Returns:
      the value of the m12 record component
    • m13

      public double m13()
      Returns the value of the m13 record component.
      Returns:
      the value of the m13 record component
    • m20

      public double m20()
      Returns the value of the m20 record component.
      Returns:
      the value of the m20 record component
    • m21

      public double m21()
      Returns the value of the m21 record component.
      Returns:
      the value of the m21 record component
    • m22

      public double m22()
      Returns the value of the m22 record component.
      Returns:
      the value of the m22 record component
    • m23

      public double m23()
      Returns the value of the m23 record component.
      Returns:
      the value of the m23 record component