I am currently coding a game in babylonjs and I need to send the direction or the rotation of some meshes, but I can’t seem to make it work. Despite me clearly changing the rotation of the object, calling rotation or getDirection on that object doesn’t output the expected results at all. Am I misunderstanding something?
So getDirection relies on the mesh’s world matrix, which you can force to be updated by calling computeWorldMatrix(true) on the mesh. Then getDirection will return the new direction.
For the second part in the PG, the rotate function performs the requested rotation using the rotationQuaternion property, so it converts the rotation vector to a quaternion and resets the vector to 0, 0, 0. However you can call toEulerAngles() on the rotationQuaternion to get the corresponding euler angles.