AnalyticalGraphicsInc/cesium — pull request #340 by bagnell (2012-11-21 22:26:55+00:00)
Title: Matrix to/from Quaternion

The `Quaternion.fromRotationMatrix` function was returning incorrect results in some cases. It was indexing the matrix by (column, row) instead of (row, column). I swapped the `Matrix*.getElementIndex` function parameters to be consistent with the class constants like `Matrix*.COLUMN*ROW*`.

While making this change, I also noticed that `Matrix3.fromQuaternion` was returning the transpose of the rotation matrix which explains why there were axis/angle negations and quaternion conjugates whenever this function was used. This pull request fixes that as well.