Public Member Functions | Static Public Attributes | Protected Attributes | Friends
Matrix4 Class Reference

A 3x3 matrix class. More...

#include <Matrix4.hh>

List of all members.

Public Member Functions

 Matrix4 ()
 Constructor.
 Matrix4 (const Matrix4 &m)
 Copy constructor.
 Matrix4 (double _v00, double _v01, double _v02, double _v03, double _v10, double _v11, double _v12, double _v13, double _v20, double _v21, double _v22, double _v23, double _v30, double _v31, double _v32, double _v33)
 Constructor.
virtual ~Matrix4 ()
 Destructor.
void Set (double _v00, double _v01, double _v02, double _v03, double _v10, double _v11, double _v12, double _v13, double _v20, double _v21, double _v22, double _v23, double _v30, double _v31, double _v32, double _v33)
 Set.
void SetTranslate (const Vector3 &_t)
 Set the translational values [ (0,3) (1,3) (2,3) ].
void SetScale (const Vector3 &_s)
 Set the scale.
bool IsAffine () const
 Return true if the matrix is affine.
Vector3 TransformAffine (const Vector3 &_v) const
 Perform an affine transformation.
const Matrix4operator= (const Matrix4 &_mat)
 Equal operator.
const Matrix4operator= (const Matrix3 &_mat)
 Equal operator for 3x3 matrix.
Matrix4 operator* (const Matrix4 &_mat) const
 Multiplication operator.
Matrix4 operator* (const Matrix3 &_mat) const
 Multiplication operator.
Vector3 operator* (const Vector3 &_vec) const
 Multiplication operator.
double * operator[] (size_t _row)
const double * operator[] (size_t _row) const

Static Public Attributes

static const Matrix4 IDENTITY
 Identity matrix.
static const Matrix4 ZERO
 Zero matrix.

Protected Attributes

double m [4][4]
 The 4x4 matrix.

Friends

std::ostream & operator<< (std::ostream &_out, const gazebo::math::Matrix4 &_m)
 Output operator.

Detailed Description

A 3x3 matrix class.


Constructor & Destructor Documentation

Matrix4 ( const Matrix4 m)

Copy constructor.

Parameters:
_mMatrix to copy
Matrix4 ( double  _v00,
double  _v01,
double  _v02,
double  _v03,
double  _v10,
double  _v11,
double  _v12,
double  _v13,
double  _v20,
double  _v21,
double  _v22,
double  _v23,
double  _v30,
double  _v31,
double  _v32,
double  _v33 
)

Constructor.

Parameters:
_v00Row 0, Col 0 value
_v01Row 0, Col 1 value
_v02Row 0, Col 2 value
_v03Row 0, Col 3 value
_v10Row 1, Col 0 value
_v11Row 1, Col 1 value
_v12Row 1, Col 2 value
_v13Row 1, Col 3 value
_v20Row 2, Col 0 value
_v21Row 2, Col 1 value
_v22Row 2, Col 2 value
_v23Row 2, Col 3 value
_v30Row 3, Col 0 value
_v31Row 3, Col 1 value
_v32Row 3, Col 2 value
_v33Row 3, Col 3 value

Member Function Documentation

bool IsAffine ( ) const

Return true if the matrix is affine.

Returns:
True if the matrix is affine
Matrix4 operator* ( const Matrix4 _mat) const

Multiplication operator.

Parameters:
_matIncoming matrix
Returns:
This matrix * _mat
Matrix4 operator* ( const Matrix3 _mat) const

Multiplication operator.

Parameters:
_matIncoming matrix
Returns:
This matrix * _mat
Vector3 operator* ( const Vector3 _vec) const

Multiplication operator.

Parameters:
_vecVector3
Returns:
Resulting vector from multiplication
const Matrix4& operator= ( const Matrix4 _mat)

Equal operator.

this = _mat

Parameters:
_matIncoming matrix
Returns:
The resulting matrix
const Matrix4& operator= ( const Matrix3 _mat)

Equal operator for 3x3 matrix.

Parameters:
_matIncoming matrix
Returns:
The resulting matrix
void Set ( double  _v00,
double  _v01,
double  _v02,
double  _v03,
double  _v10,
double  _v11,
double  _v12,
double  _v13,
double  _v20,
double  _v21,
double  _v22,
double  _v23,
double  _v30,
double  _v31,
double  _v32,
double  _v33 
)

Set.

Parameters:
_v00Row 0, Col 0 value
_v01Row 0, Col 1 value
_v02Row 0, Col 2 value
_v03Row 0, Col 3 value
_v10Row 1, Col 0 value
_v11Row 1, Col 1 value
_v12Row 1, Col 2 value
_v13Row 1, Col 3 value
_v20Row 2, Col 0 value
_v21Row 2, Col 1 value
_v22Row 2, Col 2 value
_v23Row 2, Col 3 value
_v30Row 3, Col 0 value
_v31Row 3, Col 1 value
_v32Row 3, Col 2 value
_v33Row 3, Col 3 value
void SetScale ( const Vector3 _s)

Set the scale.

Parameters:
_sscale
void SetTranslate ( const Vector3 _t)

Set the translational values [ (0,3) (1,3) (2,3) ].

Parameters:
_tValues to set
Vector3 TransformAffine ( const Vector3 _v) const

Perform an affine transformation.

Parameters:
_vVector3 value for the transformation
Returns:
The result of the transformation

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  _out,
const gazebo::math::Matrix4 _m 
) [friend]

Output operator.

Parameters:
_outOutput stream
_mMatrix to output

The documentation for this class was generated from the following file: