Class AffineTransform

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

public class AffineTransform extends Object implements Transform
An affine transform.

This class is 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

      public AffineTransform(double[] coefs)
    • AffineTransform

      public AffineTransform(double xx, double yx, double zx, double tx, double xy, double yy, double zy, double ty, double xz, double yz, double zz, double tz)
  • 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(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()
      Overrides:
      toString in class Object