The one locomotion cycle: two mirrored steps over a table that gait.js derives from a base (walk or run) and a factor vector. More...
WalkAnim and RunAnim are this with base set. Every angle comes from table, which gait.js derives from the base's authored numbers and the entity's gaitFactors; with no factors the table is the base, and the base is the cycle exactly as it was before the gait model existed - gait.test.js pins that to the digit.
A change of factors lands at the next half-cycle, when the phase that is starting reads its targets; there is no blend, which is how every other activity switch here behaves too.
Beyond the joints the cycle animates one number of its own, lift, the up-and-down of the whole figure; Character adds it to the torso's height. It is zero whenever the cycle is not running.
base : string |
"walk" or "run": whose authored numbers the table starts from.
cycleMs : real |
One full cycle, two steps, in milliseconds.
derivedSpeed : real |
Ground speed that keeps the feet from sliding, from the hip angles, the leg and the cycle length.
factors : var |
The composed factor vector, or null for neutral. Taken from the entity's gaitFactors when it has one.
lift : real |
How far the figure is raised right now, in world units: up to bounce x legHeight at mid-step, zero at contact, and zero whenever the cycle is not running.
strideLength : real |
How far the feet travel in one full cycle.
table : var |
The derived angles and cycle length the phases animate to.