Skip to content
Snippets Groups Projects
Commit 431bc758 authored by Ioan A Sucan's avatar Ioan A Sucan
Browse files

Merge pull request #26 from florent-lamiraux/master

Check that quaternion is normalized when converting to rotation matrix
parents 15b90897 4b5f0c89
No related branches found
No related tags found
No related merge requests found
......@@ -85,6 +85,10 @@ void Quaternion3f::fromRotation(const Matrix3f& R)
void Quaternion3f::toRotation(Matrix3f& R) const
{
assert (.99 < data [0]*data [0] + data [1]*data [1] +
data [2]*data [2] + data [3]*data [3]);
assert (data [0]*data [0] + data [1]*data [1] +
data [2]*data [2] + data [3]*data [3] < 1.01);
FCL_REAL twoX = 2.0*data[1];
FCL_REAL twoY = 2.0*data[2];
FCL_REAL twoZ = 2.0*data[3];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment