animations

This commit is contained in:
ryanfitzpatrickio
2026-08-03 19:20:00 -05:00
parent fb1ebeed05
commit afd764e5e7
22 changed files with 2049 additions and 212 deletions
+70
View File
@@ -285,6 +285,76 @@ export function posePass(P, { phase = 0, aim = 0 }) {
E(P.q.handL, -0.1, 0, -0.12);
}
/**
* Stick spread (RB hold): dominant arm drives the blade on a *frontal* cone —
* centre is out in front of the chest, Skill Stick X (`waggle` 1..1) sweeps
* left↔right up to ±90°. Never behind the hips. Non-dominant arm is off the
* shaft, out to the side in a ready stance. Slight crouch.
*
* Authored for a right shot (top hand R). Left shots mirror.
*/
export function poseSpread(P, { waggle = 0, phase = 1 } = {}) {
const w = clamp(phase, 0, 1);
// Skill Stick +X = screen-right. Match the stick target's sign flip so the
// arm and blade travel the same way (see skateAnimator SPREAD_ARC).
const a = -clamp(waggle, -1, 1);
const ang = a * (Math.PI / 2);
const fwd = Math.cos(ang); // 1 centre, 0 at full left/right
const lat = Math.sin(ang); // body-right after the stick-sign flip
// Bone space: +Y twist that opens the right arm across the body is opposite
// of body-right, so lateral into the arm uses lat.
const side = -lat;
// Sit into it — eyes up the ice; torso opens with the lateral sweep only.
E(P.q.spine1, 0.1 * w, -0.04 * w + side * 0.12, 0);
E(P.q.spine2, 0.12 * w, -0.05 * w + side * 0.14, 0);
E(P.q.spine3, 0.08 * w, -0.04 * w + side * 0.12, 0);
E(P.q.neck, -0.08 * w, 0.06 * w - side * 0.14, 0);
E(P.q.head, -0.06 * w, 0.06 * w - side * 0.16, 0);
// Dominant (right) arm: extended low. Centre = straight out in front;
// full stick swings the arm across the body front to each side (not
// forward/back along the midline).
E(P.q.clavicleR, 0.04 * w, -0.06 * w + side * 0.22, 0.05 * w);
E(
P.q.upperArmR,
// Pitch: reach low toward the ice; a bit more extended when out front.
lerp(-0.42, -0.28, w) - fwd * 0.12,
// Yaw: centre ≈ forward of the shoulder; lat swings ±90° in front.
lerp(0.42, 0.12, w) + side * 1.05,
lerp(0.68, 0.0, w) + Math.abs(lat) * 0.1,
);
E(
P.q.forearmR,
lerp(-1.35, -0.2, w) - fwd * 0.08,
lerp(0.02, 0.04, w) + side * 0.25,
lerp(0.32, 0.0, w),
);
E(
P.q.handR,
lerp(-0.12, -0.2, w),
lerp(0.12, 0.0, w) + side * 0.22,
lerp(0.04, 0.06, w),
);
// Non-dominant (left) arm: detached, out to the side and slightly forward —
// ready stance, does not follow the waggle.
E(P.q.clavicleL, 0.05 * w, 0.12 * w, -0.06);
E(
P.q.upperArmL,
lerp(-0.38, -0.26, w),
lerp(0.1, 0.68, w), // open wide to the left
lerp(-0.48, 0.55, w), // rolled out, clear of the shaft
);
E(
P.q.forearmL,
lerp(-1.32, -0.92, w),
-0.05,
lerp(0.18, -0.14, w),
);
E(P.q.handL, -0.05, 0.04, 0.02);
}
/**
* Poke check: a stab. One hand, the whole arm extending forward with the body
* reaching after it, back almost as fast as it went out.