Commit 2ed46873 authored by Henrik Zimmer's avatar Henrik Zimmer

changed left and right mult matrices to commonly used definition

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16153 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 2b830163
......@@ -200,6 +200,7 @@ public:
/*
/// get matrix for mult from right (Qr = q*r)
Matrix right_mult_matrix() const
{
......@@ -222,6 +223,29 @@ public:
m(3,0) = Z; m(3,1) = Y; m(3,2) = -X; m(3,3) = W;
return m;
}
*/
/// get matrix for mult from right (p*q = Qp)
Matrix right_mult_matrix() const
{
Matrix m;
m(0,0) = W; m(0,1) = -X; m(0,2) = -Y; m(0,3) = -Z;
m(1,0) = X; m(1,1) = W; m(1,2) = Z; m(1,3) = -Y;
m(2,0) = Y; m(2,1) = -Z; m(2,2) = W; m(2,3) = X;
m(3,0) = Z; m(3,1) = Y; m(3,2) = -X; m(3,3) = W;
return m;
}
/// get matrix for mult from left (q*p = Qp)
Matrix left_mult_matrix() const
{
Matrix m;
m(0,0) = W; m(0,1) = -X; m(0,2) = -Y; m(0,3) = -Z;
m(1,0) = X; m(1,1) = W; m(1,2) = -Z; m(1,3) = Y;
m(2,0) = Y; m(2,1) = Z; m(2,2) = W; m(2,3) = -X;
m(3,0) = Z; m(3,1) = -Y; m(3,2) = X; m(3,3) = W;
return m;
}
/// get quaternion from rotation matrix
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment