Documentation

Unity Engine

Download Unity

Unity Engine

Core.PoseMixer

Mixes several weighted animation streams into one output stream.
Read time 1 minuteLast updated 4 hours ago

Definition

[BurstCompile]public struct Core.PoseMixer

Remarks

The mixer adds the continuous channels of each stream, multiplied by the weight of the stream. It takes the discrete channels, such as integers and entity IDs, from the stream with the greatest weight. Use it, for example, to mix streams with the weights that a blend space computes.
To mix streams, follow these steps:
  1. Declare a
    PoseMixer
    . The default value is ready to use.
  2. Call Core.PoseMixer.Begin with the output stream. The method resets the output stream to zero.
  3. Call Core.PoseMixer.Add once for each stream and its weight.
  4. Call Core.PoseMixer.End to finish the mix. The output stream isn't a valid pose until you call it.
All streams must use the same rig. If safety checks are enabled,
Add
throws an
InvalidOperationException
if a stream uses another rig.
The weights aren't normalized. If they sum to more than 1, the translations and scales are a weighted sum of the streams, not an average, and the mixer doesn't add a default pose. The
End
method normalizes rotations once, after the mixer adds all streams. This differs from chaining pairwise blends.

Methods

Method

Description

AddAdds a weighted animation stream to the mix.
BeginStarts a mix and resets the output stream.
EndFinishes the mix and normalizes the result.