feat: add subtle full-body sheep walking motion

This commit is contained in:
2026-11-02 16:49:37 +09:00
parent 0a05c94ce1
commit 4b27a8c209
5 changed files with 103 additions and 11 deletions
+10
View File
@@ -11,6 +11,7 @@ import { Vector3 } from 'three';
test('idle breathing carries the coat and hood without lifting the feet or changing the umbrella grip', async () => {
const [model, umbrella, raincoat] = await Promise.all(['red-sheep', 'umbrella', 'raincoat'].map(asset));
raincoat.name = 'TestRaincoat';
const sheep = createSheep(model, { umbrella, raincoat });
sheep.setEquipment(true, true, true);
const body = model.getObjectByName('Body')!, head = model.getObjectByName('Head')!;
@@ -26,6 +27,15 @@ test('idle breathing carries the coat and hood without lifting the feet or chang
sheep.pose('idle', 0, false, 2);
assert.ok(arm.quaternion.angleTo(grip) < 1e-8);
assert.ok(foot.getWorldPosition(new Vector3()).distanceTo(footPosition) < 1e-8);
const remote = sheep.clone();
remote.pose('idle', 0, false, 0);
remote.pose('idle', 0, false, 1);
const remoteCoat = remote.group.getObjectByName('TestRaincoat')!;
const remoteCoatPosition = remoteCoat.position.clone();
sheep.pose('idle', 0, true, 3);
remote.pose('idle', 0, false, 1);
assert.deepEqual(remoteCoat.position, remoteCoatPosition, 'local walking cannot change a remote coat pivot');
remote.dispose();
sheep.dispose();
});