public

Inheritance Graph

graph BT
	_Matrix4x4
	click _Matrix4x4 "classGeometry_1_1__Matrix4x4"

Description

4*4 matrix.

[ _Matrix4x4 ]

Construction

   
   
  _Matrix4x4()
   
  _Matrix4x4( value_t d0, value_t d1, value_t d2, value_t d3, value_t d4, value_t d5, value_t d6, value_t d7, value_t d8, value_t d9, value_t d10, value_t d11, value_t d12, value_t d13, value_t d14, value_t d15)
   
  _Matrix4x4(const value_t * data)
   
  _Matrix4x4(const srt_t & srt)
   
  _Matrix4x4(const _Matrix3x3 < value_t > & mat)
Convert a 3 times 3 matrix to a 4 times 4 matrix by adding a one in the last entry, and zeros in the fourth.
   
  _Matrix4x4(const vec4_t & v0, const vec4_t & v1, const vec4_t & v2, const vec4_t & v3)

Information

   
   
value_t & operator[](const unsigned int i)
   
value_t at(const unsigned int i) const
   
vec3_t getColumnAsVec3(unsigned int c) const
Return the first three values of columncas three-dimensional vector.
   
vec4_t getColumn(unsigned int c) const
Return the values of columncas four-dimensional vector.
   
const value_t * getData() const
   
value_t det() const
   
bool isIdentity() const

Modification

   
   
void setIdentity()
   
_Matrix4x4 < value_t > & operator+=(const _Matrix4x4 < value_t > & m2)
   
_Matrix4x4 < value_t > & operator-=(const _Matrix4x4 < value_t > & m2)
   
_Matrix4x4 < value_t > & operator*=(const _Matrix4x4 < value_t > & m2)
   
_Matrix4x4 < value_t > & operator*=( value_t d)
   
_Matrix4x4 < value_t > & operator/=( value_t d)
   
_Matrix4x4 < value_t > & translate( value_t x, value_t y, value_t z)
   
_Matrix4x4 < value_t > & translate(const vec3_t & v)
   
_Matrix4x4 & scale( value_t sx, value_t sy, value_t sz)
   
_Matrix4x4 & scale( value_t s)
   
_Matrix4x4 < value_t > & rotate(const angle_t & angle, value_t x, value_t y, value_t z)
   
_Matrix4x4 < value_t > & rotate(const angle_t & angle, const vec3_t & axis)
   
_Matrix4x4 < value_t > & rotate_deg(const value_t deg, const vec3_t & axis)
   
_Matrix4x4 < value_t > & rotate_deg(const value_t deg, value_t x, value_t y, value_t z)
   
_Matrix4x4 < value_t > & rotate_rad(const value_t rad, const vec3_t & axis)
   
_Matrix4x4 < value_t > & rotate_rad(const value_t rad, value_t x, value_t y, value_t z)
   
_Matrix4x4 < value_t > & rotateToDirection(const vec3_t & _baseZ)
   
_Matrix4x4 < value_t > & lookAt(const vec3_t & _pos, const vec3_t & _target, const vec3_t & _up)
   
_Matrix4x4 < value_t > & transpose()
   
_Matrix4x4 createScale( value_t sx, value_t sy, value_t sz)
   
_Matrix4x4 createScale( value_t s)
   
_Matrix4x4 perspectiveProjection(const angle_t & angle, value_t ratio, value_t zNear, value_t zFar)
   
_Matrix4x4 perspectiveProjection( value_t l, value_t r, value_t b, value_t t, value_t n, value_t f)
   
_Matrix4x4 orthographicProjection( value_t l, value_t r, value_t b, value_t t, value_t n, value_t f)

Creation

   
   
const _Matrix4x4 < value_t > operator+(const _Matrix4x4 < value_t > & m2) const
   
const _Matrix4x4 < value_t > operator-(const _Matrix4x4 < value_t > & m2) const
   
const _Matrix4x4 < value_t > operator*(const _Matrix4x4 < value_t > & m2) const
   
const _Matrix4x4 < value_t > operator*( value_t d) const
   
