- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# FMMatrix44 Class Reference
[Mathematics Classes.]

A 4x4 Row Major matrix: use to represent 3D transformations. More...

`#include <FMMatrix44.h>`

List of all members.

## Public Member Functions
| FMMatrix44 (const float *_m)
| Creates a FMMatrix44 from the `float` array.
| FMMatrix44 (const double *_m)
| See above.
| FMMatrix44 ()
| Creates an empty FMMatrix44.
| operator float * ()
| Get this FMMatrix44 as an array of `floats`.
| operator const float * () const
| See above.
template<class Integer>
float * | operator[] (Integer a)
| Get a specified row of FMMatrix44 as an array of `floats`.
template<class Integer>
const float * | operator[] (Integer a) const
| See above.
FMMatrix44 & | operator= (const FMMatrix44 &copy)
| Assign this FMMatrix44's elements to be the same as that of the given matrix.
void | Set (const float *_m)
| Sets a FMMatrix44 from the `float` array.
void | Set (const double *_m)
| See above.
FMMatrix44 | Transposed () const
| Gets the transposed of this FMMatrix44.
FMMatrix44 | Inverted () const
| Gets the inverse of this matrix.
float | Determinant () const
| Gets the determinant of this matrix.
void | Decompose (FMVector3 &scale, FMVector3 &rotation, FMVector3 &translation, float &inverted) const
| Decompose this matrix into its scale, rotation, and translation components; it also tells whether it is inverted.
void | Recompose (const FMVector3 &scale, const FMVector3 &rotation, const FMVector3 &translation, float inverted=1.0f)
| Recompose this matrix from its scale, rotation, and translation components.
FMVector3 | TransformCoordinate (const FMVector3 &coordinate) const
| Transforms the given point by this matrix.
FMVector4 | TransformCoordinate (const FMVector4 &coordinate) const
| See above.
FMVector3 | TransformVector (const FMVector3 &v) const
| Transforms the given vector by this FMMatrix44.
const FMVector3 & | GetTranslation () const
| Gets the translation component of this matrix.
FMVector3 & | GetTranslation ()
| See Above.
void | SetTranslation (const FMVector3 &translation)
| Sets the translation component of this matrix.
const FMVector3 & | GetAxis (FMath::AXIS axis) const
| Gets a reference to an axis of this matrix.
FMVector3 & | GetAxis (FMath::AXIS axis)
| See above.
## Static Public Member Functions
static FMMatrix44 | TranslationMatrix (const FMVector3 &translation)
| Gets the FMMatrix44 representation of a 3D translation.
static FMMatrix44 | AxisRotationMatrix (const FMVector3 &axis, float angle)
| Gets the FMMatrix44 representation of a 3D rotation about a given axis by an angle.
static FMMatrix44 | XAxisRotationMatrix (float angle)
| Creates an FMMatrix44 rotation matrix of angle degrees around the X axis.
static FMMatrix44 | YAxisRotationMatrix (float angle)
| Creates an FMMatrix44 rotation matrix of angle degrees around the X axis.
static FMMatrix44 | ZAxisRotationMatrix (float angle)
| Creates an FMMatrix44 rotation matrix of angle degrees around the X axis.
static FMMatrix44 | EulerRotationMatrix (const FMVector3 &rotation)
| Gets the matrix representation of a 3D euler rotation.
static FMMatrix44 | ScaleMatrix (const FMVector3 &scale)
| Gets the FMMatrix44 representation of a 3D axis-bound scale.
static FMMatrix44 | LookAtMatrix (const FMVector3 &eye, const FMVector3 &target, const FMVector3 &up)
| Gets the FMMatrix44 represention of a look-at transformation.
## Public Attributes
float | m [4][4]
| The matrix elements stored in a 2D array.
## Static Public Attributes
static FMMatrix44 | Identity
| The identity matrix.

## Detailed Description

A 4x4 Row Major matrix: use to represent 3D transformations.

## Constructor & Destructor Documentation

FMMatrix44::FMMatrix44 | ( | const float * | _m | ) |

  | Creates a FMMatrix44 from the `float` array. The float array stores the elements in the following order: m[0][0], m[1][0], m[2][0], m[3][0], m[0][1], m[1][1], m[2][1], m[3][1], m[0][2], m[1][2], m[2][2], m[3][2], m[0][3], m[1][3], m[2][3], m[3][3]. Parameters:
  | _m | The `float` array to create the matrix from.

FMMatrix44::FMMatrix44 | ( |  | ) | `[inline]`

| Creates an empty FMMatrix44. The default values are left un-initialized. To get an identity matrix: FMMatrix44 identity(FMMatrix44::Identity);

## Member Function Documentation

static FMMatrix44 FMMatrix44::AxisRotationMatrix | ( | const FMVector3 & | axis,
|  | float | angle
| ) | `[static]`

  | Gets the FMMatrix44 representation of a 3D rotation about a given axis by an angle. Parameters:
  | axis | The axis of rotation.
  | angle | The angle of rotation in radians.
Returns: The rotation FMMatrix44.

void FMMatrix44::Decompose | ( | FMVector3 & | scale,
|  | FMVector3 & | rotation,
|  | FMVector3 & | translation,
|  | float & | inverted
| ) | const

  | Decompose this matrix into its scale, rotation, and translation components; it also tells whether it is inverted. To get back the original matrix, perform the following multiplication: translation * axis-rotation [z*y*x order] * scale - or use the Recompose function. If invert is negative, then to get back the original matrix, negate scale and perform the above multiplication. Parameters:
  | scale | The FMVector to place the scale components to.
  | rotation | The FMVector to place the rotation components to.
  | translation | The FMVector to place the translation components to.
  | inverted | -1.0 if inverted, 1.0 if not inverted.

float FMMatrix44::Determinant | ( |  | ) | const

| Gets the determinant of this matrix. Returns: The determinant of this matrix.

static FMMatrix44 FMMatrix44::EulerRotationMatrix | ( | const FMVector3 & | rotation | ) | `[static]`

  | Gets the matrix representation of a 3D euler rotation. The angles are considered in the order: x, y, z, which represents heading, banking and roll. Parameters:
  | rotation | The euler rotation angles.
Returns: The rotation matrix.

const FMVector3& FMMatrix44::GetAxis | ( | FMath::AXIS | axis | ) | const`[inline]`

  | Gets a reference to an axis of this matrix. Parameters:
  | axis | The index of the axis to get (X = 0, Y = 1, Z = 2)
Returns: A reference to the axis

const FMVector3& FMMatrix44::GetTranslation | ( |  | ) | const`[inline]`

| Gets the translation component of this matrix. Returns: A Reference to the FMVector3 representation of the translation.

FMMatrix44 FMMatrix44::Inverted | ( |  | ) | const

| Gets the inverse of this matrix. Returns: The inverse of this matrix.

static FMMatrix44 FMMatrix44::LookAtMatrix | ( | const FMVector3 & | eye,
|  | const FMVector3 & | target,
|  | const FMVector3 & | up
| ) | `[static]`

  | Gets the FMMatrix44 represention of a look-at transformation. Parameters:
  | eye | The eye position.
  | target | The target position.
  | up | The up direction.
Returns: The look-at transformation matrix.

FMMatrix44::operator float * | ( |  | ) | `[inline]`

| Get this FMMatrix44 as an array of `floats`. The array contains the elements in the following order: m[0][0], m[0][1], m[0][2], m[0][3], m[1][0], m[1][1], m[1][2], m[1][3], m[2][0], m[2][1], m[2][2], m[0][3], m[3][0], m[3][1], m[3][2], m[3][3]. Returns: The `float` array.

FMMatrix44& FMMatrix44::operator= | ( | const FMMatrix44 & | copy | ) |

  | Assign this FMMatrix44's elements to be the same as that of the given matrix. Parameters:
  | copy | The FMMatrix to copy elements from.
