Public Member Functions | Public Attributes

ml7::Matrix3x3 Class Reference

#include <Matrix3x3.h>

List of all members.

Public Member Functions

 Matrix3x3 (void)
 Matrix3x3 (const Matrix3x3 &m)
Matrix3x3operator= (const Matrix3x3 &m)
void swap (Matrix3x3 &m)
 ~Matrix3x3 (void)
 Matrix3x3 (const float _11, const float _12, const float _13, const float _21, const float _22, const float _23, const float _31, const float _32, const float _33)
 Matrix3x3 (const Vector3 &x, const Vector3 &y, const Vector3 &z)
 Matrix3x3 (const Vector3 &v, const float phi)
 Matrix3x3 (const Vector3 &v)
 Matrix3x3 (const Quaternion &q)
const float det () const
const Matrix3x3 transposed () const
const Matrix3x3 inverted () const
const float operator[] (unsigned index) const
float & operator[] (unsigned index)
const Vector3 get (unsigned i) const
const Matrix3x3set (unsigned i, const Vector3 &v)
const Matrix3x3set (const ml7::Vector3 &x, const ml7::Vector3 &y, const ml7::Vector3 &z)
const Vector3 axis () const
const float angle () const
void axisangle (Vector3 *v, float *phi) const
const Quaternion rotation () const
const Matrix3x3 operator- () const
const Matrix3x3 operator+ (const Matrix3x3 &m) const
const Matrix3x3 operator- (const Matrix3x3 &m) const
const Matrix3x3 operator* (const float s) const
const Vector3 operator* (const Vector3 &v) const
const Matrix3x3 operator* (const Matrix3x3 &m) const
const Vector3 trans (const Vector3 &v) const
const Vector3 transinv (const Vector3 &v) const
Matrix3x3operator+= (const Matrix3x3 &m)
Matrix3x3operator-= (const Matrix3x3 &m)
Matrix3x3operator*= (const float s)
Matrix3x3operator*= (const Matrix3x3 &m)
Matrix3x3clear ()
Matrix3x3identity ()
Matrix3x3transpose ()
Matrix3x3transpose (const Matrix3x3 &m)
Matrix3x3invert ()
Matrix3x3invert (const Matrix3x3 &m)
Matrix3x3rotation (const Vector3 &v, const float phi)
Matrix3x3rotation (const Vector3 &v)
Matrix3x3rotation (const Quaternion &q)
Matrix3x3rotx (const float alpha)
Matrix3x3roty (const float beta)
Matrix3x3rotz (const float gamma)
const bool operator== (const Matrix3x3 &m) const
const bool operator!= (const Matrix3x3 &m) const
const bool operator< (const Matrix3x3 &m) const
const bool operator> (const Matrix3x3 &m) const
const bool operator<= (const Matrix3x3 &m) const
const bool operator>= (const Matrix3x3 &m) const
 operator const float *const () const
 operator float *const ()

Public Attributes

union {
   struct {
      float   _11
      float   _12
      float   _13
      float   _21
      float   _22
      float   _23
      float   _31
      float   _32
      float   _33
   } 
   float   data [9]
   float   m [3][3]
}; 

Detailed Description

Represents a 3x3-matrix for rotating 3d-vectors or holding inertia tensors of rigid bodies. Used for 3d-physics and -graphics.


Constructor & Destructor Documentation

ml7::Matrix3x3::Matrix3x3 ( void   )  [inline]

Default constructor. Creates a new identity matrix representing a zero rotation.

ml7::Matrix3x3::Matrix3x3 ( const Matrix3x3 m  )  [inline]

Copy constructor. Copies a given matrix m.

ml7::Matrix3x3::~Matrix3x3 ( void   )  [inline]

Destructor.

ml7::Matrix3x3::Matrix3x3 ( const float  _11,
const float  _12,
const float  _13,
const float  _21,
const float  _22,
const float  _23,
const float  _31,
const float  _32,
const float  _33 
) [inline]

Explicit constructor with parameters for each element.

ml7::Matrix3x3::Matrix3x3 ( const Vector3 x,
const Vector3 y,
const Vector3 z 
) [inline]

