Keep the positionGizmo'pose by a given value

when we use the positionGizmo,we can choose whether or not to follow the posture of the mesh by the property called ‘updateGizmoRotationToMatchAttachedMesh’

as the source code say,we only have two choice.

now,i have a business requirements,i need to keep the positionGizmo’s pose in other rotationQuaternion
i try to set the _effectiveMesh but there is no setter for it(i know this approach is also wrong)
so,how can i implement the business requirements

Perhaps this is a new feature that can be added?

provide a customRotationQuaternion property for Gizmo.

Adding @Cedric

Best solution would possibly be to use a transformNode (child/parent) ? :slight_smile:

So it would look something like…

I agree with @aWeirdo , you need to use another transform with a custom rotation/postion and attach the gizmo to.

em…if i do that,when i drag the gizmo,Do I need to copy the posture of the transformNode to apply it to the real node

can you supply a small Playground so we’re on the same page as to exactly how it should work/act?

@Cedric I implemented a solution before

But it can only solve the situation where one gizmo appears(positionGizmo or rotationGizmo)

as a gizmoManager,it can’t apply two poses for two gizmo tools,

so,i think ,it could be better to add a customRotationQuaternion property for Gizmo.

Instead of inventing various solutions

@aWeirdo Is this space1 similar to the transformNode you mentioned?

I was thinking of something like this:

gizmo pose | Babylon.js Playground

when 1 mesh is clicked, set the parent transform to be modified by the gizmo.


I think setting an attribute is more convenient than these conversion operations

how about this:

Maybe you can try the convenience brought by this operation

Can you please provide a pull request ?

I created a PR just now,maybe you can have a look

1 Like