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::FixedVector4D_t Struct Reference

4 dimensional fixed point vector More...

Public Member Functions

void Zero (void)
 Initialize the vector elements to zero.
 
void One (void)
 Initialize the vector elements to 1.0f (Fixed)
 
void Identity (void)
 Initialize the vector elements to identity for a quaternion.
 
fixed16_16_t GetX (void) const
 Return the x component of the vector.
 
fixed16_16_t GetY (void) const
 Return the y component of the vector.
 
fixed16_16_t GetZ (void) const
 Return the z component of the vector.
 
fixed16_16_t GetW (void) const
 Return the w component of the vector.
 
void SetX (fixed16_16_t fX)
 Set the x component of the vector.
 
void SetY (fixed16_16_t fY)
 Set the y component of the vector.
 
void SetZ (fixed16_16_t fZ)
 Set the z component of the vector.
 
void SetW (fixed16_16_t fW)
 Set the w component of the vector.
 
void Set (fixed16_16_t fX, fixed16_16_t fY, fixed16_16_t fZ)
 Set the values to specific values.
 
void Set (fixed16_16_t fX, fixed16_16_t fY, fixed16_16_t fZ, fixed16_16_t fW)
 Initialize the vector elements to specific values,.
 
void Set (const FixedVector4D_t *pInput)
 Copy a FixedVector4D_t.
 
void Negate (void)
 Negate a 4D vector.
 
void Negate (fixed16_16_t fX, fixed16_16_t fY, fixed16_16_t fZ, fixed16_16_t fW)
 Negate the input and store it in this structure.
 
void Negate (const FixedVector4D_t *pInput)
 Make a copy of the input after it's been negated.
 

Public Attributes

fixed16_16_t x
 32 bit fixed point X value for the 4D Vector
 
fixed16_16_t y
 32 bit fixed point Y value for the 4D Vector
 
fixed16_16_t z
 32 bit fixed point Z value for the 4D Vector
 
fixed16_16_t w
 32 bit fixed point W value for the 4D Vector
 

Detailed Description

4 dimensional fixed point vector


This 16 byte vector contains x,y,z and w 32 bit fixed point coordinates. 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::FixedVector2D_t, Burger::FixedVector3D_t or Burger::Vector4D_t

Member Function Documentation

◆ GetW()

fixed16_16_t Burger::FixedVector4D_t::GetW ( void ) const
inline

Return the w component of the vector.


Returns
The w component of the vector.
See also
SetW(fixed16_16_t)

◆ GetX()

fixed16_16_t Burger::FixedVector4D_t::GetX ( void ) const
inline

Return the x component of the vector.


Returns
The x component of the vector.
See also
SetX(fixed16_16_t)

◆ GetY()

fixed16_16_t Burger::FixedVector4D_t::GetY ( void ) const
inline

Return the y component of the vector.


Returns
The y component of the vector.
See also
SetY(fixed16_16_t)

◆ GetZ()

fixed16_16_t Burger::FixedVector4D_t::GetZ ( void ) const
inline

Return the z component of the vector.


Returns
The z component of the vector.
See also
SetZ(fixed16_16_t)

◆ Identity()

void Burger::FixedVector4D_t::Identity ( void )
inline

Initialize the vector elements to identity for a quaternion.


Fills x, y, and z with BURGER_FLOAT_TO_FIXED(0.0f) and w is filled in with BURGER_FLOAT_TO_FIXED(1.0f). Thereby initializing the structure to the equivalant of a quaternion identity..

See also
Zero(void) or Set(fixed16_16_t,fixed16_16_t,fixed16_16_t,fixed16_16_t)

◆ Negate() [1/3]

void Burger::FixedVector4D_t::Negate ( const FixedVector4D_t * pInput)
inline

Make a copy of the input after it's been negated.


Copy the input data and negate it.

Parameters
pInputValid pointer to a FixedVector4D_t structure to copy and negate
See also
Negate(fixed16_16_t,fixed16_16_t,fixed16_16_t,fixed16_16_t) or Negate(void)

◆ Negate() [2/3]

void Burger::FixedVector4D_t::Negate ( fixed16_16_t fX,
fixed16_16_t fY,
fixed16_16_t fZ,
fixed16_16_t fW )
inline