Explicit constructor with given three vectors making up the columns.

ml7::Matrix3x3::Matrix3x3 ( const Vector3 v,
const float  phi 
) [inline]

Explicit constructor with a given rotation axis v and a clockwise-angle phi.

ml7::Matrix3x3::Matrix3x3 ( const Vector3 v  )  [inline, explicit]

Explicit constructor with a given rotation axis v and a clockwise-angle given by the length of vector v.

ml7::Matrix3x3::Matrix3x3 ( const Quaternion q  )  [inline, explicit]

Explicit constructor with a given rotation quaternion q.


Member Function Documentation

const float ml7::Matrix3x3::angle (  )  const

Returns the angle of the clockwise rotation represented by this matrix.

const Vector3 ml7::Matrix3x3::axis (  )  const

Returns the axis of the clockwise rotation represented by this matrix.

void ml7::Matrix3x3::axisangle ( Vector3 v,
float *  phi 
) const

Determines the rotation axis v and the clockwise angle phi.

Matrix3x3 & ml7::Matrix3x3::clear (  ) 

Forces this matrix to be an empty matrix representing no legal rotation.

const float ml7::Matrix3x3::det (  )  const

Returns the determinant of this matrix.

const Vector3 ml7::Matrix3x3::get ( unsigned  i  )  const [inline]

Returns the i-th (0-indexed) column vector of this matrix.

Matrix3x3 & ml7::Matrix3x3::identity (  ) 

Forces this matrix to be an identity matrix representing a zero rotation.

Matrix3x3 & ml7::Matrix3x3::invert ( const Matrix3x3 m  ) 

Replaces this matrix by a given matrix m inverted. Fortunately we have to deal with a rotation matrix so we confidently may do a transposition instead of an expensive inversion.

Matrix3x3 & ml7::Matrix3x3::invert (  ) 

Inverts this matrix. Fortunately we have to deal with a rotation matrix so we confidently may do a transposition instead of an expensive inversion.

const Matrix3x3 ml7::Matrix3x3::inverted (  )  const [inline]

Copies this matrix and inverts it. Fortunately we have to deal with a rotation matrix so we confidently may do a transposition instead of an expensive inversion.

ml7::Matrix3x3::operator const float *const (  )  const [inline]
ml7::Matrix3x3::operator float *const (  )  [inline]
const bool ml7::Matrix3x3::operator!= ( const Matrix3x3 m  )  const

Checks if a given matrix m and this have non-identical elements.

const Matrix3x3 ml7::Matrix3x3::operator* ( const float  s  )  const

Returns a copy of this matrix scaled by a given scalar s.

const Vector3 ml7::Matrix3x3::operator* ( const Vector3 v  )  const

Returns a copy of a given vector v tranformed by this matrix.

const Matrix3x3 ml7::Matrix3x3::operator* ( const Matrix3x3 m  )  const

Returns a copy of a given matrix m transformed by this.

Matrix3x3 & ml7::Matrix3x3::operator*= ( const float  s  ) 

Scales this matrix by a given scalar s.

Matrix3x3& ml7::Matrix3x3::operator*= ( const Matrix3x3 m  )  [inline]

Transforms this matrix by a given matrix m. It results in an operation identical to m * this.

const Matrix3x3 ml7::Matrix3x3::operator+ ( const Matrix3x3 m  )  const

Returns a given matrix m added to this.

Matrix3x3 & ml7::Matrix3x3::operator+= ( const Matrix3x3 m  ) 

Adds a given matrix m to this.

const Matrix3x3 ml7::Matrix3x3::operator- ( const Matrix3x3 m  )  const

Returns a given matrix m subtracted from this.

const Matrix3x3 ml7::Matrix3x3::operator- (  )  const [inline]

Returns a copy of this matrix with the elements having signs flipped.

Matrix3x3 & ml7::Matrix3x3::operator-= ( const Matrix3x3 m  ) 

Subtracts a given matrix m from this.

const bool ml7::Matrix3x3::operator< ( const Matrix3x3 m  )  const [inline]

Checks if the angle of the rotation represented by this matrix is less than that of a given matrix m.

