Interface IRootMotionClipOptions
characterNode?: TransformNode;
cloneAnimations?: boolean;
contactNodes?: any[];
directionSnapAngle?: number;
extractLateralMotion?: boolean;
extractRotation?: boolean;
minimumTravel?: number;
minimumTurn?: number;
name?: string;
rootNode?: any;
samplesPerSecond?: number;
source?: RootMotionSource;
upAxis?: Vector3;
}
Properties
Optionalcharacter Node
The node that receives the motion and whose local space the motion is measured in. Defaults to the topmost ancestor of the root node (the "root" node of a glTF asset). The group must not animate its position or rotation, since the motion applied to it would be overwritten.
Optionalclone Animations
Whether every animation is cloned into the in-place animation group. By default (false) only the root channels the extraction rewrites are cloned, and the animations it leaves untouched are shared with the source group, as AnimationGroup.clone shares them. Set it to true before changing the in-place group's animations in place
- with AnimationGroup.MakeAnimationAdditive or AnimationGroup.normalize for example - so the source group's animations are not changed with them.
Optionalcontact Nodes
The nodes that touch the ground, used when the root does not travel. A bone is resolved to its linked transform node. Defaults to the leaf nodes under the root that come closest to the ground during the clip.
Optionaldirection Snap Angle
A straight clip whose direction of travel is within this angle of a character space axis, in radians, travels along that axis; 0 keeps the measured direction. Ignored when lateral motion is extracted.
By default a root clip keeps its direction (0): its travel is authored or captured, and a deliberate veer is data. Travel deduced from contacts snaps within 10 degrees: an in-place clip is meant to travel straight, and the deduced direction is an estimate - Xbot's run deduces 3.5 degrees off straight from feet that slide 1 degree off.
Optionalextract Lateral Motion
When false (the default) only the travel along the clip's direction of travel is extracted, leaving the side-to-side sway of the root in the animation. Set to true to extract all horizontal motion, for strafing clips. Turning clips always extract all horizontal motion, since their direction of travel changes.
Optionalextract Rotation
Whether the root's turning about the up axis is extracted and applied to the character. By default it is when a cycle leaves the character facing at least IRootMotionClipOptions.minimumTurn away from where it started, so a walk's hip twist - or a dance that spins round to face the front again - stays in the pose while a turning clip turns the character.
Optionalminimum Travel
Travel below this share of the character's height over a cycle is treated as the clip standing still: root sway rather than root motion. Default is 0.1.
Optionalminimum Turn
Turning below this angle over a cycle, in radians, is treated as twist rather than a turn. Default is 10 degrees.
Optionalname
The name of the in-place animation group. Defaults to the source group's name followed by " (in place)".
Optionalroot Node
The root node, usually the hips or a dedicated root bone, whose own travel is tried first. A bone is resolved to its linked transform node. Defaults to the position-animated node with the most animated descendants in the group. A node the group does not animate is accepted as the base of the animated hierarchy: the travel then comes from the contact nodes under it, and RootMotionSource.Root cannot be forced.
Optionalsamples Per Second
How densely the clip is sampled during analysis. Default is 60 samples per second of animation.
Optionalsource
Forces the source of the travel instead of trying RootMotionSource.Root first and falling back to RootMotionSource.FootContact.
Optionalup Axis
The up axis in character space. Default is +Y.
Options for RootMotionClip.