const _Matrix4x4 < value_t > operator/( value_t d) const
   
const vec3_t transformDirection(const vec3_t & v) const
   
const vec3_t transformDirection( value_t x, value_t y, value_t z) const
   
const vec3_t transformPosition(const vec3_t & v) const
   
const vec3_t transformPosition( value_t x, value_t y, value_t z) const
   
const vec4_t operator*(const vec4_t & v) const
   
const srt_t operator*(const srt_t & srt) const
   
_Matrix4x4 < value_t > inverse() const
   
_Matrix4x4 < value_t > getTransposed() const

Comparators

   
   
bool equals(const _Matrix4x4 & other, value_t epsilon) const
   
bool operator==(const _Matrix4x4 < value_t > & m2) const
   
bool operator!=(const _Matrix4x4 < value_t > & m2) const

Serialization

 
 
 

Public Types

   
   
typedef T_ value_t
   
typedef _Angle < value_t > angle_t
   
typedef _SRT < value_t > srt_t
   
typedef _Vec3 < value_t > vec3_t
   
typedef _Vec4 < value_t > vec4_t

Public Functions

   
   
bool convertsSafelyToSRT() const
Can be used to check whether it is (relatively) safe to convert a matrix to an SRT without loss of information.
   
srt_t toSRT() const
Converts a matrix to a SRT; throws an exception if the transformation can not be captured by a SRT.
   
srt_t _toSRT() const
Converts a matrix to a SRT even if information may be lost.

Documentation

function
Geometry::_Matrix4x4::_Matrix4x4

public inline
   
   
_Matrix4x4( )

Defined in Geometry/Matrix4x4.h:50


function
Geometry::_Matrix4x4::_Matrix4x4

public inline
     
     
_Matrix4x4( value_t d0,
  value_t d1,
  value_t d2,
  value_t d3,
  value_t d4,
  value_t d5,
  value_t d6,
  value_t d7,
  value_t d8,
  value_t d9,
  value_t d10,
  value_t d11,
  value_t d12,
  value_t d13,
  value_t d14,
  value_t d15
)    

Defined in Geometry/Matrix4x4.h:54


function
Geometry::_Matrix4x4::_Matrix4x4

public inline explicit
     
     
_Matrix4x4( const value_t * data )

Defined in Geometry/Matrix4x4.h:74


function
Geometry::_Matrix4x4::_Matrix4x4

public inline explicit
     
     
_Matrix4x4( const srt_t & srt )

Defined in Geometry/Matrix4x4.h:78


function
Geometry::_Matrix4x4::_Matrix4x4

public inline explicit
     
     
_Matrix4x4( const _Matrix3x3 < value_t > & mat )

Convert a 3 times 3 matrix to a 4 times 4 matrix by adding a one in the last entry, and zeros in the fourth.

Defined in Geometry/Matrix4x4.h:84


function
Geometry::_Matrix4x4::_Matrix4x4

public inline
     
     
_Matrix4x4( const vec4_t & v0,
  const vec4_t & v1,
  const vec4_t & v2,
  const vec4_t & v3
)    

v0.x v1.x v2.x v3.x v0.y v1.y v2.y v3.y v0.z v1.z v2.z v3.z v0.w v1.w v2.w v3.w

Defined in Geometry/Matrix4x4.h:109


function
Geometry::_Matrix4x4::operator[]

public inline
     
     
value_t & operator[]( const unsigned int i )

Parameters

i
an index

Returns

the i-th element of this matrix

Note: elements are arranged row-wise, so i=3 will result in the 1st column in the 2nd row

Defined in Geometry/Matrix4x4.h:139


function
Geometry::_Matrix4x4::at

public const inline
     
     
value_t at( const unsigned int i ) const

Parameters

i
an index

Returns

the i-th element of this matrix

Note: elements are arranged row-wise, so i=3 will result in the 1st column in the 2nd row

Defined in Geometry/Matrix4x4.h:147


function
Geometry::_Matrix4x4::getColumnAsVec3

public const inline
     
     
vec3_t getColumnAsVec3( unsigned int c ) const

