fix: correct compass E/W and object rotation
AC heading is standard clockwise (0=N, 90=E). Both compass labels and object rotation need positive heading — previous negation broke the compass while fixing objects. Now both use the same sign. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
eaa5b5c48d
commit
359d255730
1 changed files with 4 additions and 4 deletions
|
|
@ -3726,8 +3726,8 @@ function updateRadarWindow(msg) {
|
|||
|
||||
// Always heading-up: player facing direction = up on canvas.
|
||||
// Compass labels rotate around the edge based on player heading.
|
||||
// AC heading convention is opposite from standard math angles — negate
|
||||
const headingRad = -playerHeading * Math.PI / 180;
|
||||
// AC heading: 0=N, 90=E, 180=S, 270=W (standard clockwise)
|
||||
const headingRad = playerHeading * Math.PI / 180;
|
||||
const compassLabels = [
|
||||
{ label: 'N', angle: 0 },
|
||||
{ label: 'E', angle: Math.PI / 2 },
|
||||
|
|
@ -3754,8 +3754,8 @@ function updateRadarWindow(msg) {
|
|||
ctx.lineTo(cx, cy - cx * 0.85);
|
||||
ctx.stroke();
|
||||
|
||||
// Rotation angle: negate heading to counter-rotate world so facing = up
|
||||
const rotAngle = -headingRad;
|
||||
// Rotate world by heading so player facing = up on canvas
|
||||
const rotAngle = headingRad;
|
||||
|
||||
// Draw objects
|
||||
objects.forEach(obj => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue