Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::Matrix4D_t Struct Reference

4 dimensional floating point matrix More...

Collaboration diagram for Burger::Matrix4D_t:

Public Member Functions

void Zero (void) noexcept
 Clear out a 4D matrix.
 
void Identity (void) noexcept
 Initialize a 4D matrix so that it is inert.
 
void Set (const Matrix4D_t *pInput) noexcept
 Copy the matrix.
 
void Set (const FixedMatrix4D_t *pInput) noexcept
 Convert a fixed point matrix into a floating point matrix.
 
void Set (const Matrix3D_t *pInput) noexcept
 Copy a Matrix3D_t to a Matrix4D_t.
 
void SetYaw (float fYaw) noexcept
 Initialize a rotation matrix with radians for yaw (Y)
 
void SetPitch (float fPitch) noexcept
 Initialize a rotation matrix with radians for pitch (X)
 
void SetRoll (float fRoll) noexcept
 Initialize a rotation matrix with radians for roll (Z)
 
void SetYXZ (float fYaw, float fPitch, float fRoll) noexcept
 Initialize a rotation matrix in the order of Y, X and Z.
 
void SetYZX (float fYaw, float fPitch, float fRoll) noexcept
 Initialize a rotation matrix in the order of Y, Z and X.
 
void SetXYZ (float fYaw, float fPitch, float fRoll) noexcept
 Initialize a rotation matrix in the order of X, Y and Z.
 
void SetXZY (float fYaw, float fPitch, float fRoll) noexcept
 Initialize a rotation matrix in the order of X, Z and Y.
 
void SetZYX (float fYaw, float fPitch, float fRoll) noexcept
 Initialize a rotation matrix in the order of Z, Y and X.
 
void SetZXY (float fYaw, float fPitch, float fRoll) noexcept
 Initialize a rotation matrix in the order of Z, X and Y.
 
void SetTranslate (float fX, float fY, float fZ) noexcept
 Create a 4D translation matrix.
 
void SetFromQuaternion (const Vector4D_t *pInput) noexcept
 Convert a quaternion to a 4x4 matrix.
 
void TransposeSetYaw (float fYaw) noexcept
 Initialize a rotation matrix with radians for yaw (Y)
 
void TransposeSetPitch (float fPitch) noexcept
 Initialize a rotation matrix with radians for pitch (X)
 
void TransposeSetRoll (float fRoll) noexcept
 Initialize a rotation matrix with radians for roll (Z)
 
void TransposeSetYXZ (float fYaw, float fPitch, float fRoll) noexcept
 Initialize a transposed rotation matrix in the order of Y, X and Z.
 
void TransposeSetYZX (float fYaw, float fPitch, float fRoll) noexcept
 Initialize a transposed rotation matrix in the order of Y, Z and X.
 
void TransposeSetXYZ (float fYaw, float fPitch, float fRoll) noexcept
 Initialize a transposed rotation matrix in the order of X, Y and Z.
 
void TransposeSetXZY (float fYaw, float fPitch, float fRoll) noexcept
 Initialize a transposed rotation matrix in the order of X, Z and Y.
 
void TransposeSetZYX (float fYaw, float fPitch, float fRoll) noexcept
 Initialize a transposed rotation matrix in the order of Z, Y and X.
 
void TransposeSetZXY (float fYaw, float fPitch, float fRoll) noexcept
 Initialize a transposed rotation matrix in the order of Z, X and Y.
 
void TransposeSetFromQuaternion (const Vector4D_t *pInput) noexcept
 Convert a quaternion to a transposed 4x4 matrix.
 
void SetScale (float fX, float fY, float fZ) noexcept
 Create a 4D scale matrix.
 
void SetScale (float fX, float fY, float fZ, float fW) noexcept
 Create a 4D scale matrix.
 
void SetFrustum (float fLeft, float fRight, float fBottom, float fTop, float fNear, float fFar) noexcept
 Create a transposed 4D projection matrix.
 
void TransposeSetFrustum (float fLeft, float fRight, float fBottom, float fTop, float fNear, float fFar) noexcept
 Create a 4D projection matrix.
 
void SetOrtho (float fLeft, float fRight, float fBottom, float fTop, float fNear, float fFar) noexcept
 Create a transposed orthogonal 4D projection matrix.
 
void TransposeSetOrtho (float fLeft, float fRight, float fBottom, float fTop, float fNear, float fFar) noexcept
 Create an orthogonal 4D projection matrix.
 
void SetPerspective (float fFieldOfViewY, float fAspect, float fNear, float fFar) noexcept
 Create a 4D perspective matrix.
 
void TransposeSetPerspective (float fFieldOfViewY, float fAspect, float fNear, float fFar) noexcept
 Create a 4D perspective matrix.
 
void Transpose (void) noexcept
 Perform a matrix transposition.
 
void Transpose (const Matrix4D_t *pInput) noexcept
 Perform a matrix transposition.
 
void GetXRow (Vector3D_t *pOutput) const noexcept
 Return the X row from a matrix.
 
void GetXRow (Vector4D_t *pOutput) const noexcept
 Return the X row from a matrix.
 
void GetYRow (Vector3D_t *pOutput) const noexcept
 Return the Y row from a matrix.
 
void GetYRow (Vector4D_t *pOutput) const noexcept
 Return the Y row from a matrix.
 
void GetZRow (Vector3D_t *pOutput) const noexcept
 Return the Z row from a matrix.
 
void GetZRow (Vector4D_t *pOutput) const noexcept
 Return the Z row from a matrix.
 
void GetWRow (Vector3D_t *pOutput) const noexcept
 Return the W row from a matrix.
 
void GetWRow (Vector4D_t *pOutput) const noexcept
 Return the W row from a matrix.
 
void GetXColumn (Vector3D_t *pOutput) const noexcept
 Return the X column from a matrix.
 
void GetXColumn (Vector4D_t *pOutput) const noexcept
 Return the X column from a matrix.
 
void GetYColumn (Vector3D_t *pOutput) const noexcept
 Return the Y column from a matrix.
 
void GetYColumn (Vector4D_t *pOutput) const noexcept
 Return the Y column from a matrix.
 
void GetZColumn (Vector3D_t *pOutput) const noexcept
 Return the Z column from a matrix.
 
void GetZColumn (Vector4D_t *pOutput) const noexcept
 Return the Z column from a matrix.
 
void GetWColumn (Vector3D_t *pOutput) const noexcept
 Return the W column from a matrix.
 
void GetWColumn (Vector4D_t *pOutput) const noexcept
 Return the W column from a matrix.
 
void SetXRow (const Vector3D_t *pInput) noexcept
 Set the X row of a matrix.
 
void SetXRow (const Vector4D_t *pInput) noexcept
 Set the X row of a matrix.
 
void SetYRow (const Vector3D_t *pInput) noexcept
 Set the Y row of a matrix.
 
void SetYRow (const Vector4D_t *pInput) noexcept
 Set the Y row of a matrix.
 
void SetZRow (const Vector3D_t *pInput) noexcept
 Set the Z row of a matrix.
 
void SetZRow (const Vector4D_t *pInput) noexcept
 Set the Z row of a matrix.
 
void SetWRow (const Vector3D_t *pInput) noexcept
 Set the W row of a matrix.
 
void SetWRow (const Vector4D_t *pInput) noexcept
 Set the W row of a matrix.
 
void SetXColumn (const Vector3D_t *pInput) noexcept
 Set the X column of a matrix.
 
void SetXColumn (const Vector4D_t *pInput) noexcept
 Set the X column of a matrix.
 
void SetYColumn (const Vector3D_t *pInput) noexcept
 Set the Y column of a matrix.
 
void SetYColumn (const Vector4D_t *pInput) noexcept
 Set the Y column of a matrix.
 
void SetZColumn (const Vector3D_t *pInput) noexcept
 Set the Z column of a matrix.
 
void SetZColumn (const Vector4D_t *pInput) noexcept
 Set the Z column of a matrix.
 
void SetWColumn (const Vector3D_t *pInput) noexcept
 Set the W column of a matrix.
 
void SetWColumn (const Vector4D_t *pInput) noexcept
 Set the W column of a matrix.
 
void Multiply (const Matrix4D_t *pInput) noexcept
 Perform a matrix multiply against this matrix.
 
void Multiply (const Matrix4D_t *pInput1, const Matrix4D_t *pInput2) noexcept
 Perform a matrix multiply.
 
void Multiply (float fScale) noexcept
 Perform a matrix multiply by a scalar.
 
void Multiply (const Matrix4D_t *pInput, float fScale) noexcept
 Initialize with a matrix multiplied by a scalar.
 
void Multiply (float fScaleX, float fScaleY, float fScaleZ) noexcept
 Multiply by an X,Y and Z scale.
 
void Multiply (const Matrix4D_t *pInput, float fScaleX, float fScaleY, float fScaleZ) noexcept
 Multiply by an X,Y and Z scale into a copy.
 
void Multiply (float fScaleX, float fScaleY, float fScaleZ, float fScaleW) noexcept
 Multiply by an X, Y, Z and W scale.
 
void Multiply (const Matrix4D_t *pInput, float fScaleX, float fScaleY, float fScaleZ, float fScaleW) noexcept
 Multiply by an X, Y, Z and W scale.
 
void Multiply3x3 (float fInput) noexcept
 Perform a 3x3 matrix multiply by a scalar.
 
void Multiply3x3 (const Matrix4D_t *pInput, float fInput) noexcept
 Perform a 3x3 matrix multiply by a scalar.
 
void TransposeMultiply (float fScaleX, float fScaleY, float fScaleZ) noexcept
 Multiply by an X,Y and Z scale.
 
void TransposeMultiply (const Matrix4D_t *pInput, float fScaleX, float fScaleY, float fScaleZ) noexcept
 Multiply by an X,Y and Z scale into a copy.
 
void TransposeMultiply (float fScaleX, float fScaleY, float fScaleZ, float fScaleW) noexcept
 Multiply by an X, Y, Z, and W scale.
 
void TransposeMultiply (const Matrix4D_t *pInput, float fScaleX, float fScaleY, float fScaleZ, float fScaleW) noexcept
 Multiply by an X, Y, Z, and W scale.
 
void Transform (Vector3D_t *pInput) const noexcept
 Multiply a vector by a matrix.
 
void Transform (Vector4D_t *pInput) const noexcept
 Multiply a vector by a matrix.
 
void Transform (Vector3D_t *pOutput, const Vector3D_t *pInput) const noexcept
 Multiply a vector by a matrix.
 
void Transform (Vector4D_t *pOutput, const Vector4D_t *pInput) const noexcept
 Multiply a vector by a matrix.
 
void TransposeTransform (Vector3D_t *pInput) const noexcept
 Multiply a vector by a transposed matrix.
 
void TransposeTransform (Vector4D_t *pInput) const noexcept
 Multiply a vector by a transposed matrix.
 
void TransposeTransform (Vector3D_t *pOutput, const Vector3D_t *pInput) const noexcept
 Multiply a vector by a transposed matrix.
 
void TransposeTransform (Vector4D_t *pOutput, const Vector4D_t *pInput) const noexcept
 Multiply a vector by a transposed matrix.
 
void Transform3x3 (Vector3D_t *pInput) const noexcept
 Multiply a vector by a matrix without adding W.
 
void Transform3x3 (Vector3D_t *pOutput, const Vector3D_t *pInput) const noexcept
 Multiply a vector by a matrix without adding W.
 
void TransposeTransform3x3 (Vector3D_t *pInput) const noexcept
 Multiply a vector by a transposed matrix without adding W.
 
