Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LineSegments2 raycast bug #29666

Open
rajsunku opened this issue Oct 15, 2024 · 2 comments
Open

LineSegments2 raycast bug #29666

rajsunku opened this issue Oct 15, 2024 · 2 comments

Comments

@rajsunku
Copy link

rajsunku commented Oct 15, 2024

Description

When a LineSegments2 object is rendered off the screen, the LineMaterial.resolution variable doesn't get updated until the onBeforeRender function is run. This causes raycasters to intersect with the lines incorrectly even when they are not on the screen. It gets resolved once you pan to the line since the resolution gets updated.

Reproduction steps

  1. Render a line outside of camera view
  2. If your app has some picking logic that highlights a line that is selected, click anywhere on the screen.
  3. Once you pan to the line, you will see that it is highlighted.

Code

// code goes here

Live example

Screenshots

No response

Version

0.168.0

Device

No response

Browser

No response

OS

No response

@gkjohnson
Copy link
Collaborator

gkjohnson commented Oct 16, 2024

I think there's a bigger question of what these screenspace thickness lines should do for raycasting when they're off screen - if a line is off screen there's not a clear interpretation of what "screen space" means. And projecting into camera clip space to to perform the raycasting won't necessarily have sensible results.

cc @WestLangley

@WestLangley
Copy link
Collaborator

@rajsunku Can you please provide a live example to demonstrate exactly what you are doing?

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

No branches or pull requests

3 participants