Keyframe

A compiled scalar keyframe value that can be evaluated with a runtime context.


float value = Keyframe.of(2F).eval(KeyframeRuntimeContext.empty());

Since

3.7.0

Inheritors

Types

Link copied to clipboard
A scalar keyframe that returns the same value for every runtime context.
Link copied to clipboard
interface Operator2
An operation on two evaluated scalar keyframe values.
Link copied to clipboard
interface Operator4
An operation on four evaluated scalar keyframe values.

Companion properties

Link copied to clipboard
The shared constant one keyframe.
Link copied to clipboard
The shared constant zero keyframe.

Companion functions

Link copied to clipboard
@NotNull
open fun of(value: Float): @NotNull Keyframe
Creates a constant scalar keyframe.
Link copied to clipboard
@NotNull
open fun operate(@NotNull p0: @NotNull Keyframe, @NotNull p1: @NotNull Keyframe, @NotNull operator: Keyframe.Operator2): @NotNull Keyframe
Combines two scalar keyframes.
@NotNull
open fun operate(@NotNull p0: @NotNull Keyframe, @NotNull p1: @NotNull Keyframe, @NotNull p2: @NotNull Keyframe, @NotNull p3: @NotNull Keyframe, @NotNull operator: Keyframe.Operator4): @NotNull Keyframe
Combines four scalar keyframes.

Functions

Link copied to clipboard
abstract fun eval(@NotNull context: @NotNull KeyframeRuntimeContext): Float
Evaluates this keyframe with the supplied runtime context.
Link copied to clipboard
open fun isConstant(): Boolean
Reports whether evaluation is independent of the runtime context.
Link copied to clipboard
open fun isZero(): Boolean
Checks whether this keyframe is the shared ZERO instance.
Link copied to clipboard
@NotNull
open fun map(@NotNull function: @NotNull Float2FloatFunction): @NotNull Keyframe
Transforms the scalar result.
Link copied to clipboard
@NotNull
open fun weight(@NotNull keyframe: @NotNull Keyframe): @NotNull Keyframe
Multiplies this value by a weight evaluated with the same runtime context.