Suggestion - pointerPick also on mesh holes

Hi there,
in my project i’ve to pick meshes like that in this PG: https://playground.babylonjs.com/#HBRF92#47
When the user zooms in, is quite simple to pick the mesh, but when the user zooms out and the mesh becomes smaller, it’s possible that the pointerPick doesn’t hit the mesh but the void pallet space between wooden boards.
I’d like that the mesh could be pickable all over its bounding box.
Is there a way to do that?

Thanks :wink:

For that specific use case I would recommend using a simpler mesh as an impostor (an invisible impostor)

1 Like

Hi @Deltakosh ,
i’ve read the doc about Physics and tried to apply an impostor as you’ve suggested. But i think i miss something else.
This is the new PG: https://playground.babylonjs.com/#HBRF92#49 on line 25-26 i set the impostor.
Is there any other option to set to make the impostor pickable?
Thank you :wink:

Hi @Mercurio ,

Deltakosh didn’t actually mean a physics impostor in that case, but simply an invisible mesh of the same size that is invisible and will be selected when clicked on, instead of the mesh that you are actually trying to select. It should be as big as the bounding box of the mesh you are trying to select.

Ah ok! It was my first try but it seems that invisible meshes aren’t pickable.
https://playground.babylonjs.com/#HBRF92#48
If you set fakeBox.isVisible = false; it seems to be not pickable.

You will need to adjust the default predicate for that to work:

stl to blob test - mercurio | Babylon.js Playground (babylonjs.com)

It is a custom picking mechanism (we pick according to the mesh), so it requires a bit of modifications of the default params :slight_smile:

1 Like

Thank you, understood :wink: