Include thinInstanceIndex for OnPointerOverTrigger, OnPointerOutTrigger

Hi, I’ve been working with thin instances and pointer events using the action manager. Would it be possible to include the thinInstanceIndex when you hover a mesh that has thin instances? Or maybe even a different over & out events for each thin instance?

It might be too specific to the project I’m working on as we store different data based on the thin instance index but I feel that it might be useful as instanced meshes for comparison would trigger individual events.

The data sort of already exists as we have a picking result here:

Welcome aboard!

Could you setup a small repro in the Playground? I think all picking methods in Babylon are using the same underlying code, and thin instances are handled by this code: you get the thin instance index in the thinInstanceIndex property of the PickingInfo structure.

So, I feel it should work. Have you enabled thin instances picking with mesh.thinInstanceEnablePicking = true?

1 Like

Thanks!

I set up a playground that tried to convey what feature could be missing. If using the action manager we don’t know what thin instance index is pointer over/out. Whereas for instanced meshes the action manager would trigger for each instance.

But as I wrote this might be too specific to the project I’m working on and can be solved just using scene.pick().

Hopefully it’s not too confusing what the texts mean when hovering the 4 different spheres.
https://playground.babylonjs.com/#3H8B60

When this PR is merged:

You will be able to access the pickResult structure used to trigger the on pointer out/over events of the ActionManager through event.additionalData.pickResult. So no need to issue an additional scene.pick query.

1 Like