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

3 dimensional floating point vector More...

Public Member Functions

void Zero (void) noexcept
 Set all values to zero.
 
void One (void) noexcept
 Set all values to 1.0f.
 
float GetX (void) const noexcept
 Return the x component of the vector.
 
float GetY (void) const noexcept
 Return the y component of the vector.
 
float GetZ (void) const noexcept
 Return the z component of the vector.
 
void SetX (float fX) noexcept
 Set the x component of the vector.
 
void SetY (float fY) noexcept
 Set the y component of the vector.
 
void SetZ (float fZ) noexcept
 Set the z component of the vector.
 
void Set (float fInput) noexcept
 Set all of the members to specific value.
 
void Set (float fX, float fY) noexcept
 Set the values to specific values.
 
void Set (float fX, float fY, float fZ) noexcept
 Set the values to specific values.
 
void Set (const Vector3D_t *pInput) noexcept
 Copy a Vector3D_t.
 
void Set (const FixedVector3D_t *pInput) noexcept
 Convert a fixed point vector into a floating point vector.
 
void Negate (void) noexcept
 Negate a 3D vector.
 
void Negate (float fX, float fY, float fZ) noexcept
 Negate the input and store it in this structure.
 
void Negate (const Vector3D_t *pInput) noexcept
 Make a copy of the input after it's been negated.
 
void Interpolate (const Vector3D_t *pFrom, const Vector3D_t *pTo, float fFactor) noexcept
 Interpolate between two vectors.
 
float Dot (float fX, float fY, float fZ) const noexcept
 Return a dot product of two 3D vectors.
 
float Dot (const Vector3D_t *pInput) const noexcept
 Return a dot product of two 3D vectors.
 
void Add (const Vector3D_t *pInput) noexcept
 Add another vector to this one.
 
void Add (float fInput) noexcept
 Add the same scalar value to each of member values.
 
void Add (const Vector3D_t *pInput1, const Vector3D_t *pInput2) noexcept
 Add two vectors and store the result in this vector.
 
void Add (const Vector3D_t *pInput, float fInput) noexcept
 Add a vector and a scalar to every member of the vector and store the result in this vector.
 
void Sub (const Vector3D_t *pInput) noexcept
 Subtract another vector from this one.
 
void Sub (float fInput) noexcept
 Subtract the same scalar value from each of member values.
 
void Sub (const Vector3D_t *pInput1, const Vector3D_t *pInput2) noexcept
 Subtract two vectors and store the result in this vector.
 
void Sub (const Vector3D_t *pInput, float fInput) noexcept
 Subract a vector and a scalar to every member of the vector and store the result in this vector.
 
void Mul (const Vector3D_t *pInput) noexcept
 Multiply another vector to this one.
 
void Mul (float fInput) noexcept
 Multiply the same scalar value to each of member values.
 
void Mul (const Vector3D_t *pInput1, const Vector3D_t *pInput2) noexcept
 Multiply two vectors and store the result in this vector.
 
void Mul (const Vector3D_t *pInput, float fInput) noexcept
 Multiply a vector and a scalar to every member of the vector and store the result in this vector.
 
void MulAdd (const Vector3D_t *pMul, const Vector3D_t *pAdd) noexcept
 Multiply two vectors and add a third and store the result in this vector.
 
void MulAdd (const Vector3D_t *pMul1, const Vector3D_t *pMul2, const Vector3D_t *pAdd) noexcept
 Multiply two vectors and add a third and store the result in this vector.
 
void MulAdd (float fInput, const Vector3D_t *pAdd) noexcept
 Multiply this vector by a scalar and add a second vector and store the result in this vector.
 
void MulAdd (const Vector3D_t *pMul, float fInput, const Vector3D_t *pAdd) noexcept
 Multiply a vector by a scalar and add a second vector and store the result in this vector.
 
void Cross (const Vector3D_t *pInput) noexcept
 Return a cross product of two 3D vectors.
 
void Cross (const Vector3D_t *pInput1, const Vector3D_t *pInput2) noexcept
 Return a cross product of two 3D vectors.
 
float GetLengthSquared (void) const noexcept
 Returns the square of the length of a 3D vector.
 
