Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

arena: orbit angle persists until left-click

Remove auto-decay of orbitAngle. After right-click orbit is released, the
camera stays at that angle. Only resets to 0 when the user left-clicks.

Allows holding a freelook angle without the camera snapping back.

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

+10 -4
+10 -4
system/public/aesthetic.computer/disks/arena.mjs
··· 83 83 let orbiting = false; // currently dragging with right button 84 84 let appliedOrbitOffset = [0, 0]; // track X,Z offset we applied so we can undo it 85 85 let baseRotY = 0; // cam.rotY when orbit started, to prevent player spinning 86 + let orbitSnapped = false; // true if orbit was released; reset on next left-click 86 87 87 88 function applyZoom(doll) { 88 89 if (!doll) return; ··· 688 689 689 690 // 🎥 Camera orbit effect (3P mode only): rotate camera around player by 690 691 // modifying the XZ offset without changing cam.rotY (so player body stays put). 691 - if (!orbiting) { 692 - orbitAngle *= 0.85; // decay back to 0 on release 693 - if (Math.abs(orbitAngle) < 0.5) orbitAngle = 0; 694 - } 692 + // Orbit angle persists after release until left-click is pressed. 695 693 696 694 if (zoomLevel > 0 && Math.abs(orbitAngle) > 0.01) { 697 695 const pCamX = phys?.playerCamX ?? cam.x; ··· 969 967 if (e.is("touch") && e.button === 2 && cam) { 970 968 orbiting = true; 971 969 baseRotY = cam.rotY; // lock player rotation to current heading 970 + orbitSnapped = false; // start orbiting fresh 972 971 } else if (e.is("lift") && e.button === 2) { 973 972 orbiting = false; 973 + orbitSnapped = true; // mark that orbit was released; wait for left-click to reset 974 974 } else if (e.is("draw") && e.button === 2) { 975 975 // Drag: accumulate orbit angle (1px ≈ 0.4° per frame) 976 976 orbitAngle += e.delta.x * 0.4; 977 + } 978 + 979 + // Left-click resets orbit angle (only if orbit was previously snapped/released) 980 + if (e.is("touch") && e.button === 0 && orbitSnapped) { 981 + orbitAngle = 0; 982 + orbitSnapped = false; 977 983 } 978 984 979 985 // While dead, any touch respawns; otherwise the first touch re-locks the pen.