PointerDragBehaviour with rotated mesh

I have a specific problem and am wondering if there is an easy solution out there.

I have a box I want to drag around. The box is inside a transformnode which may be rotated. If I rotate the node all the dragging goes crazy. Is there any way to fix this? Do I need to recalculate the dragAxis for example?

Pinging @Cedric

Do you have a PG showing your issue? Most of the computation is done in world space. If the parented transform moves/rotate between 2 frames, while there is a drag, result should be undefined. There might be some way to mitigate the effect.

I just hit that problem yesterday, when I added a rotation gizmo. When you have both a rotation & position gizmo, there is something to the position gizmo, so that it is un-affected by rotation

gizmoManager.gizmos.positionGizmo.updateGizmoRotationToMatchAttachedMesh = false;

Was planning to look at the gizmo source for hints, but not today.

I did experiment with that a little - Babylon.js Playground (babylonjs.com). it does seem a bit off when there is a rotation

I don’t see a difference. I’ve tested with dragaxis and dragPlaneNormal and got no issue.

Thanks for all the replies. I’ll have to come up with a simple PG that demonstrates it. Still getting used to the playground system…

The example from RaananW does show it pretty well actually. I’ll see if I can put something in show as well.

Hard to reproduce so far - I realized I have a transformnode inside a transformnode, but doing that in the playground does not seem to affect anything. (I mean it seems to work there)

I need to do some more testing.