Vixen
02b45cc4
csharp
public readonly record struct ConstraintGizmoStyle

What the gizmo pass draws, and how far off counts as bad.

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

Remarks

⚠ Tolerance is what turns a number into a colour, and it is per project rather than per goal: two centimetres is a miss on a hand and nothing at all on a hip, but an author scanning a viewport needs one scale to read, not one per goal kind.

⚠ default is a quiet style, not the usual one, and the difference cost a round of failing tests. A struct's property initialisers do not run for default, so a zeroed style has every flag off — and a zero tolerance would have graded every goal fully red. The numbers read their zero as "use the usual value"; the flags cannot, so zeroed means chains, shapes and labels off, leaving only the misses. That is a real style somebody would want, which is the only reason it is allowed to be the zero one.

Fields and properties (11)

  • public const float DefaultTolerance

    How far off a hand may be before an author would call it wrong, in metres.

  • public const float DefaultAngularTolerance

    The same question for a rotation, in degrees.

  • public const float DefaultSize

    How big a frame's axes are drawn, in metres.

  • public static ConstraintGizmoStyle Default

    Everything on, two centimetres and two degrees.

  • public float Tolerance

    How far off a position goal may be before the line reads as red, in metres. Zero means DefaultTolerance.

  • public float AngularTolerance

    How far off an angular goal may be before the line reads as red, in radians. Zero means DefaultAngularTolerance.

  • public float Size

    How big the frame axes and effector crosses are, in metres. Zero means the usual.

  • public bool Chains

    Whether the joints a goal is allowed to move are drawn.

  • public bool Shapes

    Whether the proxy shape a surface goal lives on is drawn.

  • public bool Readout

    Whether each goal is labelled with what it is and how far off it is.

  • public float Extent

    How big a frame's axes are, with a zeroed style answering the usual size.

Methods (2)

  • public ConstraintGizmoStyle()

    Creates the usual style.

  • public float Severity(in ConstraintResidual residual)

    How bad a residual is, in [0, 1], against whichever tolerance applies.

Used by (3)

  • ConstraintGizmoSystemVixen.Animation
  • ConstraintGizmosVixen.Animation
  • GizmoTestsVixen.Animation.Tests