Lines Matching refs:Quaternion
960 class Quaternion
967 Quaternion () : v(0, 0, 0), w(0) {}; in Quaternion() function
968 Quaternion (const Quaternion<T>& q) : v(q.v), w(q.w) {}; in Quaternion() function
970 Quaternion (const Vec3d& vec, T _w) : v(vec), w(_w) {}; in Quaternion() function
971 Quaternion (const Vec4d& vec) : v(vec[0], vec[1], vec[2]), w(vec[3]) {}; in Quaternion() function
972 Quaternion (T _x, T _y, T _z, T _w) : v(_x, _y, _z), w(_w) {}; in Quaternion() function
979 inline Quaternion<T>& operator = (const Quaternion<T>& rhs) {
985 inline Quaternion<T> operator + (const Quaternion<T>& rhs) const {
986 const Quaternion<T>& lhs = *this;
987 return Quaternion<T>(lhs.v + rhs.v, lhs.w + rhs.w);
990 inline Quaternion<T> operator - (const Quaternion<T>& rhs) const {
991 const Quaternion<T>& lhs = *this;
992 return Quaternion<T>(lhs.v - rhs.v, lhs.w - rhs.w);
995 inline Quaternion<T> operator * (T rhs) const {
996 return Quaternion<T>(v * rhs, w * rhs);
999 inline Quaternion<T> operator * (const Quaternion<T>& rhs) const {
1000 const Quaternion<T>& lhs = *this;
1001 …return Quaternion<T>(lhs.w * rhs.v[0] + lhs.v[0] * rhs.w + lhs.v[1] * rhs.v[2] - lhs.v[2] * rhs.v[…
1023 inline Quaternion<T> conjugate (const Quaternion<T>& quat) const { in conjugate()
1024 return Quaternion<T>(-quat.v, quat.w); in conjugate()
1027 inline Quaternion<T> inverse (const Quaternion<T>& quat) const { in inverse()
1031 inline Quaternion<T> lerp (T weight, const Quaternion<T>& quat) const { in lerp()
1032 return Quaternion<T>(v.lerp(weight, quat.v), (1 - weight) * w + weight * quat.w); in lerp()
1035 inline Quaternion<T> slerp(T r, const Quaternion<T>& quat) const { in slerp()
1036 Quaternion<T> ret; in slerp()
1065 static Quaternion<T> create_quaternion (Vec3d axis, T angle_rad) { in create_quaternion()
1069 return Quaternion<T>(axis * sin_theta_over_two, cos_theta_over_two); in create_quaternion()
1072 static Quaternion<T> create_quaternion (Vec3d euler) { in create_quaternion()
1078 static Quaternion<T> create_quaternion (const Mat3d& mat) { in create_quaternion()
1079 Quaternion<T> q; in create_quaternion()
1196 typedef Quaternion<double> Quaternd;