void TransposeTransform3x3 (Vector3D_t *pOutput, const Vector3D_t *pInput) const noexcept
 Multiply a vector by a transposed matrix without adding W.
 
void Yaw (float fYaw) noexcept
 Rotate a matrix in the Y axis (Yaw)
 
void Pitch (float fPitch) noexcept
 Rotate a matrix in the X axis (Pitch)
 
void Roll (float fRoll) noexcept
 Rotate a matrix in the Z axis (Roll)
 
void Rotate (float fRadians, float fX, float fY, float fZ) noexcept
 Rotate a matrix in an arbitrary axis.
 
void Translate (float fX, float fY, float fZ) noexcept
 Multiply the matrix by a generated translation matrix.
 
void TransposeTranslate (float fX, float fY, float fZ) noexcept
 Multiply the matrix by a generated transposed translation matrix.
 
uint_t AffineInverse (const Matrix4D_t *pInput) noexcept
 Generate an affine inverse of a matrix.
 
void PerspectiveFovLH (float fFieldOfViewY, float fAspect, float fNear, float fFar) noexcept
 Create a 4D perspective matrix.
 
void PerspectiveFovRH (float fFieldOfViewY, float fAspect, float fNear, float fFar) noexcept
 Create a 4D perspective matrix.
 
 operator const float * () const noexcept
 Convert to a const float pointer.
 

Public Attributes

Vector4D_t x
 32 bit floating point X row for the 4D Matrix
 
Vector4D_t y
 32 bit floating point Y row for the 4D Matrix
 
Vector4D_t z
 32 bit floating point Z row for the 4D Matrix
 
Vector4D_t w
 32 bit floating point W row for the 4D Matrix
 

Detailed Description

4 dimensional floating point matrix


This 64 byte matrix contains x,y,z and w 32 bit floating point rows and columns. A set of common functions for simple 4 dimensional math are part of the structure.

It is expected to be 4 byte aligned and use scalar math. The members are hard coded to be "x", "y", "z" and "w" for maximum compatibility

Note
Since this is a structure, there is no constructor or destructor, so assume the data is uninitialized when creating this data type.
See also
Burger::Vector4D_t, Burger::Matrix3D_t or Burger::FixedMatrix4D_t

Member Function Documentation

◆ AffineInverse()

uint_t BURGER_API Burger::Matrix4D_t::AffineInverse ( const Matrix4D_t * pInput)
noexcept

Generate an affine inverse of a matrix.


Using the 3x3 sub-matrix, generate a determinate and use it to calculate the inverse of the 3x3 matrix. Adjust the translate component and then clear out the scale.

If the matrix cannot be inverted, FALSE is returned and the original matrix is copied as is.

Parameters
pInputPointer to a matrix to affine invert.
Returns
TRUE if the inversion was successful, FALSE if not

◆ GetWColumn() [1/2]

void BURGER_API Burger::Matrix4D_t::GetWColumn ( Vector3D_t * pOutput) const
noexcept

Return the W column from a matrix.


Copy the w column of a matrix into a user supplied Vector3D_t buffer.

x y z
xw yw zw
Parameters
pOutputPointer to an uninitialized Vector3D_t structure to receive the data

◆ GetWColumn() [2/2]

void BURGER_API Burger::Matrix4D_t::GetWColumn ( Vector4D_t * pOutput) const
noexcept

Return the W column from a matrix.


Copy the w column of a matrix into a user supplied Vector4D_t buffer.

x y z w
xw yw zw ww
Parameters
pOutputPointer to an uninitialized Vector4D_t structure to receive the data

◆ GetWRow() [1/2]

void BURGER_API Burger::Matrix4D_t::GetWRow ( Vector3D_t * pOutput) const
noexcept

Return the W row from a matrix.


Copy the w row of a matrix into a user supplied Vector3D_t buffer.

x y z
wx wy wz
Parameters
pOutputPointer to an uninitialized Vector3D_t structure to receive the data

◆ GetWRow() [2/2]

void BURGER_API Burger::Matrix4D_t::GetWRow ( Vector4D_t * pOutput) const
noexcept

Return the W row from a matrix.


Copy the w row of a matrix into a user supplied Vector4D_t buffer.

x y z w
wx wy wz ww
Parameters
pOutputPointer to an uninitialized Vector4D_t structure to receive the data

◆ GetXColumn() [1/2]

void BURGER_API Burger::Matrix4D_t::GetXColumn ( Vector3D_t * pOutput) const
noexcept

Return the X column from a matrix.


Copy the x column of a matrix into a user supplied Vector3D_t buffer.

x y z
xx yx zx
Parameters
pOutputPointer to an uninitialized Vector3D_t structure to receive the data

◆ GetXColumn() [2/2]

void BURGER_API Burger::Matrix4D_t::GetXColumn ( Vector4D_t * pOutput) const
noexcept

Return the X column from a matrix.


Copy the x column of a matrix into a user supplied Vector4D_t buffer.

x y z w
xx yx zx wx
Parameters
pOutputPointer to an uninitialized Vector4D_t structure to receive the data

◆ GetXRow() [1/2]

void BURGER_API Burger::Matrix4D_t::GetXRow ( Vector3D_t * pOutput) const
noexcept

Return the X row from a matrix.


Copy the x row of a matrix into a user supplied Vector3D_t buffer.

x y z
xx xy xz
Parameters
pOutputPointer to an uninitialized Vector3D_t structure to receive the data

◆ GetXRow() [2/2]

void BURGER_API Burger::Matrix4D_t::GetXRow ( Vector4D_t * pOutput) const
noexcept

Return the X row from a matrix.


Copy the x row of a matrix into a user supplied Vector4D_t buffer.

x y z w
xx xy xz xw
Parameters
pOutputPointer to an uninitialized Vector4D_t structure to receive the data

◆ GetYColumn() [1/2]

void BURGER_API Burger::Matrix4D_t::GetYColumn ( Vector3D_t * pOutput) const
noexcept

Return the Y column from a matrix.


Copy the y column of a matrix into a user supplied Vector3D_t buffer.

x y z
xy yy zy
Parameters
pOutputPointer to an uninitialized Vector3D_t structure to receive the data

◆ GetYColumn() [2/2]

void BURGER_API Burger::Matrix4D_t::GetYColumn ( Vector4D_t * pOutput) const
noexcept

Return the Y column from a matrix.


Copy the y column of a matrix into a user supplied Vector4D_t buffer.

x y z w
xy yy zy wy
Parameters
pOutputPointer to an uninitialized Vector4D_t structure to receive the data

◆ GetYRow() [1/2]

void BURGER_API Burger::Matrix4D_t::GetYRow ( Vector3D_t * pOutput) const
noexcept

Return the Y row from a matrix.


Copy the y row of a matrix into a user supplied Vector3D_t buffer.

x y z
yx yy yz
Parameters
pOutputPointer to an uninitialized Vector3D_t structure to receive the data

◆ GetYRow() [2/2]

void BURGER_API Burger::Matrix4D_t::GetYRow ( Vector4D_t * pOutput) const
noexcept

Return the Y row from a matrix.


Copy the y row of a matrix into a user supplied Vector4D_t buffer.

x y z w
yx yy yz yw
Parameters
pOutputPointer to an uninitialized Vector4D_t structure to receive the data

◆ GetZColumn() [1/2]

void BURGER_API Burger::Matrix4D_t::GetZColumn ( Vector3D_t * pOutput) const
noexcept

Return the Z column from a matrix.


Copy the z column of a matrix into a user supplied Vector3D_t buffer.

x y z
xz yz zz
Parameters
pOutputPointer to an uninitialized Vector3D_t structure to receive the data

◆ GetZColumn() [2/2]

void BURGER_API Burger::Matrix4D_t::GetZColumn ( Vector4D_t * pOutput) const
noexcept

Return the Z column from a matrix.


Copy the z column of a matrix into a user supplied Vector4D_t buffer.

x y z w
xz yz zz wz
Parameters
pOutputPointer to an uninitialized Vector4D_t structure to receive the data

◆ GetZRow() [1/2]

void BURGER_API Burger::Matrix4D_t::GetZRow ( Vector3D_t * pOutput) const
noexcept

Return the Z row from a matrix.


Copy the z row of a matrix into a user supplied Vector3D_t buffer.

x y z
zx zy zz
Parameters
pOutputPointer to an uninitialized Vector3D_t structure to receive the data

◆ GetZRow() [2/2]

void BURGER_API Burger::Matrix4D_t::GetZRow ( Vector4D_t * pOutput) const
noexcept

Return the Z row from a matrix.


Copy the z row of a matrix into a user supplied Vector4D_t buffer.

x y z w
zx zy zz zw
Parameters
pOutputPointer to an uninitialized Vector4D_t structure to receive the data

◆ Identity()

void BURGER_API Burger::Matrix4D_t::Identity ( void )
noexcept

Initialize a 4D matrix so that it is inert.


Sets the x.x, y.y, z.z and w.w components to 1.0f, all others to 0.0f

x y z w
x 1 0 0 0
y 0 1 0 0
z 0 0 1 0
w 0 0 0 1
See also
Zero(void)

◆ Multiply() [1/8]

void BURGER_API Burger::Matrix4D_t::Multiply ( const Matrix4D_t * pInput)
noexcept

Perform a matrix multiply against this matrix.


Multiply this matrix against another one

Use this formula to create the final matrix, this matrix is matrix #1 and the input matrix is matrix #2

x y z w
x (x.x*pInput->x.x)+(y.x*pInput->x.y)+(z.x*pInput->x.z)+(w.x*pInput->x.w) (x.y*pInput->x.x)+(y.y*pInput->x.y)+(z.y*pInput->x.z)+(w.y*pInput->x.w) (x.z*pInput->x.x)+(y.z*pInput->x.y)+(z.z*pInput->x.z)+(w.z*pInput->x.w) (x.w*pInput->x.x)+(y.w*pInput->x.y)+(z.w*pInput->x.z)+(w.w*pInput->x.w)
y (x.x*pInput->y.x)+(y.x*pInput->y.y)+(z.x*pInput->y.z)+(w.x*pInput->y.w) (x.y*pInput->y.x)+(y.y*pInput->y.y)+(z.y*pInput->y.z)+(w.y*pInput->y.w) (x.z*pInput->y.x)+(y.z*pInput->y.y)+(z.z*pInput->y.z)+(w.z*pInput->y.w) (x.w*pInput->y.x)+(y.w*pInput->y.y)+(z.w*pInput->y.z)+(w.w*pInput->y.w)
z (x.x*pInput->z.x)+(y.x*pInput->z.y)+(z.x*pInput->z.z)+(w.x*pInput->z.w) (x.y*pInput->z.x)+(y.y*pInput->z.y)+(z.y*pInput->z.z)+(w.y*pInput->z.w) (x.z*pInput->z.x)+(y.z*pInput->z.y)+(z.z*pInput->z.z)+(w.z*pInput->z.w) (x.w*pInput->z.x)+(y.w*pInput->z.y)+(z.w*pInput->z.z)+(w.w*pInput->z.w)
w (x.x*pInput->w.x)+(y.x*pInput->w.y)+(z.x*pInput->z.z)+(w.x*pInput->w.w) (x.y*pInput->w.x)+(y.y*pInput->w.y)+(z.y*pInput->z.z)+(w.y*pInput->w.w) (x.z*pInput->w.x)+(y.z*pInput->w.y)+(z.z*pInput->z.z)+(w.z*pInput->w.w) (x.w*pInput->w.x)+(y.w*pInput->w.y)+(z.w*pInput->z.z)+(w.w*pInput->w.w)
Parameters
pInputMatrix to multiply against
See also
Multiply(const Matrix4D_t *,const Matrix4D_t *)

