Class GuiTransform
The compositor resolver executes affine and perspective 3D transforms. A transformed component is represented by the
projective homography produced by intersecting its local z=0 plane with the GUI viewport.
Modern style transitions and keyframes interpolate matching operations in order. A shorter list, including
NONE, is extended with the identities of the longer list's trailing operations. Translation, scale,
rotation, skew and 2D matrix operations support this extension; 3D rotations require the same authored axis and
interpolate their angle. Angles retain their authored turns, and 2D matrix coefficients interpolate directly.
Reordered or incompatible operations, different 3D axes and missing or changed perspective operations switch the
whole list at halfway. An unchanged perspective operation can remain in a compatible list. No matrix decomposition is
performed. Sampling an exact segment endpoint preserves its authored transform object. Scalar interpolation retains
the existing bounded easing behavior; it does not extrapolate beyond either operation value.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResolved CSS-compatible 2D affine matrix.static final recordResolved portable axis-aligned transform used by paint and input.static final recordCSS-compatible 2D matrix usingx' = a*x + c*y + txandy' = b*x + d*y + ty.static interfaceOne transform operation in the authored list.static final recordstatic final recordstatic final recordInvertible 2D homography used for perspective paint and hit testing.static final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final record -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisBackFacing(GuiRect reference, GuiTransformOrigin origin) Tests the transformed plane's facing using the inverse 4D normal, so a 2D mirror remains front-facing.booleanisNone()static GuiTransformof(GuiTransform.Operation... operations) resolveAffine(GuiRect reference, GuiTransformOrigin origin) Resolves this list against a reference box as an invertible 2D affine transform.resolveAxisAligned(GuiRect reference, GuiTransformOrigin origin) Resolves this list against a reference box and returns a portable axis-aligned transform when possible.resolveProjective(GuiRect reference, GuiTransformOrigin origin) Resolves this transform list to an invertible projective mapping of the component plane.static GuiTransformrotate(float degrees) static GuiTransformscale(float scale) static GuiTransformscale(float x, float y) then(GuiTransform.Operation operation) static GuiTransformtranslate(float x, float y)
-
Field Details
-
NONE
-
-
Constructor Details
-
GuiTransform
-
-
Method Details
-
of
-
translate
-
scale
-
scale
-
rotate
-
then
-
operations
-
isNone
public boolean isNone() -
resolveAxisAligned
public Optional<GuiTransform.AxisAligned> resolveAxisAligned(GuiRect reference, GuiTransformOrigin origin) Resolves this list against a reference box and returns a portable axis-aligned transform when possible.- Parameters:
reference- transform reference boxorigin- normalized transform origin- Returns:
- resolved transform, or empty for a non-axis-aligned/3D matrix
-
resolveAffine
Resolves this list against a reference box as an invertible 2D affine transform.- Parameters:
reference- transform reference boxorigin- normalized transform origin- Returns:
- resolved affine transform, or empty for perspective/non-planar 3D
-
resolveProjective
public Optional<GuiTransform.Projective> resolveProjective(GuiRect reference, GuiTransformOrigin origin) Resolves this transform list to an invertible projective mapping of the component plane.- Parameters:
reference- transform reference boxorigin- normalized transform origin- Returns:
- resolved homography, or empty for a singular/non-finite mapping
-
isBackFacing
Tests the transformed plane's facing using the inverse 4D normal, so a 2D mirror remains front-facing.- Parameters:
reference- transform reference boxorigin- normalized transform origin- Returns:
- whether the plane faces away from the viewer; invalid matrices keep the base content visible
-