Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

arena: decouple player rotation from camera rotation

Introduce playerFacing as independent state. During normal camera look-around,
playerFacing tracks cam.rotY. During right-click orbit, playerFacing stays
frozen so the player body doesn't spin.

This allows the camera to swivel freely around a stationary player during
orbit, enabling true freelook without player model rotation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+10 -2
+10 -2
system/public/aesthetic.computer/disks/arena.mjs
··· 74 74 const ZOOM_DISTANCES = [0, 0.5, 1, 1.5, 2, 3, 4.5, 6, 9, 12, 16, 24, 32]; 75 75 let zoomLevel = 2; // Start at 1 unit back (shoulder camera) 76 76 77 + // 🎥 Player facing direction (decoupled from camera rotation) 78 + let playerFacing = 0; // Player body Y rotation (degrees), independent from camera 79 + 77 80 // 🎥 Right-click camera orbit (3P mode only): rotate camera around player 78 81 // without changing player body rotation. Orbits by modifying XZ offset. 79 82 let orbitAngle = 0; // extra Y rotation for camera only (degrees) ··· 623 626 plumbLine.scale[1] = Math.max(0, playerWorldY - GROUND_Y - 0.02); 624 627 } 625 628 629 + // Update player facing direction (camera rotY when not orbiting) 630 + if (!orbiting) { 631 + playerFacing = cam.rotY; 632 + } 633 + 626 634 if (bodyFeet) { 627 635 const footBaseY = playerAlive 628 636 ? GROUND_Y ··· 630 638 bodyFeet.position[0] = playerCamX; 631 639 bodyFeet.position[1] = footBaseY; 632 640 bodyFeet.position[2] = playerCamZ; 633 - bodyFeet.rotation[1] = cam.rotY; 641 + bodyFeet.rotation[1] = playerFacing; 634 642 } 635 643 if (bodyArms) { 636 644 const crouchDrop = (phys?.crouch ?? 0) * 0.2; ··· 638 646 bodyArms.position[0] = playerCamX; 639 647 bodyArms.position[1] = playerWorldY - crouchDrop + bob; 640 648 bodyArms.position[2] = playerCamZ; 641 - bodyArms.rotation[1] = cam.rotY; 649 + bodyArms.rotation[1] = playerFacing; 642 650 } 643 651 644 652 // 🐛 Once-per-second debug dump. Paste this back into chat to diagnose.