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

3D Fixed32 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)
 
Fixed32 GetX (void) const
 Return the x component of the vector.
 
Fixed32 GetY (void) const
 Return the y component of the vector.
 
Fixed32 GetZ (void) const
 Return the z component of the vector.
 
void SetX (Fixed32 fX)
 Set the x component of the vector.
 
void SetY (Fixed32 fY)
 Set the y component of the vector.
 
void SetZ (Fixed32 fZ)
 Set the z component of the vector.
 
void Set (Fixed32 fX, Fixed32 fY, Fixed32 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.
 
Fixed32 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

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

Detailed Description

3D Fixed32 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()

Fixed32 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
Fixed32 result of the dot product.

◆ GetX()

Burger::FixedVector3D_t::GetX ( void ) const
inline

Return the x component of the vector.


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

◆ GetY()

Burger::FixedVector3D_t::GetY ( void ) const
inline

Return the y component of the vector.


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

◆ GetZ()

Burger::FixedVector3D_t::GetZ ( void ) const
inline

Return the z component of the vector.


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

◆ 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()

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(Fixed32,Fixed32,Fixed32)

◆ 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(Fixed32,Fixed32,Fixed32) 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]

Burger::FixedVector3D_t::Set ( Fixed32 fX,
Fixed32 fY,
Fixed32 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->Fixed32 conversion. Saturation is performed. NaN and Infinity will yield undefined results.

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

◆ SetX()

Burger::FixedVector3D_t::SetX ( Fixed32 fX)
inline

Set the x component of the vector.


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

◆ SetY()

Burger::FixedVector3D_t::SetY ( Fixed32 fY)
inline

Set the y component of the vector.


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

◆ SetZ()

Burger::FixedVector3D_t::SetZ ( Fixed32 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()

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(Fixed32,Fixed32,Fixed32)

Member Data Documentation

◆ x

Fixed32 Burger::FixedVector3D_t::x

X value for the 3D Vector.

◆ y

Fixed32 Burger::FixedVector3D_t::y

Y value for the 3D Vector.

◆ z

Fixed32 Burger::FixedVector3D_t::z

Z value for the 3D Vector.