Go to the SVN repository for this file.
1 #ifndef GUI_MATH___QUAT___HPP 2 #define GUI_MATH___QUAT___HPP 73 const T&
X(
void)
const{
return m_Xyzw[0]; }
76 const T&
Y(
void)
const{
return m_Xyzw[1]; }
79 const T&
Z(
void)
const{
return m_Xyzw[2]; }
82 const T&
W(
void)
const{
return m_Xyzw[3]; }
124 return(
first[0] == second[0] &&
125 first[1] == second[1] &&
126 first[2] == second[2] &&
127 first[3] == second[3]);
136 return!(
first== second);
157 first.W() * second));
181 first.W() / second));
235 doublecos_theta = cos(theta / 2.0);
236 doublesin_theta = sin(theta / 2.0);
238m_Xyzw[0] =
T(axis[0]*sin_theta);
239m_Xyzw[1] =
T(axis[1]*sin_theta);
240m_Xyzw[2] =
T(axis[2]*sin_theta);
241m_Xyzw[3] =
T(cos_theta);
250 Tnew_x =
W() * q.
X() + X() * q.
W() + ( Y() * q.
Z() -
Z() * q.
Y() );
251 Tnew_y =
W() * q.
Y() + Y() * q.
W() + (
Z() * q.
X() - X() * q.
Z() );
252 Tnew_z =
W() * q.
Z() +
Z() * q.
W() + ( X() * q.
Y() - Y() * q.
X() );
253 Tnew_w =
W() * q.
W() - (X() * q.
X() + Y() * q.
Y() +
Z() * q.
Z());
308 TNq = m_Xyzw[0]*m_Xyzw[0] +
309m_Xyzw[1]*m_Xyzw[1] +
310m_Xyzw[2]*m_Xyzw[2] +
312 Ts = (Nq > 0) ? (
T(2.0) / Nq) : 0;
326m(0,0) =
T(1.0) - (yy + zz);
330m(1,1) =
T(1.0) - (xx + zz);
334m(2,2) =
T(1.0) - (xx + yy);
363 returnsqrt(Length2());
372 return(m_Xyzw[0]*m_Xyzw[0] +
373m_Xyzw[1]*m_Xyzw[1] +
374m_Xyzw[2]*m_Xyzw[2] +
375m_Xyzw[3]*m_Xyzw[3]);
384 return(Conjugate() / Length2());
395 CQuat<T>p(point.
X(), point.
Y(), point.
Z(), 0);
402point.
X() = p.
X();
403point.
Y() = p.
Y();
404point.
Z() = p.
Z();
414o <<
"[("<< quat.
X() <<
", "<< quat.
Y() <<
", "<< quat.
Z()
415<<
"), "<< quat.
W() <<
"]";
Include a standard set of the NCBI C++ Toolkit most basic headers.
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
void ToMatrix(CMatrix4< T > &) const
CQuat< T > & operator+=(const CQuat< T > &)
CQuat< T > Conjugate(void) const
CQuat< T > Inverse(void) const
CQuat< T > operator-(const CQuat< T > &first, const CQuat< T > &second)
ostream & operator<<(ostream &o, const CQuat< T > &quat)
CMatrix4< T > ToMatrix(void) const
CQuat< T > operator*(const CQuat< T > &first, const CQuat< T > &second)
CQuat(const CVect3< T > &axis, T degrees)
void Rotate(CVect3< float > &point) const
CQuat< T > operator+(const CQuat< T > &first, const CQuat< T > &second)
CQuat(T x, T y, T z, T w)
CQuat< T > operator/(const CQuat< T > &first, T second)
bool operator!=(const CQuat< T > &first, const CQuat< T > &second)
bool operator==(const CQuat< T > &first, const CQuat< T > &second)
CQuat< T > & operator*=(const CQuat< T > &)
CQuat< T > & operator-=(const CQuat< T > &)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define Z
printf format modifier for size_t
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4