I really have some confuse about the hkQuaternion and hkRotation
1.First, I have a quat like this
hkQuaternion quat; quat.setAxisAngle(hkVector4(0, 1, 0), HK_REAL_PI / 4.0f);
Then, I want use a hkRotation to instead of this quat,
hkVector4 offset; offset.set(1,0,0); offset.setRotatedDir( quat, offset); hkRotation rotation; hkVector4& col0 = rotation.getColumn(0); hkVector4& col1 = rotation.getColumn(1); hkVector4& col2 = rotation.getColumn(2); hkVector4 surfaceNorm; surfaceNorm = hkVector4(0,1,0); col1 = surfaceNorm ; col2.setCross( col1, offset); col2.normalize3(); col0.setCross( col1, col2 );
But when I get the new hkQuaternion from this hkRotation
The new hkQuaternion is not the same like my initial hkQuaternion
I think I make sth wrong with this, but not know where and why.
2.How can I get the hkRotation from an exist hkQuaternion?