I found out my error when I was trying to write my respond explaining that I am doing nothing wrong !
My product operator expects a quaternion class constructor with the W component as a first parameter.
While the available constructor expects an angle as the first parameter.
HQuaternion HQuaternion::operator*(HQuaternion & q)
{
return HQuaternion(
w*q.w - v.Dot(q.v),HVector3(q.v*w + v*q.w + v.Cross(q.v) )
);
}
HQuaternion::HQuaternion(double angle, HVector3 & _v):v(_v)
{
double angleover2 = angle/2;
double c = cos(angleover2);
double s = sin(angleover2);
v.Normalize();
w=c;
v *= s;
}
Thank you for your responses and for the link
hbdevelop1
Member Since 28 Nov 2012Offline Last Active Jan 14 2013 07:53 PM
Not Telling