Rotation Gizmo does not Update Quaternion

According to the docs for gizmo, the rotation gizmo should update the rotationQuaternion. However, it appears that it updates the rotation instead of the rotationQuaternion if the quaternion has not been set based on this PG. Maybe just needs clarification in the docs.

As far as i recall, you have to set the rotationQuaternion yourself before using the gizmo.

If the mesh does not have/use rotationQuaternion the gizmo will update the default rotation instead.

Right, but the docs say this

Note: Gizmos will set/modify the rotationQuaternion of the attached node. After attaching, any rotation of the mesh should be done with the rotationQuaternion property instead of rotation.

Which implies to me that they update quaternion regardless of whether it has been initialized or not, so I think the docs need to be clarified if this is the correct behavior.

I feel like there is a property on the gizmo, whether it should override rotation with a quaternion or not… :thinking:

But i’m from my phone, so i can’t check atm

This is weird. I was sure using a rotation gizmo would create and use rotationQuaternion. But after some tests, it looks like it only works like that for the boundingBoxGizmo.
so, this line must be removed:
After attaching, any rotation of the mesh should be done with the rotationQuaternion property instead of rotation.

It 100% used to be like that.
But yeah, the docs seem to be wrong now.

the gizmo only sets rotationQuaternion if the mesh already have one.

Edit;
Thinking i was losing my mind, i had to double check… for sure it existed! :joy:

And indeed i found some traces, there is still a constructor property " useEulerRotation", though it appears to do nothing now whether it’s set true or false.

Creates a RotationGizmo
@param gizmoLayer — The utility layer the gizmo will be added to
@param tessellation — Amount of tessellation to be used when creating rotation circles
@param useEulerRotation — Use and update Euler angle instead of quaternion
@param thickness — display gizmo axis thickness
@param gizmoManager — Gizmo manager
@param options — More options

1 Like