Class GuiTransform

java.lang.Object
com.render.api.gui.effects.GuiTransform

public final class GuiTransform extends Object
Immutable ordered component-transform list.

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.

  • Field Details

  • Constructor Details

  • Method Details

    • of

      public static GuiTransform of(GuiTransform.Operation... operations)
    • translate

      public static GuiTransform translate(float x, float y)
    • scale

      public static GuiTransform scale(float scale)
    • scale

      public static GuiTransform scale(float x, float y)
    • rotate

      public static GuiTransform rotate(float degrees)
    • then

      public GuiTransform then(GuiTransform.Operation operation)
    • operations

      public List<GuiTransform.Operation> 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 box
      origin - normalized transform origin
      Returns:
      resolved transform, or empty for a non-axis-aligned/3D matrix
    • resolveAffine

      public Optional<GuiTransform.Affine> resolveAffine(GuiRect reference, GuiTransformOrigin origin)
      Resolves this list against a reference box as an invertible 2D affine transform.
      Parameters:
      reference - transform reference box
      origin - 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 box
      origin - normalized transform origin
      Returns:
      resolved homography, or empty for a singular/non-finite mapping
    • isBackFacing

      public boolean isBackFacing(GuiRect reference, GuiTransformOrigin origin)
      Tests the transformed plane's facing using the inverse 4D normal, so a 2D mirror remains front-facing.
      Parameters:
      reference - transform reference box
      origin - normalized transform origin
      Returns:
      whether the plane faces away from the viewer; invalid matrices keep the base content visible