operate

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

Combines two vectors by applying the same binary operation to each pair of components.


var sum = KeyframeVector.operate(vector, KeyframeVector.ZERO, (a, b) -> a + b);

Return

the combined vector

Since

3.7.0

Parameters

p0

the first vector

p1

the second vector

operator

the operation applied to all three component pairs

Throws

if the operator throws during constant folding


@NotNull
open fun operate(@NotNull p0: @NotNull KeyframeVector, @NotNull p1: @NotNull KeyframeVector, @NotNull xOperator: Keyframe.Operator2, @NotNull yOperator: Keyframe.Operator2, @NotNull zOperator: Keyframe.Operator2): @NotNull KeyframeVector

Combines two vectors using a separate binary operation for each axis.


var combined = KeyframeVector.operate(vector, other,
    (a, b) -> a + b, (a, b) -> a - b, (a, b) -> a * b);

Return

the combined vector

Since

3.7.0

Parameters

p0

the first vector

p1

the second vector

xOperator

the operation for the X components

yOperator

the operation for the Y components

zOperator

the operation for the Z components

Throws

if a component operator throws during constant folding


@NotNull
open fun operate(@NotNull p0: @NotNull KeyframeVector, @NotNull p1: @NotNull KeyframeVector, @NotNull p2: @NotNull KeyframeVector, @NotNull p3: @NotNull KeyframeVector, @NotNull operator: Keyframe.Operator4): @NotNull KeyframeVector

Combines four vectors by applying the same operation to the four values on each axis.


var sum = KeyframeVector.operate(first, second, third, fourth,
    (a, b, c, d) -> a + b + c + d);

Return

the combined vector

Since

3.7.0

Parameters

p0

the first vector

p1

the second vector

p2

the third vector

p3

the fourth vector

operator

the operation applied to the four components on each axis

Throws

if the operator throws during constant folding