Pointer drag ignores world matrix of the mesh

Hi, I have a question about dragging meshes with the updated world matrix.
Perhaps I did something wrong, but if a mesh gets a custom transformation matrix and then is attached to a dragger, its world matrix changes back to an identity matrix.

I’ve reproduced it on the Playground. When you start dragging the box, it jumps to the global origin first.

Of course, if I decompose the transformation matrix to rotations → scaling → translation and set the corresponding params on the mesh, it works fine. But I believe dragging should do it by default, no?

So, this will work. https://playground.babylonjs.com/#HMQMKB#1
Perhaps there are a better way?

Looks like I found what I need: decomposeToTransformNode
Here is the the result including rotation: https://playground.babylonjs.com/#HMQMKB#2

1 Like