Negate the input and store it in this structure.


Set the x,y,z and w values to -fX,-fY,-fZ and -fW respectively

Parameters
fXX value to negate
fYY value to negate
fZZ value to negate
fWW value to negate
See also
Negate(const FixedVector4D_t *) or Negate(void)

◆ Negate() [3/3]

void Burger::FixedVector4D_t::Negate ( void )
inline

Negate a 4D vector.


Set the x,y,z and w values to -x,-y,-z and -w respectively

See also
Negate(const FixedVector4D_t *) or Negate(fixed16_16_t,fixed16_16_t,fixed16_16_t,fixed16_16_t)

◆ One()

void Burger::FixedVector4D_t::One ( void )
inline

Initialize the vector elements to 1.0f (Fixed)


Fills in all of the entries with zero, thereby initializing the structure to a known state.

See also
Identity(void), Set(fixed16_16_t,fixed16_16_t,fixed16_16_t,fixed16_16_t)

◆ Set() [1/3]

void Burger::FixedVector4D_t::Set ( const FixedVector4D_t * pInput)
inline

Copy a FixedVector4D_t.


Make a copy of a FixedVector4D_t

Parameters
pInputValid pointer to a FixedVector4D_t structure to copy
See also
Zero(void), Identity(void) or Set(fixed16_16_t,fixed16_16_t,fixed16_16_t,fixed16_16_t)

◆ Set() [2/3]

void Burger::FixedVector4D_t::Set ( fixed16_16_t fX,
fixed16_16_t fY,
fixed16_16_t fZ )
inline

Set the values to specific values.


Sets the x, y and z values to specific values. w is set to BURGER_FLOAT_TO_FIXED(1.0f)

Parameters
fXNew x value
fYNew y value
fZNew z value
See also
Zero(void), Identity(void) or Set(float,float,float,float)

◆ Set() [3/3]

void Burger::FixedVector4D_t::Set ( fixed16_16_t fX,
fixed16_16_t fY,
fixed16_16_t fZ,
fixed16_16_t fW )
inline

Initialize the vector elements to specific values,.


Given the new values for x, y, z and w, store them into the structure.

Parameters
fXThe new x component to store in the vector.
fYThe new y component to store in the vector.
fZThe new z component to store in the vector.
fWThe new w component to store in the vector.
See also
Zero(void), Identity(void) or Set(fixed16_16_t,fixed16_16_t,fixed16_16_t)

◆ SetW()

void Burger::FixedVector4D_t::SetW ( fixed16_16_t fW)
inline

Set the w component of the vector.


Parameters
fWThe new w component of the vector.
See also
GetW(void) const

◆ SetX()

void Burger::FixedVector4D_t::SetX ( fixed16_16_t fX)
inline

Set the x component of the vector.


Parameters
fXThe new x component of the vector.
See also
GetX(void) const

◆ SetY()

void Burger::FixedVector4D_t::SetY ( fixed16_16_t fY)
inline

Set the y component of the vector.


Parameters
fYThe new y component of the vector.
See also
GetY(void) const

◆ SetZ()

void Burger::FixedVector4D_t::SetZ ( fixed16_16_t fZ)
inline

Set the z component of the vector.


Parameters
fZThe new z component of the vector.
See also
GetZ(void) const

◆ Zero()

void Burger::FixedVector4D_t::Zero ( void )
inline

Initialize the vector elements to zero.


Fills in all of the entries with zero, thereby initializing the structure to a known state.

See also
Identity(void), Set(fixed16_16_t,fixed16_16_t,fixed16_16_t,fixed16_16_t)

Member Data Documentation

◆ w

fixed16_16_t Burger::FixedVector4D_t::w

32 bit fixed point W value for the 4D Vector

◆ x

fixed16_16_t Burger::FixedVector4D_t::x

32 bit fixed point X value for the 4D Vector

◆ y

fixed16_16_t Burger::FixedVector4D_t::y

32 bit fixed point Y value for the 4D Vector

◆ z

fixed16_16_t Burger::FixedVector4D_t::z

32 bit fixed point Z value for the 4D Vector