Should I prefer using rotation or rotationQuaternion for TransformNodes?

Hi all,
I’ve just read about TransformNodes.rotationQuaternion being set to undefined by default so I wonder: performance wise is it better to always stick to rotation or should I prefer always using rotationQuaternion?

The only info I could find was that I can work with both at the same time thanks to reIntegrateRotationIntoRotationQuaternion, but based on this it’s not the best performance wise.

So if I have to make a choice, and considering that my code doesn’t change much based on what I implement (since some parts use Vector3 for rotations and some others Quaternions in an equally amount), which one should I use?

P.s: just started to work with BabylonJS so please have mercy if it is a noob question or I missed it in the forum :slight_smile:

Hi @Tolomeo, have mercy on you! :wink:

It all depends on comfortable are you with quaternions. If you are, it is preferable to use them. But as long as euler angles fulfill your rotation needs, there is no true need to switch.

Once you start using functions like rotate on a mesh, or use a physics engine (or import a complex mesh), you will see that the rotationQuaternion is being defined and the .rotation. object is no longer working.

Thanks for you answer @RaananW!
I will stick to quaternions then since I’m confortable with them :slight_smile:

2 Likes