Documentation

Unity Engine

Download Unity

Unity Engine

ComputeBlendSpace1DWeights(float, NativeArray<float>, bool, float, float, NativeArray<float>)

Compute 1D blend space weights given an input, wrap information and animation stream values.
Read time 1 minuteLast updated 4 hours ago

Definition

public static void ComputeBlendSpace1DWeights(float input, NativeArray<float> values, bool wrap, float min, float max, NativeArray<float> outWeights)

Parameters

input

The input value to convert into weights, in the same space as
values
.

The blend space value of each animation stream, in ascending order. The method doesn't check the order, and returns incorrect weights if the values aren't sorted.

wrap

If
true
, the input wraps between
min
and
max
.

The lower bound of the wrap range. The method uses it only if
wrap
is
true
.

The upper bound of the wrap range. The method uses it only if
wrap
is
true
.

The array that receives the weight of each animation stream. Its length must equal the length of
values
.

Remarks

When
wrap
is
true
, the method first wraps the input into the range from
min
to
max
. An input outside the range that
values
covers then blends between the last and the first animation across the edge of the range. When
wrap
is
false
, an input beyond the first or last value gives that animation a weight of 1.
If
values
is empty, the method doesn't write to
outWeights
.