Language:
Discover
By Skill Level
By Category

FMatrix

Choose your OS:

Inheritance Hierarchy

Syntax

struct FMatrix

Remarks

4x4 matrix of floating point values. Matrix-matrix multiplication happens with a pre-multiple of the transpose in other words, Res = Mat1.operator*(Mat2) means Res = Mat2^T * Mat1, as opposed to Res = Mat1 * Mat2. Matrix elements are accessed with M[RowIndex][ColumnIndex].

A 4x4 matrix. The full C++ class is located here: Engine\Source\Runtime\Core\Public\Math\Matrix.h

Variables

Name Description

Public variable

union FMatrix::...

 

@196

Public variable

float[4][4]

 

M

Public variable

FPlane

 

WPlane

Public variable

FPlane

 

XPlane

Public variable

FPlane

 

YPlane

Public variable

FPlane

 

ZPlane

Constructors

Name Description

Public function

FMatrix()

Constructors.

Public function

FMatrix

(
    EForceInit
)

Constructor.

Public function

FMatrix

(
    const FPlane & InX,
    const FPlane & InY,
    const FPlane & InZ,
    const FPlane & InW
)

Constructor.

Public function

FMatrix

(
    const FVector & InX,
    const FVector & InY,
    const FVector & InZ,
    const FVector & InW
)

Constructor.

Functions

Name Description

Public function

FMatrix

 

ApplyScale

(
    float Scale
)

Apply Scale to this matrix

Public function

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)uint ...

 

ComputeHash()

For debugging purpose, could be changed

Public function

FMatrix

 

ConcatTranslation

(
    const FVector & Translation
)

Returns a matrix with an additional translation concatenated.

Public function

bool

 

ContainsNaN()

Returns true if any element of this matrix is NaN

Public function

void

 

DebugPrint()

Output ToString

Public function

float

 

Determinant()

Determinant.

Public function

bool

 

Equals

(
    const FMatrix & Other,
    float Tolerance
)

Error-tolerant comparison.

Public function

FVector

 

ExtractScaling

(
    float Tolerance
)

Remove any scaling from this matrix (ie magnitude of each row is 1) and return the 3D scale vector that was initially present with error Tolerance

Public function

FVector

 

GetColumn

(
    int32 i
)

Get a column of this matrix

vector of the column

Public function

bool

 

GetFrustumBottomPlane

(
    FPlane & OutPlane
)

Public function

bool

 

GetFrustumFarPlane

(
    FPlane & OutPlane
)

Public function

bool

 

GetFrustumLeftPlane

(
    FPlane & OutPlane
)

Public function

bool

 

GetFrustumNearPlane

(
    FPlane & OutPlane
)

Frustum plane extraction.

Public function

bool

 

GetFrustumRightPlane

(
    FPlane & OutPlane
)

Public function

bool

 

GetFrustumTopPlane

(
    FPlane & OutPlane
)

Public function

FMatrix

 

GetMatrixWithoutScale

(
    float Tolerance
)

Returns matrix after RemoveScaling with error Tolerance.

Public function

float

 

GetMaximumAxisScale()

The maximum magnitude of any row of the matrix.

Public function

FVector

 

GetOrigin()

GetOrigin.

Public function

void

 

GetScaledAxes

(
    FVector & X,
    FVector & Y,
    FVector & Z
)

Get axes of this matrix scaled by the scale of the matrix

Public function

FVector

 

GetScaledAxis

(
    EAxis::Type Axis
)

Get axis of this matrix scaled by the scale of the matrix

Public function

FVector

 

GetScaleVector

(
    float Tolerance
)

Return a 3D scale vector calculated from this matrix (where each component is the magnitude of a row vector) with error Tolerance.

Public function

FMatrix

 

GetTransposed()

Transpose.

Public function

void

 

GetUnitAxes

(
    FVector & X,
    FVector & Y,
    FVector & Z
)

Get unit length axes of this matrix

Public function

