Hi there!
My use case is a little difficult to explain, but is there an opposite of BABYLON.Matrix.RotationYawPitchRoll such that given a matrix, I can derive its yaw pitch and roll?
I tried to follow an answer from SO but with no success.
const newRotation = BABYLON.Matrix.RotationYawPitchRoll(mesh.rotation.y, mesh.rotation.x, mesh.rotation.z);
const rotationEuler = new BABYLON.Vector3(
Math.atan2(newRotation.getRow(2).y, newRotation.getRow(2).z),
Math.atan2(-newRotation.getRow(2).x, Math.sqrt(Math.pow(newRotation.getRow(2).y, 2) + Math.pow(newRotation.getRow(2).z, 2))),
Math.atan2(newRotation.getRow(1).x, newRotation.getRow(0).x)
);
Unfortunately, rotationEuler is never equal to mesh.rotation…