1
0

feat(actors): build articulated dog v2

This commit is contained in:
2026-08-19 03:07:40 -07:00
parent 264daaab61
commit 20deae2a0f
9 changed files with 615 additions and 104 deletions
+11 -8
View File
@@ -17,9 +17,9 @@ import {
disposeCrow,
disposeDog,
disposeHumanoid,
dogPoseStateForSpeed,
poseCrowFlight,
poseDogAttention,
poseDogWalk,
poseDog,
poseHumanoid,
type CrowRig,
type DogRig,
@@ -208,12 +208,15 @@ function animateActor(
stride: THREE.MathUtils.clamp(speed / 3.2, 0, 0.68),
});
} else if (visual.kind === "dog") {
poseDogWalk(
visual.rig,
seconds * Math.max(1.4, speed * 7.2),
THREE.MathUtils.clamp(speed / 4, 0, 0.68),
);
poseDogAttention(visual.rig, 0, seconds * 5);
const state = dogPoseStateForSpeed(speed);
const turn = THREE.MathUtils.clamp(sample.velocity.yawDegPerSec / 160, -1, 1);
poseDog(visual.rig, {
state,
phase: seconds * Math.max(1.4, speed * 7.2),
amount: state === "idle" ? 1 : THREE.MathUtils.clamp(0.38 + speed / 4.2, 0.38, 1),
turn,
attentionYaw: -turn * 0.08,
});
} else {
poseCrowFlight(
visual.rig,