Return the first three values of columncas three-dimensional vector.

Defined in Geometry/Matrix4x4.h:152


function
Geometry::_Matrix4x4::getColumn

public const inline
     
     
vec4_t getColumn( unsigned int c ) const

Return the values of columncas four-dimensional vector.

Defined in Geometry/Matrix4x4.h:160


function
Geometry::_Matrix4x4::getData

public const inline
   
   
const value_t * getData( ) const

Returns

the underlying array of this matrix

Note: elements in array are arranged row-wise

Defined in Geometry/Matrix4x4.h:171


function
Geometry::_Matrix4x4::det

public const inline
   
   
value_t det( ) const

Returns

the determinant of this

Defined in Geometry/Matrix4x4.h:177


function
Geometry::_Matrix4x4::isIdentity

public const inline
   
   
bool isIdentity( ) const

Defined in Geometry/Matrix4x4.h:187


function
Geometry::_Matrix4x4::setIdentity

public inline
   
   
void setIdentity( )

Defined in Geometry/Matrix4x4.h:198


function
Geometry::_Matrix4x4::operator+=

public inline
     
     
_Matrix4x4 < value_t > & operator+=( const _Matrix4x4 < value_t > & m2 )

Defined in Geometry/Matrix4x4.h:203


function
Geometry::_Matrix4x4::operator-=

public inline
     
     
_Matrix4x4 < value_t > & operator-=( const _Matrix4x4 < value_t > & m2 )

Defined in Geometry/Matrix4x4.h:208


function
Geometry::_Matrix4x4::operator*=

public inline
     
     
_Matrix4x4 < value_t > & operator*=( const _Matrix4x4 < value_t > & m2 )

Defined in Geometry/Matrix4x4.h:213


function
Geometry::_Matrix4x4::operator*=

public inline
     
     
_Matrix4x4 < value_t > & operator*=( value_t d )

Defined in Geometry/Matrix4x4.h:244


function
Geometry::_Matrix4x4::operator/=

public inline
     
     
_Matrix4x4 < value_t > & operator/=( value_t d )

Defined in Geometry/Matrix4x4.h:249


function
Geometry::_Matrix4x4::translate

public inline
     
     
_Matrix4x4 < value_t > & translate( value_t x,
  value_t y,
  value_t z
)    

Defined in Geometry/Matrix4x4.h:254


function
Geometry::_Matrix4x4::translate

public inline
     
     
_Matrix4x4 < value_t > & translate( const vec3_t & v )

Defined in Geometry/Matrix4x4.h:261


function
Geometry::_Matrix4x4::scale

public inline
     
     
_Matrix4x4 & scale( value_t sx,
  value_t sy,
  value_t sz
)    

Defined in Geometry/Matrix4x4.h:270


function
Geometry::_Matrix4x4::scale

public inline
     
     
_Matrix4x4 & scale( value_t s )

Defined in Geometry/Matrix4x4.h:273


function
Geometry::_Matrix4x4::rotate

public inline
     
     
_Matrix4x4 < value_t > & rotate( const angle_t & angle,
  value_t x,
  value_t y,
  value_t z
)    

See also: http://de.wikipedia.org/wiki/Rotationsmatrix

See also: http://wiki.delphigl.com/index.php/glRotate

Defined in Geometry/Matrix4x4.h:279


function
Geometry::_Matrix4x4::rotate

public inline
     
     
_Matrix4x4 < value_t > & rotate( const angle_t & angle,
  const vec3_t & axis
)    

Defined in Geometry/Matrix4x4.h:301


function
Geometry::_Matrix4x4::rotate_deg

public inline
     
     
_Matrix4x4 < value_t > & rotate_deg( const value_t deg,
  const vec3_t & axis
)    

Defined in Geometry/Matrix4x4.h:304


function
Geometry::_Matrix4x4::rotate_deg

public inline
     
     
_Matrix4x4 < value_t > & rotate_deg( const value_t deg,
  value_t x,
  value_t y,
  value_t z
)    

Defined in Geometry/Matrix4x4.h:307


function
Geometry::_Matrix4x4::rotate_rad

public inline
     
     
_Matrix4x4 < value_t > & rotate_rad( const value_t rad,
  const vec3_t & axis
)    

Defined in Geometry/Matrix4x4.h:310


function
Geometry::_Matrix4x4::rotate_rad

public inline
     
     
_Matrix4x4 < value_t > & rotate_rad( const value_t rad,
  value_t x,
  value_t y,
  value_t z
)    

Defined in Geometry/Matrix4x4.h:313


function
Geometry::_Matrix4x4::rotateToDirection

public inline
     
     
_Matrix4x4 < value_t > & rotateToDirection( const vec3_t & _baseZ )

// www.gamedev.net/community/forums/topic.asp?topic_id=384661

Defined in Geometry/Matrix4x4.h:320


function
Geometry::_Matrix4x4::lookAt

public inline
     
     
_Matrix4x4 < value_t > & lookAt( const vec3_t & _pos,
  const vec3_t & _target,
  const vec3_t & _up
)    

//http://pyopengl.sourceforge.net/documentation/manual/gluLookAt.3G.html

Defined in Geometry/Matrix4x4.h:357


function
Geometry::_Matrix4x4::transpose

public inline
   
   
_Matrix4x4 < value_t > & transpose( )

Exchange rows and columns.

Defined in Geometry/Matrix4x4.h:414


function
Geometry::_Matrix4x4::createScale

public static inline
     
     
_Matrix4x4 createScale( value_t sx,
  value_t sy,
  value_t sz
)    

Defined in Geometry/Matrix4x4.h:264


function
Geometry::_Matrix4x4::createScale

public static inline
     
     
_Matrix4x4 createScale( value_t s )

Defined in Geometry/Matrix4x4.h:267


function
Geometry::_Matrix4x4::perspectiveProjection

public static inline
     
     
_Matrix4x4 perspectiveProjection( const angle_t & angle,
  value_t ratio,
  value_t zNear,
  value_t zFar
)    

http://pyopengl.sourceforge.net/documentation/manual/gluPerspective.3G.html

Defined in Geometry/Matrix4x4.h:387


function
Geometry::_Matrix4x4::perspectiveProjection

public static inline
     
     
_Matrix4x4 perspectiveProjection( value_t l,
  value_t r,
  value_t b,
  value_t t,
  value_t n,
  value_t f
)    

http://wiki.delphigl.com/index.php/glFrustumglFrustum(left,right,bottom,top,near,far);

Defined in Geometry/Matrix4x4.h:395


function
Geometry::_Matrix4x4::orthographicProjection

public static inline
     
     
_Matrix4x4 orthographicProjection( value_t l,
  value_t r,
  value_t b,
  value_t t,
  value_t n,
  value_t f
)    

http://wiki.delphigl.com/index.php/glOrthoglOrtho(left,right,bottom,top,near,far);

Defined in Geometry/Matrix4x4.h:405


function
Geometry::_Matrix4x4::operator+

public const inline
     
     
const _Matrix4x4 < value_t > operator+( const _Matrix4x4 < value_t > & m2 ) const

Defined in Geometry/Matrix4x4.h:442


function
Geometry::_Matrix4x4::operator-

public const inline
     
     
const _Matrix4x4 < value_t > operator-( const _Matrix4x4 < value_t > & m2 ) const

Defined in Geometry/Matrix4x4.h:446


function
Geometry::_Matrix4x4::operator*

public const inline
     
     
const _Matrix4x4 < value_t > operator*( const _Matrix4x4 < value_t > & m2 ) const

Defined in Geometry/Matrix4x4.h:450


function
Geometry::_Matrix4x4::operator*

public const inline
     
     
const _Matrix4x4 < value_t > operator*( value_t d ) const

Defined in Geometry/Matrix4x4.h:455


function
Geometry::_Matrix4x4::operator/

public const inline
     
     
const _Matrix4x4 < value_t > operator/( value_t d ) const

Defined in Geometry/Matrix4x4.h:459


function
Geometry::_Matrix4x4::transformDirection

public const inline
     
     
const vec3_t transformDirection( const vec3_t & v ) const

Defined in Geometry/Matrix4x4.h:463


function
Geometry::_Matrix4x4::transformDirection

public const inline
     
     
const vec3_t transformDirection( value_t x,
  value_t y,
  value_t z
) const    

Defined in Geometry/Matrix4x4.h:466


function
Geometry::_Matrix4x4::transformPosition

public const inline
     
     
const vec3_t transformPosition( const vec3_t & v ) const

Defined in Geometry/Matrix4x4.h:476


function
Geometry::_Matrix4x4::transformPosition

public const inline
     
     
const vec3_t transformPosition( value_t x,
  value_t y,
  value_t z
) const    

Defined in Geometry/Matrix4x4.h:479


function
Geometry::_Matrix4x4::operator*

public const inline
     
     
const vec4_t operator*( const vec4_t & v ) const

Defined in Geometry/Matrix4x4.h:488


function
Geometry::_Matrix4x4::operator*

public const inline
     
     
const srt_t operator*( const srt_t & srt ) const

Defined in Geometry/Matrix4x4.h:494


function
Geometry::_Matrix4x4::inverse

public const inline
   
   
_Matrix4x4 < value_t > inverse( ) const

Returns

the inverse matrix of this

Exceptions

a
division by zero will occur if det is zero

Note: numerical problems will occur if det is nearly zero

Note: a new matrix is created, this remains unchanged

Defined in Geometry/Matrix4x4.h:508


function
Geometry::_Matrix4x4::getTransposed

public const inline
   
   
_Matrix4x4 < value_t > getTransposed( ) const

Returns a new matrix whose rows and columns are exchanged.

Defined in Geometry/Matrix4x4.h:554


function
Geometry::_Matrix4x4::equals

public const inline
     
     
bool equals( const _Matrix4x4 & other,
  value_t epsilon
) const    

compares this with other componentwise

Parameters

other
the object to compare with
epsilon
the maximum allowed difference between the component pairs

Returns

true iff any the absolute difference between any pai of components is larger than epsilon

Defined in Geometry/Matrix4x4.h:568


function
Geometry::_Matrix4x4::operator==

public const inline
     
     
bool operator==( const _Matrix4x4 < value_t > & m2 ) const

Defined in Geometry/Matrix4x4.h:574


function
Geometry::_Matrix4x4::operator!=

public const inline
     
     
bool operator!=( const _Matrix4x4 < value_t > & m2 ) const

Defined in Geometry/Matrix4x4.h:580


typedef
Geometry::_Matrix4x4::value_t

public
 
 
typedef T_ value_t

Defined in Geometry/Matrix4x4.h:34


typedef
Geometry::_Matrix4x4::angle_t

public
 
 
typedef _Angle < value_t > angle_t

Defined in Geometry/Matrix4x4.h:35


typedef
Geometry::_Matrix4x4::srt_t

public
 
 
typedef _SRT < value_t > srt_t

Defined in Geometry/Matrix4x4.h:36


typedef
Geometry::_Matrix4x4::vec3_t

public
 
 
typedef _Vec3 < value_t > vec3_t

Defined in Geometry/Matrix4x4.h:37


typedef
Geometry::_Matrix4x4::vec4_t

public
 
 
typedef _Vec4 < value_t > vec4_t

Defined in Geometry/Matrix4x4.h:38


function
Geometry::_Matrix4x4::convertsSafelyToSRT

public const inline
   
   
bool convertsSafelyToSRT( ) const

Can be used to check whether it is (relatively) safe to convert a matrix to an SRT without loss of information.

Defined in Geometry/Matrix4x4.h:586


function
Geometry::_Matrix4x4::toSRT

public const inline
   
   
srt_t toSRT( ) const

Converts a matrix to a SRT; throws an exception if the transformation can not be captured by a SRT.

Defined in Geometry/Matrix4x4.h:603


function
Geometry::_Matrix4x4::_toSRT

public const inline
   
   
srt_t _toSRT( ) const

Converts a matrix to a SRT even if information may be lost.

Defined in Geometry/Matrix4x4.h:610