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

3D fixed16_16_t 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)
 
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.
 
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 Set (fixed16_16_t fX, fixed16_16_t fY, fixed16_16_t fZ)
 Initialize the vector elements to specific values,.
 
void Set (const FixedVector3D_t *pInput)
 Copy a FixedVector3D_t.
 
void Set (const Vector3D_t *pInput)
 Convert a floating point vector into fixed point vector.
 
void SetAsInt (const Vector3D_t *pInput)
 Convert a floating point vector into an integer vector.
 
void Negate (void)
 Negate a fixed vector.
 
void Negate (const FixedVector3D_t *pInput)
 Negate and copy a vector.
 
void Add (const FixedVector3D_t *pInput)
 Add two vectors.
 
void Add (const FixedVector3D_t *pInput1, const FixedVector3D_t *pInput2)
 Add and copy two vectors.
 
void Sub (const FixedVector3D_t *pInput)
 Subtract two vectors.
 
void Sub (const FixedVector3D_t *pInput1, const FixedVector3D_t *pInput2)
 Subtract and copy two vectors.
 
fixed16_16_t Dot (const FixedVector3D_t *pInput) const
 Perform a dot product.
 
void Cross (const FixedVector3D_t *pInput1, const FixedVector3D_t *pInput2)
 Perform a cross product.
 

Public Attributes

fixed16_16_t x
 X value for the 3D Vector.
 
fixed16_16_t y
 Y value for the 3D Vector.
 
fixed16_16_t z
 Z value for the 3D Vector.
 

Detailed Description

3D fixed16_16_t vector.


This 12 byte structure contains 3 32-bit Fixed point values as a 3D vector.

Note
Since this is a structure, there is no constructor or destructor, so assume the data is uninitialized when creating this data type.

Member Function Documentation

◆ Add() [1/2]

void BURGER_API Burger::FixedVector3D_t::Add ( const FixedVector3D_t * pInput)

Add two vectors.


Perform a vector addition in the form of x += pInput->x, y+=pInput->y etc.

Parameters
pInputPointer to a valid FixedVector3D_t

◆ Add() [2/2]

void BURGER_API Burger::FixedVector3D_t::Add ( const FixedVector3D_t * pInput1,
const FixedVector3D_t * pInput2 )

Add and copy two vectors.


Perform a vector addition in the form of x = pInput1->x+pInput2->x, y = pInput2->y+pInput2->y etc.

Parameters
pInput1Pointer to a valid FixedVector3D_t
pInput2Pointer to a valid FixedVector3D_t to add with
Note
The *this vector does not need to be initialized.

◆ Cross()

void BURGER_API Burger::FixedVector3D_t::Cross ( const FixedVector3D_t * pInput1,
const FixedVector3D_t * pInput2 )

Perform a cross product.


Perform a cross product between two vector and store the result in the *this value. The values are cached, so the *this pointer can be used as an input parameter without causing a problem.

Parameters
pInput1Pointer to a valid FixedVector3D_t
pInput2Pointer to a valid FixedVector3D_t to add with

◆ Dot()

fixed16_16_t BURGER_API Burger::FixedVector3D_t::Dot ( const FixedVector3D_t * pInput) const

Perform a dot product.


Perform a dot product with *this and the supplied vector.

Parameters
pInputPointer to a valid FixedVector3D_t
Returns
fixed16_16_t result of the dot product.

◆ GetX()

fixed16_16_t Burger::FixedVector3D_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::FixedVector3D_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::FixedVector3D_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)

◆ Negate() [1/2]

void BURGER_API Burger::FixedVector3D_t::Negate ( const FixedVector3D_t * pInput)

Negate and copy a vector.


Perform a negation on all three elements of a given vector and store the results.

Parameters
pInputPointer to a valid FixedVector3D_t
Note
The *this vector does not need to be initialized.

◆ Negate() [2/2]

void BURGER_API Burger::FixedVector3D_t::Negate ( void )

Negate a fixed vector.


Perform a negation on all three elements of the vector.

◆ One()

void Burger::FixedVector3D_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
Set(fixed16_16_t,fixed16_16_t,fixed16_16_t)

◆ Set() [1/3]

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

Copy a FixedVector3D_t.


Make a copy of a FixedVector3D_t

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

◆ Set() [2/3]

void BURGER_API Burger::FixedVector3D_t::Set ( const Vector3D_t * pInput)

Convert a floating point vector into fixed point vector.


Using round to nearest, convert a Vector3D_t 's data into a FixedVector3D_t. Saturation is performed. NaN and Infinity will yield undefined results.

Parameters
pInputPointer to an initialized Vector3D_t structure.
See also
SetAsInt(const Vector3D_t *)

◆ Set() [3/3]

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

Initialize the vector elements to specific values,.


Given the new values for x,y and z, 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.
See also
Zero(void)

◆ SetAsInt()

void BURGER_API Burger::FixedVector3D_t::SetAsInt ( const Vector3D_t * pInput)

Convert a floating point vector into an integer vector.


Using round to nearest, convert a Vector3D_t 's data into a FixedVector3D_t and the conversion will place integer values in the members instead of performing the float->fixed16_16_t conversion. Saturation is performed. NaN and Infinity will yield undefined results.

Parameters
pInputPointer to an initialized Vector3D_t structure.
Note
If fixed16_16_t versions of the values are desired, use Set(const Vector3D_t *) instead.
See also
Set(const Vector3D_t *pInput)

◆ SetX()

void Burger::FixedVector3D_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::FixedVector3D_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::FixedVector3D_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

◆ Sub() [1/2]

void BURGER_API Burger::FixedVector3D_t::Sub ( const FixedVector3D_t * pInput)

Subtract two vectors.


Perform a vector subtraction in the form of x -= pInput->x, y-=pInput->y etc.

Parameters
pInputPointer to a valid FixedVector3D_t

◆ Sub() [2/2]

void BURGER_API Burger::FixedVector3D_t::Sub ( const FixedVector3D_t * pInput1,
const FixedVector3D_t * pInput2 )

Subtract and copy two vectors.


Perform a vector subtraction in the form of x = pInput1->x-pInput2->x, y = pInput2->y-pInput2->y etc.

Parameters
pInput1Pointer to a valid FixedVector3D_t
pInput2Pointer to a valid FixedVector3D_t to subtract from
Note
The *this vector does not need to be initialized.

◆ Zero()

void Burger::FixedVector3D_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
Set(fixed16_16_t,fixed16_16_t,fixed16_16_t)

Member Data Documentation

◆ x

fixed16_16_t Burger::FixedVector3D_t::x

X value for the 3D Vector.

◆ y

fixed16_16_t Burger::FixedVector3D_t::y

Y value for the 3D Vector.

◆ z

fixed16_16_t Burger::FixedVector3D_t::z

Z value for the 3D Vector.