From David Spilling, "Matrix_implementation.cpp modified as requested. I ran a version of it through a local version of osgunittests.cpp and it passes.
From David Spilling, "Matrix_implementation.cpp modified as requested. I ran a version of it through a local version of osgunittests.cpp and it passes.

Note that firstly it always returns the positive real quaternion (positive w)

Note also that it will sometimes slightly differ from the results of the other methods because it assumes that the input matrix really is a rotation matrix - if it isn't, e.g. because of rounding error, then the output quaternion will be very slightly different. For example, the test matrix

0 1 0 0
1 0 0 0
0 0 0.999999 0
0 0 0 1

will return 0.707107 0.707107 0.0005033 0.0005033

whereas the previous methods return 0.707107 0.707107 0.0 0.0

However, since quaternions are rotations, the meaning of how to convert a matrix that isn't a rotation is a little unclear..."


git-svn-id: 23b6355f2bb369032457de4eb5f713ee134f73a8@5366 16af8721-9629-0410-8352-f15c8da7e697

joevandyk/osg,joevandyk/osg,joevandyk/osg,joevandyk/osg,joevandyk/osg