PositionGizmo does not respect "update Gizmo Position To Match Attached Mesh"

I think I found a bug (I’m sorry if it isn’t :innocent:).

Please have a look at https://playground.babylonjs.com/#31M2AP#348

Expected behavior:
Setting gizmo.updateGizmoPositionToMatchAttachedMesh = false keeps the three arrows fixed in space even when moving the gizmo.

Actual behavior:
The arrows move with the gizmo manipulation.

Workaround:
Setting updateGizmoPositionToMatchAttachedMesh for the three individual AxisDragGizmos works (see example).

A few more observations:

  • The same seems to be true for the RotationGizmo and the updateGizmoRotationToMatchAttachedMesh attribute.
  • The described workaround keeps the arrows (and the circles for the RotationGizmo) fixed, but in the case of the RotationGizmo, the pivot point for calculating the rotation still seems to be translated, which makes the combination of a “fixed” PositionGizmo and a RotationGizmo difficult to handle after a translation.
    Here’s PG which combines both Gizmos: https://playground.babylonjs.com/#31M2AP#349
    The point for calculating the actual rotation seems to be off and it gets worse when translating the object.

Thanks for reporting! I’m taking a look.

1 Like
2 Likes

@Cedric You rock! I’m going to test it as soon as it is released.

Merci beaucoup, mon ami!

1 Like

I’m afraid to say that I see the same issue with the updateScale attribute. If I assign it directly to RotationGizmo or PositionGizmo (same for ScaleGizmo I suppose), it’s not effective. Assigning it to the individual x/y/zGizmos works as expected.

PR updated

2 Likes

Awesome! Thanks again!

Here’s a PG for testing: https://playground.babylonjs.com/#VE7VH3#7

2 Likes