float GetLength (void) const noexcept
 Return the length of a vector (High precision)
 
float GetLengthFast (void) const noexcept
 Return the length of a vector (Good precision)
 
void SetLength (float fInput) noexcept
 Normalize a 3D vector to a specific length (High precision)
 
void SetLengthFast (float fInput) noexcept
 Normalize a 3D vector to a specific length (Good precision)
 
float GetDistanceSquared (float fX, float fY, float fZ) const noexcept
 Returns the square of the distance between two 3D points.
 
float GetDistanceSquared (const Vector3D_t *pInput) const noexcept
 Returns the square of the distance between two 3D points.
 
float GetDistance (float fX, float fY, float fZ) const noexcept
 Returns the square of the distance between two 3D points.
 
float GetDistance (const Vector3D_t *pInput) const noexcept
 Returns the square of the distance between two 3D points.
 
float GetDistanceFast (float fX, float fY, float fZ) const noexcept
 Returns the square of the distance between two 3D points (Good precision).
 
float GetDistanceFast (const Vector3D_t *pInput) const noexcept
 Returns the square of the distance between two 3D points (Good precision).
 
void Normalize (void) noexcept
 Normalize a 3D vector.
 
void Normalize (float fX, float fY, float fZ) noexcept
 Copy a normalized 3D vector.
 
void Normalize (const Vector3D_t *pInput) noexcept
 Copy a normalized 3D vector.
 
void PlaneNormal (const Vector3D_t *pOrigin, const Vector3D_t *pPoint1, const Vector3D_t *pPoint2) noexcept
 Calculate Plane Normal from three points on plane's.
 
void NormalizeFast (void) noexcept
 Normalize a 3D vector (Good precision)
 
void NormalizeFast (float fX, float fY, float fZ) noexcept
 Copy a normalized 3D vector.
 
void NormalizeFast (const Vector3D_t *pInput) noexcept
 Copy a normalized 3D vector.
 
uint_t Equal (const Vector3D_t *pInput) const noexcept
 Check if two vectors are equal.
 
uint_t Equal (const Vector3D_t *pInput, float fRange) const noexcept
 Check if two vectors are equal within an epsilon range.
 
uint_t BitwiseEqual (const Vector3D_t *pInput) const noexcept
 Compare two Vector3D_t's for bitwise equality.
 
floatoperator[] (uintptr_t uInput) noexcept
 Access the members as an array.
 
const floatoperator[] (uintptr_t uInput) const noexcept
 Access the members as an array.
 
uint_t operator== (const Vector3D_t &rInput) const noexcept
 Compare two Vector3D_t's for equality.
 
uint_t operator!= (const Vector3D_t &rInput) const noexcept
 Compare two Vector3D_t's for inequality.
 
 operator const float * () const noexcept
 Convert to a const float pointer.
 

Public Attributes

float x
 32 bit floating point X value for the 3D Vector
 
float y
 32 bit floating point Y value for the 3D Vector
 
float z
 32 bit floating point Z value for the 3D Vector
 

Detailed Description

3 dimensional floating point vector


This 12 byte vector contains x,y and z 32 bit floating point coordinates. A set of common functions for simple 3 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" and "z" 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::Vector2D_t or Burger::Vector4D_t

Member Function Documentation

◆ Add() [1/4]

void Burger::Vector3D_t::Add ( const Vector3D_t * pInput)
inlinenoexcept

Add another vector to this one.


Parameters
pInputVector to add
See also
Add(float), Add(const Vector3D_t *,const Vector3D_t *) or Add(const Vector3D_t *,float)

◆ Add() [2/4]

void Burger::Vector3D_t::Add ( const Vector3D_t * pInput,
float fInput )
inlinenoexcept

Add a vector and a scalar to every member of the vector and store the result in this vector.


Initialize this vector with the result of the addition of the input vector and a scalar applied to every member.

Parameters
pInputVector to add the scalar to
fInputScalar to add to the vector
See also
Add(float), Add(const Vector3D_t *) or Add(const Vector3D_t *,const Vector3D_t *)

◆ Add() [3/4]

void Burger::Vector3D_t::Add ( const Vector3D_t * pInput1,
const Vector3D_t * pInput2 )
inlinenoexcept

Add two vectors and store the result in this vector.


Initialize this vector with the result of the addition of the two input vectors.

Parameters
pInput1First vector to add
pInput2Second vector to add
See also
Add(float), Add(const Vector3D_t *) or Add(const Vector3D_t *,float)

◆ Add() [4/4]

void Burger::Vector3D_t::Add ( float fInput)
inlinenoexcept

Add the same scalar value to each of member values.


Parameters
fInputValue to add
See also
Add(const Vector3D_t *), Add(const Vector3D_t *,const Vector3D_t *) or Add(const Vector3D_t *,float)

◆ BitwiseEqual()

uint_t BURGER_API Burger::Vector3D_t::BitwiseEqual ( const Vector3D_t * pInput) const
noexcept

Compare two Vector3D_t's for bitwise equality.


Unlike operator==(const Vector3D_t &) const, this function performs a bitwise comparison, which in some cases is faster if pure equality detection is desired.

Parameters
pInputPointer to the Vector3D_t to compare against
Returns
TRUE if equal, FALSE if not
See also
operator==(const Vector3D_t&) const

◆ Cross() [1/2]

void BURGER_API Burger::Vector3D_t::Cross ( const Vector3D_t * pInput)
noexcept

Return a cross product of two 3D vectors.


Calculate the cross product between two 3D vectors. The end result is the perpendicular vector

x y z
(y * pInput->z) - (z * pInput->y) (z * pInput->x) - (x * pInput->z) (x * pInput->y) - (y * pInput->x)
Parameters
pInputValid pointer to a Vector3D_t structure to perform a cross product against
See also
Cross(const Vector3D_t *,const Vector3D_t *)

◆ Cross() [2/2]

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

Return a cross product of two 3D vectors.


Calculate the cross product between two 3D vectors. The end result is the perpendicular vector stored in this Vector3D_t instance.

x y z
(pInput1->y * pInput2->z) - (pInput1->z * pInput2->y) (pInput1->z * pInput2->x) - (pInput1->x * pInput2->z) (pInput1->x * pInput2->y) - (pInput1->y * pInput2->x)
Parameters
pInput1Valid pointer to a Vector3D_t structure to perform a cross product from
pInput2Valid pointer to a Vector3D_t structure to perform a cross product against
See also
Cross(const Vector3D_t *)

◆ Dot() [1/2]

float Burger::Vector3D_t::Dot ( const Vector3D_t * pInput) const
inlinenoexcept

Return a dot product of two 3D vectors.


Parameters
pInputValid pointer to a Vector3D_t structure to perform a dot product against
Returns
Dot product of the two vectors
See also
Dot(float,float,float) const

◆ Dot() [2/2]

float Burger::Vector3D_t::Dot ( float fX,
float fY,
float fZ ) const
inlinenoexcept

Return a dot product of two 3D vectors.


Parameters
fXX value to dot against
fYY value to dot against
fZZ value to dot against
Returns
Dot product of the two vectors
See also
Dot(const Vector3D_t *) const

◆ Equal() [1/2]

uint_t BURGER_API Burger::Vector3D_t::Equal ( const Vector3D_t * pInput) const
noexcept

Check if two vectors are equal.


Perform a binary compare of two vectors for equality.

Note
This performs a binary comparison, so NaN forced inequality will not work. Use Vector3D_t::Equal(const Vector3D_t *,float) const instead
Parameters
pInputVector to compare against
Returns
TRUE if the vectors are a binary match or FALSE if not.
See also
Vector3D_t::Equal(const Vector3D_t *,float) const

◆ Equal() [2/2]

uint_t BURGER_API Burger::Vector3D_t::Equal ( const Vector3D_t * pInput,
float fRange ) const
noexcept

Check if two vectors are equal within an epsilon range.


Perform a difference of each member and if they are less than a specific range, return TRUE for equality

Parameters
pInputVector to compare against
fRangeEpsilon range to use for equality
Returns
TRUE if the vectors are close enough to be equal or FALSE if not.
See also
Vector3D_t::Equal(const Vector3D_t *) const

◆ GetDistance() [1/2]

