Interface Transformation
Vector3d
s, for general use in block transformations.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Transformation.Builder
builder()
Gets aTransformation.Builder
for creating transformations.Gets thematrix
used to perform this transformation on direction vectors.boolean
initialMirror
(Axis axis) Returns the direction of mirroring in this transformation, if mirroring was performed before rotation, at the point before the mirroring occurs.inverse()
Gets theTransformation
that reverses this transformation.boolean
Returns whether this transformation results in mirroring in the direction of the provided axis.origin()
Gets the origin of the position transformation matrix.boolean
If this istrue
, then this transformation will attempt to round the result to reduce the effects of machine precision, which may be particularly useful for those who expect integer values.Gets thematrix
used to perform this transformation on position vectors.rotation()
Gets theRotation
around the y-axisthen
(Transformation transformation) Returns are new Transformation which represents the combination of this transformation, followed by the supplied transformation.Creates aTransformation.Builder
that represents this transformation.transformDirection
(Vector3d originalDirection) Transforms aVector3d
that represents a direction based on the transformation this object represents.transformPosition
(Vector3d original) Transforms aVector3d
that represents a position based on the transformation this object represents.
-
Method Details
-
builder
Gets aTransformation.Builder
for creating transformations.- Returns:
- A builder
-
transformPosition
Transforms aVector3d
that represents a position based on the transformation this object represents.- Parameters:
original
- The position vector to transform- Returns:
- The transformed position vector
-
transformDirection
Transforms aVector3d
that represents a direction based on the transformation this object represents.Specifically, this transformation will not apply any translational transformations.
- Parameters:
originalDirection
- The direction vector to transform- Returns:
- The transformed direction vector
-
positionTransformationMatrix
Matrix4d positionTransformationMatrix()Gets thematrix
used to perform this transformation on position vectors.- Returns:
- The
Matrix4d
-
directionTransformationMatrix
Matrix4d directionTransformationMatrix()Gets thematrix
used to perform this transformation on direction vectors.- Returns:
- The
Matrix4d
-
origin
Vector3d origin()Gets the origin of the position transformation matrix.- Returns:
- The origin of the position transformations
-
rotation
Rotation rotation()Gets theRotation
around the y-axis- Returns:
- The
Rotation
-
mirror
Returns whether this transformation results in mirroring in the direction of the provided axis.This represents any mirroring that would need to occur after any rotation has occurred. If you require knowing what the mirror state would be pre-rotation, use
initialMirror(Axis)
instead.- Parameters:
axis
- TheAxis
- Returns:
- true if so
-
initialMirror
Returns the direction of mirroring in this transformation, if mirroring was performed before rotation, at the point before the mirroring occurs. The axis is in the direction of the mirroring.Unlike
mirror(Axis)
, which provides a view to the direction(s) of mirroring after all transformations have taken place, this method returns the direction of mirroring before any rotation has taken place, such that if therotation()
was set toRotations.NONE
, this would be the direction of mirroring.- Parameters:
axis
- TheAxis
- Returns:
- true if so
-
inverse
Transformation inverse()Gets theTransformation
that reverses this transformation.- Returns:
- The inverse transformation
-
performsRounding
boolean performsRounding()If this istrue
, then this transformation will attempt to round the result to reduce the effects of machine precision, which may be particularly useful for those who expect integer values.The rounding should be on the order of 15 decimal places, though other implementations may choose more sophisticated rounding.
- Returns:
- Whether the result will have minor rounding applied.
-
toBuilder
Transformation.Builder toBuilder()Creates aTransformation.Builder
that represents this transformation.- Returns:
- The builder.
-
then
Returns are new Transformation which represents the combination of this transformation, followed by the supplied transformation.You must not assume that the second transformation origin is relative to the first. Each transformation is assumed to operate in untransformed and each is assumed to operate around the origin specified in that transformation. For example, if the first transformation operates around (1, 1, 1), and the second operates around (2, 2, 2), this will still be the case, the second won't operate around (3, 3, 3). As a result,
origin()
will returnVector3d.ZERO
unless the two origins are equal to each other.The resultant transformation will set
performsRounding()
to the value of this transformation.- Parameters:
transformation
- The transformation to perform after this one- Returns:
- A new, combined, transformation
-