When scene has a large number of face, the detection of ray will be more and more slowly (“ActionManager.OnPointerOverTrigger”). Using “scene.skipPointerMovePicking = false” is too bad, mouseover event cannot work. Any idea to handle it ?
There is no optimal way of fixing this issue. If you want the complex meshes to be detected by the pointer system this is the method we offer. If you can filter them, you can either set the complex one to not be pickable, define a different mouse move predicate, or implement your own picking mechanism.
What’s your use case? Do you need constant mesh-under-pointer updates on all meshes?
Ping @PolygonalSun to keep him in the loop as well.
My case has some device models, each one has hundreds fo thousands of cace. I need to mouse over the device parts to show its info
If you need them all to be pickable my best suggestion would be to optimize your mesh.
Even if we debounce mouse over or run it once a second it’ll still not perform well of its checking for so many elements all the time. I assume they are close to each other as well? So even checking bounding box only won’t do no good?
Bounding box is not suitable fo Irregular polyhedra. For example an annular tube, some meshes maybe inside it.
That was my assumption. Otherwise performance would be better as well. The best way would be to optimize your mesh or be very selective when defining the pick predicate.
If a bounding box isn’t accurate enough for your mesh, generating some kind of Bounding Volume Hierarchy Bounding volume hierarchy - Wikipedia might be the way to go.