duck's head should align with movement direction
- SHA
adccf1a30ed06bb6836bf9f0f4f32e7623cf061b- Parents
-
a782e54 - Tree
e2c0d48
adccf1a
adccf1a30ed06bb6836bf9f0f4f32e7623cf061ba782e54
e2c0d48| Status | File | + | - |
|---|---|---|---|
| M |
src/renderers/three/duck.js
|
2 | 1 |
src/renderers/three/duck.jsmodified@@ -278,7 +278,8 @@ export function createDoug(scene, gradientMap) { | |||
| 278 | group.position.y = Math.sin(elapsed * 2) * 0.03 | 278 | group.position.y = Math.sin(elapsed * 2) * 0.03 |
| 279 | 279 | ||
| 280 | // Rotation (face direction of movement) | 280 | // Rotation (face direction of movement) |
| 281 | - group.rotation.y = state.rotation | 281 | + // Duck model faces +X locally, so offset by -PI/2 to align with movement |
| 282 | + group.rotation.y = state.rotation - Math.PI / 2 | ||
| 282 | 283 | ||
| 283 | // Body wobble while swimming | 284 | // Body wobble while swimming |
| 284 | const wobbleAmount = Math.sin(state.wobble) * 0.08 | 285 | const wobbleAmount = Math.sin(state.wobble) * 0.08 |