public sealed class ConstraintStackEvery goal one character is under, resolved, arbitrated and applied to the pose after the layers have been mixed.
Remarks
An IPoseProcessor, because that hook already exists and already argues for itself. It runs after the layer mix and before skinning, with a model-space scratch buffer — which is exactly where a correction to the blended pose belongs, and is where the three existing IK solvers already are. They keep working beside this one, in whatever order the list gives.
Stateful, and one per character. That is not an implementation detail: every visible failure of a constraint system is a discontinuity, and almost all of them come from a goal appearing or disappearing between frames. A goal that becomes resolvable eases in from where the effector actually is; one that stops resolving — the entity unbound, the detail level dropped it, the clip blended out — eases out towards the animated pose using the last frame it saw, and does not vanish. Reset clears all of it, for a teleport or a cut, where continuity is wrong.
⚠ Its temporal state and its published pose are reachable from outside, on purpose. A scheduler that solves several characters together has to be able to read what each one is under and write what each one settled at, and a type whose state was private to itself could not have hosted that. This is the part of the shape that had to be decided before anything else depended on it.
Fields and properties (22)
public Skeleton SkeletonThe skeleton being corrected.
public IConstraintArbiter ArbiterHow conflicts resolve.
public IChainSolver SolverHow a chain is moved.
public ConstraintBindings BindingsWho the other parties are.
public BoneTransform WorldTransformWhere the character is, for bringing a world-space frame into the pose's space.
public byte LodWhich detail level is in force. Zero is the highest.
public int SolveEverySolve every n-th frame, holding the previous correction in between.
public float ImportanceHow much this character matters, for a governor deciding what to spend.
public int EstimatedCostRoughly what a full solve costs, in goals.
public bool WasHeldWhether the last frame held the previous correction rather than solving.
public BoneTransform RootSuggestionWhere the character should stand, if anything asked.
public bool HasRootSuggestionWhether anything asked the character to stand somewhere else.
public ProxyShapes? ShapesThe body's proxy shapes, or if it has none.
public AttachmentSockets SocketsThe character's own attachment points.
public ConstraintTagBuffer? TagsWhere a clip's live constraints are read from, or for none.
public int LastAppliedCountHow many goals the last solve actually applied.
public ReadOnlySpan<ResolvedGoal> LastSolvedThe goals the last solve resolved, in the order the arbiter saw them.
public ReadOnlySpan<ConstraintResidual> LastResidualsHow far off each of those ended up, in the same order.
public bool ScheduledWhether a scheduler has claimed this stack for a group solve, so the animator's own processor pass leaves it alone.
public Animator? OwnerThe animator this stack was found on, once a system has gathered it.
public ReadOnlySpan<BoneTransform> PublishedThe pose a grouped pre-evaluation solve settled on, if one ran this frame.
public bool HasPublishedWhether anything published this frame.
Methods (14)
public ConstraintStack(Skeleton skeleton, IConstraintArbiter? arbiter = null, IChainSolver? solver = null)Creates a stack for a character.
public ConstraintHandle Add(ConstraintGoal goal)Adds a goal.
public void Suppress(Symbol label, float weight)Turns a label down, or off.
public void Suppress(string label, float weight)Turns a label down, or off.
public void Release(Symbol label)Gives a label back.
public float Suppression(Symbol label)How much of a label survives.
public ConstraintStack.ActiveHandles Active(Symbol label = default(Symbol))The handles wearing a label.
public ConstraintResidual Residual(ConstraintTrack track, int index)How far off a clip's tag ended up, as of the last solve.
public void Reset()Forgets every goal's history. For a teleport or a cut.
public void Publish(ReadOnlySpan<BoneTransform> pose)Publishes a pose for the other members of a group to read.
public void Unpublish()Forgets the published pose. Called at the end of the frame that produced it.
public void Process(Animator animator, Span<BoneTransform> pose, Span<BoneTransform> model)public void Solve(Span<BoneTransform> pose, float deltaTime, ConstraintGroup group = default(ConstraintGroup))Corrects a pose, using the stack's own model-space buffer.
public void Solve(Span<BoneTransform> pose, Span<BoneTransform> model, float deltaTime, ConstraintGroup group = default(ConstraintGroup))Corrects a pose.
Used by (24)
- ConstraintStageBenchmarksVixen.Benchmarks.Animation
- AnimationSystemVixen.Animation
- CameraConstraintsVixen.Animation
- ConstraintGizmoSystemVixen.Animation
- ConstraintGizmosVixen.Animation
- ConstraintGovernorVixen.Animation
- ConstraintGroupVixen.Animation
- ConstraintHandleVixen.Animation
- ConstraintStageTestsVixen.Animation.Tests
- ConstraintTestsVixen.Animation.Tests
- DefaultConstraintSchedulerVixen.Animation
- FootPlacementPresetVixen.Animation
- GizmoTestsVixen.Animation.Tests
- GroupSinkVixen.Animation
- IConstraintGroupSinkVixen.Animation
- IConstraintSchedulerVixen.Animation
- JointLimitTestsVixen.Animation.Tests
- OneGroupTestSchedulerVixen.Animation.Tests
- PlacementTestsVixen.Animation.Tests
- PlaybackVixen.Animation
- ProxyShapeTestsVixen.Animation.Tests
- SeamTestsVixen.Animation.Tests
- TrajectoryTestsVixen.Animation.Tests
- VariationHarnessVixen.Animation