How a character walks and runs: a named preset, thirteen factors, or both. More...
| Import Statement: | import Clayground.Character3D |
Every factor is 1 (the multiplicative ones) or 0 (the additive ones) at neutral, and a neutral Gait is the walk and run the framework always had. A preset is a factor vector chosen by name; the factors set here compose with it rather than replace it, so this
Character { gait: Gait { preset: "elderly"; tempo: 1.2 } }
is "elderly, a fifth quicker" and reads that way. The result composes once more, on the character, with what its build and its emotion say - see Character::gaitFactors.
Amplitudes are expressive rather than measured, and clamped: no combination of preset, factors, build and mood folds a knee backwards or stops the legs.
See also Character::gait, Character::gaitFactors, and ParametricCharacter.
armForward : real |
Degrees the whole arm swing is carried ahead of the body: more reach in front, less behind, the same amplitude. Bent elbows plus this is fists pumping before the chest.
armOut : real |
How far the upper arms are carried out from the ribs, in degrees. 0 hangs them against the body.
Held through the cycle rather than alternating with it - a carriage, not a movement - and signed by the side, so both arms go outward. It is what separates a walk with somewhere to be from one ready to hit something, and it only reads head-on: a profile cannot see it.
armSwing : real |
Arm swing amplitude. 1 is as authored, 0 hangs the arms.
bounce : real |
How high the whole figure rises at mid-step, as a fraction of leg height. 0 is flat, 0.05 is a visible spring, 0.1 the cap.
elbow : real |
Elbow bend in degrees on top of the cycle's own (a walk bends 10, a run 70). Bent elbows with a quick tempo read as fists pumping.
factors : var |
The preset and the factors above composed into one clamped factor vector - this object's whole contribution to a gait.
headPitch : real |
Head pitch in degrees. Positive looks down, negative lifts the chin.
kneeLift : real |
Knee lift. 1 is as authored; below it drags the feet, above it high-steps. The foot angles follow it.
lean : real |
Torso pitch in degrees on top of the cycle's own. Positive leans forward (a slump, a charge), negative back (chest out). Bends at the waist: the hip counters it, so the legs stay planted and only belly, chest, head and arms tip. It is shared between the two trunk segments and brings a little curve with it; spineCurve asks for more.
preset : string |
A gait by name, or empty for none.
Shipped: neutral, cheerful, dejected, furious, elderly, toddler, heavy, sneak, proud, march. The first three are exactly what the emotions of the same mood do to a walk, so a preset and a setEmotion() cannot disagree. A name that is not in the list does nothing and clears presetKnown.
presetKnown : bool |
False while preset names something the table does not have.
presetNames : list |
Every name preset accepts, for a picker.
rock : real |
Torso roll in degrees over the planted leg, alternating with the step - the side-to-side shift of weight. 0 is none.
spineCurve : real |
How round the back is, in degrees: the angle between belly and chest at the waist joint. Positive rounds it forward (sad, elderly, sneaking), negative arches it and lifts the chest (proud, marching).
Differential, not a tilt: it bends the belly back by as much as it bends the chest forward, so it changes the SHAPE of the trunk without moving where the head ends up. That is lean's job, and the two are meant to be used together - a slump is both.
stride : real |
How far the legs swing. 1 is as authored; below it shortens the step and the speed with it.
sway : real |
Hip yaw in degrees, alternating with the step, the torso countering by half. 0 is none.
tempo : real |
Cadence. 1 is as authored; 1.2 takes steps a fifth quicker and covers ground a fifth faster, since speed follows the feet.