#include <matrix.h>

Public Member Functions | |
| matrix4 (void) | |
| Default Constructor. | |
| matrix4 (real_t d00, real_t d01, real_t d02, real_t d10, real_t d11, real_t d12, real_t d20, real_t d21, real_t d22) | |
| Rotation Set Constructor. | |
| matrix4 (real_t d00, real_t d01, real_t d02, real_t d03, real_t d10, real_t d11, real_t d12, real_t d13, real_t d20, real_t d21, real_t d22, real_t d23, real_t d30, real_t d31, real_t d32, real_t d33) | |
| Full Matrix Constructor. | |
| matrix4 (const math::matrix4 &m) | |
| Copy Constructor. | |
| virtual | ~matrix4 (void) |
| Destructor. | |
| math::matrix4 & | operator= (const math::matrix4 &m) |
| Assignment Operator. | |
| operator const real_t * (void) const | |
| void | set (real_t d00, real_t d01, real_t d02, real_t d10, real_t d11, real_t d12, real_t d20, real_t d21, real_t d22) |
| Sets rotation part of matrix. | |
| void | set (real_t d00, real_t d01, real_t d02, real_t d03, real_t d10, real_t d11, real_t d12, real_t d13, real_t d20, real_t d21, real_t d22, real_t d23, real_t d30, real_t d31, real_t d32, real_t d33) |
| Sets the matrix. | |
| void | set (unsigned int row, unsigned int col, real_t x) |
| Set the element at row, col to x. | |
| real_t | operator() (unsigned int row, unsigned int col) const |
| Get the element at row, col. | |
| real_t & | operator() (unsigned int row, unsigned int col) |
| Return a reference to the element at row, col. | |
| math::vector3 | operator* (const math::vector3 &v) const |
| Matrix Vector Mulitplication. | |
| math::matrix4 | operator* (const math::matrix4 &rhs) const |
| Matrix Multiplication. | |
| math::matrix4 | operator+ (const math::matrix4 &rhs) const |
| Matrix Addition. | |
| math::matrix4 | operator- (const math::matrix4 &rhs) const |
| Matrix Subtraction. | |
| void | transpose (void) |
| Transposes the matrix. | |
| void | set_identity () |
| Sets the matirx to the identity matrix. | |
| void | from_angle_axis (real_t radians, const math::vector3 &axis) |
| Creates a rotation matrix given around an arbitrary axis. | |
| math::matrix4 | get_inverted_rotation (void) const |
| Computes the inverse of the rotation matrix. | |
| void | set_translation (const math::vector3 &trans) |
| Sets the translation part of the matrix. | |
| math::vector3 | get_translation (void) const |
| Returns a vector describing the translation part of the matrix. | |
| math::vector3 | get_radians (void) |
| Returns the Euler angle rotation in radians. | |
| math::vector3 | get_degrees (void) |
| Returns the Euler angle rotation in degrees. | |
| void | from_matrix3 (const real_t *mat) |
| Sets the matrix from a 3x3 rotation matrix. | |
| void | from_matrix4 (const real_t *mat) |
| Sets the matrix from a 4x4 rotation matrix. | |
Static Public Attributes | |
| static const math::matrix4 | IDENTITY |
| The identity matrix. | |
| static const math::matrix4 | ZERO |
| The zero matrix. | |
Protected Attributes | |
| real_t | m_data [4][4] |
| Actual matrix data. | |
Friends | |
| math::vector3 | math::operator* (const math::vector3 &v, const math::matrix4 &m) |
| Vector Matrix Mulitplication. | |
| std::ostream & | math::operator<< (std::ostream &o, const math::matrix4 &m) |
stream output operator. | |
A 4x4 matrix in row major format:
Where
Definition at line 59 of file matrix.h.
| math::matrix4::matrix4 | ( | real_t | d00, | |
| real_t | d01, | |||
| real_t | d02, | |||
| real_t | d10, | |||
| real_t | d11, | |||
| real_t | d12, | |||
| real_t | d20, | |||
| real_t | d21, | |||
| real_t | d22 | |||
| ) |
Rotation Set Constructor.
Sets the matrix as follows:
Definition at line 50 of file matrix.cpp.
References m_data.
| math::matrix4::matrix4 | ( | real_t | d00, | |
| real_t | d01, | |||
| real_t | d02, | |||
| real_t | d03, | |||
| real_t | d10, | |||
| real_t | d11, | |||
| real_t | d12, | |||
| real_t | d13, | |||
| real_t | d20, | |||
| real_t | d21, | |||
| real_t | d22, | |||
| real_t | d23, | |||
| real_t | d30, | |||
| real_t | d31, | |||
| real_t | d32, | |||
| real_t | d33 | |||
| ) |
Full Matrix Constructor.
Sets the matrix as follows:
Definition at line 77 of file matrix.cpp.
References m_data.
| void math::matrix4::from_angle_axis | ( | real_t | radians, | |
| const math::vector3 & | axis | |||
| ) |
Creates a rotation matrix given around an arbitrary axis.
Given an axis and an angle, this method will create and set this matrix as the rotation matrix that describes the rotation around the axis by angle.
| radians | A real number in radians. | |
| axis | A unit length vector describing the axis to rotate around. |
Definition at line 269 of file matrix.cpp.
References m_data, math::vector3::x(), math::vector3::y(), and math::vector3::z().
| void math::matrix4::from_matrix3 | ( | const real_t * | mat | ) |
Sets the matrix from a 3x3 rotation matrix.
| mat | Pointer to an real_t[ 9 ] representing a rotation matrix. Matrix is assumed to be stored in row major format. |
Definition at line 388 of file matrix.cpp.
| void math::matrix4::from_matrix4 | ( | const real_t * | mat | ) |
Sets the matrix from a 4x4 rotation matrix.
| mat | Pointer to an real_t[ 16 ] representing a matrix. Matrix is assumed to be stored in row major format. |
Definition at line 399 of file matrix.cpp.
| math::matrix4 math::matrix4::get_inverted_rotation | ( | void | ) | const |
Computes the inverse of the rotation matrix.
Inverts the rotation part of this matrix.
Definition at line 302 of file matrix.cpp.
References math::equals(), IDENTITY, and m_data.
| math::matrix4::operator const real_t * | ( | void | ) | const [inline] |
| real_t& math::matrix4::operator() | ( | unsigned int | row, | |
| unsigned int | col | |||
| ) | [inline] |
| real_t math::matrix4::operator() | ( | unsigned int | row, | |
| unsigned int | col | |||
| ) | const [inline] |
| math::vector3 math::matrix4::operator* | ( | const math::vector3 & | v | ) | const |
Matrix Vector Mulitplication.
Multiplies the matrix m by vector v. The operation is defined as:
Definition at line 185 of file matrix.cpp.
References m_data, math::vector3::x(), math::vector3::y(), and math::vector3::z().
| void math::matrix4::set | ( | unsigned int | row, | |
| unsigned int | col, | |||
| real_t | x | |||
| ) | [inline] |
| void math::matrix4::set | ( | real_t | d00, | |
| real_t | d01, | |||
| real_t | d02, | |||
| real_t | d03, | |||
| real_t | d10, | |||
| real_t | d11, | |||
| real_t | d12, | |||
| real_t | d13, | |||
| real_t | d20, | |||
| real_t | d21, | |||
| real_t | d22, | |||
| real_t | d23, | |||
| real_t | d30, | |||
| real_t | d31, | |||
| real_t | d32, | |||
| real_t | d33 | |||
| ) |
Sets the matrix.
Sets the matrix as follows:
Definition at line 156 of file matrix.cpp.
References m_data.
| void math::matrix4::set | ( | real_t | d00, | |
| real_t | d01, | |||
| real_t | d02, | |||
| real_t | d10, | |||
| real_t | d11, | |||
| real_t | d12, | |||
| real_t | d20, | |||
| real_t | d21, | |||
| real_t | d22 | |||
| ) |
Sets rotation part of matrix.
Sets the matrix as follows:
Definition at line 128 of file matrix.cpp.
References m_data.
Referenced by math::quaternion::get_rotation_matrix(), and math::quaternion::get_transposed_rotation_matrix().
| void math::matrix4::set_identity | ( | ) | [inline] |
| void math::matrix4::set_translation | ( | const math::vector3 & | trans | ) | [inline] |
Sets the translation part of the matrix.
Sets the matrix as follows:
| trans | A vector describing the new translation. |
Definition at line 313 of file matrix.h.
References m_data, math::vector3::x(), math::vector3::y(), and math::vector3::z().
| void math::matrix4::transpose | ( | void | ) |
Transposes the matrix.
Sets the matrix
to
.
Definition at line 243 of file matrix.cpp.
References m_data, and math::swap().
| math::vector3 math::operator* | ( | const math::vector3 & | v, | |
| const math::matrix4 & | m | |||
| ) | [friend] |
Vector Matrix Mulitplication.
Multiplies the vector v by the matrix m. The operation is defined as:
const math::matrix4 math::matrix4::IDENTITY [static] |
The identity matrix.
The identity matrix is defined as:
Definition at line 358 of file matrix.h.
Referenced by get_inverted_rotation(), and set_identity().
const math::matrix4 math::matrix4::ZERO [static] |
1.5.7.1