The following code produces said error:
Code: Select all
core::quaternion quat;
quat.rotationFromTo(core::vector3df(0,0,1), core::vector3df(0,0,-1));
printf("quat: %f,%f,%f,%f\n", quat.W,quat.X,quat.Y,quat.Z);
Does this mean this is a special case for which there is no solution?
(in which case could this please be noted in the docs?)
or can the check for zero be added? (but I'm not sure what the desirable behaviour should be in this case...)
[real world example: I calculate the rotation for my scene node to look in a particular vector, and this problem occurs on the rare occasion that the node is facing the exact opposite direction.]