Package me.deecaad.core.transition
Interface Interpolator<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Blends two values of type
T by a normalized factor t in [0, 1].
Interpolators are pure functions; implementations should not mutate a or b.
Values that cannot be meaningfully blended (e.g. BlockData, ItemStack) should use
a stepped interpolator (see Interpolators.stepped()) which returns a and reports
isContinuous() as false.
-
Method Summary
Modifier and TypeMethodDescriptioninterpolate(T a, T b, double t) Returns a value betweenaandb.default booleanWhether this interpolator produces meaningful intermediate values (true) or merely returnsauntil a discrete switch tob(false).
-
Method Details
-
interpolate
Returns a value betweenaandb. Implementations may clampt.- Parameters:
a- The non-null start value.b- The non-null end value.t- The normalized blend factor.- Returns:
- The blended value.
-
isContinuous
default boolean isContinuous()Whether this interpolator produces meaningful intermediate values (true) or merely returnsauntil a discrete switch tob(false). Used by playback helpers to choose between native interpolation and stepped scheduling.- Returns:
- true if continuous.
-