operate

@NotNull
open fun operate(@NotNull p0: @NotNull Keyframe, @NotNull p1: @NotNull Keyframe, @NotNull operator: Keyframe.Operator2): @NotNull Keyframe

Combines two scalar keyframes. If all operands are Constant values, applies the operator immediately.


var sum = Keyframe.operate(Keyframe.of(1F), Keyframe.of(2F),
    (a, b) -> a + b);

Return

the combined keyframe

Since

3.7.0

Parameters

p0

the first operand

p1

the second operand

operator

the operation to apply to the operand values

Throws

if all operands are constants and the operator throws


@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. If all operands are Constant values, applies the operator immediately.


var sum = Keyframe.operate(Keyframe.of(1F), Keyframe.of(2F), Keyframe.of(3F), Keyframe.of(4F),
    (a, b, c, d) -> a + b + c + d);

Return

the combined keyframe

Since

3.7.0

Parameters

p0

the first operand

p1

the second operand

p2

the third operand

p3

the fourth operand

operator

the operation to apply to the operand values

Throws

if all operands are constants and the operator throws