You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use Line2 for both screen space and world space lines.
Unfortunately, we need to have different thresholds for pixel / world units. Because for example, a threshold of 10 looks quite small, but 10 world units is quite big (of course depending on the camera distance).
These thresholds are used for making it easier to select items with a mouse so to me it's much more sensible to specify them in pixel units rather than providing a separate option for a world threshold. Ie we can change the Line2 world raycasting logic to allow for intersecting the line if the mouse is within the "threshold" amount of pixels around the projected shape. So:
Calculate the "world width" of a pixel at the distance of the point to the camera
Use that world width and threshold factor to determine whether the point is close enough
Alternatively the threshold could be used to specify the minimum screen width to use for the calculation instead of unnecessarily expanding an already large world-units line that is close to the camera.
Description
We use Line2 for both screen space and world space lines.
Unfortunately, we need to have different thresholds for pixel / world units. Because for example, a threshold of 10 looks quite small, but 10 world units is quite big (of course depending on the camera distance).
Solution
Something like:
In the
raycast
function ofLineSegments2.js
I'm happy to make a PR, just want to get a thumbs up before I do it.
Alternatives
For now, I'll make a change to three.js locally and use patch-package to apply it.
Additional context
No response
The text was updated successfully, but these errors were encountered: