A 4x4 matrix class. More...
#include <ignition/math/Matrix4.hh>
Public Member Functions | |
Matrix4 () | |
Constructor. More... | |
Matrix4 (const Matrix4< T > &_m) | |
Copy constructor. More... | |
Matrix4 (T _v00, T _v01, T _v02, T _v03, T _v10, T _v11, T _v12, T _v13, T _v20, T _v21, T _v22, T _v23, T _v30, T _v31, T _v32, T _v33) | |
Constructor. More... | |
Matrix4 (const Quaternion< T > &_q) | |
Construct Matrix4 from a quaternion. More... | |
virtual | ~Matrix4 () |
Destructor. More... | |
void | Axis (const Vector3< T > &_axis, T _angle) |
Set the upper-left 3x3 matrix from an axis and angle. More... | |
Vector3< T > | EulerRotation (bool _firstSolution) const |
Get the rotation as a Euler angles. More... | |
Matrix4< T > | Inverse () const |
Return the inverse matrix. More... | |
bool | IsAffine () const |
Return true if the matrix is affine. More... | |
bool | operator!= (const Matrix4< T > &_m) const |
Inequality test operator. More... | |
const T & | operator() (size_t _row, size_t _col) const |
Get the value at the specified row, column index. More... | |
T & | operator() (size_t _row, size_t _col) |
Get a mutable version the value at the specified row, column index. More... | |
Matrix4< T > | operator* (const Matrix4< T > &_m2) const |
Multiplication operator. More... | |
Vector3< T > | operator* (const Vector3< T > &_vec) const |
Multiplication operator. More... | |
Matrix4< T > & | operator= (const Matrix4< T > &_mat) |
Equal operator. More... | |
const Matrix4< T > & | operator= (const Matrix3< T > &_mat) |
Equal operator for 3x3 matrix. More... | |
bool | operator== (const Matrix4< T > &_m) const |
Equality operator. More... | |
Pose3< T > | Pose () const |
Get the transformation as math::Pose. More... | |
Quaternion< T > | Rotation () const |
Get the rotation as a quaternion. More... | |
Vector3< T > | Scale () const |
Get the scale values as a Vector3<T> More... | |
void | Scale (const Vector3< T > &_s) |
Set the scale. More... | |
void | Scale (T _x, T _y, T _z) |
Set the scale. More... | |
void | Set (T _v00, T _v01, T _v02, T _v03, T _v10, T _v11, T _v12, T _v13, T _v20, T _v21, T _v22, T _v23, T _v30, T _v31, T _v32, T _v33) |
Change the values. More... | |
Vector3< T > | TransformAffine (const Vector3< T > &_v) const |
Perform an affine transformation. More... | |
void | Translate (const Vector3< T > &_t) |
Set the translational values [ (0, 3) (1, 3) (2, 3) ]. More... | |
void | Translate (T _x, T _y, T _z) |
Set the translational values [ (0, 3) (1, 3) (2, 3) ]. More... | |
Vector3< T > | Translation () const |
Get the translational values as a Vector3. More... | |
Static Public Attributes | |
static const Matrix4< T > | Identity |
Identity matrix. More... | |
static const Matrix4< T > | Zero |
Zero matrix. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const ignition::math::Matrix4< T > &_m) |
Stream insertion operator. More... | |
std::istream & | operator>> (std::istream &_in, ignition::math::Matrix4< T > &_m) |
Stream extraction operator. More... | |
A 4x4 matrix class.
|
inline |
Constructor.
|
inline |
Copy constructor.
_m | Matrix to copy |
|
inline |
Constructor.
[in] | _v00 | Row 0, Col 0 value |
[in] | _v01 | Row 0, Col 1 value |
[in] | _v02 | Row 0, Col 2 value |
[in] | _v03 | Row 0, Col 3 value |
[in] | _v10 | Row 1, Col 0 value |
[in] | _v11 | Row 1, Col 1 value |
[in] | _v12 | Row 1, Col 2 value |
[in] | _v13 | Row 1, Col 3 value |
[in] | _v20 | Row 2, Col 0 value |
[in] | _v21 | Row 2, Col 1 value |
[in] | _v22 | Row 2, Col 2 value |
[in] | _v23 | Row 2, Col 3 value |
[in] | _v30 | Row 3, Col 0 value |
[in] | _v31 | Row 3, Col 1 value |
[in] | _v32 | Row 3, Col 2 value |
[in] | _v33 | Row 3, Col 3 value |
|
inline |
Construct Matrix4 from a quaternion.
[in] | _q | Quaternion. |
|
inlinevirtual |
Destructor.
|
inline |
Set the upper-left 3x3 matrix from an axis and angle.
[in] | _axis | the axis |
[in] | _angle | ccw rotation around the axis in radians |
|
inline |
Get the rotation as a Euler angles.
[in] | _firstSolution | True to get the first Euler solution, false to get the second. |
|
inline |
Return the inverse matrix.
This is a non-destructive operation.
|
inline |
Return true if the matrix is affine.
Referenced by ignition::math::Matrix4< double >::TransformAffine().
|
inline |
Inequality test operator.
[in] | _m | Matrix4<T> to test |
|
inline |
Get the value at the specified row, column index.
[in] | _col | The column index |
[in] | _row | the row index |
|
inline |
Get a mutable version the value at the specified row, column index.
[in] | _col | The column index |
[in] | _row | The row index |
|
inline |
Multiplication operator.
_mat | Incoming matrix |
|
inline |
|
inline |
Equal operator.
this = _mat
_mat | Incoming matrix |
|
inline |
Equal operator for 3x3 matrix.
_mat | Incoming matrix |
|
inline |
Equality operator.
[in] | _m | Matrix3 to test |
|
inline |
Get the transformation as math::Pose.
|
inline |
Get the rotation as a quaternion.
algorithm from Ogre::Quaternion<T> source, which in turn is based on Ken Shoemake's article "Quaternion<T> Calculus and Fast Animation".
Referenced by ignition::math::Matrix4< double >::Pose().
|
inline |
Get the scale values as a Vector3<T>
|
inline |
Set the scale.
[in] | _s | scale |
|
inline |
Set the scale.
[in] | _x | X scale value. |
[in] | _y | Y scale value. |
[in] | _z | Z scale value. |
|
inline |
Change the values.
[in] | _v00 | Row 0, Col 0 value |
[in] | _v01 | Row 0, Col 1 value |
[in] | _v02 | Row 0, Col 2 value |
[in] | _v03 | Row 0, Col 3 value |
[in] | _v10 | Row 1, Col 0 value |
[in] | _v11 | Row 1, Col 1 value |
[in] | _v12 | Row 1, Col 2 value |
[in] | _v13 | Row 1, Col 3 value |
[in] | _v20 | Row 2, Col 0 value |
[in] | _v21 | Row 2, Col 1 value |
[in] | _v22 | Row 2, Col 2 value |
[in] | _v23 | Row 2, Col 3 value |
[in] | _v30 | Row 3, Col 0 value |
[in] | _v31 | Row 3, Col 1 value |
[in] | _v32 | Row 3, Col 2 value |
[in] | _v33 | Row 3, Col 3 value |
Referenced by ignition::math::Matrix4< double >::Matrix4().
|
inline |
Perform an affine transformation.
_v | Vector3 value for the transformation |
AffineException | when matrix is not affine. |
|
inline |
Set the translational values [ (0, 3) (1, 3) (2, 3) ].
[in] | _t | Values to set |
|
inline |
Set the translational values [ (0, 3) (1, 3) (2, 3) ].
[in] | _x | X translation value. |
[in] | _y | Y translation value. |
[in] | _z | Z translation value. |
|
inline |
Get the translational values as a Vector3.
Referenced by ignition::math::Matrix4< double >::Pose().
|
friend |
Stream insertion operator.
_out | output stream |
_m | Matrix to output |
|
friend |
Stream extraction operator.
_in | input stream |
_pt | Matrix4<T> to read values into |
|
static |
Identity matrix.
|
static |
Zero matrix.