float BURGER_API Burger::Vector3D_t::GetDistance ( const Vector3D_t * pInput) const
noexcept

Returns the square of the distance between two 3D points.


Create a vector from the difference of two 3D points and return the vector's length

Parameters
pInputValid pointer to a Vector3D_t structure that contains the other 3D point
Returns
The distance between the two points
See also
GetDistance(float,float,float) const, GetDistanceSquared(const Vector3D_t *) const or GetDistanceFast(const Vector3D_t *) const

◆ GetDistance() [2/2]

float BURGER_API Burger::Vector3D_t::GetDistance ( float fX,
float fY,
float fZ ) const
noexcept

Returns the square of the distance between two 3D points.


Create a vector from the difference of two 3D points and return the vector's length

Parameters
fXX value of the other 3D point
fYY value of the other 3D point
fZZ value of the other 3D point
Returns
The distance between the two points
See also
GetDistance(const Vector3D_t *) const, GetDistanceSquared(float,float,float) const or GetDistanceFast(float,float,float) const

◆ GetDistanceFast() [1/2]

float BURGER_API Burger::Vector3D_t::GetDistanceFast ( const Vector3D_t * pInput) const
noexcept

Returns the square of the distance between two 3D points (Good precision).


Create a vector from the difference of two 3D points and return the vector's length

On some systems, lower precision instructions are used to increase speed at the cost of precision. If the calculation doesn't rely on high precision, use this function for higher performance

Parameters
pInputValid pointer to a Vector3D_t structure that contains the other 3D point
Returns
The distance between the two points
See also
GetDistanceFast(float,float,float) const, GetDistanceSquared(const Vector3D_t *) const or GetDistance(const Vector3D_t *) const

◆ GetDistanceFast() [2/2]

float BURGER_API Burger::Vector3D_t::GetDistanceFast ( float fX,
float fY,
float fZ ) const
noexcept

Returns the square of the distance between two 3D points (Good precision).


Create a vector from the difference of two 3D points and return the vector's length

On some systems, lower precision instructions are used to increase speed at the cost of precision. If the calculation doesn't rely on high precision, use this function for higher performance

Parameters
fXX value of the other 3D point
fYY value of the other 3D point
fZZ value of the other 3D point
Returns
The distance between the two points
See also
GetDistanceFast(const Vector3D_t *) const, GetDistanceSquared(float,float,float) const or GetDistance(float,float,float) const

◆ GetDistanceSquared() [1/2]

float BURGER_API Burger::Vector3D_t::GetDistanceSquared ( const Vector3D_t * pInput) const
noexcept

Returns the square of the distance between two 3D points.


Create a vector from the difference of two 3D points and return the vector's length squared

Parameters
pInputValid pointer to a Vector3D_t structure that contains the other 3D point
Returns
The distance between the two points, squared
See also
GetDistanceSquared(float,float,float) const, GetDistance(const Vector3D_t *) const or GetDistanceFast(const Vector3D_t *) const

◆ GetDistanceSquared() [2/2]

float BURGER_API Burger::Vector3D_t::GetDistanceSquared ( float fX,
float fY,
float fZ ) const
noexcept

Returns the square of the distance between two 3D points.


Create a vector from the difference of two 3D points and return the vector's length squared

Parameters
fXX value of the other 3D point
fYY value of the other 3D point
fZZ value of the other 3D point
Returns
The distance between the two points, squared
See also
GetDistanceSquared(const Vector3D_t *) const, GetDistance(float,float,float) const or GetDistanceFast(float,float,float) const

◆ GetLength()

float Burger::Vector3D_t::GetLength ( void ) const
inlinenoexcept

Return the length of a vector (High precision)


Returns
sqrt(x*x+y*y+z*z)
See also
GetLengthFast(void) const or GetLengthSquared(void) const

◆ GetLengthFast()

float Burger::Vector3D_t::GetLengthFast ( void ) const
inlinenoexcept

Return the length of a vector (Good precision)


On some systems, lower precision instructions are used to increase speed at the cost of precision. If the calculation doesn't rely on high precision, use this function for higher performance

Returns
sqrt(x*x+y*y+z*z)
See also
GetLength(void) const or GetLengthSquared(void) const

◆ GetLengthSquared()

float Burger::Vector3D_t::GetLengthSquared ( void ) const
inlinenoexcept

Returns the square of the length of a 3D vector.


Returns
x*x+y*y+z*z
See also
GetLengthFast(void) const or GetLength(void) const

◆ GetX()

float Burger::Vector3D_t::GetX ( void ) const
inlinenoexcept

Return the x component of the vector.


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

◆ GetY()

float Burger::Vector3D_t::GetY ( void ) const
inlinenoexcept

Return the y component of the vector.


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

◆ GetZ()

float Burger::Vector3D_t::GetZ ( void ) const
inlinenoexcept

Return the z component of the vector.


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

◆ Interpolate()

void BURGER_API Burger::Vector3D_t::Interpolate ( const Vector3D_t * pFrom,
const Vector3D_t * pTo,
float fFactor )
noexcept

Interpolate between two vectors.


Given a factor between 0.0f and 1.0f inclusive, perform a linear scale between the two vectors and return pFrom if the factor is 0.0f and pTo if the factor is 1.0f

No clamping is performed.

Parameters
pFromValid pointer to a Vector3D_t structure for a factor of 0.0f
pToValid pointer to a Vector3D_t structure for a factor of 1.0f
fFactorScale value between 0.0f and 1.0f inclusive
See also
Vector2D_t::Interpolate() and Vector4D_t::Interpolate()

◆ Mul() [1/4]

void Burger::Vector3D_t::Mul ( const Vector3D_t * pInput)
inlinenoexcept

Multiply another vector to this one.


Parameters
pInputVector to multiply
See also
Mul(float), Mul(const Vector3D_t *,const Vector3D_t *) or Mul(const Vector3D_t *,float)

◆ Mul() [2/4]

void Burger::Vector3D_t::Mul ( const Vector3D_t * pInput,
float fInput )
inlinenoexcept

Multiply a vector and a scalar to every member of the vector and store the result in this vector.


Initialize this vector with the result of the multiplication of the input vector and a scalar applied to every member.

Parameters
pInputVector to multiply the scalar to
fInputScalar to multiply to the vector
See also
Mul(float), Mul(const Vector3D_t *) or Mul(const Vector3D_t *,const Vector3D_t *)

◆ Mul() [3/4]

void Burger::Vector3D_t::Mul ( const Vector3D_t * pInput1,
const Vector3D_t * pInput2 )
inlinenoexcept

Multiply two vectors and store the result in this vector.


Initialize this vector with the result of the multiplication of the two input vectors.

Parameters
pInput1First vector to multiply
pInput2Second vector to multiply
See also
Mul(float), Mul(const Vector3D_t *) or Mul(const Vector3D_t *,float)

◆ Mul() [4/4]

void Burger::Vector3D_t::Mul ( float fInput)
inlinenoexcept

Multiply the same scalar value to each of member values.


Parameters
fInputValue to multiply
See also
Mul(const Vector3D_t *), Mul(const Vector3D_t *,const Vector3D_t *) or Mul(const Vector3D_t *,float)

◆ MulAdd() [1/4]

void Burger::Vector3D_t::MulAdd ( const Vector3D_t * pMul,
const Vector3D_t * pAdd )
inlinenoexcept

Multiply two vectors and add a third and store the result in this vector.


Initialize this vector with the result of the multiplication of this vector and pMul and add the vector pAdd

this = (this*pMul)+pAdd;

Parameters
pMulVector to multiply
pAddVector to add
See also
MulAdd(float,const Vector3D_t *), MulAdd(const Vector3D_t *,const Vector3D_t *,const Vector3D_t *) or MulAdd(const Vector3D_t ,float,const Vector3D_t *)

◆ MulAdd() [2/4]

void Burger::Vector3D_t::MulAdd ( const Vector3D_t * pMul,
float fInput,
const Vector3D_t * pAdd )
inlinenoexcept

Multiply a vector by a scalar and add a second vector and store the result in this vector.


Initialize this vector with the result of the multiplication of a vector and a scalar and add the vector pAdd

this = (pMul*fInput)+pAdd;

Parameters
pMulVector to multiply
fInputScalar to multiply by all members of the vector pMul
pAddVector to add
See also
MulAdd(const Vector3D_t *,const Vector3D_t *,const Vector3D_t *), MulAdd(const Vector3D_t *,const Vector3D_t *) or MulAdd(float,const Vector3D_t*)

◆ MulAdd() [3/4]

void Burger::Vector3D_t::MulAdd ( const Vector3D_t * pMul1,
const Vector3D_t * pMul2,
const Vector3D_t * pAdd )
inlinenoexcept

Multiply two vectors and add a third and store the result in this vector.


Initialize this vector with the result of the multiplication of two vectors and add the vector pAdd

this = (pMul1*pMu2)+pAdd;

Parameters
pMul1First vector to multiply
pMul2Second vector to multiply
pAddVector to add
See also
MulAdd(float,const Vector3D_t *), MulAdd(const Vector3D_t *,const Vector3D_t *) or MulAdd(const Vector3D_t *,float,const Vector3D_t *)

◆ MulAdd() [4/4]

void Burger::Vector3D_t::MulAdd ( float fInput,
const Vector3D_t * pAdd )
inlinenoexcept

Multiply this vector by a scalar and add a second vector and store the result in this vector.


Initialize this vector with the result of the multiplication of a vector and a scalar and add the vector pAdd

this = (this*fInput)+pAdd;

Parameters
fInputScalar to multiply by all members of this vector
pAddVector to add
See also
MulAdd(const Vector3D_t *,const Vector3D_t *,const Vector3D_t *), MulAdd(const Vector3D_t *,const Vector3D_t *) or MulAdd(const Vector3D_t ,float,const Vector3D_t *)

◆ Negate() [1/3]

void Burger::Vector3D_t::Negate ( const Vector3D_t * pInput)
inlinenoexcept

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


Copy the input data and negate it.

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

◆ Negate() [2/3]

void Burger::Vector3D_t::Negate ( float fX,
float fY,
float fZ )
inlinenoexcept

Negate the input and store it in this structure.


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

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

◆ Negate() [3/3]

void Burger::Vector3D_t::Negate ( void )
inlinenoexcept

Negate a 3D vector.


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

See also
Negate(const Vector3D_t *) or Negate(float,float,float)

◆ Normalize() [1/3]

void BURGER_API Burger::Vector3D_t::Normalize ( const Vector3D_t * pInput)
noexcept

Copy a normalized 3D vector.


Make a copy of a 3D vector and set the copy's length to 1.0f

Parameters
pInputValid pointer to a Vector3D_t structure that will be copied and normalize
See also
Normalize(void), Normalize(float,float,float) or NormalizeFast(const Vector3D_t *)

◆ Normalize() [2/3]

void BURGER_API Burger::Vector3D_t::Normalize ( float fX,
float fY,
float fZ )
noexcept

Copy a normalized 3D vector.


Make a copy of a 3D vector and set the copy's length to 1.0f

Parameters
fXX value of the 3D vector to normalize
fYY value of the 3D vector to normalize
fZZ value of the 3D vector to normalize
See also
Normalize(void), Normalize(const Vector3D_t *) or NormalizeFast(float,float,float)

◆ Normalize() [3/3]

void BURGER_API Burger::Vector3D_t::Normalize ( void )
noexcept

Normalize a 3D vector.


Set the 3D vector's length to 1.0f

See also
Normalize(float,float,float), Normalize(const Vector3D_t *) or NormalizeFast(void)

◆ NormalizeFast() [1/3]

void BURGER_API Burger::Vector3D_t::NormalizeFast ( const Vector3D_t * pInput)
noexcept

Copy a normalized 3D vector.


Make a copy of a 3D vector and set the copy's length to 1.0f

On some systems, lower precision instructions are used to increase speed at the cost of precision. If the calculation doesn't rely on high precision, use this function for higher performance

Parameters
pInputValid pointer to a Vector3D_t structure that will be copied and normalize
See also
NormalizeFast(void), NormalizeFast(float,float,float) or Normalize(const Vector3D_t *)

◆ NormalizeFast() [2/3]

void BURGER_API Burger::Vector3D_t::NormalizeFast ( float fX,
float fY,
float fZ )
noexcept

