18 #ifndef ZENI_QUATERNION_HXX
19 #define ZENI_QUATERNION_HXX
36 space(0.0
f, 0.0
f, 0.0
f),
37 degenerate(degenerate_)
133 return star / (*
this * star).
time;
154 const float &
a =
time;
158 const float &
v1 = rhs.
i;
159 const float &
v2 = rhs.
j;
160 const float &
v3 = rhs.
k;
165 const float t2 = a *
b;
166 const float t3 = a *
c;
167 const float t4 = a *
d;
168 const float t5 = -b *
b;
169 const float t6 = b *
c;
170 const float t7 = b *
d;
171 const float t8 = -c *
c;
172 const float t9 = c *
d;
173 const float t10 = -d *
d;
175 const float v1new = 2.0f * ((t8 + t10) * v1 + (t6 - t4) * v2 + (t3 + t7) * v3) +
v1;
176 const float v2new = 2.0f * ((t4 + t6) * v1 + (t5 + t10) * v2 + (t9 -
t2) * v3) +
v2;
177 const float v3new = 2.0f * ((t7 - t3) * v1 + (t2 + t9) * v2 + (t5 + t8) * v3) +
v3;
187 else if(q.
time > 1.0f)
190 const float angle = 2.0f * float(acos(q.
time));
191 float s = float(sqrt(1.0
f - q.
time * q.
time));
194 return std::make_pair(q.
space, angle);
196 return std::make_pair(q.
space / s, angle);
211 1.0
f - 2.0
f * (y2 + z2),
217 1.0
f - 2.0
f * (x2 + z2),
223 1.0
f - 2.0
f * (x2 + y2),
226 0.0
f, 0.0
f, 0.0
f, 1.0
f);
230 assert(-1 < index && index < 4);
231 const float *
const ptr = &
time;
236 assert(-1 < index && index < 4);
237 float *
const ptr = &
time;
Quaternion & operator+=(const Quaternion &rhs)
Set equal to the sum.
Quaternion absolute_value() const
Quaternion adjoint() const
Quaternion reciprocal() const
GLfloat GLfloat GLfloat GLfloat v3
GLboolean GLboolean GLboolean GLboolean a
Matrix4f get_matrix() const
Get the matrix form of the rotation in row-major order.
Quaternion euclidean_product(const Quaternion &rhs) const
Get the Euclidean product.
Quaternion grassman_odd_product(const Quaternion &rhs) const
Get the Grassman odd/outer-product.
return Display return Display Bool Bool int d
GLfixed GLfixed GLfixed y2
Quaternion euclidean_even_product(const Quaternion &rhs) const
Get the Euclidean even/inner-product.
Quaternion operator+(const Quaternion &rhs) const
Get the sum.
Quaternion euclidean_odd_product(const Quaternion &rhs) const
Get the Euclidean odd/outer-product.
A Featureful 3-Space Vector Class.
std::pair< Vector3f, float > get_rotation() const
Get the rotation in radians left about an axis.
Quaternion normalized() const
Get the normalized vector.
Quaternion conjugate() const
Get the spacial conjugation.
Quaternion grassman_product(const Quaternion &rhs) const
Get the Grassman-product.
Quaternion & operator/=(const float &rhs)
Set equal to the scalar something.
A Featureful Quaternion Class.
Quaternion & operator-=(const Quaternion &rhs)
Set equal to the difference.
Quaternion operator*(const Quaternion &rhs) const
Get the grassman_product.
float magnitude() const
Get the magnitude of the vector.
const float & operator[](const int &index) const
Get 'index'.
Quaternion operator*=(const Quaternion &rhs)
Get the grassman_odd_product.
Quaternion determinant() const
Quaternion operator/(const float &rhs) const
Get the scalar... something.
GLdouble GLdouble GLdouble GLdouble q
Quaternion(const bool °enerate_=false)
GLdouble GLdouble GLdouble b
A Featureful 4-Space Matrix Class.
Quaternion operator-() const
Get the negation.
float magnitude2() const
Get the 'magnitude squared' of the vector.
Quaternion grassman_even_product(const Quaternion &rhs) const
Get the Grassman even/inner-product.
GLfloat GLfloat GLfloat v2