FVector

 

GetUnitAxis

(
    EAxis::Type Axis
)

Get unit length axis of this matrix

vector of the axis

Public function

FMatrix

 

Inverse()

Inverse.

Public function

FMatrix

 

InverseFast()

Inverse.

Public function

FVector

 

InverseTransformPosition

(
    const FVector & V
)

Inverts the matrix and then transforms V - correctly handles scaling in this matrix.

Public function

FVector

 

InverseTransformVector

(
    const FVector & V
)

Transform a direction vector by the inverse of this matrix - will not take into account translation part.

Public function

void

 

Mirror

(
    EAxis::Type MirrorAxis,
    EAxis::Type FlipAxis
)

Utility for mirroring this transform across a certain plane, and flipping one of the axis as well.

Public function

void

 

RemoveScaling

(
    float Tolerance
)

NOTE: There is some compiler optimization issues with WIN64 that cause FORCEINLINE to cause a crash Remove any scaling from this matrix (ie magnitude of each row is 1) with error Tolerance

Public function

FMatrix

 

RemoveTranslation()

Remove any translation from this matrix.

Public function

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FRot ...

 

Rotator()

Rotator representation of this matrix

Public function

float

 

RotDeterminant()

The determinant of rotation 3x3 matrix Calculate determinant of rotation 3x3 matrix

Public function

void

 

ScaleTranslation

(
    const FVector & Scale3D
)

Scale the translation part of the matrix by the supplied vector.

Public function

bool

 

Serialize

(
    FArchive & Ar
)

Public function

void

 

SetAxes

(
    FVector * Axis0,
    FVector * Axis1,
    FVector * Axis2,
    FVector * Origin
)

Update the axes of the matrix if any value is NULL do not update that axis

Public function

void

 

SetAxis

(
    int32 i,
    const FVector & Axis
)

Set an axis of this matrix

Public function

void

 

SetIdentity()

Set this to the identity matrix.

Public function

void

 

SetOrigin

(
    const FVector & NewOrigin
)

Set the origin of the coordinate system to the given vector.

Public function

void

 

To3x4MatrixTranspose

(
    float* Out
)

Convert this Atom to the 3x4 transpose of the transformation matrix.

Public function

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FQua ...

 

ToQuat()

Transform a rotation matrix into a quaternion.

Public function

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FStr ...

 

ToString()

Get a textual representation of the vector.

Text describing the vector.

Public function

FVector4

 

TransformFVector4

(
    const FVector4 & V
)

Homogeneous transform.

Public function

FVector4

 

TransformPosition

(
    const FVector & V
)

Transform position.

Public function

FVector4

 

TransformVector

(
    const FVector & V
)

Transform vector.

Public function

FMatrix

 

TransposeAdjoint()

Operators

Name Description

Public function

bool

 

operator!=

(
    const FMatrix & Other
)

Checks whether another Matrix is not equal to this, within specified tolerance.

Public function

FMatrix

 

operator*

(
    float Other
)

This isn't applying SCALE, just multiplying the value to all members - i.e. weighting

Public function

FMatrix

 

operator*

(
    const FMatrix & Other
)

Gets the result of multiplying a Matrix to this.

The result of multiplication.

Public function

void

 

operator*=

(
    float Other
)

Multiply this matrix by a weighting factor.

a reference to this after weighting.

Public function

void

 

operator*=

(
    const FMatrix & Other
)

Multiply this by a matrix.

reference to this after multiply.

Public function

FMatrix

 

operator+

(
    const FMatrix & Other
)

Gets the result of adding a matrix to this.

The result of addition.

Public function

void

 

operator+=

(
    const FMatrix & Other
)

Adds to this matrix.

Reference to this after addition.

Public function

bool

 

operator==

(
    const FMatrix & Other
)

Comparison operators.

Constants

Name

Description

Identity

Identity matrix.

References

Module

Core

Header

Runtime/Core/Public/Math/Matrix.h