Vixen
02b45cc4
csharp
public sealed class MoveSetMotion

A move set, playing. It is a Motion, so everything above it is unchanged.

Read the guide page for this →

Remarks

The cheapest possible integration, and that is the point of the type. A state holds one of these exactly as it holds a clip or a blend tree, and every layer, mask, event and root-motion path above it works with no change — because from up there this is a motion. A game with no state machine at all can hold one directly, which is the common case for a background character.

⚠ The query is re-asked only when it changes. A selection pass is cheap and is not free, and re-running it every frame would also mean re-deciding every frame — which is how a character standing on the boundary between two equally good moves flickers between them. The query is a value; comparing this frame's to last frame's is comparing a few words.

Two moves are evaluated during a transition and blended, and the phase runs through both. Which phase the incoming move starts at is the SyncMode's business, and the answer that matters is ClosestFoot — matching contacts rather than fractions, because contacts are what an eye reads.

It is also an IPhaseSource, so an upper-body set on a masked layer above can hang off this one's cycle instead of free-running against it.

Fields and properties (7)

  • public MoveSet Set

    The vocabulary being chosen from.

  • public MoveEntry? Current

    What is playing, or before the first query.

  • public MoveEntry? Outgoing

    What is blending out, or when nothing is.

  • public MoveSelection Selection

    What the last selection decided.

  • public float PlaybackRate

    The rate the current move is playing at, from the retime.

  • public PhaseSource Phase

    Where the cycle it is driven by comes from.

  • public float TransitionWeight

    How far through the current transition, in [0, 1]. One when settled.

Methods (6)

  • public MoveSetMotion(MoveSet set, IMoveSelector? selector = null, IMoveScorer? scorer = null, ITransitionPolicy? transitions = null)

    Creates a motion over a set.

  • public bool Ask(in MoveQuery query)

    Asks for a move, re-selecting only if the question changed.

  • public void Invalidate()

    Forces the next Ask to re-select even if the query is unchanged.

  • public bool TryGetPhase(out float phase, out float footPhase)

    Where the cycle is, in [0, 1].

  • public override float Length(AnimationParameters parameters)
  • public override RootMotionDelta Evaluate(in MotionContext context, Span<BoneTransform> destination)

Used by (2)

  • MoveSetTestsVixen.Animation.Tests
  • MoveTransitionTestsVixen.Animation.Tests