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
- Type: Method
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
public static void ComputeBlendSpace1DWeights(float input, NativeArray<float> values, bool wrap, float min, float max, NativeArray<float> outWeights)
Parameters
The input value to convert into weights, in the same space as .
valuesThe 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.
If , the input wraps between and .
trueminmaxThe lower bound of the wrap range. The method uses it only if is .
wraptrueThe upper bound of the wrap range. The method uses it only if is .
wraptrueThe array that receives the weight of each animation stream. Its length must equal the length of .
valuesRemarks
When is , the method first wraps the input into the range from to . An input outside the range that covers then blends between the last and the first animation across the edge of the range. When is , an input beyond the first or last value gives that animation a weight of 1.
wraptrueminmaxvalueswrapfalseIf is empty, the method doesn't write to .
valuesoutWeights