Thin instances and picking

repro: https://playground.babylonjs.com/#217750#9

Don’t move the camera. Seeing a couple of stuff here.
a) don’t think this is correct, but if you clicked on the sphere overlapping the ground, pickedMesh is ground. But if you move your pointer just upwards a little and click on the part NOT overlapping the ground, console shows sphere. If you comment out all the thin instance parts until the scene has only 1 sphere and ground, its wai. Something is definitely off here.

b) sphere.thinInstanceEnablePicking = true; only works when the source sphere is visible. If I comment out line 31 (thinInstanceAddSelf) and click on the single sphere in the scene, console throws error. How can I still enable picking on the thin instances without having the source sphere in scene ?

This PR should fix these problems:

1 Like

Tested, works. Thanks for the fix !

erm, so I found smthg weird again. repro: https://playground.babylonjs.com/#217750#10

mouseover the sphere closest to cam doesn’t show in console, but the farther one does. It seems to be depth related. But when I increase the number of spheres (https://playground.babylonjs.com/#217750#11), the problem isn’t as obvious. What am I doing wrong ?

Here’s the fix:

Hopefully the thin instance intersection code is now fully debugged!

Thanks for your reportings, by the way.

2 Likes

Looks good now ! Thank you very much!