◆ Multiply() [2/8]

void BURGER_API Burger::Matrix4D_t::Multiply ( const Matrix4D_t * pInput,
float fScale )
noexcept

Initialize with a matrix multiplied by a scalar.


Multiply all values of the matrix by a scalar constant and store the result in this matrix

Use this formula to create the final matrix

x y z w
x pInput->xx*fInput pInput->xy*fInput pInput->xz*fInput pInput->xw*fInput
y pInput->yx*fInput pInput->yy*fInput pInput->yz*fInput pInput->yw*fInput
z pInput->zx*fInput pInput->zy*fInput pInput->zz*fInput pInput->zw*fInput
w pInput->wx*fInput pInput->wy*fInput pInput->wz*fInput pInput->ww*fInput
Parameters
pInputPointer to Matrix to multiply
fScaleScalar value to multiply all values by
See also
Multiply(float) or Multiply3x3(float)

◆ Multiply() [3/8]

void BURGER_API Burger::Matrix4D_t::Multiply ( const Matrix4D_t * pInput,
float fScaleX,
float fScaleY,
float fScaleZ )
noexcept

Multiply by an X,Y and Z scale into a copy.


Using only the x.x, y.y, and z.z components of a simulated matrix, perform a matrix multiply quickly that would yield a multiplication vs a scale matrix and store the result in this Matrix4D_t

Use this formula to create the final matrix

x y z w
x (pInput->x.x*fScaleX) (pInput->x.y*fScaleX) (pInput->x.z*fScaleX) (pInput->x.w*fScaleX)
y (pInput->y.x*fScaleY) (pInput->y.y*fScaleY) (pInput->y.z*fScaleY) (pInput->y.w*fScaleY)
z (pInput->z.x*fScaleZ) (pInput->z.y*fScaleZ) (pInput->z.z*fScaleZ) (pInput->z.w*fScaleZ)
w (pInput->w.x*1.0f) (pInput->w.y*1.0f) pInput->w.z*1.0f) (pInput->w.w*1.0f)
Note
Terms with a multiply by 1.0f perform a copy operation instead of a multiply in the implementation.
Parameters
pInputPointer to a valid Matrix4D_t to apply the scale to
fScaleXX scale value
fScaleYY scale value
fScaleZZ scale value
See also
Multiply(float,float,float), TransposeMultiply(const Matrix4D_t*,float,float,float) or SetScale(float,float,float)

◆ Multiply() [4/8]

void BURGER_API Burger::Matrix4D_t::Multiply ( const Matrix4D_t * pInput,
float fScaleX,
float fScaleY,
float fScaleZ,
float fScaleW )
noexcept

Multiply by an X, Y, Z and W scale.


Using only the x.x, y.y, z.z and w.w components of a simulated matrix, perform a matrix multiply quickly that would yield a multiplication vs a scale matrix and store the result in this Matrix4D_t

Use this formula to create the final matrix

x y z w
x (pInput->x.x*fScaleX) (pInput->x.y*fScaleX) (pInput->x.z*fScaleX) (pInput->x.w*fScaleX)
y (pInput->y.x*fScaleY) (pInput->y.y*fScaleY) (pInput->y.z*fScaleY) (pInput->y.w*fScaleY)
z (pInput->z.x*fScaleZ) (pInput->z.y*fScaleZ) (pInput->z.z*fScaleZ) (pInput->z.w*fScaleZ)
w (pInput->w.x*fScaleW) (pInput->w.y*fScaleW) (pInput->w.z*fScaleW) (pInput->w.w*fScaleW)
Parameters
pInputPointer to a valid Matrix4D_t to apply the scale to
fScaleXX scale value
fScaleYY scale value
fScaleZZ scale value
fScaleWW scale value
See also
Multiply(float,float,float,float), TransposeMultiply(const Matrix4D_t*,float,float,float,float) or SetScale(float,float,float,float)

◆ Multiply() [5/8]

void BURGER_API Burger::Matrix4D_t::Multiply ( const Matrix4D_t * pInput1,
const Matrix4D_t * pInput2 )
noexcept

Perform a matrix multiply.


Multiply two matrices together and store the result in this matrix.

Use this formula to create the final matrix

x y z w
x (pInput1->x.x*pInput2->x.x)+(pInput1->y.x*pInput2->x.y)+(pInput1->z.x*pInput2->x.z)+(pInput1->w.x*pInput2->x.w) (pInput1->x.y*pInput2->x.x)+(pInput1->y.y*pInput2->x.y)+(pInput1->z.y*pInput2->x.z)+(pInput1->w.y*pInput2->x.w) (pInput1->x.z*pInput2->x.x)+(pInput1->y.z*pInput2->x.y)+(pInput1->z.z*pInput2->x.z)+(pInput1->w.z*pInput2->x.w) (pInput1->x.w*pInput2->x.x)+(pInput1->y.w*pInput2->x.y)+(pInput1->z.w*pInput2->x.z)+(pInput1->w.w*pInput2->x.w)
y (pInput1->x.x*pInput2->y.x)+(pInput1->y.x*pInput2->y.y)+(pInput1->z.x*pInput2->y.z)+(pInput1->w.x*pInput2->y.w) (pInput1->x.y*pInput2->y.x)+(pInput1->y.y*pInput2->y.y)+(pInput1->z.y*pInput2->y.z)+(pInput1->w.y*pInput2->y.w) (pInput1->x.z*pInput2->y.x)+(pInput1->y.z*pInput2->y.y)+(pInput1->z.z*pInput2->y.z)+(pInput1->w.z*pInput2->y.w) (pInput1->x.w*pInput2->y.x)+(pInput1->y.w*pInput2->y.y)+(pInput1->z.w*pInput2->y.z)+(pInput1->w.w*pInput2->y.w)
z (pInput1->x.x*pInput2->z.x)+(pInput1->y.x*pInput2->z.y)+(pInput1->z.x*pInput2->z.z)+(pInput1->w.x*pInput2->z.w) (pInput1->x.y*pInput2->z.x)+(pInput1->y.y*pInput2->z.y)+(pInput1->z.y*pInput2->z.z)+(pInput1->w.y*pInput2->z.w) (pInput1->x.z*pInput2->z.x)+(pInput1->y.z*pInput2->z.y)+(pInput1->z.z*pInput2->z.z)+(pInput1->w.z*pInput2->z.w) (pInput1->x.w*pInput2->z.x)+(pInput1->y.w*pInput2->z.y)+(pInput1->z.w*pInput2->z.z)+(pInput1->w.w*pInput2->z.w)
w (pInput1->x.x*pInput2->w.x)+(pInput1->y.x*pInput2->w.y)+(pInput1->z.x*pInput2->z.z)+(pInput1->w.x*pInput2->w.w) (pInput1->x.y*pInput2->w.x)+(pInput1->y.y*pInput2->w.y)+(pInput1->z.y*pInput2->z.z)+(pInput1->w.y*pInput2->w.w) (pInput1->x.z*pInput2->w.x)+(pInput1->y.z*pInput2->w.y)+(pInput1->z.z*pInput2->z.z)+(pInput1->w.z*pInput2->w.w) (pInput1->x.w*pInput2->w.x)+(pInput1->y.w*pInput2->w.y)+(pInput1->z.w*pInput2->z.z)+(pInput1->w.w*pInput2->w.w)
Note
This function is optimized to reduce variable usage by storing into the output without buffering. Do not use the output matrix as an input matrix.
Parameters
pInput1Matrix to multiply from
pInput2Matrix to multiply against
See also
Multiply(const Matrix4D_t *)

◆ Multiply() [6/8]

void BURGER_API Burger::Matrix4D_t::Multiply ( float fScale)
noexcept

Perform a matrix multiply by a scalar.


Multiply a scalar value to every element in the matrix.

Use this formula to create the final matrix

x y z w
x xx*fInput xy*fInput xz*fInput xw*fInput
y yx*fInput yy*fInput yz*fInput yw*fInput
z zx*fInput zy*fInput zz*fInput zw*fInput
w wx*fInput wy*fInput wz*fInput ww*fInput
Parameters
fScaleScalar value to multiply all values by
See also
Multiply(const Matrix4D_t *,float) or Multiply3x3(float)

◆ Multiply() [7/8]

void BURGER_API Burger::Matrix4D_t::Multiply ( float fScaleX,
float fScaleY,
float fScaleZ )
noexcept

Multiply by an X,Y and Z scale.


Using only the x.x, y.y, and z.z components of a simulated matrix, perform a matrix multiply quickly that would yield a multiplication vs a scale matrix

Use this formula to create the final matrix

x y z w
x (x.x*fScaleX) (x.y*fScaleX) (x.z*fScaleX) (x.w*fScaleX)
y (y.x*fScaleY) (y.y*fScaleY) (y.z*fScaleY) (y.w*fScaleY)
z (z.x*fScaleZ) (z.y*fScaleZ) (z.z*fScaleZ) (z.w*fScaleZ)
w (w.x*1.0f) (w.y*1.0f) (w.z*1.0f) (w.w*1.0f)
Note
Terms with a multiply by 1.0f perform no action in the implementation.
Parameters
fScaleXX scale value
fScaleYY scale value
fScaleZZ scale value
See also
Multiply(const Matrix4D_t *,float,float,float), TransposeMultiply(float,float,float) or SetScale(float,float,float)

◆ Multiply() [8/8]

void BURGER_API Burger::Matrix4D_t::Multiply ( float fScaleX,
float fScaleY,
float fScaleZ,
float fScaleW )
noexcept

Multiply by an X, Y, Z and W scale.


Using only the x.x, y.y, z.z and w.w components of a simulated matrix, perform a matrix multiply quickly that would yield a multiplication vs a scale matrix

Use this formula to create the final matrix

x y z w
x (x.x*fScaleX) (x.y*fScaleX) (x.z*fScaleX) (x.w*fScaleX)
y (y.x*fScaleY) (y.y*fScaleY) (y.z*fScaleY) (y.w*fScaleY)
z (z.x*fScaleZ) (z.y*fScaleZ) (z.z*fScaleZ) (z.w*fScaleZ)
w (w.x*fScaleW) (w.y*fScaleW) (w.z*fScaleW) (w.w*fScaleW)
Parameters
fScaleXX scale value
fScaleYY scale value
fScaleZZ scale value
fScaleWW scale value
See also
Multiply(const Matrix4D_t *,float,float,float,float), TransposeMultiply(float,float,float,float) or SetScale(float,float,float,float)

◆ Multiply3x3() [1/2]

void BURGER_API Burger::Matrix4D_t::Multiply3x3 ( const Matrix4D_t * pInput,
float fInput )
noexcept

Perform a 3x3 matrix multiply by a scalar.


Multiply a scalar value to the 3x3 subset of a matrix (The equivalent of W equaling 1.0f)

Use this formula to create the final matrix

x y z w
x pInput->xx*fInput pInput->xy*fInput pInput->xz*fInput pInput->xw*1.0f
y pInput->yx*fInput pInput->yy*fInput pInput->yz*fInput pInput->yw*1.0f
z pInput->zx*fInput pInput->zy*fInput pInput->zz*fInput pInput->zw*1.0f
w pInput->wx*1.0f pInput->wy*1.0f pInput->wz*1.0f pInput->ww*1.0f
Note
The terms where the value is multiplied by 1.0f are actually not performed and are replaced with a value copy since mathematically they perform the same action.
Parameters
pInputPointer to Matrix to multiply
fInputScalar value to multiply all values by
See also
Multiply3x3(float) or Multiply(float)

◆ Multiply3x3() [2/2]

void BURGER_API Burger::Matrix4D_t::Multiply3x3 ( float fInput)
noexcept

Perform a 3x3 matrix multiply by a scalar.


Multiply a scalar value to the 3x3 subset of a matrix (The equivalent of W equaling 1.0f)

Use this formula to create the final matrix

x y z w
x xx*fInput xy*fInput xz*fInput xw*1.0f
y yx*fInput yy*fInput yz*fInput yw*1.0f
z zx*fInput zy*fInput zz*fInput zw*1.0f
w wx*1.0f wy*1.0f wz*1.0f ww*1.0f
Note
The terms where the value is multiplied by 1.0f are actually not performed and are replaced with a value copy since mathematically they perform the same action.
Parameters
fInputScalar value to multiply all values by
See also
Multiply3x3(const Matrix4D_t *,float) or Multiply(float)

◆ operator const float *()

Burger::Matrix4D_t::operator const float * ( ) const
inlinenoexcept

Convert to a const float pointer.


This convenience operator converts the Matrix4D_t into a float pointer to pass to other APIs that treat this as an array of 32 bit floats.

Returns
The pointer to the object typecast as a (const float *)

◆ PerspectiveFovLH()

void BURGER_API Burger::Matrix4D_t::PerspectiveFovLH ( float fFieldOfViewY,
float fAspect,
float fNear,
float fFar )
noexcept

Create a 4D perspective matrix.


Using a field of view, an aspect ratio (width/height) and a near/far range, create a left handed projection matrix.

fYScale = 1.0f / tan(fFieldOfViewY*0.5f);

