Vixen
02b45cc4
csharp
public sealed class PoseScratch

The temporary poses a blend needs, rented and returned instead of allocated.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Evaluating a tree of motions needs a buffer per child being blended, and the depth of the tree decides how many are alive at once. Allocating them is a hundred joints × forty bytes × however many children, every frame, per character — which is the shape of garbage that does not show up in a profile as one thing and does show up as a collection pause.

A stack rather than a general pool, because the lifetimes are strictly nested: a node rents what it needs, evaluates its children, blends, and returns. Rent hands out a buffer and Dispose puts it back, so using is what enforces the nesting and a node that forgets is a leak of one array rather than a corrupted pose.

Not thread-safe, and deliberately so: one of these belongs to one animator, and two characters animating in parallel have one each. Sharing would need a lock in the innermost loop of the system to save an array per character.

Fields and properties (2)

  • public int JointCount

    How many joints each buffer holds.

  • public int Capacity

    How many buffers have ever been needed at once.

Methods (2)

  • public PoseScratch(int jointCount)

    Creates a pool for poses of a given skeleton.

  • public PoseScratch.Lease Rent()

    Takes a buffer.

Used by (13)

  • AnimationLayerVixen.Animation
  • AnimatorVixen.Animation
  • BlendEvaluatorVixen.Animation
  • BlendTreeTestsVixen.Animation.Tests
  • LeaseVixen.Animation
  • MotionContextVixen.Animation
  • MoveSetMotionVixen.Animation
  • MoveSetTestsVixen.Animation.Tests
  • MoveTransitionTestsVixen.Animation.Tests
  • PoseBlendTestsVixen.Animation.Tests
  • StateMachineInstanceVixen.Animation
  • StateMachineTestsVixen.Animation.Tests
  • AnimationGraphCompilerVixen.Editor.AnimationGraph