Mesh.addChild() with negative scaling transforms child rotation incorrectly

Thank you @Cedric , confirming the PR works.

For others who might be reading this, negative scaling does work with Gizmo. Here is a working solution:

  1. Copy transform of childMesh to gizmoMesh
  2. Sanitize gizmoMesh.scaling to only have positive values
  3. Store scaling state of the childMesh before attaching to gizmoMesh with gizmoMesh.addChild(childMesh, true)
  4. Attach gizmoMesh to GizmoManager GizmoManager.attachToMesh(gizmoMesh)
  5. Let gizmo do any transform as usual, except negative scaling (need to detach GizmoManager from gizmoMesh first, then apply negative scaling to the gizmoMesh directly)
  6. Release the childMesh with gizmoMesh.removeChild(childMesh, true)
  7. Apply back stored scaling state of childMesh, along with gizmoMesh.scaling to get the final scaling state of the childMesh.
3 Likes