zenilib
0.5.3.0
|
A Featureful Quaternion Class. More...
#include <Quaternion.h>
Public Member Functions | |
Quaternion (const bool °enerate_=false) | |
Quaternion (const float &time, const Vector3f &space, const bool °enerate_=false) | |
For advanced use only. More... | |
Quaternion (const float &yaw, const float &pitch, const float &roll, const bool °enerate_=false) | |
Quaternion (const Quaternion &rhs, const bool °enerate_=false) | |
Quaternion | absolute_value () const |
Quaternion | adjoint () const |
Quaternion | conjugate () const |
Get the spacial conjugation. More... | |
Quaternion | determinant () const |
Quaternion | euclidean_even_product (const Quaternion &rhs) const |
Get the Euclidean even/inner-product. More... | |
Quaternion | euclidean_odd_product (const Quaternion &rhs) const |
Get the Euclidean odd/outer-product. More... | |
Quaternion | euclidean_product (const Quaternion &rhs) const |
Get the Euclidean product. More... | |
Matrix4f | get_matrix () const |
Get the matrix form of the rotation in row-major order. More... | |
std::pair< Vector3f, float > | get_rotation () const |
Get the rotation in radians left about an axis. More... | |
Quaternion | grassman_even_product (const Quaternion &rhs) const |
Get the Grassman even/inner-product. More... | |
Quaternion | grassman_odd_product (const Quaternion &rhs) const |
Get the Grassman odd/outer-product. More... | |
Quaternion | grassman_product (const Quaternion &rhs) const |
Get the Grassman-product. More... | |
float | magnitude () const |
Get the magnitude of the vector. More... | |
float | magnitude2 () const |
Get the 'magnitude squared' of the vector. More... | |
Quaternion | norm () const |
Quaternion & | normalize () |
Normalize the vector. More... | |
Quaternion | normalized () const |
Get the normalized vector. More... | |
Quaternion | operator* (const Quaternion &rhs) const |
Get the grassman_product. More... | |
Quaternion | operator* (const float &rhs) const |
Get the scalar multiple. More... | |
Vector3f | operator* (const Vector3f &rhs) const |
Rotate a vector, maintaining constant magnitude. More... | |
Quaternion | operator*= (const Quaternion &rhs) |
Get the grassman_odd_product. More... | |
Quaternion & | operator*= (const float &rhs) |
Set equal to the scalar multiple. More... | |
Quaternion | operator+ (const Quaternion &rhs) const |
Get the sum. More... | |
Quaternion & | operator+= (const Quaternion &rhs) |
Set equal to the sum. More... | |
Quaternion | operator- (const Quaternion &rhs) const |
Get the difference. More... | |
Quaternion | operator- () const |
Get the negation. More... | |
Quaternion & | operator-= (const Quaternion &rhs) |
Set equal to the difference. More... | |
Quaternion | operator/ (const float &rhs) const |
Get the scalar... something. More... | |
Quaternion & | operator/= (const float &rhs) |
Set equal to the scalar something. More... | |
const float & | operator[] (const int &index) const |
Get 'index'. More... | |
float & | operator[] (const int &index) |
Get 'index'. More... | |
Quaternion | reciprocal () const |
Static Public Member Functions | |
static Quaternion | Axis_Angle (const Vector3f &v, const float &theta) |
Create a Quaternion from an Axis/Angle pair. More... | |
static Quaternion | Forward_Up (const Vector3f &destination_forward, const Vector3f &destination_up, const Vector3f &default_forward=ZENI_DEFAULT_FORWARD_VECTOR, const Vector3f &default_up=ZENI_DEFAULT_UP_VECTOR) |
Create a Quaternion from a Forward/Up Vector3f pair. More... | |
static Quaternion | Vector3f_to_Vector3f (const Vector3f &destination, const Vector3f &source) |
Create a Quaternion rotating to one Vector3f from another. More... | |
Public Attributes | |
bool | degenerate |
Vector3f | space |
float | time |
A Featureful Quaternion Class.
Quaternion provides functionality for representing "pure" rotations. You can think of a Quaternion as the combination of an axis and an angle.
Contact: bazal d@ze nipex .com
Definition at line 44 of file Quaternion.h.
Definition at line 34 of file Quaternion.hxx.
Referenced by absolute_value(), Axis_Angle(), conjugate(), determinant(), euclidean_even_product(), euclidean_odd_product(), euclidean_product(), Forward_Up(), grassman_even_product(), grassman_odd_product(), grassman_product(), norm(), normalized(), operator*(), operator+(), operator-(), operator/(), and Vector3f_to_Vector3f().
Zeni::Quaternion::Quaternion | ( | const float & | time, |
const Vector3f & | space, | ||
const bool & | degenerate_ = false |
||
) |
For advanced use only.
Definition at line 26 of file Quaternion.cpp.
Zeni::Quaternion::Quaternion | ( | const float & | yaw, |
const float & | pitch, | ||
const float & | roll, | ||
const bool & | degenerate_ = false |
||
) |
Definition at line 97 of file Quaternion.cpp.
References cos(), Zeni::Vector3f::i, Zeni::Vector3f::j, Zeni::Vector3f::k, sin(), space, and time.
Zeni::Quaternion::Quaternion | ( | const Quaternion & | rhs, |
const bool & | degenerate_ = false |
||
) |
Definition at line 117 of file Quaternion.cpp.
|
inline |
Definition at line 136 of file Quaternion.hxx.
References degenerate, magnitude(), and Quaternion().
|
inline |
Definition at line 149 of file Quaternion.hxx.
References conjugate(), and norm().
|
static |
Create a Quaternion from an Axis/Angle pair.
Definition at line 56 of file Quaternion.cpp.
References cos(), Zeni::Vector3f::degenerate, Zeni::Vector3f::normalized(), Quaternion(), sin(), and time.
Referenced by Zeni::Camera::adjust_pitch(), Zeni::Camera::adjust_roll(), Zeni::Camera::adjust_yaw(), Forward_Up(), Zeni::Model::get_position(), Zeni::Camera::turn_left_xy(), and Vector3f_to_Vector3f().
|
inline |
Get the spacial conjugation.
Definition at line 127 of file Quaternion.hxx.
References degenerate, Quaternion(), space, and time.
Referenced by adjoint(), and reciprocal().
|
inline |
Definition at line 144 of file Quaternion.hxx.
References degenerate, magnitude2(), and Quaternion().
|
inline |
Get the Euclidean even/inner-product.
Definition at line 87 of file Quaternion.hxx.
References degenerate, Quaternion(), space, and time.
|
inline |
Get the Euclidean odd/outer-product.
Definition at line 91 of file Quaternion.hxx.
References degenerate, Quaternion(), space, and time.
|
inline |
Get the Euclidean product.
Definition at line 83 of file Quaternion.hxx.
References degenerate, Quaternion(), space, and time.
|
static |
Create a Quaternion from a Forward/Up Vector3f pair.
Definition at line 66 of file Quaternion.cpp.
References Zeni::Vector3f::angle_between(), Axis_Angle(), degenerate, INFINTESSIMAL, Zeni::Global::pi, and Quaternion().
Referenced by Zeni::Camera::look_at().
|
inline |
Get the matrix form of the rotation in row-major order.
Definition at line 199 of file Quaternion.hxx.
References Zeni::Vector3f::i, Zeni::Vector3f::j, Zeni::Vector3f::k, space, and time.
Referenced by Zeni::Matrix4f::Rotate().
|
inline |
Get the rotation in radians left about an axis.
Definition at line 182 of file Quaternion.hxx.
References fabs(), normalized(), space, and time.
Referenced by Zeni::Video::rotate_scene(), and Zeni::Model::set_rotate().
|
inline |
Get the Grassman even/inner-product.
Definition at line 75 of file Quaternion.hxx.
References degenerate, Quaternion(), space, and time.
|
inline |
Get the Grassman odd/outer-product.
Definition at line 79 of file Quaternion.hxx.
References degenerate, Quaternion(), and space.
|
inline |
Get the Grassman-product.
Definition at line 71 of file Quaternion.hxx.
References degenerate, Quaternion(), space, and time.
Referenced by operator*(), and operator*=().
|
inline |
Get the magnitude of the vector.
Definition at line 123 of file Quaternion.hxx.
References magnitude2().
Referenced by absolute_value(), normalize(), and normalized().
|
inline |
Get the 'magnitude squared' of the vector.
Definition at line 119 of file Quaternion.hxx.
Referenced by determinant(), magnitude(), and norm().
|
inline |
Definition at line 140 of file Quaternion.hxx.
References degenerate, magnitude2(), and Quaternion().
Referenced by adjoint().
Quaternion & Zeni::Quaternion::normalize | ( | ) |
Normalize the vector.
Definition at line 124 of file Quaternion.cpp.
References degenerate, INFINTESSIMAL, magnitude(), space, and time.
Quaternion Zeni::Quaternion::normalized | ( | ) | const |
Get the normalized vector.
Definition at line 140 of file Quaternion.cpp.
References INFINTESSIMAL, magnitude(), Quaternion(), space, and time.
Referenced by get_rotation(), and Vector3f_to_Vector3f().
|
inline |
Get the grassman_product.
Definition at line 63 of file Quaternion.hxx.
References grassman_product().
|
inline |
Get the scalar multiple.
Definition at line 95 of file Quaternion.hxx.
References degenerate, Quaternion(), space, and time.
Rotate a vector, maintaining constant magnitude.
Definition at line 153 of file Quaternion.hxx.
References d, degenerate, Zeni::Vector3f::degenerate, Zeni::Vector3f::i, Zeni::Vector3f::j, Zeni::Vector3f::k, space, t2, and time.
|
inline |
Get the grassman_odd_product.
Definition at line 67 of file Quaternion.hxx.
References grassman_product().
|
inline |
Set equal to the scalar multiple.
Definition at line 103 of file Quaternion.hxx.
|
inline |
Get the sum.
Definition at line 41 of file Quaternion.hxx.
References degenerate, Quaternion(), space, and time.
|
inline |
Set equal to the sum.
Definition at line 49 of file Quaternion.hxx.
References degenerate, space, and time.
|
inline |
Get the difference.
Definition at line 45 of file Quaternion.hxx.
References degenerate, Quaternion(), space, and time.
|
inline |
Get the negation.
Definition at line 115 of file Quaternion.hxx.
References degenerate, Quaternion(), space, and time.
|
inline |
Set equal to the difference.
Definition at line 56 of file Quaternion.hxx.
References degenerate, space, and time.
|
inline |
Get the scalar... something.
Definition at line 99 of file Quaternion.hxx.
References degenerate, Quaternion(), space, and time.
|
inline |
Set equal to the scalar something.
Definition at line 109 of file Quaternion.hxx.
|
inline |
Definition at line 131 of file Quaternion.hxx.
References conjugate(), and time.
|
static |
Create a Quaternion rotating to one Vector3f from another.
Definition at line 33 of file Quaternion.cpp.
References Zeni::Vector3f::angle_between(), Axis_Angle(), degenerate, Zeni::Vector3f::i, INFINTESSIMAL, Zeni::Vector3f::j, Zeni::Vector3f::k, normalized(), Zeni::Global::pi, and Quaternion().
bool Zeni::Quaternion::degenerate |
Definition at line 107 of file Quaternion.h.
Referenced by absolute_value(), conjugate(), determinant(), euclidean_even_product(), euclidean_odd_product(), euclidean_product(), Forward_Up(), grassman_even_product(), grassman_odd_product(), grassman_product(), norm(), normalize(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), and Vector3f_to_Vector3f().
Vector3f Zeni::Quaternion::space |
Definition at line 105 of file Quaternion.h.
Referenced by conjugate(), euclidean_even_product(), euclidean_odd_product(), euclidean_product(), get_matrix(), get_rotation(), grassman_even_product(), grassman_odd_product(), grassman_product(), magnitude2(), normalize(), normalized(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), Quaternion(), Zeni::serialize(), and Zeni::unserialize().
float Zeni::Quaternion::time |
Definition at line 104 of file Quaternion.h.
Referenced by Axis_Angle(), conjugate(), euclidean_even_product(), euclidean_odd_product(), euclidean_product(), get_matrix(), get_rotation(), grassman_even_product(), grassman_product(), magnitude2(), normalize(), normalized(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator[](), Quaternion(), reciprocal(), Zeni::serialize(), and Zeni::unserialize().