-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
Add near and far check in intersectRay #657
Comments
This would be a good change - currently I think the raycast results may even be incorrect if raycaster.near or far are modified.
I think we can just add
If we do this lets change the ray lengths to help show the difference in what's happening.
I've been meaning to do this but have never had time. Help would be great! The bvh raycasting demo I added to three.js uses InstancedMesh for the spheres and updates a LineSegments class for all the lines. |
I think to be able to make a PR this weekend :) |
Adding
near
andfar
to theintersectRay
function would avoid recursively checking many bvh nodes when raycasting.It will require a change in the API.
I did a test by setting raycaster.far = 0.1 from raycast example page and of course it is super fast.
It would also be useful to edit the raycast example page by adding
near
andfar
in the GUI (which will also change the length of the drawn lines) and to useInstancedMesh
so that raycasting can be tested better (too many drawcalls are a bottleneck).The text was updated successfully, but these errors were encountered: