IKSolver Class |
Namespace: DigitalRune.Animation.Character
The IKSolver type exposes the following members.
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnInvalidate |
Called when the SkeletonPose was exchanged.
| |
OnSolve |
Called when Solve(Single) is called.
| |
Solve |
Modifies the SkeletonPose to reach the Target position.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
MaxAngularVelocity |
Gets or sets the maximal angular velocity per bone.
| |
SkeletonPose |
Gets or sets the skeleton pose.
| |
Target |
Gets or sets the target position in model space.
| |
Weight |
Gets or sets the weight.
|
Name | Description | |
---|---|---|
IAnimatableObjectGetAnimatablePropertyT |
Gets the property with given name and type which can be animated.
| |
IAnimatableObjectGetAnimatedProperties |
Gets the properties which are currently being animated.
| |
INamedObjectName |
Not implemented.
|
An inverse kinematics (IK) solver transforms the bones of a skeleton in order to achieve a desired pose. For instance, a LookAtIKSolver rotates a bone (e.g. a head) to look into a desired direction. A TwoJointIKSolver can be used to bend/stretch a leg so that it touches the ground, or to make an arm reach a certain target.
An IKSolver instances modifies a SkeletonPose instance. And the goal is to point to or reach the Target position. The solver works in model space - not in world space. Therefore, Target and other positions and orientations must be specified in model space.
If Solve(Single) is called and MaxAngularVelocity is PositiveInfinity (default), the SkeletonPose is changed instantly. To avoid this instantaneous change, a MaxAngularVelocity limit can be set, then the bones will rotate slowly to the target pose over several Solve(Single) calls. MaxAngularVelocity defines the maximal rotation velocity for each bone. (However, limiting MaxAngularVelocity is not ideal if the model is also animated, because the animation might reset the previous IK pose.)
The solver also has a Weight parameter. If the weight is 0, the solver is disabled. If the weight is 1, the solver tries its best to make the skeleton reach the target. A weight less than 1 can be used to blend the target skeleton pose with the unmodified skeleton pose.
Note that the IKSolver implements IAnimatableObject which means that it has properties which can be animated: The only property that can be animated is the Weight, the other properties are not animatable. Animating the weight can be useful to fade an IK pose in or out.