Create spotLight with a positionGizmo will change the spotLight direction

It will change the spotLight direction when i drag the positionGizmo.

cc @Cedric who is the gizmo king

Thatā€™s an issue. I will take a closer look .

2 Likes

Thanks for you reply

Thanks for you reply. :smiley:

Yes, Iā€™ll do my best to fix it today.

1 Like

Thanks for your hard work :heart:

1 Like

Itā€™s not an issue. Spotlights need an intermediate lightgizmo, like you did, but instead of attaching the gizmomanager to the light, attach it to the lightgizmo:

lightGizmo | Babylon.js Playground (babylonjs.com)

2 Likes

Okay~Thanks for your reply.

I add a positionGizmo to light node,it will change the light rotation too.I saw the gizmo code,i donā€™t understand the _tempQuaternion(0, 0, 0, 1).And then set the attachedNode rotation by it,it seems that will always set attachedNode rotation = (0, 0, 1).
example is v4.2.0.Changing to lastest version,itā€™s different.

Indeed! Let me take a closer look.

My description has some errors,spotLight is setting direction.
I think that it may caused by rotationQuaternion,because spotLight has not this parameter.

PR is live :

2 Likes

Thanks for your hard workļ¼ :smile:

1 Like