22 #ifndef __dgQuaternion__ 23 #define __dgQuaternion__ 30 DG_MSC_VECTOR_ALIGMENT
35 dgQuaternion(dgFloat32 q0, dgFloat32 q1, dgFloat32 q2, dgFloat32 q3);
38 void Scale(dgFloat32
scale);
40 inline dgFloat32 DotProduct(
const dgQuaternion &QB)
const;
54 } DG_GCC_VECTOR_ALIGMENT;
59 inline dgQuaternion::dgQuaternion() {
60 m_q0 = dgFloat32(1.0f);
61 m_q1 = dgFloat32(0.0f);
62 m_q2 = dgFloat32(0.0f);
63 m_q3 = dgFloat32(0.0f);
66 inline dgQuaternion::dgQuaternion(dgFloat32 Q0, dgFloat32 Q1, dgFloat32 Q2, dgFloat32 Q3) {
76 inline void dgQuaternion::Scale(dgFloat32
scale) {
83 inline void dgQuaternion::Normalize() {
84 Scale(dgRsqrt(DotProduct(*
this)));
87 inline dgFloat32 dgQuaternion::DotProduct(
const dgQuaternion &QB)
const {
88 return m_q0 * QB.m_q0 + m_q1 * QB.m_q1 + m_q2 * QB.m_q2 + m_q3 * QB.m_q3;
96 return dgQuaternion(m_q0 + B.m_q0, m_q1 + B.m_q1, m_q2 + B.m_q2, m_q3 + B.m_q3);
100 return dgQuaternion(m_q0 - B.m_q0, m_q1 - B.m_q1, m_q2 - B.m_q2, m_q3 - B.m_q3);
105 return dgQuaternion(B.m_q0 * m_q0 - B.m_q1 * m_q1 - B.m_q2 * m_q2 - B.m_q3 * m_q3,
106 B.m_q1 * m_q0 + B.m_q0 * m_q1 - B.m_q3 * m_q2 + B.m_q2 * m_q3,
107 B.m_q2 * m_q0 + B.m_q3 * m_q1 + B.m_q0 * m_q2 - B.m_q1 * m_q3,
108 B.m_q3 * m_q0 - B.m_q2 * m_q1 + B.m_q1 * m_q2 + B.m_q0 * m_q3);
Definition: dgVector.h:86
Definition: dgQuaternion.h:31
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: dgMatrix.h:41