Vixen
02b45cc4
csharp
public sealed class SkeletonPose

One skeleton, posed: a local transform per joint, and the two derived forms anything outside this assembly asks for.

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

Remarks

Local space is the only space stored. Everything that composes — a clip, a blend, a layer, a mask — is defined joint by joint against the parent, and converting to model space is a forward pass that costs one multiply per joint. Storing model space instead would make every blend wrong: interpolating two model-space poses stretches the bones between the joints, which is the artefact that makes a naïve crossfade look like rubber.

One allocation, reused. A pose is per character and per frame, and there are several of them alive at once — the layer stack alone needs a scratch pose per layer. The array is allocated when the pose is created and never again; the operations take and return spans so that none of them can allocate either.

Fields and properties (5)

  • public Skeleton Skeleton

    The skeleton this poses.

  • public int JointCount

    How many joints it holds.

  • public Span<BoneTransform> Bones

    The local transforms, in joint order, writable in place.

  • public ReadOnlySpan<BoneTransform> ReadBones

    The local transforms, in joint order.

  • public ref BoneTransform this[int joint]

    One joint's local transform, writable in place.

Methods (8)

  • public SkeletonPose(Skeleton skeleton)

    Creates a pose for a skeleton, in its bind pose.

  • public void ResetToBindPose()

    Puts every joint back where the artist modelled it.

  • public void CopyFrom(SkeletonPose source)

    Copies another pose of the same skeleton over this one.

  • public void CopyFrom(ReadOnlySpan<BoneTransform> source)

    Copies raw joint transforms over this pose.

  • public void ComputeModelSpace(Span<BoneTransform> destination)

    Composes every joint's transform relative to the model's origin.

  • public static void ComputeModelSpace(Skeleton skeleton, ReadOnlySpan<BoneTransform> local, Span<BoneTransform> destination)

    Composes joint transforms relative to the model's origin.

  • public static void ComputeLocalSpace(Skeleton skeleton, ReadOnlySpan<BoneTransform> model, Span<BoneTransform> destination)

    Undoes ComputeModelSpace: model-space transforms back to local ones.

  • public void ComputeSkinningMatrices(Span<Matrix4x4> destination, Span<BoneTransform> scratch = default(Span<BoneTransform>))

    The bone palette GPU skinning reads: inverseBindPose * jointModelSpace, one matrix per joint.

Used by (36)

  • AnimatorVixen.Animation
  • AnimatorTestsVixen.Animation.Tests
  • AuthoringTestsVixen.Animation.Tests
  • ConstraintGizmoSystemVixen.Animation
  • ConstraintProposalsVixen.Animation
  • ConstraintStackVixen.Animation
  • ConstraintTestsVixen.Animation.Tests
  • DefaultChainSolverVixen.Animation
  • DefaultConstraintArbiterVixen.Animation
  • FootPlacementVixen.Animation
  • FootPlacementPresetVixen.Animation
  • GizmoTestsVixen.Animation.Tests
  • GroupSinkVixen.Animation
  • HarnessTestsVixen.Animation.Tests
  • IkTestsVixen.Animation.Tests
  • JointLimitTestsVixen.Animation.Tests
  • LookAtIkVixen.Animation
  • NetworkBonesApplySystemVixen.Net.Animation
  • NetworkBonesCaptureSystemVixen.Net.Animation
  • PlacementTestsVixen.Animation.Tests
  • ProxyShapeAuditVixen.Animation
  • ProxyShapeTestsVixen.Animation.Tests
  • RetargetingTestsVixen.Animation.Tests
  • SkeletonRetargetVixen.Animation
  • SkeletonTestsVixen.Animation.Tests
  • TeleportingTestSolverVixen.Animation.Tests
  • TestBodyVixen.Animation.Tests
  • TestBodyVixen.Animation.Tests
  • TestRailVixen.Animation.Tests
  • TestRigsVixen.Animation.Tests
  • TrajectoryTestsVixen.Animation.Tests
  • TwoBoneIkVixen.Animation
  • VariationHarnessVixen.Animation
  • WeightedTestArbiterVixen.Animation.Tests
  • ProxyShapeGizmoTargetVixen.Editor.AssetEditors
  • ProxyShapeViewVixen.Editor.AssetEditors