Enable and disable camera wheel events

Hey~all, I previously used GUI.ScrollViewer events to control the disabling and enabling of camera wheel input.
in line: 83~89.
pg: https://playground.babylonjs.com/#HJZBRG#210
( I’m not sure if this is reasonable, because when you can see that as long as the mouse moves on the panel, it will always call disable input. I don’t know how to judge whether to disable it when enabled )

In my actual use, the panel may appear inside the gizmo, which will make it unavailable. Do you have any good ideas ?
pg: https://playground.babylonjs.com/#HJZBRG#212

Pinging @msDestiny14 - First - this feels like it should be the default behavior, though I must admit I am not sure. Second, it seems like the wheel event is not passed to the scroll view what the gizmo is visible. can you check that?


So for part 1: https://playground.babylonjs.com/#HJZBRG#213

I changed the line to onPointerMove to onPointerEnter. I think this is more the behavior you want. onPointerMove is once you are already inside the control and moving around. Plus you are now detaching multiple times.

Also if you want the camera to be disabled on the entire panel where the white is included you might have to do some additional steps. First would be moving the onPointerEnter/Outs to the stackPanel. Next you may need to set some sort of flag for the child scroll viewer because entering on that might cause you to be out on the stackPanel? I’m trying to remember if that is the case of if that’s a react feature and not Babylon. Will need to check that. Let me know if you need help and I can take a look.

Part 2: https://playground.babylonjs.com/#HJZBRG#214
Really simple. boundingBox.isPickable = false; :slight_smile:

1 Like