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

Please add a separate Line2 threshold for world / pixel based lines. #30623

Open
nzjony opened this issue Feb 27, 2025 · 1 comment
Open

Please add a separate Line2 threshold for world / pixel based lines. #30623

nzjony opened this issue Feb 27, 2025 · 1 comment

Comments

@nzjony
Copy link
Contributor

nzjony commented Feb 27, 2025

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:

		const threshold = ( raycaster.params.Line2 !== undefined ) ?
			( worldUnits ? ( raycaster.params.Line2.thresholdWorld || 0 ) :
				( raycaster.params.Line2.thresholdPixel || 0 ) ) : 0;

In the raycast function of LineSegments2.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

@WestLangley
Copy link
Collaborator

@gkjohnson I am curious as to how you feel about this. 😇

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

No branches or pull requests

3 participants