How to change the default event for PlaneRotationGizmo

Hi I understand that once PlaneRotationGizmo is attached to a mesh, the default event that enables the rotation of the mesh is right mouse pointer down. But is there a way to change this default event to any other event?

Thanks in Advance.

adding @Cedric

Hi @Pragathi_Hathwar

Can you be more explicit on what you want to achieve?

Hi Cedric,

When we add a planerotationGizmo to a mesh, the mesh can be rotated when by right mouse click and drag. I understand that this is the default event to rotate a mesh. I would wanted to know if this default event can be changed, say rotating a mesh by using left mouse click and drag?

Not sure we can. I’m not very skilled with events and observable. Maybe @PolygonalSun can tell.

TBH, I’m not too familiar with the PlaneRotationGizmo but I believe that, by default, either the left click or right click should allow for rotation when using this gizmo. To add to or change the behavior for this particular Gizmo, you’ll probably need to start by looking at the onDragObservable object that’s a part of the PlaneRotationGizmo’s dragBehavior object (its type is PointerDragBehavior). Just out of curiosity, what is the type of action that you’re looking to have?

Yes you are right. Left click also works. But is there a way to restrict rotation only on left and not rotate the mesh on right click?

Any ideas @Cedric or @PolygonalSun?

TBH, I’d have to think on this one. I’ve been looking through the code and there’s no real way to discriminate between left and right clicking with a drag, at least with respect to the PointerDragBehavior object.

Thank you. Appreciate the help. :slightly_smiling_face: