Both methods return picking mesh info. So when to use the first one and when the second one?
Which method is better in terms of performance? I see that we can use fastCheck in both methods. Then what’s the main difference between them?
The main difference is that intersectsMesh() works with passing bunch of meshes while pickWithRay() is not? Thus intersectsMesh() way better for performance if that fits our needs?
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()
2 Likes