Returns: This FMMatrix.

template<class Integer>
float* FMMatrix44::operator[] | ( | Integer | a | ) | `[inline]`

  | Get a specified row of FMMatrix44 as an array of `floats`. Parameters:
  | a | The row index, starting at 0, of the row to get.
Returns: The `float` array of the elements in the specified row.

void FMMatrix44::Recompose | ( | const FMVector3 & | scale,
|  | const FMVector3 & | rotation,
|  | const FMVector3 & | translation,
|  | float | inverted = `1.0f`
| ) |

  | Recompose this matrix from its scale, rotation, and translation components. ; it also tells whether it is inverted. To get back the original matrix, perform the following multiplication: translation * rotation [x*y*z order] * scale. If invert is negative, then to get back the original matrix, negate scale and perform the above multiplication. Parameters:
  | scale | The FMVector to place the scale components to.
  | rotation | The FMVector to place the rotation components to.
  | translation | The FMVector to place the translation components to.
  | inverted | -1.0 if inverted, 1.0 if not inverted.

static FMMatrix44 FMMatrix44::ScaleMatrix | ( | const FMVector3 & | scale | ) | `[static]`

  | Gets the FMMatrix44 representation of a 3D axis-bound scale. Parameters:
  | scale | The scaling components.
Returns: The scale transform.

void FMMatrix44::Set | ( | const float * | _m | ) |

  | Sets a FMMatrix44 from the `float` array. The float array stores the elements in the following order: m[0][0], m[1][0], m[2][0], m[3][0], m[0][1], m[1][1], m[2][1], m[3][1], m[0][2], m[1][2], m[2][2], m[3][2], m[0][3], m[1][3], m[2][3], m[3][3]. Parameters:
  | _m | The `float` array to create the matrix from.

void FMMatrix44::SetTranslation | ( | const FMVector3 & | translation | ) | `[inline]`

  | Sets the translation component of this matrix. Parameters:
  | translation | The new translation component.

FMVector3 FMMatrix44::TransformCoordinate | ( | const FMVector3 & | coordinate | ) | const

  | Transforms the given point by this matrix. Parameters:
  | coordinate | The point to transform.
Returns: The vector representation of the transformed point.

FMVector3 FMMatrix44::TransformVector | ( | const FMVector3 & | v | ) | const

  | Transforms the given vector by this FMMatrix44. Parameters:
  | v | The vector to transform.
Returns: The FMVector3 representation of the transformed vector.

static FMMatrix44 FMMatrix44::TranslationMatrix | ( | const FMVector3 & | translation | ) | `[static]`

  | Gets the FMMatrix44 representation of a 3D translation. The translation in the x, y and z directions correspond to the x, y, and z components of the FMVector3. Parameters:
  | translation | The FMVector3 to get the translation components from.
Returns: The translation FMMatrix44.

FMMatrix44 FMMatrix44::Transposed | ( |  | ) | const

| Gets the transposed of this FMMatrix44. Returns: The transposed of this FMMatrix.

static FMMatrix44 FMMatrix44::XAxisRotationMatrix | ( | float | angle | ) | `[static]`

  | Creates an FMMatrix44 rotation matrix of angle degrees around the X axis. Parameters:
  | angle | The rotation angle in radians
Returns: The rotation FMMatrix44

static FMMatrix44 FMMatrix44::YAxisRotationMatrix | ( | float | angle | ) | `[static]`

  | Creates an FMMatrix44 rotation matrix of angle degrees around the X axis. Parameters:
  | angle | The rotation angle in radians
Returns: The rotation FMMatrix44

static FMMatrix44 FMMatrix44::ZAxisRotationMatrix | ( | float | angle | ) | `[static]`

  | Creates an FMMatrix44 rotation matrix of angle degrees around the X axis. Parameters:
  | angle | The rotation angle in radians
Returns: The rotation FMMatrix44

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

- FMath/FMMatrix44.h