Gizmo use tmpParent but do not preserve scaling sign

I think that we should preserve scaling sign when we use gizmo.Though we do not preserve scaling sign,it will has same result.But it means different.
1)Withough preserve scaling sign:
before attach gizmo:


after attach gizmo:

source code:

2)preserve scaling sign:
before attach gizmo:


after attach gizmo:

source code:

By the way,why we set preserveScalingSign default false?

My workmate finds this topic.This has obviously been discussed.Should we add the same parameter to control gizmo preserve scale sign?

Let me see what I can do.

1 Like

PR New flag to preserve scaling when using gizmos by CedricGuillemet · Pull Request #12385 · BabylonJS/Babylon.js · GitHub

1 Like

Thanks for your hard work. :smile:

1 Like

I review the code and tried that.But it doesn’t work.By the way,the positionGizmo dragObserver do not need fix?Or it was fixed by the gizmo.ts changes.I think that we should preserve scale sign when we set origin parent.We should preserve scale sign everywhere that change the attachedMesh parent.

Did you enable it ?
Gizmo.PreserveScaling = true

Yes,i hack the resource code and set it true.

Can you try to pull master branch and test from there?

It is hard now,let me find some ways to do this.I will notify the result as soon as possible.
By the way,i hack the code that version is 5.1.0.

Unfortunately,it still has some problems;
1)uncorrect linebox
2)with negative scale,drag shpere with opposite rotate direction

And it has other problem in my project.



When attachedNodeChange set originParent,it has other result.Should we preserve scale sign everywhere that change the attachedMesh parent?

I guess that the reason is that the duck parent is transformNode that i create,but not default Nodes parent like this.



I set the next method call true,and the method result is correct.But the next flow has another process.
My first reply show that i set every change of the (attached)mesh parent set sign true,and it work.We can check if we should promise that every change of mesh parent should preserve sign.

I’m taking a look.

:facepunch:Thanks for your hard work.

1 Like

I have a fix for the house bouding box issue. Do you have a PG for the last problem you’ve found?

1 Like

Like this.
I think that we should set attachedMesh parent with preserve sign everytime(In gizmo process).

It’s not a bug. You can specify to keep sign when calling setParent:

gizmo preserveScaling with uncorrect boundingBoxGizmo line box | Babylon.js Playground (babylonjs.com)

SetParent with PreserveScalingSign true,withouth attach boundingBoxGizmo:


SetParent with PreserveScalingSign true,with attach boundingBoxGizmo:

I meas that the gizmo method which change the attachedMesh parent should preserve scale sign.Otherwise it will change the scale sign when we set origin parent to the attachedMesh.