Skip to content

Fix for raycasting inaccuracy#166

Open
pichiste wants to merge 2 commits into
RodrigoHamuy:mainfrom
pichiste:main
Open

Fix for raycasting inaccuracy#166
pichiste wants to merge 2 commits into
RodrigoHamuy:mainfrom
pichiste:main

Conversation

@pichiste

Copy link
Copy Markdown

Solves #68

Fixes raycast inaccuracy, which was more pronounced when objects were towards the edge of the viewport. The problem was that the raycast origin did not take the cursor position into account.

Changes:

  • Updated ray origin to use pointerX and pointerY
  • Moved the calculation to a computeRay helper
  • Added a regression test (compute-ray.test.ts) for this issue

Screen Captures:

before.mp4
after.mp4

@pichiste pichiste requested a review from RodrigoHamuy as a code owner June 13, 2026 10:29
@changeset-bot

changeset-bot Bot commented Jun 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 88c8f6b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-three-map Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci

codesandbox-ci Bot commented Jun 13, 2026

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 88c8f6b:

Sandbox Source
example-mapbox Configuration
example-maplibre Configuration
stories Configuration

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant