feat(actors): build articulated dog v2
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user