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 Summary
ConstructorDescriptionCreates a new affine transform3D set to the identity.AffineTransform
(double[] coefs) Deprecated.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 aAffineTransform
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the result of applying the function to the input.double[]
Returns the affine coefficients of the transform.combine
(AffineTransform other) Create a newTransform
that combines this transform with another.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.concatenate
(AffineTransform that) Returns the affine transform created by applying first the affine transform given bythat
, then this affine transform.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.inverse()
Computes the inverse affine transform.boolean
Returns if this affine transform represents a horizontal flip.boolean
Return whether this transform is an identity.boolean
Returns if this affine transform represents a vertical flip.double
m00()
Returns the value of them00
record component.double
m01()
Returns the value of them01
record component.double
m02()
Returns the value of them02
record component.double
m03()
Returns the value of them03
record component.double
m10()
Returns the value of them10
record component.double
m11()
Returns the value of them11
record component.double
m12()
Returns the value of them12
record component.double
m13()
Returns the value of them13
record component.double
m20()
Returns the value of them20
record component.double
m21()
Returns the value of them21
record component.double
m22()
Returns the value of them22
record component.double
m23()
Returns the value of them23
record component.Return the affine transform created by applying first this affine transform, then the affine transform given bythat
.rotateX
(double theta) rotateY
(double theta) rotateZ
(double theta) scale
(double s) scale
(double sx, double sy, double sz) toString()
Returns a string representation of this record class.translate
(double x, double y, double z) translate
(BlockVector3 vec)
-
Constructor Details
-
AffineTransform
public AffineTransform()Creates a new affine transform3D set to the identity. -
AffineTransform
Deprecated.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 aAffineTransform
record class.- Parameters:
m00
- the value for them00
record componentm01
- the value for them01
record componentm02
- the value for them02
record componentm03
- the value for them03
record componentm10
- the value for them10
record componentm11
- the value for them11
record componentm12
- the value for them12
record componentm13
- the value for them13
record componentm20
- the value for them20
record componentm21
- the value for them21
record componentm22
- the value for them22
record componentm23
- the value for them23
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 interfaceTransform
- Returns:
- true if identity
-
coefficients
public double[] coefficients()Returns the affine coefficients of the transform. Result is an array of 12 double. -
inverse
Computes the inverse affine 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
Returns the affine transform created by applying first the affine transform given bythat
, then this affine transform.- Parameters:
that
- the transform to apply first- Returns:
- the composition this * that
-
preConcatenate
Return the affine transform created by applying first this affine transform, then the affine transform given bythat
.- Parameters:
that
- the transform to apply in a second step- Returns:
- the composition that * this
-
translate
-
translate
-
translate
-
rotateX
-
rotateY
-
rotateZ
-
scale
-
scale
-
scale
-
apply
Description copied from interface:Transform
Returns the result of applying the function to the input. -
combine
-
combine
Description copied from interface:Transform
Create a newTransform
that combines this transform with another. -
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
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. -
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. -
equals
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 '=='. -
m00
public double m00()Returns the value of them00
record component.- Returns:
- the value of the
m00
record component
-
m01
public double m01()Returns the value of them01
record component.- Returns:
- the value of the
m01
record component
-
m02
public double m02()Returns the value of them02
record component.- Returns:
- the value of the
m02
record component
-
m03
public double m03()Returns the value of them03
record component.- Returns:
- the value of the
m03
record component
-
m10
public double m10()Returns the value of them10
record component.- Returns:
- the value of the
m10
record component
-
m11
public double m11()Returns the value of them11
record component.- Returns:
- the value of the
m11
record component
-
m12
public double m12()Returns the value of them12
record component.- Returns:
- the value of the
m12
record component
-
m13
public double m13()Returns the value of them13
record component.- Returns:
- the value of the
m13
record component
-
m20
public double m20()Returns the value of them20
record component.- Returns:
- the value of the
m20
record component
-
m21
public double m21()Returns the value of them21
record component.- Returns:
- the value of the
m21
record component
-
m22
public double m22()Returns the value of them22
record component.- Returns:
- the value of the
m22
record component
-
m23
public double m23()Returns the value of them23
record component.- Returns:
- the value of the
m23
record component
-
AffineTransform(double, double, double, double, double, double, double, double, double, double, double, double)
instead