Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

arena: fix orbit angle and extend max zoom to 32

Fix orbit calculation to use proper atan2(dx, dz) angle computation for
cam-space XZ plane. The magnitude should stay constant as it rotates.

Extend ZOOM_DISTANCES to [0, 0.5, 1, 1.5, 2, 3, 4.5, 6, 9, 12, 16, 24, 32].

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

+3 -2
+3 -2
system/public/aesthetic.computer/disks/arena.mjs
··· 71 71 // Level 0 = first person. Levels 1..N = third person, pulling the camera back 72 72 // further each click. More close-in steps for shoulder-camera views. 73 73 // Middle-mouse still toggles between 1P and a default 3P. 74 - const ZOOM_DISTANCES = [0, 0.5, 1, 1.5, 2, 3, 4.5, 6, 9, 12, 16]; 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 77 // 🎥 Right-click camera orbit (3P mode only): rotate camera around player ··· 692 692 const dz = cam.z - pCamZ; 693 693 const dist = Math.sqrt(dx * dx + dz * dz); 694 694 if (dist > 0) { 695 - // Compute current angle in XZ plane, add orbit angle, recompute position 695 + // Compute current angle in XZ plane using atan2(X, Z) convention for cam-space 696 696 const baseAngle = Math.atan2(dx, dz); 697 697 const orbitRad = orbitAngle * Math.PI / 180; 698 698 const newAngle = baseAngle + orbitRad; 699 + // Keep the distance constant by using the magnitude of the XZ offset 699 700 const newX = pCamX + dist * Math.sin(newAngle); 700 701 const newZ = pCamZ + dist * Math.cos(newAngle); 701 702 // Track the total change we're making so we can undo it next frame