Rigged creatures, animated by the motion library. What This Module Does
reactor_3d_motions.js - the shared motion library: the poses and motions of Forge › 3D Character Builder and the default motions of every rigged humanoid in the game, one source for both. Loaded by the game when a rigged humanoid first needs a motion of its own, and by the editor.
Classes & Namespaces
Design Notes from the Source Code
reactor_3d_motions.js - the shared motion library: the poses and motions of Forge › 3D Character Builder and the default motions of every rigged humanoid in the game, one source for both. Loaded by the game when a rigged humanoid first needs a motion of its own, and by the editor.
RRMotionLibrary.POSES [{ id, label, group }], in the panel's order (GROUPS) RRMotionLibrary.clip(bones, id, body, options) { name, times, tracks: [{ bone, values }], heights, lift, skin, once } or null RRMotionLibrary.stateClip(bones, id) one of STATE_MOTIONS as the game plays it RRMotionLibrary.gameClips(bones, body, set) the clips a saved character carries (GAME_CLIPS) RRMotionLibrary.load() / loadAsync(url) reads the data (reactor_3d_motions.bin beside this file)
(Also RRCharacterPoses, the name the builder knows it by.)
bones is a skeleton at rest: [{ name, parent, head, tail? }], Mixamo's
names (Hips, Spine, Spine1, Spine2, Neck, Head, LeftShoulder, LeftArm,
LeftForeArm, LeftHand and its fingers, LeftUpLeg, LeftLeg, LeftFoot,
LeftToeBase and the right side's), any of them but the arms' and legs'
own optional. body (optional) is the body's skin at rest, { positions,
joints, weights }: the arms then keep out of the trunk as this body is
shaped.
Bones rest unrotated (each one's frame is the world's); the character
faces +z with its left toward +x. A track holds one quaternion per time.
The motions are motion capture (the data, from the CMU Graphics Lab
Motion Capture Database; see reactor_3d_motions.LICENSE.md), some with
authored layers over it: per frame, each mapped bone's frame in the
world, a direction along it and one across it. Each body's own joints
are turned to match them, so a motion holds for any height, limb length
or build; the arms keep out of the body's own trunk, and the hands off
the face. The wrists hang as a hand hangs (the capture's twist kept, its
bend not), the fingers take the pose's hand shapes (HAND_SHAPES),
closing until they meet the palm, the legs keep within their joints'
reach (LEG_RANGE), and the hands (and for a climb the feet) reach where
the pose's aim sets them on this body: a gun on the eye's line, a rifle
in the shoulder, both hands on one hilt, rungs and holds. lift(t) is
how far the whole body stands off its rest height at time t: worked out
by following the skeleton joint by joint, so the lowest heel, ball or
toe touches the floor, and for a jump, a flip or a run's flight the
capture's own height off it added, in leg lengths. A pose resting the
body itself on the floor (sitting, kneeling, lying) says skin; a
motion that plays once (a fall, a flip, a throw) says once.
View reactor_3d_motions.js on GitHub · Hide internal (_) functions