Are the following lines different in any way?
MyObject.rotation *= Quaternion.AngleAxis (RotationValue * Time.deltaTime, Vector3.up );
MyObject.rotation *= Quaternion.Euler (0f , RotationValue * Time.deltaTime , 0f);
Both seem to work the same way but I thought maybe I’m missing something. Or maybe one is faster than the other?
Both should work the same way. I would stick to Euler for this example, as it’s easier to read.
Where AngleAxis really shines is with arbitrary axes. If you’re rotating around the standard coordinate axes, then Euler is usually enough.
Angle axis you have two options:
- You can choose how many degrees it rotates
- Around what axis it rotates
Within euler you only have one option:
- The magnitude of rotation with respect to transforms axis.
They are basically the same, however, Angle Axis gives you more control over how the transform rotates. Where as in Euler if you want the same effect you should do allot of computation to get the correct vertor3.
Normally this isn’t a problem since most transformations are not that complex. But should you be doing a cut scene where the object should change the way it rotates multiple times, it would be easier to use Angle Axis rather than doing the computation multiple times.