Vixen
02b45cc4
csharp
public sealed class ConstraintGizmoSystem

Puts the constraint gizmos in whatever viewport is drawing debug geometry.

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

As a system

Phase
LateUpdate

Remarks

The editor's answer to "the viewport draws the goal", and a game's answer to "why is his hand through the wall on this one machine". One system, off by default, that walks the animators carrying a ConstraintStack and asks ConstraintGizmos to draw what the last solve did.

⚠ In LateUpdate, after the poses exist. Running it in the animation phase would race the very solve it is trying to show — half the characters would be drawn against this frame's answer and half against last frame's, depending on where the scheduler put them.

⚠ Only is the field that makes this usable. A scene of thirty constrained characters is a thousand lines and nothing legible; an author debugging one interaction wants one character. Left unset it draws all of them, which is right for a screenshot and wrong for everything else.

Fields and properties (6)

  • public SystemAccess Access

    What this system reads and writes.

  • public bool Enabled

    Whether anything is drawn at all.

  • public Entity? Only

    The one character to draw, or for every one of them.

  • public ConstraintGizmoStyle Style

    What to draw and what counts as a miss.

  • public bool AllShapes

    Whether every proxy shape is drawn, and not only the ones a goal is anchored to.

  • public int LastDrawnCount

    How many stacks the last run drew.

Methods (3)

  • public ConstraintGizmoSystem(DebugDraw draw)

    Puts the constraint gizmos in whatever viewport is drawing debug geometry.

  • public override JobHandle Update(in SystemContext context, JobHandle dependency)

    Runs the system.

  • public void Run(World world)

    Draws every constrained character in a world.

Used by (2)

  • AnimationSystemsVixen.Animation
  • GizmoTestsVixen.Animation.Tests