Skip to content

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

@nzjony

Description

@nzjony

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions