Inconsistent raycast precision API
See original GitHub issueDescription of the problem
Both Points
and Line
implement a raycast()
function/method. They both use a threshold/precision:
I think the API is a bit inconsistent and they could both be named either threshold or precision and also they could both be set in the Raycaster
in the same way. Right now you have to:
raycaster.linePrecision = 42;
raycaster.params.Points.threshold = 42;
Also, only linePrecision
is documented.
Proposal
Same API for all thresholds/precisions. It seems the .params
attribute is more complete/flexible, so I would say:
raycaster.params.Line.threshold = 42;
raycaster.params.Points.threshold = 42;
That means removing the linePrecision
attribute.
Three.js version
- Dev
- r113
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Inconsistent raycasting? - Unity Forum
Well in my game you select cubes via clicking and at certain inbetween areas of cubes it's wildly inconsistent, flashing back and forth...
Read more >Raycast hitting collider of character inconsistently, but hitting ...
I do this using raycasts. I have an issue where the raycast is not always hitting the (huge) box collider I expect it...
Read more >Raycast Hitbox 4.01: For all your melee needs!
Accurate, performant, and easy to use! Use attachments or vectors to make your hitboxes in seconds! Attachment pairing to create straight-line ...
Read more >Does anyone have experience with why Physics.RayCast ...
Unity's Physics.RayCast() doesn't seem very reliable when it comes to aiming the ray at ship parts. It works fine for ground terrain or...
Read more >unity - How to solve the ground check problem?
It's more accurate than raycast: Raycast is a shoot-to-check method, if your raycast shooting is not enough coverage, then it leads to bug ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Mugen87 I have very little experience with JS, but I will try. It is the least I can do for this project and the community behind it, who already helped me a couple of times when I felt lost. ❤️
Hopefully, I will be able to find some time to work on this before next week.
Agreed, a common approach for
Points
andLines
is desirable. I think I vote for enhancingRaycaster.params
, too. And deprecatingRaycaster.linePrecision
.