Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Burger::FixedMatrix4D_t Struct Reference

4x4 Fixed32 matrix. More...

Collaboration diagram for Burger::FixedMatrix4D_t:
Collaboration graph
[legend]

Public Member Functions

void Zero (void)
 Clear out a 4D matrix.
 
void Identity (void)
 Initialize a 4D matrix so that it is inert.
 
void Set (const Matrix4D_t *pInput)
 Convert a floating point matrix into a Fixed32 matrix.
 
void Set (const FixedMatrix4D_t *pInput)
 Copy a matrix into this one.
 
void SetTranslate (Fixed32 fX, Fixed32 fY, Fixed32 fZ)
 Create a 4D translation matrix.
 
void SetScale (Fixed32 fX, Fixed32 fY, Fixed32 fZ)
 Create a 4D scale matrix.
 
void SetScale (Fixed32 fX, Fixed32 fY, Fixed32 fZ, Fixed32 fW)
 Create a 4D scale matrix.
 

Public Attributes

FixedVector4D_t x
 X row for the 4x4 Matrix.
 
FixedVector4D_t y
 Y row for the 4x4 Matrix.
 
FixedVector4D_t z
 Z row for the 4x4 Matrix.
 
FixedVector4D_t w
 W row for the 4x4 Matrix.
 

Detailed Description

4x4 Fixed32 matrix.


This 64 byte matrix contains x,y,z and w 32 bit 16.16 fixed 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::FixedVector4D_t, Burger::FixedMatrix3D_t or Burger::Matrix4D_t

Member Function Documentation

◆ Identity()

void BURGER_API Burger::FixedMatrix4D_t::Identity ( void )

Initialize a 4D matrix so that it is inert.


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

See also
Zero(void)

◆ Set() [1/2]

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

Copy a matrix into this one.


Perform a literal memory copy operation

Parameters
pInputPointer to a valid FixedMatrix4D_t
See also
Set(const Matrix4D_t *)

◆ Set() [2/2]

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

Convert a floating point matrix into a Fixed32 matrix.


Using round to nearest, convert a matrix using floating point values into one that has Fixed32 values. The destination matrix is assumed to be uninitialized.

Parameters
pInputPointer to a valid Matrix4D_t
See also
Set(const FixedMatrix4D_t *) or float_to_fixed_round(Fixed32 *,float)

◆ SetScale() [1/2]

void BURGER_API Burger::FixedMatrix4D_t::SetScale ( Fixed32 fX,
Fixed32 fY,
Fixed32 fZ )

Create a 4D scale matrix.


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

Parameters
fXnew x.x component
fYnew y.y component
fZnew z.z component
See also
Identity(void)

◆ SetScale() [2/2]

void BURGER_API Burger::FixedMatrix4D_t::SetScale ( Fixed32 fX,
Fixed32 fY,
Fixed32 fZ,
Fixed32 fW )

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 BURGER_FLOAT_TO_FIXED(0.0f)

Parameters
fXnew x.x component
fYnew y.y component
fZnew z.z component
fWnew w.w component
See also
Identity(void)

◆ SetTranslate()

void BURGER_API Burger::FixedMatrix4D_t::SetTranslate ( Fixed32 fX,
Fixed32 fY,
Fixed32 fZ )

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.

Parameters
fXnew w.x component
fYnew w.y component
fZnew w.z component
See also
Identity(void)

◆ Zero()

void BURGER_API Burger::FixedMatrix4D_t::Zero ( void )

Clear out a 4D matrix.


Set all of the entries to zero

See also
Identity(void)

Member Data Documentation

◆ w

FixedVector4D_t Burger::FixedMatrix4D_t::w

W row for the 4x4 Matrix.

◆ x

FixedVector4D_t Burger::FixedMatrix4D_t::x

X row for the 4x4 Matrix.

◆ y

FixedVector4D_t Burger::FixedMatrix4D_t::y

Y row for the 4x4 Matrix.

◆ z

FixedVector4D_t Burger::FixedMatrix4D_t::z

Z row for the 4x4 Matrix.