public sealed class BlendTree1DMotions on a line, blended by one parameter: idle at 0, walk at 2, run at 6.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Two children contribute at a time, and never more. The parameter falls between two thresholds and is a linear interpolation between them; a value below the first or above the last is the end motion alone. That is what makes a 1D tree cheap enough to have several of, and it is also what makes it predictable — an artist placing a motion at a threshold knows it plays exactly there, unblended.
The tree's length is the weighted average of its children's, and every child is sampled at the same normalised time. This is the whole trick of locomotion blending: a 1.2-second walk and a 0.8-second run blended half and half play as a 1.0-second cycle with both feet landing together, where sampling both in seconds would have them drift apart and the character would appear to have four legs.
Fields and properties (2)
public int ParameterThe index of the parameter that drives the blend.
public ReadOnlySpan<BlendTree1DChild> ChildrenThe motions, ordered by threshold.
Methods (5)
public BlendTree1D(int parameter, IEnumerable<BlendTree1DChild> children)Builds a tree.
public BlendTree1D(AnimationParameters parameters, string parameter, IEnumerable<BlendTree1DChild> children)Builds a tree, declaring the parameter if it is not already.
public override float Length(AnimationParameters parameters)How long one pass takes at the current parameters, in seconds.
public override RootMotionDelta Evaluate(in MotionContext context, Span<BoneTransform> destination)Poses the skeleton, and reports what the root did.
public void ComputeWeights(AnimationParameters parameters, Span<float> destination)The weights a parameter value produces, for a test or an editor.
Used by (3)
- RigsVixen.Benchmarks.Animation
- BlendTreeTestsVixen.Animation.Tests
- AnimationGraphCompilerVixen.Editor.AnimationGraph