Vixen
02b45cc4
csharp
public sealed class ProxyShapes

One character's proxy shapes, posed only when something asks for them.

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

Remarks

⚠ Lazy, and that is the second of the three reasons proxy shapes are not physics colliders. A character may carry a hundred of these; a frame typically touches two to six. Posing all of them to serve two goals is a hundred transform compositions per character per frame for nothing, so the stage walks the active goals, collects the shapes their frames name, and poses only those. PosedLastFrame is what makes that claim checkable rather than asserted.

Per-animator, because where a shape is is per-character even though the set is shared. Not thread-safe, for PoseScratch's reason: one of these belongs to one animator.

Fields and properties (6)

  • public ProxyShapeSet Set

    The shapes at full detail.

  • public ProxyShapeSet? Coarse

    The shapes at reduced detail, or for none.

  • public byte Detail

    Which detail level is in force. Zero is the full set.

  • public IProxyShapePoser Poser

    How a shape is placed.

  • public ProxyShapeSet Active

    The set answering right now.

  • public int PosedLastFrame

    How many shapes were actually posed on the last frame.

Methods (6)

  • public ProxyShapes(ProxyShapeSet set, IProxyShapePoser? poser = null)

    Creates a per-character view of a set.

  • public void Frame()

    Starts a frame, and reports what the last one cost.

  • public void Invalidate()

    Forgets where the shapes were, because the pose moved.

  • public bool TryPose(Symbol name, ReadOnlySpan<BoneTransform> model, out ProxyShapePose pose)

    Where a named shape is, posing it if nobody has yet this frame.

  • public bool TryPose(Facet tag, ReadOnlySpan<BoneTransform> model, out ProxyShapePose pose)

    Where the first shape affording something is.

  • public static ProxyShapeSet Coarsen(ProxyShapeSet set, Skeleton skeleton, Symbol key, string? name = null)

    Builds a reduced set: one box per tag group, enclosing every member of it.

Used by (13)

  • CameraSubjectVixen.Animation
  • ConstraintContextVixen.Animation
  • ConstraintGizmosVixen.Animation
  • ConstraintProposalsVixen.Animation
  • ConstraintStackVixen.Animation
  • GizmoTestsVixen.Animation.Tests
  • ProxyShapeAuditVixen.Animation
  • ProxyShapeTestsVixen.Animation.Tests
  • SurfaceFrameVixen.Animation
  • TrajectoryTestsVixen.Animation.Tests
  • VariationHarnessVixen.Animation
  • ProxyShapeDocumentVixen.Editor.AssetEditors
  • ProxyShapeViewVixen.Editor.AssetEditors