Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

arena: TEST — flip Z convention in hover raycast

Experimental: flip the sign on ray origin Z and ray direction Z to test
whether the engine's Z-forward convention is reversed from what the
derivation assumed. If the hover highlight now lands on the correct tile,
we've isolated the mismatch. To revert: un-negate camWorldZ and fz.

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

+9 -4
+9 -4
system/public/aesthetic.computer/disks/arena.mjs
··· 552 552 lastHitWorld = null; 553 553 lastPenScreen = penLocked ? null : [mx, my]; 554 554 if (fy < -0.001) { 555 - // Ray origin = render camera world position (not the logical player, so 556 - // the hit point matches what the user sees through the crosshair/mouse). 555 + // EXPERIMENT: Z convention flip test. If the raycast hits the wrong tile 556 + // mirrored across the player, flipping Z in both ray origin AND direction 557 + // is a point reflection across the XY plane through origin. If this 558 + // makes the hover tile correct, we know Z-axis in engine is inverted 559 + // from what my derivation assumed. (Direction-only or origin-only flips 560 + // would not cause a clean mirror; we need both or neither.) 557 561 const camWorldX = -cam.x; 558 562 const camWorldY = -cam.y; 559 - const camWorldZ = -cam.z; 563 + const camWorldZ = cam.z; // was -cam.z (flipped) 564 + const fzAdj = -fz; // flipped direction 560 565 const t = (GROUND_Y - camWorldY) / fy; 561 566 if (t > 0 && t < 200) { 562 567 const hitX = camWorldX + t * fx; 563 - const hitZ = camWorldZ + t * fz; 568 + const hitZ = camWorldZ + t * fzAdj; 564 569 hoverTile = tileAt(hitX, hitZ); 565 570 lastHitWorld = [hitX, hitZ]; 566 571 }