Copy a normalized 3D vector.


Make a copy of a 3D vector and set the copy's length to 1.0f

On some systems, lower precision instructions are used to increase speed at the cost of precision. If the calculation doesn't rely on high precision, use this function for higher performance

Parameters
fXX value of the 3D vector to normalize
fYY value of the 3D vector to normalize
fZZ value of the 3D vector to normalize
See also
NormalizeFast(void), NormalizeFast(const Vector3D_t *) or Normalize(float,float,float)

◆ NormalizeFast() [3/3]

void BURGER_API Burger::Vector3D_t::NormalizeFast ( void )
noexcept

Normalize a 3D vector (Good precision)


Set the 3D vector's length to 1.0f

On some systems, lower precision instructions are used to increase speed at the cost of precision. If the calculation doesn't rely on high precision, use this function for higher performance

See also
NormalizeFast(float,float,float), NormalizeFast(const Vector3D_t *) or Normalize(void)

◆ One()

void Burger::Vector3D_t::One ( void )
inlinenoexcept

Set all values to 1.0f.


See also
Set(const Vector3D_t *) or Set(float,float,float)

◆ operator const float *()

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

Convert to a const float pointer.


This convenience operator converts the Vector3D_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 *)

◆ operator!=()

Burger::Vector3D_t::operator!= ( const Vector3D_t & rInput) const
inlinenoexcept

Compare two Vector3D_t's for inequality.


Parameters
rInputReference to the Vector3D_t to compare against
Returns
TRUE if not equal, FALSE if equal
See also
operator==(const Vector3D_t&) const

◆ operator==()

Burger::Vector3D_t::operator== ( const Vector3D_t & rInput) const
inlinenoexcept

Compare two Vector3D_t's for equality.


Parameters
rInputReference to the Vector3D_t to compare against
Returns
TRUE if equal, FALSE if not
See also
operator!=(const Vector3D_t&) const

◆ operator[]() [1/2]

const float & Burger::Vector3D_t::operator[] ( uintptr_t uInput) const
inlinenoexcept

Access the members as an array.


Parameters
uInput0 for x, 1 for y, 2 for z, any other value is an error
See also
operator[](uintptr_t)

◆ operator[]() [2/2]

float & Burger::Vector3D_t::operator[] ( uintptr_t uInput)
inlinenoexcept

Access the members as an array.


Parameters
uInput0 for x, 1 for y, 2 for z, any other value is an error
See also
operator[](uintptr_t) const

◆ PlaneNormal()

void BURGER_API Burger::Vector3D_t::PlaneNormal ( const Vector3D_t * pOrigin,
const Vector3D_t * pPoint1,
const Vector3D_t * pPoint2 )
noexcept

Calculate Plane Normal from three points on plane's.


The three input vectors are treated as points on a single plane and are used to make two vectors which a cross product is applied to create the normal.

3 dimensional floating point vector
Definition burger.h:16335
void Cross(const Vector3D_t *pInput) noexcept
Return a cross product of two 3D vectors.
Definition brvector3d.cpp:555
void Normalize(void) noexcept
Normalize a 3D vector.
Definition brvector3d.cpp:975
Select a type based if the conditional is true or false.
Definition burger.h:3178
Parameters
pOriginPointer to the origin point on the plane
pPoint1Pointer to the first ray endpoint
pPoint2Pointer to the second ray endpoint
See also
Cross() and Normalize()

◆ Set() [1/5]

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

Convert a fixed point vector into a floating point vector.


Parameters
pInputValid pointer to a FixedVector3D_t structure to copy
See also
Set(const Vector3D_t *), Set(float,float,float) or Zero(void)

◆ Set() [2/5]

void Burger::Vector3D_t::Set ( const Vector3D_t * pInput)
inlinenoexcept

Copy a Vector3D_t.


Make a copy of a Vector3D_t

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

◆ Set() [3/5]

void Burger::Vector3D_t::Set ( float fInput)
inlinenoexcept

Set all of the members to specific value.


Sets the x,y and z values to a specific value

Parameters
fInputNew value for all members
See also
Zero(void), SetX(float), SetY(float), SetZ(float) or Set(const Vector3D_t *)

