Hiya RW, welcome to the forum.
Check out line 54… a different kind of “rotate”.
Some call it… rotationQuaternion -rotate… or just ‘quat-rot’. hehe
At certain times/purposes, BabylonJS mesh use mesh.rotationQuaternion instead of mesh.rotation… to store the rotational values.
Physics engines LOVE quaternion-based rotation, and dislike Euler (like .rotation). SO… yep… when the physics engines are involved, you can be sure that box.rotationQuaternion is in-use.
I HOPE I’m using the rotate() func correctly in line 54. You might want to do some research on it. If you know your “quats”, you can go right in and poke it with values, or use one of MANY helper tools on BabylonJS Quaternion-class objects (there’s even a fromEulerVector).
box.rotationQuaternion is a quaternion-class object, of course.
Quaternions are not for children. Sometimes they require a bit of web study, and a bit of knowledge about matrix transformations might help. A quaternion is a 4-value data-type, and is used for rotations (including real spacecraft) where a phenomenon called “gimbal lock” is to be avoided. Exciting story, eh? (snore)
Some have said it like this: THREE quat values are for aiming an arrow in 3d space, and the 4th quat value… is the amount of mesh rotation AROUND that arrow’s shaft. The “order” of the values in a quat… are important, too.