Skip to content

Track observer position in ConstellationArtLayer and add unit tests#3

Open
kws wants to merge 1 commit intomainfrom
codex/add-observer-centered-placement-for-constellation-art
Open

Track observer position in ConstellationArtLayer and add unit tests#3
kws wants to merge 1 commit intomainfrom
codex/add-observer-centered-placement-for-constellation-art

Conversation

@kws
Copy link
Copy Markdown
Member

@kws kws commented Apr 5, 2026

Motivation

  • Ensure the constellation art layer follows the observer's world position inside the content root so artwork stays colocated with the viewer while preserving the layer's orientation, and add tests to verify this behavior.

Description

  • Added src/layers/__tests__/constellation-art-layer.test.js with two tests that verify the layer tracks observer position and that orientation is not changed when the observer moves.
  • Updated src/layers/constellation-art-layer.js to compute the observer's world position and convert it into contentRoot local coordinates, setting the layer group.position accordingly.
  • Introduced internal vectors _observerWorldPosition and _observerInContentPosition to avoid reallocations during update.
  • Left existing opacity/fade logic unchanged and preserved existing public API (getConfig, attach, dispose).

Testing

  • Executed the new unit tests in src/layers/__tests__/constellation-art-layer.test.js using the Node test runner via node --test src/layers/__tests__/constellation-art-layer.test.js.
  • Both tests passed, confirming position tracking and orientation preservation.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant