I think intersectsMesh() is faster, because you can prepare meshes, that gets evaluated with your ray intersection, in an array. While on pickWithRay you have to always go through all meshes of the scene and i.e. use a condition (predicate) to determine if a mesh of the scene is part of this type of your custom intersection evaluation. Another option is mesh.intersects(), which seems to have even more options to increase performance. Source: SolidParticle.intersectsMesh() or Scene.pickWithRay() or Ray.intersectsMesh()
Takemura
2
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| pickWithRay vs intersectsMeshes, best approach? | 13 | 1062 | January 19, 2023 | |
| Performance. Choosing between rays and checking for mesh intersections | 7 | 600 | May 1, 2023 | |
| Why scene.pickWithRay !== mesh.intersects? | 4 | 112 | August 28, 2024 | |
| Scene.PickWithRay VS Physics.Raycast | 3 | 726 | August 20, 2021 | |
| Weekly Video: Pick Objects in your scene using Rays! | 7 | 1075 | April 30, 2020 |