x y z w
x fYScale/fAspect 0 0 0
y 0 fYScale 0 0
z 0 0 fFar/(fFar-fNear) 1
w 0 0 (-fNear * fFar) / (fFar-fNear) 0
Note
This is a drop in replacement for the Windows function [D3DXMatrixPerspectiveFovLH()] (http://msdn.microsoft.com/en-us/library/bb205350(VS.85).aspx)
Parameters
fFieldOfViewYAngle of the field of view in radians
fAspectAspect ratio of the screen
fNearNear clip plane
fFarFar clip plane
See also
PerspectiveFovRH()

◆ PerspectiveFovRH()

void BURGER_API Burger::Matrix4D_t::PerspectiveFovRH ( float fFieldOfViewY,
float fAspect,
float fNear,
float fFar )
noexcept

Create a 4D perspective matrix.


Using a field of view, an aspect ratio (width/height) and a near/far range, create a right handed projection matrix.

fYScale = 1.0f / tan(fFieldOfViewY*0.5f);

x y z w
x fYScale/fAspect 0 0 0
y 0 fYScale 0 0
z 0 0 fFar/(fNear-fFar) -1
w 0 0 (fNear * fFar) / (fNear-fFar) 0
Note
This is a drop in replacement for the Windows function [D3DXMatrixPerspectiveFovRH()] (http://msdn.microsoft.com/en-us/library/bb205351(v=vs.85).aspx)
Parameters
fFieldOfViewYAngle of the field of view in radians
fAspectAspect ratio of the screen
fNearNear clip plane
fFarFar clip plane
See also
PerspectiveFovLH()

◆ Pitch()

void BURGER_API Burger::Matrix4D_t::Pitch ( float fPitch)
noexcept

Rotate a matrix in the X axis (Pitch)


Given a X angle in radians, rotate the matrix accordingly

fCos = get_cosine(fPitch); fSin = get_sine(fPitch);

x y z w
x x.x x.y x.z x.w
y (z.x*fSin)+(y.x*fCos) (z.y*fSin)+(y.y*fCos) (z.z*fSin)+(y.z*fCos) (z.w*fSin)+(y.w*fCos)
z (z.x*fCos)-(y.x*fSin) (z.y*fCos)-(y.y*fSin) (z.z*fCos)-(y.z*fSin) (z.w*fCos)-(y.w*fSin)
w w.x w.y w.z w.w
Parameters
fPitchAngle in radians to pitch the matrix
See also
Yaw(float) or Roll(float)

◆ Roll()

void BURGER_API Burger::Matrix4D_t::Roll ( float fRoll)
noexcept

Rotate a matrix in the Z axis (Roll)


Given a Z angle in radians, rotate the matrix accordingly

fCos = get_cosine(fRoll); fSin = get_sine(fRoll);

x y z w
x (y.x*fSin)+(x.x*fCos) (y.y*fSin)+(x.y*fCos) (y.z*fSin)+(x.z*fCos) (y.w*fSin)+(x.w*fCos)
y (y.x*fCos)-(x.x*fSin) (y.y*fCos)-(x.y*fSin) (y.z*fCos)-(x.z*fSin) (y.w*fCos)-(x.w*fSin)
z z.x z.y z.z z.w
w w.x w.y w.z w.w
Parameters
fRollAngle in radians to roll the matrix
See also
Yaw(float) or Pitch(float)

◆ Rotate()

void BURGER_API Burger::Matrix4D_t::Rotate ( float fRadians,
float fX,
float fY,
float fZ )
noexcept

Rotate a matrix in an arbitrary axis.


Given a vector to determine direction and an angle in radians, rotate the matrix accordingly

Note
This is a replacement for glRotate()
Parameters
fRadiansAngle in radians to roll the matrix
fXX value of the vector
fYY value of the vector
fZZ value of the vector
See also
Yaw(float), Pitch(float) or Roll(float)

◆ Set() [1/3]

void BURGER_API Burger::Matrix4D_t::Set ( const FixedMatrix4D_t * pInput)
noexcept

Convert a fixed point matrix into a floating point matrix.


Using fixed_to_float(float *,Fixed32), convert all of the entries from a 4x4 16.16 fixed point matrix into a floating point matrix

Parameters
pInputPointer to a valid FixedMatrix4D_t for conversion
See also
fixed_to_float(float *,Fixed32)

◆ Set() [2/3]

void BURGER_API Burger::Matrix4D_t::Set ( const Matrix3D_t * pInput)
noexcept

Copy a Matrix3D_t to a Matrix4D_t.


Copy a 3x3 matrix into this one.

x y z w
x pInput->x.x pInput->x.y pInput->x.z 0
y pInput->y.x pInput->y.y pInput->y.z 0
z pInput->z.x pInput->z.y pInput->z.z 0
w 0 0 0 1
Parameters
pInputPointer to a valid Matrix3D_t for copying
See also
Set(const Matrix4D_t *) or Matrix3D_t::Set(const Matrix4D_t *)

◆ Set() [3/3]

void BURGER_API Burger::Matrix4D_t::Set ( const Matrix4D_t * pInput)
noexcept

Copy the matrix.


Copy a matrix into this one

Parameters
pInputPointer to a valid Matrix4D_t for copying
See also
Identity() or Zero()

◆ SetFromQuaternion()

void BURGER_API Burger::Matrix4D_t::SetFromQuaternion ( const Vector4D_t * pInput)
noexcept

Convert a quaternion to a 4x4 matrix.


Here's the resulting matrix of math used using terms from the input quaternion

x y z w
x 1-(2yy+2zz) 2xy+2wz 2xz-2wy 0
y 2xy-2wz 1-(2xx+2zz) 2yz+2wx 0
z 2xz+2wy 2yz-2wx 1-(2xx+2yy) 0
w 0 0 0 1
Parameters
pInputPointer to a normalized quaternion
See also
Matrix3D_t::SetFromQuaternion(const Vector4D_t *pInput) or TransposeSetFromQuaternion(const Vector4D_t *pInput)

◆ SetFrustum()

void BURGER_API Burger::Matrix4D_t::SetFrustum ( float fLeft,
float fRight,
float fBottom,
float fTop,
float fNear,
float fFar )
noexcept

Create a transposed 4D projection matrix.


Using a frustum, create a projection matrix in a format that OpenGL can use directly. If a DirectX version is desired, call TransposeSetFrustum() instead.

x y z w
x (fNear * 2.0f) / (fRight - fLeft) 0 0 0
y 0 (fNear * 2.0f) / (fTop - fBottom) 0 0
z (fRight + fLeft) / (fRight - fLeft) (fTop + fBottom) / (fTop - fBottom) -(fFar+fNear) / (fFar - fNear) -1
w 0 0 -(2.0f * fFar * fNear) / (fFar -fNear) 0
Note
This is functional duplicate of glFrustum()
Parameters
fLeftLeftmost X coordinate
fRightRightmost X coordinate
fBottomBottommost Y coordinate
fTopTopmost Y coordinate
fNearNear clip plane
fFarFar clip plane
See also
SetOrtho(), SetPerspective() or TransposeSetFrustum()

◆ SetOrtho()

void BURGER_API Burger::Matrix4D_t::SetOrtho ( float fLeft,
float fRight,
float fBottom,
float fTop,
float fNear,
float fFar )
noexcept

Create a transposed orthogonal 4D projection matrix.


Using a frustum, create an orthogonal matrix in a format that OpenGL can use directly. If a DirectX version is desired, call TransposeSetOrtho() instead.

x y z w
x 2.0f / (fRight - fLeft) 0 0 0
y 0 2.0f / (fTop - fBottom) 0 0
z 0 0 -2.0f / (fFar - fNear) 0
w -(fRight + fLeft) / (fRight - fLeft) -(fTop + fBottom) / (fTop - fBottom) -(Far + fNear) / (fFar - fNear) 1
Parameters
fLeftLeftmost X coordinate
fRightRightmost X coordinate
fBottomBottommost Y coordinate
fTopTopmost Y coordinate
fNearNear clip plane
fFarFar clip plane
See also
SetFrustum() or TransposeSetOrtho()

◆ SetPerspective()

void BURGER_API Burger::Matrix4D_t::SetPerspective ( float fFieldOfViewY,
float fAspect,
float fNear,
float fFar )
noexcept

Create a 4D perspective matrix.


Using a field of view and an aspect ratio (x/y), create a projection matrix in a format that OpenGL can use directly. If a DirectX version is desired, call TransposeSetPerspective() instead.

f = 1.0f / tan((fFieldOfViewY*g_fDegreesToRadians)*0.5f);

x y z w
x f/fAspect 0 0 0
y 0 f 0 0
z 0 0 (fFar+fNear) / (fNear-fFar) -1
w 0 0 (2.0f * fFar * fNear) / (fNear-fFar) 0
Note
This is functional duplicate of gluPerspective()
Parameters
fFieldOfViewYAngle of the field of view in degrees
fAspectAspect ratio of the screen
fNearNear clip plane
fFarFar clip plane
See also
SetOrtho(), SetFrustum() or TransposeSetPerspective()

◆ SetPitch()

void BURGER_API Burger::Matrix4D_t::SetPitch ( float fPitch)
noexcept

Initialize a rotation matrix with radians for pitch (X)


float sx = get_sine(fPitch);
float cx = get_cosine(fPitch);
float get_cosine(float fInput) noexcept
Return the cosine from radians.
Definition brsinecosine.cpp:1203
float get_sine(float fInput) noexcept
Return the sine from radians.
Definition brsinecosine.cpp:969
x y z w
x 1 0 0 0
y 0 cx -sx 0
z 0 sx cx 0
w 0 0 0 1
Parameters
fPitchPitch of the X in radians
See also
TransposeSetPitch(float), SetXYZ(float,float,float), SetYaw(float) and SetRoll(float)

◆ SetRoll()

void BURGER_API Burger::Matrix4D_t::SetRoll ( float fRoll)
noexcept

Initialize a rotation matrix with radians for roll (Z)


float sz = get_sine(fRoll);
float cz = get_cosine(fRoll);
x y z w
x cz -sz 0 0
y sz cz 0 0
z 0 0 1 0
w 0 0 0 1
Parameters
fRollRoll of the Z in radians
See also
TransposeSetRoll(float), SetXYZ(float,float,float), SetYaw(float) and SetPitch(float)

◆ SetScale() [1/2]

void BURGER_API Burger::Matrix4D_t::SetScale ( float fX,
float fY,
float fZ )
noexcept

Create a 4D scale matrix.


Sets the x.x, y.y and z.z components to the input values, w.w is set to 1.0f and all others are set to 0.0f

x y z w
x fX 0 0 0
y 0 fY 0 0
z 0 0 fZ 0
w 0 0 0 1
Parameters
fXnew x.x component
fYnew y.y component
fZnew z.z component
See also
Identity(void) and SetScale(float,float,float,float)

◆ SetScale() [2/2]

void BURGER_API Burger::Matrix4D_t::SetScale ( float fX,
float fY,
float fZ,
float fW )
noexcept

Create a 4D scale matrix.


Sets the x.x, y.y, z.z and w.w components to the input values and all others are set to 0.0f

x y z w
x fX 0 0 0
y 0 fY 0 0
z 0 0 fZ 0
w 0 0 0 fW
Parameters
fXnew x.x component
fYnew y.y component
fZnew z.z component
fWnew w.w component
See also
Identity(void) and SetScale(float,float,float)

◆ SetTranslate()

void BURGER_API Burger::Matrix4D_t::SetTranslate ( float fX,
float fY,
float fZ )
noexcept

Create a 4D translation matrix.


Sets the w row to fX, fY and fZ and the rest of the values to that of an identity matrix.

x y z w
x 1 0 0 0
y 0 1 0 0
z 0 0 1 0
w fX fY fZ 1
Parameters
fXnew w.x component
fYnew w.y component
fZnew w.z component
See also
Identity(void)

◆ SetWColumn() [1/2]

void BURGER_API Burger::Matrix4D_t::SetWColumn ( const Vector3D_t * pInput)
noexcept

Set the W column of a matrix.


Overwrite the W column of the matrix with the input vector

x y z w
x xx xy xz pInput->x
y yx yy yz pInput->y
z zx zy zz pInput->z
w wx wy wz ww
Parameters
pInputPointer to a Vector3D_t structure that has the new W column

◆ SetWColumn() [2/2]

void BURGER_API Burger::Matrix4D_t::SetWColumn ( const Vector4D_t * pInput)
noexcept

Set the W column of a matrix.


Overwrite the W column of the matrix with the input vector

x y z w
x xx xy xz pInput->x
y yx yy yz pInput->y
z zx zy zz pInput->z
w wx wy wz pInput->w
Parameters
pInputPointer to a Vector4D_t structure that has the new W column

◆ SetWRow() [1/2]

void BURGER_API Burger::Matrix4D_t::SetWRow ( const Vector3D_t * pInput)
noexcept

Set the W row of a matrix.


Overwrite the W row of the matrix with the input vector

x y z w
x xx xy xz xw
y yx yy yz yw
z zx zy zz zw
w pInput->x pInput->y pInput->z ww
Parameters
pInputPointer to a Vector3D_t structure that has the new W row

◆ SetWRow() [2/2]

void BURGER_API Burger::Matrix4D_t::SetWRow ( const Vector4D_t * pInput)
noexcept

Set the W row of a matrix.


Overwrite the W row of the matrix with the input vector

x y z w
x xx xy xz xw
y yx yy yz yw
z zx zy zz zw
w pInput->x pInput->y pInput->z pInput->w
Parameters
pInputPointer to a Vector4D_t structure that has the new W row

◆ SetXColumn() [1/2]

void BURGER_API Burger::Matrix4D_t::SetXColumn ( const Vector3D_t * pInput)
noexcept

Set the X column of a matrix.


Overwrite the X column of the matrix with the input vector

x y z w
x pInput->x xy xz xw
y pInput->y yy yz yw
z pInput->z zy zz zw
w wx wy wz ww
Parameters
pInputPointer to a Vector3D_t structure that has the new X column

◆ SetXColumn() [2/2]

void BURGER_API Burger::Matrix4D_t::SetXColumn ( const Vector4D_t * pInput)
noexcept

Set the X column of a matrix.


Overwrite the X column of the matrix with the input vector

x y z w
x pInput->x xy xz xw
y pInput->y yy yz yw
z pInput->z zy zz zw
w pInput->w wy wz ww
Parameters
pInputPointer to a Vector4D_t structure that has the new X column

◆ SetXRow() [1/2]

void BURGER_API Burger::Matrix4D_t::SetXRow ( const Vector3D_t * pInput)
noexcept

Set the X row of a matrix.


Overwrite the X row of the matrix with the input vector

x y z w
x pInput->x pInput->y pInput->z xw
y yx yy yz yw
z zx zy zz zw
w wx wy wz ww
Parameters
pInputPointer to a Vector3D_t structure that has the new X row

◆ SetXRow() [2/2]

void BURGER_API Burger::Matrix4D_t::SetXRow ( const Vector4D_t * pInput)
noexcept

Set the X row of a matrix.


Overwrite the X row of the matrix with the input vector

x y z w
x pInput->x pInput->y pInput->z pInput->w
y yx yy yz yw
z zx zy zz zw
w wx wy wz ww
Parameters
pInputPointer to a Vector4D_t structure that has the new X row

◆ SetXYZ()

void BURGER_API Burger::Matrix4D_t::SetXYZ ( float fYaw,
float fPitch,
float fRoll )
noexcept

Initialize a rotation matrix in the order of X, Y and Z.


Initialize a rotation matrix with radians for Yaw (Y), Pitch (X), and Roll (Z) in the order of X, Y and then Z.

float sx = get_sine(fPitch);
float sy = get_sine(fYaw);
float sz = get_sine(fRoll);
float cx = get_cosine(fPitch);
float cy = get_cosine(fYaw);
float cz = get_cosine(fRoll);
x y z w
x cy*cz (-sy*sx*cz)+(cx*-sz) (-sy*cx*cz)+(-sx*-sz) 0
y cy*sz (cx*cz)+(-sy*sx*sz) (-sx*cx)+(cy*sx*-sz) 0
z sy cy*sx cy*cx 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
fPitchPitch of the X in radians
fRollRoll of the Z in radians
See also
TransposeSetXYZ(float,float,float), SetYaw(float), SetPitch(float), and SetRoll(float)

◆ SetXZY()

void BURGER_API Burger::Matrix4D_t::SetXZY ( float fYaw,
float fPitch,
float fRoll )
noexcept

Initialize a rotation matrix in the order of X, Z and Y.


Initialize a rotation matrix with radians for Yaw (Y), Pitch (X), and Roll (Z) in the order of X, Z and then Y.

float sx = get_sine(fPitch);
float sy = get_sine(fYaw);
float sz = get_sine(fRoll);
float cx = get_cosine(fPitch);
float cy = get_cosine(fYaw);
float cz = get_cosine(fRoll);
x y z w
x cy*cz (cx*-sz*cy)+(-sy*sx) (-sx*-sz*cy)+(-sy*cx) 0
y sz cx*cz -sx*cz 0
z sy*cz (sx*cy)+(sy*cx*-sz) (cx*cy)+(sy*-sx*-sz) 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
fPitchPitch of the X in radians
fRollRoll of the Z in radians
See also
TransposeSetXZY(float,float,float), SetYaw(float), SetPitch(float), and SetRoll(float)

◆ SetYaw()

void BURGER_API Burger::Matrix4D_t::SetYaw ( float fYaw)
noexcept

Initialize a rotation matrix with radians for yaw (Y)


float sy = get_sine(fYaw);
float cy = get_cosine(fYaw);
x y z w
x cy 0 -sy 0
y 0 1 0 0
z sy 0 cy 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
See also
TransposeSetYaw(float), SetXYZ(float,float,float), SetPitch(float) and SetRoll(float)

◆ SetYColumn() [1/2]

void BURGER_API Burger::Matrix4D_t::SetYColumn ( const Vector3D_t * pInput)
noexcept

Set the Y column of a matrix.


Overwrite the Y column of the matrix with the input vector

x y z w
x xx pInput->x xz xw
y yx pInput->y yz yw
z zx pInput->z zz zw
w wx wy wz ww
Parameters
pInputPointer to a Vector3D_t structure that has the new Y column

◆ SetYColumn() [2/2]

void BURGER_API Burger::Matrix4D_t::SetYColumn ( const Vector4D_t * pInput)
noexcept

Set the Y column of a matrix.


Overwrite the Y column of the matrix with the input vector

x y z w
x xx pInput->x xz xw
y yx pInput->y yz yw
z zx pInput->z zz zw
w wx pInput->w wz ww
Parameters
pInputPointer to a Vector4D_t structure that has the new Y column

◆ SetYRow() [1/2]

void BURGER_API Burger::Matrix4D_t::SetYRow ( const Vector3D_t * pInput)
noexcept

Set the Y row of a matrix.


Overwrite the Y row of the matrix with the input vector

x y z w
x xx xy xz xw
y pInput->x pInput->y pInput->z yw
z zx zy zz zw
w wx wy wz ww
Parameters
pInputPointer to a Vector3D_t structure that has the new Y row

◆ SetYRow() [2/2]

void BURGER_API Burger::Matrix4D_t::SetYRow ( const Vector4D_t * pInput)
noexcept

Set the Y row of a matrix.


Overwrite the Y row of the matrix with the input vector

x y z w
x xx xy xz xw
y pInput->x pInput->y pInput->z pInput->w
z zx zy zz zw
w wx wy wz ww
Parameters
pInputPointer to a Vector4D_t structure that has the new Y row

◆ SetYXZ()

void BURGER_API Burger::Matrix4D_t::SetYXZ ( float fYaw,
float fPitch,
float fRoll )
noexcept

Initialize a rotation matrix in the order of Y, X and Z.


Initialize a rotation matrix with radians for Yaw (Y), Pitch (X), and Roll (Z) in the order of Y, X and then Z.

float sx = get_sine(fPitch);
float sy = get_sine(fYaw);
float sz = get_sine(fRoll);
float cx = get_cosine(fPitch);
float cy = get_cosine(fYaw);
float cz = get_cosine(fRoll);
x y z w
x (cy*cz)+(sy*-sx*-sz) cx*-sz (-sy*cz)+(cy*-sx*-sz) 0
y (sy*-sx*cz)+(cy*sz) cx*cz (cy*-sx*cz)+(-sy*sz) 0
z sy*cx sx cy*cx 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
fPitchPitch of the X in radians
fRollRoll of the Z in radians
See also
TransposeSetYXZ(float,float,float), SetYaw(float), SetPitch(float), and SetRoll(float)

◆ SetYZX()

void BURGER_API Burger::Matrix4D_t::SetYZX ( float fYaw,
float fPitch,
float fRoll )
noexcept

Initialize a rotation matrix in the order of Y, Z and X.


Initialize a rotation matrix with radians for Yaw (Y), Pitch (X), and Roll (Z) in the order of Y, Z and then X.

float sx = get_sine(fPitch);
float sy = get_sine(fYaw);
float sz = get_sine(fRoll);
float cx = get_cosine(fPitch);
float cy = get_cosine(fYaw);
float cz = get_cosine(fRoll);
x y z w
x cy*cz -sz -sy*cz 0
y (cy*sz*cx)+(sy*-sx) cx*cz (-sy*sz*cx)+(cy*-sx) 0
z (sy*cx)+(cy*sx*sz) sx*cz (cy*cx)+(-sy*sx*sz) 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
fPitchPitch of the X in radians
fRollRoll of the Z in radians
See also
TransposeSetYZX(float,float,float), SetYaw(float), SetPitch(float), and SetRoll(float)

◆ SetZColumn() [1/2]

void BURGER_API Burger::Matrix4D_t::SetZColumn ( const Vector3D_t * pInput)
noexcept

Set the Z column of a matrix.


Overwrite the Z column of the matrix with the input vector

x y z w
x xx xy pInput->x xw
y yx yy pInput->y yw
z zx zy pInput->z zw
w wx wy wz ww
Parameters
pInputPointer to a Vector3D_t structure that has the new Z column

◆ SetZColumn() [2/2]

void BURGER_API Burger::Matrix4D_t::SetZColumn ( const Vector4D_t * pInput)
noexcept

Set the Z column of a matrix.


Overwrite the Z column of the matrix with the input vector

x y z w
x xx xy pInput->x xw
y yx yy pInput->y yw
z zx zy pInput->z zw
w wx wy pInput->w ww
Parameters
pInputPointer to a Vector4D_t structure that has the new Z column

◆ SetZRow() [1/2]

void BURGER_API Burger::Matrix4D_t::SetZRow ( const Vector3D_t * pInput)
noexcept

Set the Z row of a matrix.


Overwrite the Z row of the matrix with the input vector

x y z w
x xx xy xz xw
y yx yy yz yw
z pInput->x pInput->y pInput->z zw
w wx wy wz ww
Parameters
pInputPointer to a Vector3D_t structure that has the new Z row

◆ SetZRow() [2/2]

void BURGER_API Burger::Matrix4D_t::SetZRow ( const Vector4D_t * pInput)
noexcept

Set the Z row of a matrix.


Overwrite the Z row of the matrix with the input vector

x y z w
x xx xy xz xw
y yx yy yz yw
z pInput->x pInput->y pInput->z pInput->w
w wx wy wz ww
Parameters
pInputPointer to a Vector4D_t structure that has the new Z row

◆ SetZXY()

void BURGER_API Burger::Matrix4D_t::SetZXY ( float fYaw,
float fPitch,
float fRoll )
noexcept

Initialize a rotation matrix in the order of Z, X and Y.


Initialize a rotation matrix with radians for Yaw (Y), Pitch (X), and Roll (Z) in the order of Z, X and then Y.

float sx = get_sine(fPitch);
float sy = get_sine(fYaw);
float sz = get_sine(fRoll);
float cx = get_cosine(fPitch);
float cy = get_cosine(fYaw);
float cz = get_cosine(fRoll);
x y z w
x (cz*cy)+(-sy*sx*sz) (-sz*cy)+(-sy*sx*cz) -sy*cx 0
y cx*sz cx*cz -sx 0
z (sx*sz*cy)+(sy*cz) (sx*cz*cy)+(sy*-sz) cy*cx 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
fPitchPitch of the X in radians
fRollRoll of the Z in radians
See also
TransposeSetZXY(float,float,float), SetYaw(float), SetPitch(float), and SetRoll(float)

◆ SetZYX()

void BURGER_API Burger::Matrix4D_t::SetZYX ( float fYaw,
float fPitch,
float fRoll )
noexcept

Initialize a rotation matrix in the order of Z, Y and X.


Initialize a rotation matrix with radians for Yaw (Y), Pitch (X), and Roll (Z) in the order of Z, Y and then X.

float sx = get_sine(fPitch);
float sy = get_sine(fYaw);
float sz = get_sine(fRoll);
float cx = get_cosine(fPitch);
float cy = get_cosine(fYaw);
float cz = get_cosine(fRoll);
x y z w
x cy*cz cy*-sz -sy 0
y (sz*cx)+(sy*-sx*cz) (cz*cx)+(sy*-sx*-sz) cy*-sx 0
z (sy*cz*cx)+(sx*sz) (sy*-sz*cx)+(sx*cz) cy*cx 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
fPitchPitch of the X in radians
fRollRoll of the Z in radians
See also
TransposeSetZYX(float,float,float), SetYaw(float), SetPitch(float), and SetRoll(float)

◆ Transform() [1/4]

void BURGER_API Burger::Matrix4D_t::Transform ( Vector3D_t * pInput) const
noexcept

Multiply a vector by a matrix.


Transform the point by the matrix

x y z
(xx*x)+(xy*y)+(xz*z)+(xw) (yx*x)+(yy*y)+(yz*z)+(yw) (zx*x)+(zy*y)+(zz*z)+(zw)
Parameters
pInputPointer to a Vector3D_t to transform against this matrix
See also
Transform(Vector3D_t *,const Vector3D_t *) const or TransposeTransform(Vector3D_t *) const

◆ Transform() [2/4]

void BURGER_API Burger::Matrix4D_t::Transform ( Vector3D_t * pOutput,
const Vector3D_t * pInput ) const
noexcept

Multiply a vector by a matrix.


Transform the point by the matrix and store the result in an uninitialized Vector3D_t

x y z
(xx*x)+(xy*y)+(xz*z)+(xw) (yx*x)+(yy*y)+(yz*z)+(yw) (zx*x)+(zy*y)+(zz*z)+(zw)
Parameters
pInputPointer to a Vector3D_t to transform against this matrix
pOutputPointer to an uninitialized Vector3D_t to store the result
See also
Transform(Vector3D_t *) const or TransposeTransform(Vector3D_t *,const Vector3D_t *) const

◆ Transform() [3/4]

void BURGER_API Burger::Matrix4D_t::Transform ( Vector4D_t * pInput) const
noexcept

Multiply a vector by a matrix.


Transform the point by the matrix

x y z w
(xx*x)+(xy*y)+(xz*z)+(xw*w) (yx*x)+(yy*y)+(yz*z)+(yw*w) (zx*x)+(zy*y)+(zz*z)+(zw*w) (wx*x)+(wy*y)+(wz*z)+(ww*w)
Parameters
pInputPointer to a Vector4D_t to transform against this matrix
See also
Transform(Vector4D_t *,const Vector4D_t *) const or TransposeTransform(Vector4D_t *) const

◆ Transform() [4/4]

void BURGER_API Burger::Matrix4D_t::Transform ( Vector4D_t * pOutput,
const Vector4D_t * pInput ) const
noexcept

Multiply a vector by a matrix.


Transform the point by the matrix and store the result in an uninitialized Vector4D_t

x y z w
(xx*x)+(xy*y)+(xz*z)+(xw*w) (yx*x)+(yy*y)+(yz*z)+(yw*w) (zx*x)+(zy*y)+(zz*z)+(zw*w) (wx*x)+(wy*y)+(wz*z)+(ww*w)
Parameters
pInputPointer to a Vector4D_t to transform against this matrix
pOutputPointer to an uninitialized Vector4D_t to store the result
See also
Transform(Vector4D_t *) const or TransposeTransform(Vector4D_t *,const Vector4D_t *) const

◆ Transform3x3() [1/2]

void BURGER_API Burger::Matrix4D_t::Transform3x3 ( Vector3D_t * pInput) const
noexcept

Multiply a vector by a matrix without adding W.


Transform the point by the matrix only using the x, y and z terms

x y z
(xx*x)+(xy*y)+(xz*z) (yx*x)+(yy*y)+(yz*z) (zx*x)+(zy*y)+(zz*z)
Parameters
pInputPointer to a Vector3D_t to transform against this matrix
See also
Transform3x3(Vector3D_t *,const Vector3D_t *) const or TransposeTransform3x3(Vector3D_t *) const

◆ Transform3x3() [2/2]

void BURGER_API Burger::Matrix4D_t::Transform3x3 ( Vector3D_t * pOutput,
const Vector3D_t * pInput ) const
noexcept

Multiply a vector by a matrix without adding W.


Transform the point by the matrix only using the x, y and z terms and store the result in an uninitialized Vector3D_t

|x|y|z|w| |:–:|:–:|:–:|:–:| |(xx*x)+(xy*y)+(xz*z)|(yx*x)+(yy*y)+(yz*z)|(zx*x)+(zy*y)+(zz*z)|

Parameters
pInputPointer to a Vector3D_t to transform against this matrix
pOutputPointer to an uninitialized Vector3D_t to store the result
See also
Transform3x3(Vector3D_t *) const or TransposeTransform3x3(Vector3D_t*,const Vector3D_t *) const

◆ Translate()

void BURGER_API Burger::Matrix4D_t::Translate ( float fX,
float fY,
float fZ )
noexcept

Multiply the matrix by a generated translation matrix.


With an X, Y and Z for translation, apply a matrix multiply if a matrix was generated with SetTranslate(float,float,float).

x y z w
x x.x x.y x.z x.w
y y.x y.y y.z y.w
z z.x z.y z.z z.w
w (x.x*fX)+(y.x*fY)+(z.x*fZ)+w.x (x.y*fX)+(y.y*fY)+(z.y*fZ)+w.y (x.z*fX)+(y.z*fY)+(z.z*fZ)+w.z (x.w*fX)+(y.w*fY)+(z.w*fZ)+w.w
Parameters
fXX value of the temp translation matrix
fYY value of the temp translation matrix
fZZ value of the temp translation matrix
See also
TransposeTranslate(float,float,float) or SetTranslate(float,float,float)

◆ Transpose() [1/2]

void BURGER_API Burger::Matrix4D_t::Transpose ( const Matrix4D_t * pInput)
noexcept

Perform a matrix transposition.


Swap the entries to convert a right handed matrix to a left handed one and vice versa. The other three entries are copied. The destination matrix is assumed to be uninitialized.

x y z w
x xx yx zx wx
y xy yy zy wy
z xz yz zz wz
w xw yw zw ww
Note
This function is optimized to write the new matrix in sequential order in the event this function is writing to write combined memory.
See also
Transpose(void)

◆ Transpose() [2/2]

void BURGER_API Burger::Matrix4D_t::Transpose ( void )
noexcept

Perform a matrix transposition.


Swap the entries to convert a right handed matrix to a left handed one and vice versa. The matrix is assumed to be already initialized.

x y z w
x xx yx zx wx
y xy yy zy wy
z xz yz zz wz
w xw yw zw ww
See also
Transpose(const Matrix4D_t *)

◆ TransposeMultiply() [1/4]

void BURGER_API Burger::Matrix4D_t::TransposeMultiply ( const Matrix4D_t * pInput,
float fScaleX,
float fScaleY,
float fScaleZ )
noexcept

Multiply by an X,Y and Z scale into a copy.


Using only the x.x, y.y, and z.z components of a simulated matrix, perform a matrix multiply quickly that would yield a multiplication vs a scale matrix and store the result in this Matrix4D_t

Use this formula to create the final matrix

x y z w
x (pInput->x.x*fScaleX) (pInput->x.y*fScaleY) (pInput->x.z*fScaleZ) (pInput->x.w*1.0f)
y (pInput->y.x*fScaleX) (pInput->y.y*fScaleY) (pInput->y.z*fScaleZ) (pInput->y.w*1.0f)
z (pInput->z.x*fScaleX) (pInput->z.y*fScaleY) (pInput->z.z*fScaleZ) (pInput->z.w*1.0f)
w (pInput->w.x*fScaleX) (pInput->w.y*fScaleY) (pInput->w.z*fScaleZ) (pInput->w.w*1.0f)
Note
Terms with a multiply by 1.0f perform a copy operation instead of a multiply in the implementation.
Parameters
pInputPointer to a valid Matrix4D_t to apply the scale to
fScaleXX scale value
fScaleYY scale value
fScaleZZ scale value
See also
TransposeMultiply(float,float,float), Multiply(const Matrix4D_t*,float,float,float) or SetScale(float,float,float)

◆ TransposeMultiply() [2/4]

void BURGER_API Burger::Matrix4D_t::TransposeMultiply ( const Matrix4D_t * pInput,
float fScaleX,
float fScaleY,
float fScaleZ,
float fScaleW )
noexcept

Multiply by an X, Y, Z, and W scale.


Using only the x.x, y.y, z.z and w.w components of a simulated matrix, perform a matrix multiply quickly that would yield a multiplication vs a scale matrix and store the result in this Matrix4D_t

Use this formula to create the final matrix

x y z w
x (pInput->x.x*fScaleX) (pInput->x.y*fScaleY) (pInput->x.z*fScaleZ) (pInput->x.w*fScaleW)
y (pInput->y.x*fScaleX) (pInput->y.y*fScaleY) (pInput->y.z*fScaleZ) (pInput->y.w*fScaleW)
z (pInput->z.x*fScaleX) (pInput->z.y*fScaleY) (pInput->z.z*fScaleZ) (pInput->z.w*fScaleW)
w (pInput->w.x*fScaleX) (pInput->w.y*fScaleY) (pInput->w.z*fScaleZ) (pInput->w.w*fScaleW)
Parameters
pInputPointer to a valid Matrix4D_t to apply the scale to
fScaleXX scale value
fScaleYY scale value
fScaleZZ scale value
fScaleWW scale value
See also
TransposeMultiply(float,float,float,float), Multiply(const Matrix4D_t*,float,float,float,float) or SetScale(float,float,float,float)

◆ TransposeMultiply() [3/4]

void BURGER_API Burger::Matrix4D_t::TransposeMultiply ( float fScaleX,
float fScaleY,
float fScaleZ )
noexcept

Multiply by an X,Y and Z scale.


Using only the x.x, y.y, and z.z components of a simulated matrix, perform a matrix multiply quickly that would yield a multiplication vs a scale matrix

Use this formula to create the final matrix

x y z w
x (x.x*fScaleX) (x.y*fScaleY) (x.z*fScaleZ) (x.w*1.0f)
y (y.x*fScaleX) (y.y*fScaleY) (y.z*fScaleZ) (y.w*1.0f)
z (z.x*fScaleX) (z.y*fScaleY) (z.z*fScaleZ) (z.w*1.0f)
w (w.x*fScaleX) (w.y*fScaleY) (w.z*fScaleZ) (w.w*1.0f)
Note
Terms with a multiply by 1.0f perform no action in the implementation.
Parameters
fScaleXX scale value
fScaleYY scale value
fScaleZZ scale value
See also
TransposeMultiply(const Matrix4D_t *,float,float,float), Multiply(float,float,float) or SetScale(float,float,float)

◆ TransposeMultiply() [4/4]

void BURGER_API Burger::Matrix4D_t::TransposeMultiply ( float fScaleX,
float fScaleY,
float fScaleZ,
float fScaleW )
noexcept

Multiply by an X, Y, Z, and W scale.


Using only the x.x, y.y, z.z and w.w components of a simulated matrix, perform a matrix multiply quickly that would yield a multiplication vs a scale matrix

Use this formula to create the final matrix

x y z w
x (x.x*fScaleX) (x.y*fScaleY) (x.z*fScaleZ) (x.w*fScaleW)
y (y.x*fScaleX) (y.y*fScaleY) (y.z*fScaleZ) (y.w*fScaleW)
z (z.x*fScaleX) (z.y*fScaleY) (z.z*fScaleZ) (z.w*fScaleW)
w (w.x*fScaleX) (w.y*fScaleY) (w.z*fScaleZ) (w.w*fScaleW)
Parameters
fScaleXX scale value
fScaleYY scale value
fScaleZZ scale value
fScaleWW scale value
See also
TransposeMultiply(const Matrix4D_t *,float,float,float,float), Multiply(float,float,float,float) or SetScale(float,float,float,float)

◆ TransposeSetFromQuaternion()

void BURGER_API Burger::Matrix4D_t::TransposeSetFromQuaternion ( const Vector4D_t * pInput)
noexcept

Convert a quaternion to a transposed 4x4 matrix.


Here's the resulting matrix of math used using terms from the input quaternion

x y z w
x 1-(2yy+2zz) 2xy-2wz 2xz+2wy 0
y 2xy+2wz 1-(2xx+2zz) 2yz-2wx 0
z 2xz-2wy 2yz+2wx 1-(2xx+2yy) 0
w 0 0 0 1
Parameters
pInputPointer to a normalized quaternion
See also
Matrix3D_t::TransposeSetFromQuaternion(const Vector4D_t *pInput) or SetFromQuaternion(const Vector4D_t *pInput)

◆ TransposeSetFrustum()

void BURGER_API Burger::Matrix4D_t::TransposeSetFrustum ( float fLeft,
float fRight,
float fBottom,
float fTop,
float fNear,
float fFar )
noexcept

Create a 4D projection matrix.


Using a frustum, create a projection matrix in a format that DirectX can use directly. If a OpenGL version is desired, call SetFrustum() instead.

x y z w
x (fNear * 2.0f) / (fRight - fLeft) 0 (fRight + fLeft) / (fRight - fLeft) 0
y 0 (fNear * 2.0f) / (fTop - fBottom) (fTop + fBottom) / (fTop - fBottom) 0
z 0 0 -(fFar+fNear) / (fFar - fNear) -(2.0f * fFar * fNear) / (fFar - fNear)
w 0 0 -1 0
Parameters
fLeftLeftmost X coordinate
fRightRightmost X coordinate
fBottomBottommost Y coordinate
fTopTopmost Y coordinate
fNearNear clip plane
fFarFar clip plane
See also
TransposeSetOrtho(), TransposeSetPerspective() or SetFrustum()

◆ TransposeSetOrtho()

void BURGER_API Burger::Matrix4D_t::TransposeSetOrtho ( float fLeft,
float fRight,
float fBottom,
float fTop,
float fNear,
float fFar )
noexcept

Create an orthogonal 4D projection matrix.


Using a frustum, create an orthogonal matrix in a format that DirectX can use directly. If an OpenGL version is desired, call SetOrtho() instead.

x y z w
x 2.0f / (fRight - fLeft) 0 0 -(fRight + fLeft) / (fRight - fLeft)
y 0 2.0f / (fTop - fBottom) 0 -(fTop + fBottom) / (fTop - fBottom)
z 0 0 -2.0f / (fFar - fNear) -(Far + fNear) / (fFar - fNear)
w 0 0 0 1
Note
This is functional duplicate of glOrtho()
Parameters
fLeftLeftmost X coordinate
fRightRightmost X coordinate
fBottomBottommost Y coordinate
fTopTopmost Y coordinate
fNearNear clip plane
fFarFar clip plane
See also
TransposeSetFrustum() or SetOrtho()

◆ TransposeSetPerspective()

void BURGER_API Burger::Matrix4D_t::TransposeSetPerspective ( float fFieldOfViewY,
float fAspect,
float fNear,
float fFar )
noexcept

Create a 4D perspective matrix.


Using a field of view and an aspect ratio (x/y), create a projection matrix in a format that DirectX can use directly. If an OpenGL version is desired, call SetPerspective() instead.

f = 1.0f / tan((fFieldOfViewY*g_fDegreesToRadians)*0.5f);

x y z w
x f/fAspect 0 0 0
y 0 f 0 0
z 0 0 (fFar+fNear) / (fNear-fFar) (2.0f * fFar * fNear) / (fNear-fFar)
w 0 0 -1 0
Parameters
fFieldOfViewYAngle of the field of view in degrees
fAspectAspect ratio of the screen
fNearNear clip plane
fFarFar clip plane
See also
TransposeSetOrtho(), TransposeSetFrustum() or SetPerspective()

◆ TransposeSetPitch()

void BURGER_API Burger::Matrix4D_t::TransposeSetPitch ( float fPitch)
noexcept

Initialize a rotation matrix with radians for pitch (X)


float sx = get_sine(fPitch);
float cx = get_cosine(fPitch);
x y z w
x 1 0 0 0
y 0 cx sx 0
z 0 -sx cx 0
w 0 0 0 1
Parameters
fPitchPitch of the X in radians
See also
SetPitch(float), TransposeSetXYZ(float,float,float), TransposeSetYaw(float) and TransposeSetRoll(float)

◆ TransposeSetRoll()

void BURGER_API Burger::Matrix4D_t::TransposeSetRoll ( float fRoll)
noexcept

Initialize a rotation matrix with radians for roll (Z)


float sz = get_sine(fRoll);
float cz = get_cosine(fRoll);
x y z w
x cz sz 0 0
y -sz cz 0 0
z 0 0 1 0
w 0 0 0 1
Parameters
fRollRoll of the Z in radians
See also
SetRoll(float), TransposeSetXYZ(float,float,float), TransposeSetYaw(float) and TransposeSetPitch(float)

◆ TransposeSetXYZ()

void BURGER_API Burger::Matrix4D_t::TransposeSetXYZ ( float fYaw,
float fPitch,
float fRoll )
noexcept

Initialize a transposed rotation matrix in the order of X, Y and Z.


Initialize a transposed rotation matrix with radians for Yaw (Y), Pitch (X), and Roll (Z) in the order of X, Y and then Z.

float sx = get_sine(fPitch);
float sy = get_sine(fYaw);
float sz = get_sine(fRoll);
float cx = get_cosine(fPitch);
float cy = get_cosine(fYaw);
float cz = get_cosine(fRoll);
x y z w
x cy*cz (sy*-sx*cz)+(cx*sz) (sy*cx*cz)+(sx*sz) 0
y cy*-sz (cx*cz)+(sy*-sx*-sz) (sx*cz)+(sy*cx*-sz) 0
z -sy cy*-sx cy*cx 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
fPitchPitch of the X in radians
fRollRoll of the Z in radians
See also
SetXYZ(float,float,float), TransposeSetYaw(float), TransposeSetPitch(float), and TransposeSetRoll(float)

◆ TransposeSetXZY()

void BURGER_API Burger::Matrix4D_t::TransposeSetXZY ( float fYaw,
float fPitch,
float fRoll )
noexcept

Initialize a transposed rotation matrix in the order of X, Z and Y.


Initialize a transposed rotation matrix with radians for Yaw (Y), Pitch (X), and Roll (Z) in the order of X, Z and then Y.

float sx = get_sine(fPitch);
float sy = get_sine(fYaw);
float sz = get_sine(fRoll);
float cx = get_cosine(fPitch);
float cy = get_cosine(fYaw);
float cz = get_cosine(fRoll);
x y z w
x cy*cz (cx*sz*cy)+(sy*-sx) (sx*sz*cy)+(sy*cx) 0
y -sz cx*cz sx*cz 0
z -sy*cz (-sx*cy)+(-sy*cx*sz) (cx*cy)+(-sy*sx*sz) 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
fPitchPitch of the X in radians
fRollRoll of the Z in radians
See also
SetXZY(float,float,float), TransposeSetYaw(float), TransposeSetPitch(float), and TransposeSetRoll(float)

◆ TransposeSetYaw()

void BURGER_API Burger::Matrix4D_t::TransposeSetYaw ( float fYaw)
noexcept

Initialize a rotation matrix with radians for yaw (Y)


float sy = get_sine(fYaw);
float cy = get_cosine(fYaw);
x y z w
x cy 0 sy 0
y 0 1 0 0
z -sy 0 cy 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
See also
SetYaw(float), TransposeSetXYZ(float,float,float), TransposeSetPitch(float) and TransposeSetRoll(float)

◆ TransposeSetYXZ()

void BURGER_API Burger::Matrix4D_t::TransposeSetYXZ ( float fYaw,
float fPitch,
float fRoll )
noexcept

Initialize a transposed rotation matrix in the order of Y, X and Z.


Initialize a transposed rotation matrix with radians for Yaw (Y), Pitch (X), and Roll (Z) in the order of Y, X and then Z.

float sx = get_sine(fPitch);
float sy = get_sine(fYaw);
float sz = get_sine(fRoll);
float cx = get_cosine(fPitch);
float cy = get_cosine(fYaw);
float cz = get_cosine(fRoll);
x y z w
x (cy*cz)+(-sy*sx*sz) cx*sz (sy*cz)+(cy*sx*sz) 0
y (-sy*sx*cz)+(cy*-sz) cx*cz (cy*sx*cz)+(sy*-sz) 0
z -sy*cx -sx cy*cx 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
fPitchPitch of the X in radians
fRollRoll of the Z in radians
See also
SetYXZ(float,float,float), TransposeSetYaw(float), TransposeSetPitch(float), and TransposeSetRoll(float)

◆ TransposeSetYZX()

void BURGER_API Burger::Matrix4D_t::TransposeSetYZX ( float fYaw,
float fPitch,
float fRoll )
noexcept

Initialize a transposed rotation matrix in the order of Y, Z and X.


Initialize a transposed rotation matrix with radians for Yaw (Y), Pitch (X), and Roll (Z) in the order of Y, Z and then X.

float sx = get_sine(fPitch);
float sy = get_sine(fYaw);
float sz = get_sine(fRoll);
float cx = get_cosine(fPitch);
float cy = get_cosine(fYaw);
float cz = get_cosine(fRoll);
x y z w
x cy*cz sz sy*cz 0
y (cy*-sz*cx)+(-sy*sx) cx*cz (sy*-sz*cx)+(cy*sx) 0
z (-sy*cx)+(cy*-sx*-sz) -sx*cz (cy*cx)+(sy*-sx*-sz) 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
fPitchPitch of the X in radians
fRollRoll of the Z in radians
See also
SetYZX(float,float,float), TransposeSetYaw(float), TransposeSetPitch(float), and TransposeSetRoll(float)

◆ TransposeSetZXY()

void BURGER_API Burger::Matrix4D_t::TransposeSetZXY ( float fYaw,
float fPitch,
float fRoll )
noexcept

Initialize a transposed rotation matrix in the order of Z, X and Y.


Initialize a transposed rotation matrix with radians for Yaw (Y), Pitch (X), and Roll (Z) in the order of Z, X and then Y.

float sx = get_sine(fPitch);
float sy = get_sine(fYaw);
float sz = get_sine(fRoll);
float cx = get_cosine(fPitch);
float cy = get_cosine(fYaw);
float cz = get_cosine(fRoll);
x y z w
x (cz*cy)+(sy*-sx*-sz) (sz*cy)+(sy*-sx*cz) sy*cx 0
y cx*-sz cx*cz sx 0
z (-sx*-sz*cy)+(-sy*cz) (-sx*cz*cy)+(-sy*sz) cy*cx 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
fPitchPitch of the X in radians
fRollRoll of the Z in radians
See also
SetZXY(float,float,float), TransposeSetYaw(float), TransposeSetPitch(float), and TransposeSetRoll(float)

◆ TransposeSetZYX()

void BURGER_API Burger::Matrix4D_t::TransposeSetZYX ( float fYaw,
float fPitch,
float fRoll )
noexcept

Initialize a transposed rotation matrix in the order of Z, Y and X.


Initialize a transposed rotation matrix with radians for Yaw (Y), Pitch (X), and Roll (Z) in the order of Z, Y and then X.

float sx = get_sine(fPitch);
float sy = get_sine(fYaw);
float sz = get_sine(fRoll);
float cx = get_cosine(fPitch);
float cy = get_cosine(fYaw);
float cz = get_cosine(fRoll);
x y z w
x cy*cz cy*sz sy 0
y (-sz*cx)+(-sy*sx*cz) (cz*cx)+(-sy*sx*sz) cy*sx 0
z (-sy*cz*cx)+(-sx*-sz) (-sy*sz*cx)+(-sx*cz) cy*cx 0
w 0 0 0 1
Parameters
fYawYaw of the Y in radians
fPitchPitch of the X in radians
fRollRoll of the Z in radians
See also
SetZYX(float,float,float), TransposeSetYaw(float), TransposeSetPitch(float), and TransposeSetRoll(float)

◆ TransposeTransform() [1/4]

void BURGER_API Burger::Matrix4D_t::TransposeTransform ( Vector3D_t * pInput) const
noexcept

Multiply a vector by a transposed matrix.


Transform the point by the transposed matrix

x y z
(xx*x)+(yx*y)+(zx*z)+(wx) (xy*x)+(yy*y)+(zy*z)+(wy) (xz*x)+(yz*y)+(zz*z)+(wz)
Parameters
pInputPointer to a Vector3D_t to transform against this transposed matrix
See also
TransposeTransform(Vector3D_t *,const Vector3D_t *) const or Transform(Vector3D_t *) const

◆ TransposeTransform() [2/4]

void BURGER_API Burger::Matrix4D_t::TransposeTransform ( Vector3D_t * pOutput,
const Vector3D_t * pInput ) const
noexcept

Multiply a vector by a transposed matrix.


Transform the point by the transposed matrix and store the result in an uninitialized Vector3D_t

x y z
(xx*x)+(yx*y)+(zx*z)+(wx) (xy*x)+(yy*y)+(zy*z)+(wy) (xz*x)+(yz*y)+(zz*z)+(wz)
Parameters
pInputPointer to a Vector3D_t to transform against this transposed matrix
pOutputPointer to an uninitialized Vector3D_t to store the result
See also
TransposeTransform(Vector3D_t *) const or Transform(Vector3D_t *,const Vector3D_t *) const

◆ TransposeTransform() [3/4]

void BURGER_API Burger::Matrix4D_t::TransposeTransform ( Vector4D_t * pInput) const
noexcept

Multiply a vector by a transposed matrix.


Transform the point by the transposed matrix

x y z w
(xx*x)+(yx*y)+(zx*z)+(wx*w) (xy*x)+(yy*y)+(zy*z)+(wy*w) (xz*x)+(yz*y)+(zz*z)+(wz*w) (xw*x)+(yw*y)+(zw*z)+(ww*w)
Parameters
pInputPointer to a Vector4D_t to transform against this transposed matrix
See also
TransposeTransform(Vector4D_t *,const Vector4D_t *) const or Transform(Vector4D_t *) const

◆ TransposeTransform() [4/4]

void BURGER_API Burger::Matrix4D_t::TransposeTransform ( Vector4D_t * pOutput,
const Vector4D_t * pInput ) const
noexcept

Multiply a vector by a transposed matrix.


Transform the point by the transposed matrix and store the result in an uninitialized Vector4D_t

x y z w
(xx*x)+(yx*y)+(zx*z)+(wx*w) (xy*x)+(yy*y)+(zy*z)+(wy*w) (xz*x)+(yz*y)+(zz*z)+(wz*w) (xw*x)+(yw*y)+(zw*z)+(ww*w)
Parameters
pInputPointer to a Vector4D_t to transform against this transposed matrix
pOutputPointer to an uninitialized Vector4D_t to store the result
See also
TransposeTransform(Vector4D_t *) const or Transform(Vector4D_t *,const Vector4D_t *) const

◆ TransposeTransform3x3() [1/2]

void BURGER_API Burger::Matrix4D_t::TransposeTransform3x3 ( Vector3D_t * pInput) const
noexcept

Multiply a vector by a transposed matrix without adding W.


Transform the point by the transposed matrix only using the x, y and z terms

|x|y|z| |:–:|:–:|:–:| |x|(xx*x)+(yx*y)+(zx*z)|(xy*x)+(yy*y)+(zy*z)|(xz*x)+(yz*y)+(zz*z)|

Parameters
pInputPointer to a Vector3D_t to transform against this transposed matrix
See also
TransposeTransform3x3(Vector3D_t *,const Vector3D_t *) const or Transform3x3(Vector3D_t *) const

◆ TransposeTransform3x3() [2/2]

void BURGER_API Burger::Matrix4D_t::TransposeTransform3x3 ( Vector3D_t * pOutput,
const Vector3D_t * pInput ) const
noexcept

Multiply a vector by a transposed matrix without adding W.


Transform the point by the transposed matrix only using the x, y and z terms and store the result in an uninitialized Vector3D_t

|x|y|z|w| |:–:|:–:|:–:|:–:| |(xx*x)+(yx*y)+(zx*z)|(xy*x)+(yy*y)+(zy*z)|(xz*x)+(yz*y)+(zz*z)|

Parameters
pInputPointer to a Vector3D_t to transform against this transposed matrix
pOutputPointer to an uninitialized Vector3D_t to store the result
See also
TransposeTransform3x3(Vector3D_t *) const or Transform3x3(Vector3D_t*,const Vector3D_t *) const

◆ TransposeTranslate()

void BURGER_API Burger::Matrix4D_t::TransposeTranslate ( float fX,
float fY,
float fZ )
noexcept

Multiply the matrix by a generated transposed translation matrix.


With an X, Y and Z for translation, apply a matrix multiply if a matrix was generated with SetTranslate(float,float,float) and then Transpose()

x y z w
x x.x x.y x.z (x.x*fX)+(x.y*fY)+(x.z*fZ)+x.w
y y.x y.y y.z (y.x*fX)+(y.y*fY)+(y.z*fZ)+y.w
z z.x z.y z.z (z.x*fX)+(z.y*fY)+(z.z*fZ)+z.w
w w.x w.y w.z (w.x*fX)+(w.y*fY)+(w.z*fZ)+w.w
Parameters
fXX value of the temp translation matrix
fYY value of the temp translation matrix
fZZ value of the temp translation matrix
See also
Translate(float,float,float) or SetTranslate(float,float,float)

◆ Yaw()

void BURGER_API Burger::Matrix4D_t::Yaw ( float fYaw)
noexcept

Rotate a matrix in the Y axis (Yaw)


Given a Y angle in radians, rotate the matrix accordingly

fCos = get_cosine(fYaw); fSin = get_sine(fYaw);

x y z w
x (z.x*fSin)+(x.x*fCos) (z.y*fSin)+(x.y*fCos) (z.z*fSin)+(x.z*fCos) (z.w*fSin)+(x.w*fCos)
y y.x y.y y.z y.w
z (z.x*fCos)-(x.x*fSin) (z.y*fCos)-(x,y*fSin) (z.z*fCos)-(x.z*fSin) (z.w*fCos)-(x.w*fSin)
w w.x w.y w.z w.w
Parameters
fYawAngle in radians to yaw the matrix
See also
Pitch(float) or Roll(float)

◆ Zero()

void BURGER_API Burger::Matrix4D_t::Zero ( void )
noexcept

Clear out a 4D matrix.


Set all of the entries to zero

x y z w
x 0 0 0 0
y 0 0 0 0
z 0 0 0 0
w 0 0 0 0
See also
Identity(void)

Member Data Documentation

◆ w

Vector4D_t Burger::Matrix4D_t::w

32 bit floating point W row for the 4D Matrix

◆ x

Vector4D_t Burger::Matrix4D_t::x

32 bit floating point X row for the 4D Matrix

◆ y

Vector4D_t Burger::Matrix4D_t::y

32 bit floating point Y row for the 4D Matrix

◆ z

Vector4D_t Burger::Matrix4D_t::z

32 bit floating point Z row for the 4D Matrix