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

filter objects in scene to raycast, as raycaster is heavy #19

Open
minhhien1996 opened this issue Dec 13, 2019 · 4 comments
Open

filter objects in scene to raycast, as raycaster is heavy #19

minhhien1996 opened this issue Dec 13, 2019 · 4 comments

Comments

@minhhien1996
Copy link

minhhien1996 commented Dec 13, 2019

After digging the docs, I found no option to filter objects in the scene to do raycasting. When my scene have some big mesh, the performance is not good. If I do the raycast manually, instead of

raycaster.intersectObjects(this.scene.children, true)

I will do

raycaster.intersectObjects(objectsShouldListenToEvent, true)

So I think an option such as func filterSceneChildren or array objectsShouldListenToEvent is good for cases like mine

@minhhien1996
Copy link
Author

minhhien1996 commented Dec 15, 2019

added a PR: #20

@jasonChen1982
Copy link
Owner

is a great idea

@minhhien1996
Copy link
Author

@jasonChen1982 anything else needed for the PR to be merged? I added a method setObjectsToRaycast

@miguelfrmn
Copy link

Great idea!

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

No branches or pull requests

3 participants