◆ Set() [4/5]

void Burger::Vector3D_t::Set ( float fX,
float fY )
inlinenoexcept

Set the values to specific values.


Sets the x and y values to specific values. z is set to 0.0f

Parameters
fXNew x value
fYNew y value
See also
Zero(void), Set(const Vector3D_t *) or Set(float,float,float)

◆ Set() [5/5]

void Burger::Vector3D_t::Set ( float fX,
float fY,
float fZ )
inlinenoexcept

Set the values to specific values.


Sets the x, y and z values to specific values.

Parameters
fXNew x value
fYNew y value
fZNew z value
See also
Zero(void) or Set(const Vector3D_t *)

◆ SetLength()

void BURGER_API Burger::Vector3D_t::SetLength ( float fInput)
noexcept

Normalize a 3D vector to a specific length (High precision)


Set the 3D vector's length to fInput

Note
fInput cannot be zero or negative. The vector will be set to 0.0f in this case
Parameters
fInputLength to set the vector to
See also
SetLengthFast(float) or Normalize(void)

◆ SetLengthFast()

void BURGER_API Burger::Vector3D_t::SetLengthFast ( float fInput)
noexcept

Normalize a 3D vector to a specific length (Good precision)


Set the 3D vector's length to fInput

Note
fInput cannot be zero or negative. The vector will be set to 0.0f in this case

On some systems, lower precision instructions are used to increase speed at the cost of precision. If the calculation doesn't rely on high precision, use this function for higher performance

Parameters
fInputLength to set the vector to
See also
SetLength(float) or NormalizeFast(void)

◆ SetX()

void Burger::Vector3D_t::SetX ( float fX)
inlinenoexcept

Set the x component of the vector.


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

◆ SetY()

void Burger::Vector3D_t::SetY ( float fY)
inlinenoexcept

Set the y component of the vector.


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

◆ SetZ()

void Burger::Vector3D_t::SetZ ( float fZ)
inlinenoexcept

Set the z component of the vector.


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

◆ Sub() [1/4]

void Burger::Vector3D_t::Sub ( const Vector3D_t * pInput)
inlinenoexcept

Subtract another vector from this one.


Parameters
pInputVector to subtract
See also
Sub(float), Sub(const Vector3D_t *,const Vector3D_t *) or Sub(const Vector3D_t *,float)

◆ Sub() [2/4]

void Burger::Vector3D_t::Sub ( const Vector3D_t * pInput,
float fInput )
inlinenoexcept

Subract a vector and a scalar to every member of the vector and store the result in this vector.


Initialize this vector with the result of the subtraction of the input vector and a scalar applied to every member.

Parameters
pInputVector to subract the scalar from
fInputScalar to subtract from the vector
See also
Sub(float), Sub(const Vector3D_t *) or Sub(const Vector3D_t *,const Vector3D_t *)

◆ Sub() [3/4]

void Burger::Vector3D_t::Sub ( const Vector3D_t * pInput1,
const Vector3D_t * pInput2 )
inlinenoexcept

Subtract two vectors and store the result in this vector.


Initialize this vector with the result of the subtraction of the two input vectors.

Parameters
pInput1First vector to subtract from
pInput2Second vector to subtract with
See also
Sub(float), Sub(const Vector3D_t *) or Sub(const Vector3D_t *,float)

◆ Sub() [4/4]

void Burger::Vector3D_t::Sub ( float fInput)
inlinenoexcept

Subtract the same scalar value from each of member values.


Parameters
fInputValue to subtract
See also
Sub(const Vector3D_t *), Sub(const Vector3D_t *,const Vector3D_t *) or Sub(const Vector3D_t *,float)

◆ Zero()

void Burger::Vector3D_t::Zero ( void )
inlinenoexcept

Set all values to zero.


See also
Set(const Vector3D_t *) or Set(float,float,float)

Member Data Documentation

◆ x

float Burger::Vector3D_t::x

32 bit floating point X value for the 3D Vector

◆ y

float Burger::Vector3D_t::y

32 bit floating point Y value for the 3D Vector

◆ z

float Burger::Vector3D_t::z

32 bit floating point Z value for the 3D Vector