33 Quaternion(Real _x, Real _y, Real _z, Real _w) : x(_x), y(_y), z(_z), w(_w) {}
58 Real mag = 1.0/(x*x+y*y+z*z+w*w);
77 return Quaternion ( q2.w * q1.x + q2.x * q1.w + q2.y * q1.z - q2.z * q1.y,
78 q2.w * q1.y + q2.y * q1.w + q2.z * q1.x - q2.x * q1.z,
79 q2.w * q1.z + q2.z * q1.w + q2.x * q1.y - q2.y * q1.x,
80 q2.w * q1.w - q2.x * q1.x - q2.y * q1.y - q2.z * q1.z );
85 return Quaternion ( q.x*a, q.y*a, q.z*a, q.w*a);
Definition: commonkernels.h:22
Quaternion & operator=(const Quaternion &q)
Assign operator.
Definition: quaternion.h:39
Vec3 imag()
imaginary part accessor
Definition: quaternion.h:63
Quaternion inverse() const
return inverse quaternion
Definition: quaternion.h:57
Basic inlined vector class.
Definition: vectorbase.h:71
Quaternion(Vec3 i, Real r)
construct a quaternion from imag/real parts
Definition: quaternion.h:36
Very basic quaternion class.
Definition: quaternion.h:23
Quaternion(const Quaternion &q)
copy constructor
Definition: quaternion.h:30
Quaternion(Real _x, Real _y, Real _z, Real _w)
construct a quaternion from members
Definition: quaternion.h:33
Quaternion()
default constructor
Definition: quaternion.h:27
Quaternion & operator*=(const Real a)
Assign multiplication operator.
Definition: quaternion.h:48