const bool ml7::Matrix3x3::operator<= ( const Matrix3x3 m  )  const [inline]

Checks if the angle of the rotation represented by this matrix is less than or equal to that of a given matrix m.

Matrix3x3& ml7::Matrix3x3::operator= ( const Matrix3x3 m  )  [inline]

Copy assignment operator. Copies the elements of a given matrix m.

const bool ml7::Matrix3x3::operator== ( const Matrix3x3 m  )  const

Checks if a given matrix m and this have identical elements.

const bool ml7::Matrix3x3::operator> ( const Matrix3x3 m  )  const [inline]

Checks if the angle of the rotation represented by this matrix is greater than that of a given matrix m.

const bool ml7::Matrix3x3::operator>= ( const Matrix3x3 m  )  const [inline]

Checks if the angle of the rotation represented by this matrix is greater than or equal to that of a given matrix m.

const float ml7::Matrix3x3::operator[] ( unsigned  index  )  const [inline]

Indexed component access.

float& ml7::Matrix3x3::operator[] ( unsigned  index  )  [inline]

Indexed component access.

Matrix3x3 & ml7::Matrix3x3::rotation ( const Vector3 v,
const float  phi 
)

Forces this matrix to be a rotation matrix with rotation axis v and a clockwise-angle phi.

Matrix3x3 & ml7::Matrix3x3::rotation ( const Vector3 v  ) 

Forces this matrix to be a rotation matrix with rotation axis v and a clockwise-angle given by the length of vector v.

Matrix3x3 & ml7::Matrix3x3::rotation ( const Quaternion q  ) 

Forces this matrix to be a rotation matrix defined by given the rotation quaternion q.

const Quaternion ml7::Matrix3x3::rotation (  )  const

Returns the quaternion of the clockwise rotation represented by this matrix.

Matrix3x3 & ml7::Matrix3x3::rotx ( const float  alpha  ) 

Forces this matrix to be a rotation matrix with rotation axis X and a clockwise-angle alpha.

Matrix3x3 & ml7::Matrix3x3::roty ( const float  beta  ) 

Forces this matrix to be a rotation matrix with rotation axis Y and a clockwise-angle beta.

Matrix3x3 & ml7::Matrix3x3::rotz ( const float  gamma  ) 

Forces this matrix to be a rotation matrix with rotation axis Z and a clockwise-angle gamma.

const Matrix3x3& ml7::Matrix3x3::set ( unsigned  i,
const Vector3 v 
) [inline]

Sets the i-th (0-indexed) column vector of this matrix.

const Matrix3x3& ml7::Matrix3x3::set ( const ml7::Vector3 x,
const ml7::Vector3 y,
const ml7::Vector3 z 
) [inline]

Sets the column vectors of this matrix.

void ml7::Matrix3x3::swap ( Matrix3x3 m  )  [inline]

Swap operation. Swaps the elements of a given matrix m with this.

const Vector3 ml7::Matrix3x3::trans ( const Vector3 v  )  const

Returns a copy of a given vector v transformed by this matrix.

const Vector3 ml7::Matrix3x3::transinv ( const Vector3 v  )  const

Returns a copy of a given vector v transformed by this matrix inverted.

Matrix3x3 & ml7::Matrix3x3::transpose (  ) 

Transposes this matrix.

Matrix3x3 & ml7::Matrix3x3::transpose ( const Matrix3x3 m  ) 

Replaces this matrix by a given matrix m transposed.

const Matrix3x3 ml7::Matrix3x3::transposed (  )  const [inline]

Copies this matrix and transposes it.


Member Data Documentation

union { ... }

Element in the 1st row and 1st column.

Element in the 1st row and 2nd column.

Element in the 1st row and 3rd column.

Element in the 2nd row and 1st column.

Element in the 2nd row and 2nd column.

Element in the 2nd row and 3rd column.

Element in the 3rd row and 1st column.

Element in the 3rd row and 2nd column.

Element in the 3rd row and 3rd column.

Array of the elements.

float ml7::Matrix3x3::m[3][3]

2d-array of the elements.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines