Assimp  v2.0 (November 2010)
Public Member Functions | Static Public Member Functions | Public Attributes
aiMatrix4x4 Struct Reference

Represents a row-major 4x4 matrix, use this for homogeneous coordinates. More...

List of all members.

Public Member Functions

 aiMatrix4x4 ()
 aiMatrix4x4 (float _a1, float _a2, float _a3, float _a4, float _b1, float _b2, float _b3, float _b4, float _c1, float _c2, float _c3, float _c4, float _d1, float _d2, float _d3, float _d4)
 aiMatrix4x4 (const aiMatrix3x3 &m)
 Constructor from 3x3 matrix.
void Decompose (aiVector3D &scaling, aiQuaternion &rotation, aiVector3D &position) const
 Decompose a trafo matrix into its original components.
void DecomposeNoScaling (aiQuaternion &rotation, aiVector3D &position) const
 Decompose a trafo matrix with no scaling into its original components.
float Determinant () const
aiMatrix4x4FromEulerAnglesXYZ (float x, float y, float z)
 Creates a trafo matrix from a set of euler angles.
aiMatrix4x4FromEulerAnglesXYZ (const aiVector3D &blubb)
aiMatrix4x4Inverse ()
 Invert the matrix.
bool IsIdentity () const
 Returns true of the matrix is the identity matrix.
bool operator!= (const aiMatrix4x4 m) const
aiMatrix4x4 operator* (const aiMatrix4x4 &m) const
aiMatrix4x4operator*= (const aiMatrix4x4 &m)
bool operator== (const aiMatrix4x4 m) const
float * operator[] (unsigned int p_iIndex)
const float * operator[] (unsigned int p_iIndex) const
aiMatrix4x4Transpose ()
 Transpose the matrix.

Static Public Member Functions

static aiMatrix4x4FromToMatrix (const aiVector3D &from, const aiVector3D &to, aiMatrix4x4 &out)
 A function for creating a rotation matrix that rotates a vector called "from" into another vector called "to".
static aiMatrix4x4Rotation (float a, const aiVector3D &axis, aiMatrix4x4 &out)
 Returns a rotation matrix for a rotation around an arbitrary axis.
static aiMatrix4x4RotationX (float a, aiMatrix4x4 &out)
 Returns a rotation matrix for a rotation around the x axis.
static aiMatrix4x4RotationY (float a, aiMatrix4x4 &out)
 Returns a rotation matrix for a rotation around the y axis.
static aiMatrix4x4RotationZ (float a, aiMatrix4x4 &out)
 Returns a rotation matrix for a rotation around the z axis.
static aiMatrix4x4Scaling (const aiVector3D &v, aiMatrix4x4 &out)
 Returns a scaling matrix.
static aiMatrix4x4Translation (const aiVector3D &v, aiMatrix4x4 &out)
 Returns a translation matrix.

Public Attributes

float a1
float a2
float a3
float a4
float b1
float b2
float b3
float b4
float c1
float c2
float c3
float c4
float d1
float d2
float d3
float d4

Detailed Description

Represents a row-major 4x4 matrix, use this for homogeneous coordinates.

There's much confusion about matrix layouts (colum vs. row order). This is *always* a row-major matrix. Even with the aiProcess_ConvertToLeftHanded flag.


Constructor & Destructor Documentation

aiMatrix4x4::aiMatrix4x4 ( ) [inline]
aiMatrix4x4::aiMatrix4x4 ( float  _a1,
float  _a2,
float  _a3,
float  _a4,
float  _b1,
float  _b2,
float  _b3,
float  _b4,
float  _c1,
float  _c2,
float  _c3,
float  _c4,
float  _d1,
float  _d2,
float  _d3,
float  _d4 
) [inline]
aiMatrix4x4::aiMatrix4x4 ( const aiMatrix3x3 m) [inline, explicit]

Constructor from 3x3 matrix.

The remaining elements are set to identity.


Member Function Documentation

void aiMatrix4x4::Decompose ( aiVector3D scaling,
aiQuaternion rotation,
aiVector3D position 
) const [inline]

Decompose a trafo matrix into its original components.

Parameters:
scalingReceives the output scaling for the x,y,z axes
rotationReceives the output rotation as a hamilton quaternion
positionReceives the output position for the x,y,z axes
void aiMatrix4x4::DecomposeNoScaling ( aiQuaternion rotation,
aiVector3D position 
) const [inline]

Decompose a trafo matrix with no scaling into its original components.

Parameters:
rotationReceives the output rotation as a hamilton quaternion
positionReceives the output position for the x,y,z axes
float aiMatrix4x4::Determinant ( ) const [inline]
aiMatrix4x4 & aiMatrix4x4::FromEulerAnglesXYZ ( float  x,
float  y,
float  z 
) [inline]

Creates a trafo matrix from a set of euler angles.

Parameters:
xRotation angle for the x-axis, in radians
yRotation angle for the y-axis, in radians
zRotation angle for the z-axis, in radians
aiMatrix4x4 & aiMatrix4x4::FromEulerAnglesXYZ ( const aiVector3D blubb) [inline]
aiMatrix4x4 & aiMatrix4x4::FromToMatrix ( const aiVector3D from,
const aiVector3D to,
aiMatrix4x4 mtx 
) [inline, static]

A function for creating a rotation matrix that rotates a vector called "from" into another vector called "to".

Input : from[3], to[3] which both must be *normalized* non-zero vectors Output: mtx[3][3] -- a 3x3 matrix in colum-major form Authors: Tomas Möller, John Hughes "Efficiently Building a Matrix to Rotate One Vector to Another" Journal of Graphics Tools, 4(4):1-4, 1999

aiMatrix4x4 & aiMatrix4x4::Inverse ( ) [inline]

Invert the matrix.

If the matrix is not invertible all elements are set to qnan. Beware, use (f != f) to check whether a float f is qnan.

bool aiMatrix4x4::IsIdentity ( ) const [inline]

Returns true of the matrix is the identity matrix.

The check is performed against a not so small epsilon.

bool aiMatrix4x4::operator!= ( const aiMatrix4x4  m) const [inline]
aiMatrix4x4 aiMatrix4x4::operator* ( const aiMatrix4x4 m) const [inline]
aiMatrix4x4 & aiMatrix4x4::operator*= ( const aiMatrix4x4 m) [inline]
bool aiMatrix4x4::operator== ( const aiMatrix4x4  m) const [inline]
float * aiMatrix4x4::operator[] ( unsigned int  p_iIndex) [inline]
const float * aiMatrix4x4::operator[] ( unsigned int  p_iIndex) const [inline]
aiMatrix4x4 & aiMatrix4x4::Rotation ( float  a,
const aiVector3D axis,
aiMatrix4x4 out 
) [inline, static]

Returns a rotation matrix for a rotation around an arbitrary axis.

Parameters:
aRotation angle, in radians
axisRotation axis, should be a normalized vector.
outReceives the output matrix
Returns:
Reference to the output matrix
aiMatrix4x4 & aiMatrix4x4::RotationX ( float  a,
aiMatrix4x4 out 
) [inline, static]

Returns a rotation matrix for a rotation around the x axis.

Parameters:
aRotation angle, in radians
outReceives the output matrix
Returns:
Reference to the output matrix
aiMatrix4x4 & aiMatrix4x4::RotationY ( float  a,
aiMatrix4x4 out 
) [inline, static]

Returns a rotation matrix for a rotation around the y axis.

Parameters:
aRotation angle, in radians
outReceives the output matrix
Returns:
Reference to the output matrix
aiMatrix4x4 & aiMatrix4x4::RotationZ ( float  a,
aiMatrix4x4 out 
) [inline, static]

Returns a rotation matrix for a rotation around the z axis.

Parameters:
aRotation angle, in radians
outReceives the output matrix
Returns:
Reference to the output matrix
aiMatrix4x4 & aiMatrix4x4::Scaling ( const aiVector3D v,
aiMatrix4x4 out 
) [inline, static]

Returns a scaling matrix.

Parameters:
vScaling vector
outReceives the output matrix
Returns:
Reference to the output matrix
aiMatrix4x4 & aiMatrix4x4::Translation ( const aiVector3D v,
aiMatrix4x4 out 
) [inline, static]

Returns a translation matrix.

Parameters:
vTranslation vector
outReceives the output matrix
Returns:
Reference to the output matrix
aiMatrix4x4 & aiMatrix4x4::Transpose ( ) [inline]

Transpose the matrix.


Member Data Documentation


The documentation for this struct was generated from the following files: