The special cases are:
Yaw = +/- 90 degree (positive 90 or negative 90)
Pitch = random
Roll = 0 degree
The result I got from a test code written in C#.
node is a SceneNode.
The Euler Angles are referenced by the variables yaw, pitch, roll.
Code: Select all
// create quaternion and apply rotations
node.Orientation = new Quaternion(new Degree(yaw), Vector3.UNIT_Y);
node.Pitch(new Degree(pitch), Node.TransformSpace.TS_LOCAL);
node.Roll(new Degree(roll), Node.TransformSpace.TS_LOCAL);
quat = node.Orientation; // get quaternion
result = quat.Yaw.ValueDegrees; // get yaw valueIs the return of a NaN (not defined) value a bug?
If not, what's the reason?
I think it's very bad, when Quaternion::getYaw() returns an undefined value in some special cases.
This behaviour was the reason of infrequently application crashes. It tooks some time to find out the reason. Similar problems could happen to other developers. So we should avoid NaN return if possible.
Note:
I use Ogre (Mogre) 1.6.5.
Maybe the bug is still fixed in newer version.
