Click or drag to resize
DigitalRuneSkeletonMapper Class
Controls the bone transforms of a SkeletonPose to resemble the posture of another SkeletonPose.
Inheritance Hierarchy
SystemObject
  DigitalRune.Animation.CharacterSkeletonMapper

Namespace: DigitalRune.Animation.Character
Assembly: DigitalRune.Animation (in DigitalRune.Animation.dll) Version: 1.4.0.0 (1.4.1.14427)
Syntax
public class SkeletonMapper

The SkeletonMapper type exposes the following members.

Constructors
  NameDescription
Public methodSkeletonMapper
Initializes a new instance of the SkeletonMapper class.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodMapAToB
Modifies the second skeleton pose to match the first skeleton pose.
Public methodMapBToA
Modifies the first skeleton pose to match the second skeleton pose.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyBoneMappers
Gets the bone mappers.
Public propertyRotationOffset
Gets or sets the rotation offset between SkeletonPoseA and SkeletonPoseB. (This a rotation that transforms rotations from model A space to model B space.)
Public propertySkeletonPoseA
Gets or sets the first skeleton pose.
Public propertySkeletonPoseB
Gets or sets the second skeleton pose.
Top
Remarks

Skeleton mapping is mainly used for two reasons:

  • Ragdoll Mapping: A high detail skeleton (e.g. 60 bones) is mapped to a low detail skeleton (e.g. 15 bones). The high detail skeleton controls a visual character model. The low detail skeleton creates a ragdoll.
  • Motion Retargeting: The animations of one character should be applied to another character that uses a different skeleton.

To use a skeleton mapper, set the two skeleton poses (SkeletonPoseA and SkeletonPoseB). If the skeletons use different model space (e.g. different forward or up directions), RotationOffset must be set. Then BoneMappers must be added to the BoneMappers collection. A bone is only mapped if a BoneMapper for this bone is added to the skeleton mapper.

In most cases, the order of the bone mappers in the BoneMappers collection is relevant. It is recommended to map parent bones before their child bones.

After the bone mappers are defined, MapAToB or MapBToA can be called to map the bone transforms of one skeleton to the other skeleton.

See Also