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

4 dimensional floating point vector More...

Inheritance diagram for Burger::Vector4D_t:

Public Member Functions

void Zero (void)
 Set all values to zero.
 
void One (void)
 Set all values to 1.0f.
 
void Identity (void)
 Initialize the vector elements to identity for a quaternion.
 
float GetX (void) const
 Return the x component of the vector.
 
float GetY (void) const
 Return the y component of the vector.
 
float GetZ (void) const
 Return the z component of the vector.
 
float GetW (void) const
 Return the w component of the vector.
 
void SetX (float fX)
 Set the x component of the vector.
 
void SetY (float fY)
 Set the y component of the vector.
 
void SetZ (float fZ)
 Set the z component of the vector.
 
void SetW (float fW)
 Set the w component of the vector.
 
void Set (float fInput)
 Set all of the members to specific value.
 
void Set (float fX, float fY)
 Set the values to specific values.
 
void Set (float fX, float fY, float fZ)
 Set the values to specific values.
 
void Set (float fX, float fY, float fZ, float fW)
 Set the values to specific values.
 
void Set (const Vector4D_t *pInput)
 Copy a Vector4D_t.
 
void Set (const FixedVector4D_t *pInput)
 Convert a fixed point vector into a floating point vector.
 
void SetRect (float fX, float fY)
 Set the values to as if it's a rectangle.
 
void SetRect (const Vector2D_t *pMinMax)
 Set the values to as if it's a rectangle.
 
void SetRect (const Vector2D_t *pMin, const Vector2D_t *pMax)
 Set the values to as if it's a rectangle.
 
void Negate (void)
 Negate a 4D vector.
 
void Negate (float fX, float fY, float fZ, float fW)
 Negate the input and store it in this structure.
 
void Negate (const Vector4D_t *pInput)
 Make a copy of the input after it's been negated.
 
void Interpolate (const Vector4D_t *pFrom, const Vector4D_t *pTo, float fFactor)
 Interpolate between two vectors.
 
float Dot (float fX, float fY, float fZ, float fW) const
 Return a dot product of two 4D vectors.
 
float Dot (const Vector4D_t *pInput) const
 Return a dot product of two 4D vectors.
 
void Add (const Vector4D_t *pInput)
 Add another vector to this one.
 
void Add (float fInput)
 Add the same scalar value to each of member values.
 
void Add (const Vector4D_t *pInput1, const Vector4D_t *pInput2)
 Add two vectors and store the result in this vector.
 
void Add (const Vector4D_t *pInput, float fInput)
 Add a vector and a scalar to every member of the vector and store the result in this vector.
 
void Sub (const Vector4D_t *pInput)
 Subtract another vector from this one.
 
void Sub (float fInput)
 Subtract the same scalar value from each of member values.
 
void Sub (const Vector4D_t *pInput1, const Vector4D_t *pInput2)
 Subtract two vectors and store the result in this vector.
 
void Sub (const Vector4D_t *pInput, float fInput)
 Subtract a vector and a scalar to every member of the vector and store the result in this vector.
 
void Mul (const Vector4D_t *pInput)
 Multiply another vector to this one.
 
void Mul (float fInput)
 Multiply the same scalar value to each of member values.
 
void Mul (const Vector4D_t *pInput1, const Vector4D_t *pInput2)
 Multiply two vectors and store the result in this vector.
 
void Mul (const Vector4D_t *pInput, float fInput)
 Multiply a vector and a scalar to every member of the vector and store the result in this vector.
 
float GetLengthSquared (void) const
 Returns the square of the length of a 4D vector.
 
float GetLength (void) const
 Return the length of a vector (High precision)
 
float GetLengthFast (void) const
 Return the length of a vector (Good precision)
 
void SetLength (float fInput)
 Normalize a 4D vector to a specific length (High precision)
 
void SetLengthFast (float fInput)
 Normalize a 3D vector to a specific length (Good precision)
 
float GetDistanceSquared (float fX, float fY, float fZ, float fW) const
 Returns the square of the distance between two 4D points.
 
float GetDistanceSquared (const Vector4D_t *pInput) const
 Returns the square of the distance between two 4D points.
 
float GetDistance (float fX, float fY, float fZ, float fW) const
 Returns the square of the distance between two 4D points.
 
float GetDistance (const Vector4D_t *pInput) const
 Returns the square of the distance between two 4D points.
 
float GetDistanceFast (float fX, float fY, float fZ, float fW) const
 Returns the square of the distance between two 4D points (Good precision)
 
float GetDistanceFast (const Vector4D_t *pInput) const
 Returns the square of the distance between two 4D points (Good precision)
 
void Normalize (void)
 Normalize a 4D vector.
 
void Normalize (float fX, float fY, float fZ, float fW)
 Copy a normalized 4D vector.
 
void Normalize (const Vector4D_t *pInput)
 Copy a normalized 4D vector.
 
void NormalizeFast (void)
 Normalize a 4D vector (Good precision)
 
void NormalizeFast (float fX, float fY, float fZ, float fW)
 Copy a normalized 4D vector.
 
void NormalizeFast (const Vector4D_t *pInput)
 Copy a normalized 4D vector.
 
float Dot3 (float fX, float fY, float fZ) const
 Return a dot product of two 3D vectors.
 
float Dot3 (const Vector4D_t *pInput) const
 Return a dot product of two 4D vectors using only x,y and z.
 
void QuaternionNegate (void)
 Negate a quaternion.
 
void QuaternionNegate (float fX, float fY, float fZ, float fW)
 Negate the input quaternion and store it in this structure.
 
void QuaternionNegate (const Vector4D_t *pInput)
 Make a copy of the input quaternion after it's been negated.
 
void QuaternionMul (const Vector4D_t *pInput)
 Multiply a quaternion by another quaternion.
 
void QuaternionMul (const Vector4D_t *pInput1, const Vector4D_t *pInput2)
 Multiply a quaternion by another quaternion and store it here.
 
void QuaternionMulNormalize (const Vector4D_t *pInput)
 Multiply a quaternion by another quaternion.
 
void QuaternionMulNormalize (const Vector4D_t *pInput1, const Vector4D_t *pInput2)
 Multiply a quaternion by another quaternion and store it here.
 
uint_t BitwiseEqual (const Vector4D_t *pInput) const
 Compare two Vector4D_t's for bitwise equality.
 
float & operator[] (uint_t uInput)
 Access the members as an array.
 
const float & operator[] (uint_t uInput) const
 Access the members as an array.
 
uint_t operator== (const Vector4D_t &rInput) const
 Compare two Vector4D_t's for equality.
 
uint_t operator!= (const Vector4D_t &rInput) const
 Compare two Vector4D_t's for inequality.
 
 operator const float * () const
 Convert to a const float pointer.
 
const Vector2D_tGetTopLeft (void) const
 Get the top left corner of the rectangle.
 
const Vector2D_tGetBottomRight (void) const
 Get the top left corner of the rectangle.
 
Vector2D_tGetTopLeft (void)
 Get the top left corner of the rectangle.
 
Vector2D_tGetBottomRight (void)
 Get the top left corner of the rectangle.
 
float GetWidth (void) const
 Get the width of the rectangle.
 
float GetHeight (void) const
 Get the height of the rectangle.
 
float GetLeft (void) const
 Get the leftmost X coordinate of the rectangle.
 
float GetTop (void) const
 Get the topmost Y coordinate of the rectangle.
 
float GetRight (void) const
 Get the rightmost X coordinate of the rectangle.
 
float GetBottom (void) const
 Get the bottommost Y coordinate of the rectangle.
 
void SetWidth (float fWidth)
 Set the width of a rectangle.
 
void SetHeight (float fHeight)
 Set the height of a rectangle.
 
void SetSize (float fWidth, float fHeight)
 Set the size of a rectangle.
 
void SetLeft (float fLeft)
 Set the left most X coordinate of a rectangle.
 
void SetTop (float fTop)
 Set the top most Y coordinate of a rectangle.
 
void SetRight (float fRight)
 Set the right most X coordinate of a rectangle.
 
void SetBottom (float fBottom)
 Set the bottom most Y coordinate of a rectangle.
 
uint_t IsInsideRect (float fX, float fY) const
 Test if a point is inside a rectangle.
 
uint_t IsInsideRect (const Vector2D_t *pInput) const
 Test if a point is inside a rectangle.
 
void ExpandRect (float fX, float fY)
 Enlarge a rectangle to encompass a point.
 
void ExpandRect (const Vector2D_t *pInput)
 Enlarge a rectangle to encompass a point.
 
void ExpandRect (const Vector4D_t *pInput)
 Enlarge a rectangle to encompass a rectangle.
 

Public Attributes

float x
 32 bit floating point X value for the 4D Vector (LeftX)
 
float y
 32 bit floating point Y value for the 4D Vector (TopY)
 
float z
 32 bit floating point Z value for the 4D Vector (RightX)
 
float w
 32 bit floating point W value for the 4D Vector (BottomY)
 

Detailed Description

4 dimensional floating point vector


This 16 byte vector contains x,y,z and w 32 bit floating 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::Vector2D_t, Burger::Vector3D_t or Burger::FixedVector4D_t

Member Function Documentation

◆ Add() [1/4]

void Burger::Vector4D_t::Add ( const Vector4D_t * pInput)
inline

Add another vector to this one.


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

◆ Add() [2/4]

void Burger::Vector4D_t::Add ( const Vector4D_t * pInput,
float fInput )
inline

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 Vector4D_t *) or Add(const Vector4D_t *,const Vector4D_t *)

◆ Add() [3/4]

void Burger::Vector4D_t::Add ( const Vector4D_t * pInput1,
const Vector4D_t * pInput2 )
inline

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 Vector4D_t *) or Add(const Vector4D_t *,float)

◆ Add() [4/4]

void Burger::Vector4D_t::Add ( float fInput)
inline

Add the same scalar value to each of member values.


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

◆ BitwiseEqual()

uint_t BURGER_API Burger::Vector4D_t::BitwiseEqual ( const Vector4D_t * pInput) const

Compare two Vector4D_t's for bitwise equality.


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

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

◆ Dot() [1/2]

float Burger::Vector4D_t::Dot ( const Vector4D_t * pInput) const
inline

Return a dot product of two 4D vectors.


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

◆ Dot() [2/2]

float Burger::Vector4D_t::Dot ( float fX,
float fY,
float fZ,
float fW ) const
inline

Return a dot product of two 4D vectors.


Parameters
fXX value to dot against
fYY value to dot against
fZZ value to dot against
fWW value to dot against
Returns
Dot product of the two vectors
See also
Dot(const Vector4D_t *) const or Dot3(float,float,float) const

◆ Dot3() [1/2]

float Burger::Vector4D_t::Dot3 ( const Vector4D_t * pInput) const
inline

Return a dot product of two 4D vectors using only x,y and z.


Performs a dot product with the w term set to 0.0f

Parameters
pInputValid pointer to a Vector4D_t structure to perform a three term dot product against
Returns
Dot product of the two vectors
See also
Dot3(float,float,float) const or Dot(const Vector4D_t *) const

◆ Dot3() [2/2]

float Burger::Vector4D_t::Dot3 ( float fX,
float fY,
float fZ ) const
inline

Return a dot product of two 3D vectors.


Parameters
fXX value to dot against
fYY value to dot against
fZZ value to dot against

Performs a dot product with the w term set to 0.0f

Returns
Dot product of the two vectors
See also
Dot3(const Vector4D_t *) const or Dot(float,float,float,float) const

◆ ExpandRect() [1/3]

void BURGER_API Burger::Vector4D_t::ExpandRect ( const Vector2D_t * pInput)

Enlarge a rectangle to encompass a point.


If the x,y coordinate is inside the rectangle, no action will be performed. If it's outside, the rectangle will be enlarged just enough to encompass the new point.

Parameters
pInputPointer to an X/Y coordinate to expand the rectangle with.
See also
ExpandRect(float,float)

◆ ExpandRect() [2/3]

void BURGER_API Burger::Vector4D_t::ExpandRect ( const Vector4D_t * pInput)

Enlarge a rectangle to encompass a rectangle.


If the left,top and right,bottom coordinates are inside the rectangle, no action will be performed. If it's outside, the rectangle will be enlarged just enough to encompass the new rectangle.

Parameters
pInputPointer to an Left/Top/Right/Bottom coordinate to expand the rectangle with.
See also
ExpandRect(float,float) or ExpandRect(const Vector2D_t *)

◆ ExpandRect() [3/3]

void BURGER_API Burger::Vector4D_t::ExpandRect ( float fX,
float fY )

Enlarge a rectangle to encompass a point.


If the x,y coordinate is inside the rectangle, no action will be performed. If it's outside, the rectangle will be enlarged just enough to encompass the new point.

Parameters
fXX coordinate to expand the x and z elements with
fYY coordinate to expand the y and w elements width
See also
ExpandRect(const Vector2D_t *)

◆ GetBottom()

float Burger::Vector4D_t::GetBottom ( void ) const
inline

Get the bottommost Y coordinate of the rectangle.


Returns the bottommost Y component of the rectangle. The w value shadows the BottomY value.

Returns
The bottommost Y of the rectangle.
See also
GetTop(void) const

◆ GetBottomRight() [1/2]

Vector2D_t * Burger::Vector4D_t::GetBottomRight ( void )
inline

Get the top left corner of the rectangle.


This function casts a pointer to the z and w elements of the Vector4D_t to a Vector2D_t which represents the bottom-right corner of a rectangle.

Returns
Pointer to the bottom right corner of the rectangle
See also
GetTopLeft(void), GetBottomRight(void) const or GetHeight(void) const

◆ GetBottomRight() [2/2]

const Vector2D_t * Burger::Vector4D_t::GetBottomRight ( void ) const
inline

Get the top left corner of the rectangle.


This function casts a pointer to the z and w elements of the Vector4D_t to a Vector2D_t which represents the bottom-right corner of a rectangle.

Returns
Pointer to the bottom right corner of the rectangle
See also
GetTopLeft(void) const, GetBottomRight(void) or GetHeight(void) const

◆ GetDistance() [1/2]

float BURGER_API Burger::Vector4D_t::GetDistance ( const Vector4D_t * pInput) const

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


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

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

◆ GetDistance() [2/2]

float BURGER_API Burger::Vector4D_t::GetDistance ( float fX,
float fY,
float fZ,
float fW ) const

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


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

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

◆ GetDistanceFast() [1/2]

float BURGER_API Burger::Vector4D_t::GetDistanceFast ( const Vector4D_t * pInput) const

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


Create a vector from the difference of two 4D 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 Vector4D_t structure that contains the other 4D point
Returns
The distance between the two points
See also
GetDistanceFast(float,float,float,float) const, GetDistanceSquared(const Vector4D_t *) const or GetDistance(const Vector4D_t *) const

◆ GetDistanceFast() [2/2]

float BURGER_API Burger::Vector4D_t::GetDistanceFast ( float fX,
float fY,
float fZ,
float fW ) const

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


Create a vector from the difference of two 4D 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 4D point
fYY value of the other 4D point
fZZ value of the other 4D point
fWW value of the other 4D point
Returns
The distance between the two points
See also
GetDistanceFast(const Vector4D_t *) const, GetDistanceSquared(float,float,float,float) const or GetDistance(float,float,float,float) const

◆ GetDistanceSquared() [1/2]

float BURGER_API Burger::Vector4D_t::GetDistanceSquared ( const Vector4D_t * pInput) const

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


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

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

◆ GetDistanceSquared() [2/2]

float BURGER_API Burger::Vector4D_t::GetDistanceSquared ( float fX,
float fY,
float fZ,
float fW ) const

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


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

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

◆ GetHeight()

float Burger::Vector4D_t::GetHeight ( void ) const
inline

Get the height of the rectangle.


This function subtracts the y component from the w component to create the height of the rectangle.

Returns
The height of the rectangle.
See also
GetWidth(void) const

◆ GetLeft()

float Burger::Vector4D_t::GetLeft ( void ) const
inline

Get the leftmost X coordinate of the rectangle.


Returns the leftmost X component of the rectangle. The x value shadows the LeftX value.

Returns
The leftmost X of the rectangle.
See also
GetRight(void) const

◆ GetLength()

float Burger::Vector4D_t::GetLength ( void ) const
inline

Return the length of a vector (High precision)


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

◆ GetLengthFast()

float Burger::Vector4D_t::GetLengthFast ( void ) const
inline

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+w*w)
See also
GetLength(void) const or GetLengthSquared(void) const

◆ GetLengthSquared()

float Burger::Vector4D_t::GetLengthSquared ( void ) const
inline

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


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

◆ GetRight()

float Burger::Vector4D_t::GetRight ( void ) const
inline

Get the rightmost X coordinate of the rectangle.


Returns the rightmost X component of the rectangle. The z value shadows the RightX value.

Returns
The rightmost X of the rectangle.
See also
GetLeft(void) const

◆ GetTop()

float Burger::Vector4D_t::GetTop ( void ) const
inline

Get the topmost Y coordinate of the rectangle.


Returns the topmost Y component of the rectangle. The y value shadows the TopY value.

Returns
The topmost Y of the rectangle.
See also
GetBottom(void) const

◆ GetTopLeft() [1/2]

Vector2D_t * Burger::Vector4D_t::GetTopLeft ( void )
inline

Get the top left corner of the rectangle.


This function casts a pointer to the x and y elements of the Vector4D_t to a Vector2D_t which represents the top-left corner of a rectangle.

Returns
Pointer to the top left corner of the rectangle
See also
GetBottomRight(void), GetTopLeft(void) const or GetWidth(void) const

◆ GetTopLeft() [2/2]

const Vector2D_t * Burger::Vector4D_t::GetTopLeft ( void ) const
inline

Get the top left corner of the rectangle.


This function casts a pointer to the x and y elements of the Vector4D_t to a Vector2D_t which represents the top-left corner of a rectangle.

Returns
Pointer to the top left corner of the rectangle
See also
GetBottomRight(void) const, GetTopLeft(void) or GetWidth(void) const

◆ GetW()

float Burger::Vector4D_t::GetW ( void ) const
inline

Return the w component of the vector.


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

◆ GetWidth()

float Burger::Vector4D_t::GetWidth ( void ) const
inline

Get the width of the rectangle.


This function subtracts the x component from the z component to create the width of the rectangle.

Returns
The width of the rectangle.
See also
GetHeight(void) const

◆ GetX()

float Burger::Vector4D_t::GetX ( void ) const
inline

Return the x component of the vector.


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

◆ GetY()

float Burger::Vector4D_t::GetY ( void ) const
inline

Return the y component of the vector.


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

◆ GetZ()

float Burger::Vector4D_t::GetZ ( void ) const
inline

Return the z component of the vector.


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

◆ Identity()

void Burger::Vector4D_t::Identity ( void )
inline

Initialize the vector elements to identity for a quaternion.


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

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

◆ Interpolate()

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

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 Vector4D_t structure for a factor of 0.0f
pToValid pointer to a Vector4D_t structure for a factor of 1.0f
fFactorScale value between 0.0f and 1.0f inclusive
See also
Vector2D_t::Interpolate() and Vector3D_t::Interpolate()

◆ IsInsideRect() [1/2]

uint_t Burger::Vector4D_t::IsInsideRect ( const Vector2D_t * pInput) const
inline

Test if a point is inside a rectangle.


Test the x,y coordinate in the Vector2D_t if it inside the rectangle this Vector4D_t represents.

Parameters
pInputPointer to a two dimensional point
Returns
TRUE if the point is inside the rectangle, FALSE if not.
See also
IsInsideRect(float,float) const or ExpandRect(const Vector2D_t *)

◆ IsInsideRect() [2/2]

uint_t Burger::Vector4D_t::IsInsideRect ( float fX,
float fY ) const
inline

Test if a point is inside a rectangle.


Test the x,y coordinate if it inside the rectangle this Vector4D_t represents.

Parameters
fXX coordinate to test
fYY coordinate to test
Returns
TRUE if the point is inside the rectangle, FALSE if not.
See also
IsInsideRect(const Vector2D_t *) const or ExpandRect(float,float)

◆ Mul() [1/4]

void Burger::Vector4D_t::Mul ( const Vector4D_t * pInput)
inline

Multiply another vector to this one.


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

◆ Mul() [2/4]

void Burger::Vector4D_t::Mul ( const Vector4D_t * pInput,
float fInput )
inline

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 Vector4D_t *) or Mul(const Vector4D_t *,const Vector4D_t *)

◆ Mul() [3/4]

void Burger::Vector4D_t::Mul ( const Vector4D_t * pInput1,
const Vector4D_t * pInput2 )
inline

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 Vector4D_t *) or Mul(const Vector4D_t *,float)

◆ Mul() [4/4]

void Burger::Vector4D_t::Mul ( float fInput)
inline

Multiply the same scalar value to each of member values.


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

◆ Negate() [1/3]

void Burger::Vector4D_t::Negate ( const Vector4D_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 Vector4D_t structure to copy and negate
See also
Negate(float,float,float,float) or Negate(void)

◆ Negate() [2/3]

void Burger::Vector4D_t::Negate ( float fX,
float fY,
float fZ,
float 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 Vector4D_t *) or Negate(void)

◆ Negate() [3/3]

void Burger::Vector4D_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 Vector4D_t *) or Negate(float,float,float,float)

◆ Normalize() [1/3]

void BURGER_API Burger::Vector4D_t::Normalize ( const Vector4D_t * pInput)

Copy a normalized 4D vector.


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

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

◆ Normalize() [2/3]

void BURGER_API Burger::Vector4D_t::Normalize ( float fX,
float fY,
float fZ,
float fW )

Copy a normalized 4D vector.


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

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

◆ Normalize() [3/3]

void BURGER_API Burger::Vector4D_t::Normalize ( void )

Normalize a 4D vector.


Set the 4D vector's length to 1.0f

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

◆ NormalizeFast() [1/3]

void BURGER_API Burger::Vector4D_t::NormalizeFast ( const Vector4D_t * pInput)

Copy a normalized 4D vector.


Make a copy of a 4D 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 Vector4D_t structure that will be copied and normalize
See also
NormalizeFast(void), NormalizeFast(float,float,float,float) or Normalize(const Vector4D_t *)

◆ NormalizeFast() [2/3]

void BURGER_API Burger::Vector4D_t::NormalizeFast ( float fX,
float fY,
float fZ,
float fW )

Copy a normalized 4D vector.


Make a copy of a 4D 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 4D vector to normalize
fYY value of the 4D vector to normalize
fZZ value of the 4D vector to normalize
fWW value of the 4D vector to normalize
See also
NormalizeFast(void), NormalizeFast(const Vector4D_t *) or Normalize(float,float,float,float)

◆ NormalizeFast() [3/3]

void BURGER_API Burger::Vector4D_t::NormalizeFast ( void )

Normalize a 4D vector (Good precision)


Set the 4D 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,float), NormalizeFast(const Vector4D_t *) or Normalize(void)

◆ One()

void Burger::Vector4D_t::One ( void )
inline

Set all values to 1.0f.


See also
Set(float,float,float,float) or Set(float,float,float)

◆ operator const float *()

Burger::Vector4D_t::operator const float * ( ) const
inline

Convert to a const float pointer.


This convenience operator converts the Vector4D_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!=()

uint_t Burger::Vector4D_t::operator!= ( const Vector4D_t & rInput) const
inline

Compare two Vector4D_t's for inequality.


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

◆ operator==()

uint_t Burger::Vector4D_t::operator== ( const Vector4D_t & rInput) const
inline

Compare two Vector4D_t's for equality.


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

◆ operator[]() [1/2]

float & Burger::Vector4D_t::operator[] ( uint_t uInput)
inline

Access the members as an array.


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

◆ operator[]() [2/2]

const float & Burger::Vector4D_t::operator[] ( uint_t uInput) const
inline

Access the members as an array.


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

◆ QuaternionMul() [1/2]

void BURGER_API Burger::Vector4D_t::QuaternionMul ( const Vector4D_t * pInput)

Multiply a quaternion by another quaternion.


Apply the multiplication using this formula from Wikipedia http://en.wikipedia.org/wiki/Quaternion#Ordered_list_form

Quaternion 1 is this instance and Quaternion2 is the parameter

x = ((y1*z2)-(z1*y2))+(w1*x2)+(x1*w2);
y = ((z1*x2)-(x1*z2))+(w1*y2)+(y1*w2);
z = ((x1*y2)-(y1*x2))+(w1*z2)+(z1*w2);
w = (w1*w2)-((x1*x2)+(y1*y2)+(z1*z2));
float w
32 bit floating point W value for the 4D Vector (BottomY)
Definition burger.h:16650
float x
32 bit floating point X value for the 4D Vector (LeftX)
Definition burger.h:16647
float z
32 bit floating point Z value for the 4D Vector (RightX)
Definition burger.h:16649
float y
32 bit floating point Y value for the 4D Vector (TopY)
Definition burger.h:16648
Parameters
pInputValid pointer to a Vector4D_t quaternion to multiply against
See also
QuaternionMul(const Vector4D_t *,const Vector4D_t *)

◆ QuaternionMul() [2/2]

void BURGER_API Burger::Vector4D_t::QuaternionMul ( const Vector4D_t * pInput1,
const Vector4D_t * pInput2 )

Multiply a quaternion by another quaternion and store it here.


Apply the multiplication using this formula from Wikipedia http://en.wikipedia.org/wiki/Quaternion#Ordered_list_form

Quaternion 1 is the first parameter and Quaternion2 is the second parameter

x = ((y1*z2)-(z1*y2))+(w1*x2)+(x1*w2);
y = ((z1*x2)-(x1*z2))+(w1*y2)+(y1*w2);
z = ((x1*y2)-(y1*x2))+(w1*z2)+(z1*w2);
w = (w1*w2)-((x1*x2)+(y1*y2)+(z1*z2));
Parameters
pInput1Valid pointer to a Vector4D_t quaternion to multiply with
pInput2Valid pointer to a Vector4D_t quaternion to multiply against
See also
QuaternionMul(const Vector4D_t *)

◆ QuaternionMulNormalize() [1/2]

void BURGER_API Burger::Vector4D_t::QuaternionMulNormalize ( const Vector4D_t * pInput)

Multiply a quaternion by another quaternion.


Apply the multiplication using this formula from Wikipedia http://en.wikipedia.org/wiki/Quaternion#Ordered_list_form

Quaternion 1 is this instance and Quaternion2 is the parameter

x = ((y1*z2)-(z1*y2))+(w1*x2)+(x1*w2);
y = ((z1*x2)-(x1*z2))+(w1*y2)+(y1*w2);
z = ((x1*y2)-(y1*x2))+(w1*z2)+(z1*w2);
w = (w1*w2)-((x1*x2)+(y1*y2)+(z1*z2));

Afterwards, the quaternion is normalized

Parameters
pInputValid pointer to a Vector4D_t quaternion to multiply against
See also
QuaternionMulNormalize(const Vector4D_t *,const Vector4D_t *) or Normalize(void)

◆ QuaternionMulNormalize() [2/2]

void BURGER_API Burger::Vector4D_t::QuaternionMulNormalize ( const Vector4D_t * pInput1,
const Vector4D_t * pInput2 )

Multiply a quaternion by another quaternion and store it here.


Apply the multiplication using this formula from Wikipedia http://en.wikipedia.org/wiki/Quaternion#Ordered_list_form

Quaternion 1 is the first parameter and Quaternion2 is the second parameter

x = ((y1*z2)-(z1*y2))+(w1*x2)+(x1*w2);
y = ((z1*x2)-(x1*z2))+(w1*y2)+(y1*w2);
z = ((x1*y2)-(y1*x2))+(w1*z2)+(z1*w2);
w = (w1*w2)-((x1*x2)+(y1*y2)+(z1*z2));

Afterwards, the quaternion is normalized

Parameters
pInput1Valid pointer to a Vector4D_t quaternion to multiply with
pInput2Valid pointer to a Vector4D_t quaternion to multiply against
See also
QuaternionMulNormalize(const Vector4D_t *) or Normalize(void)

◆ QuaternionNegate() [1/3]

void Burger::Vector4D_t::QuaternionNegate ( const Vector4D_t * pInput)
inline

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


Copy the input data and negate it in the form of -x, -y, -z and w

Parameters
pInputValid pointer to a Vector4D_t structure to copy and negate as a quaternion
See also
QuaternionNegate(float,float,float,float) or QuaternionNegate(void)

◆ QuaternionNegate() [2/3]

void Burger::Vector4D_t::QuaternionNegate ( float fX,
float fY,
float fZ,
float fW )
inline

Negate the input quaternion 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
QuaternionNegate(const Vector4D_t *) or QuaternionNegate(void)

◆ QuaternionNegate() [3/3]

void Burger::Vector4D_t::QuaternionNegate ( void )
inline

Negate a quaternion.


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

See also
QuaternionNegate(const Vector4D_t *) or QuaternionNegate(float,float,float,float)

◆ Set() [1/6]

void BURGER_API Burger::Vector4D_t::Set ( const FixedVector4D_t * pInput)

Convert a fixed point vector into a floating point vector.


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

◆ Set() [2/6]

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

Copy a Vector4D_t.


Make a copy of a Vector4D_t

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

◆ Set() [3/6]

void Burger::Vector4D_t::Set ( float fInput)
inline

Set all of the members to specific value.


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

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

◆ Set() [4/6]

void Burger::Vector4D_t::Set ( float fX,
float fY )
inline

Set the values to specific values.


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

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

◆ Set() [5/6]

void Burger::Vector4D_t::Set ( float fX,
float fY,
float fZ )
inline

Set the values to specific values.


Sets the x, y and z values to specific values. w is set to 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() [6/6]

void Burger::Vector4D_t::Set ( float fX,
float fY,
float fZ,
float fW )
inline

Set the values to specific values.


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

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

◆ SetBottom()

void Burger::Vector4D_t::SetBottom ( float fBottom)
inline

Set the bottom most Y coordinate of a rectangle.


Set the bottom most Y coordinate to a specific value. No bounds checking is performed to prevent unsorted rectangles.

Parameters
fBottomRequested bottom most Y coordinate of the rectangle.
See also
GetBottom(void) const or SetTop(float)

◆ SetHeight()

void Burger::Vector4D_t::SetHeight ( float fHeight)
inline

Set the height of a rectangle.


Set the bottom most Y coordinate so the rectangle will be the requested height. No bounds checking is performed, so unsorted rectangles are possible on overflow or underflow input.

Parameters
fHeightRequested height of the rectangle.
See also
GetHeight() const or SetWidth(float)

◆ SetLeft()

void Burger::Vector4D_t::SetLeft ( float fLeft)
inline

Set the left most X coordinate of a rectangle.


Set the left most X coordinate to a specific value. No bounds checking is performed to prevent unsorted rectangles.

Parameters
fLeftRequested left most X coordinate of the rectangle.
See also
GetLeft(void) const or SetRight(float)

◆ SetLength()

void BURGER_API Burger::Vector4D_t::SetLength ( float fInput)

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


Set the 4D 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::Vector4D_t::SetLengthFast ( float fInput)

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)

◆ SetRect() [1/3]

void Burger::Vector4D_t::SetRect ( const Vector2D_t * pMin,
const Vector2D_t * pMax )
inline

Set the values to as if it's a rectangle.


Sets the x and y values to pMin and z and w to pMax. This treats the Vector4D_t as if it's a rectangle.

Parameters
pMinPointer to a point that will be used as the upper left corner.
pMaxPointer to a point that will be used as the lower right corner.
See also
Zero(void), SetRect(float,float) or SetRect(const Vector2D_t *)

◆ SetRect() [2/3]

void Burger::Vector4D_t::SetRect ( const Vector2D_t * pMinMax)
inline

Set the values to as if it's a rectangle.


Sets the x and z values to pMinMax->x and y and w to pMinMax->y. This treats the Vector4D_t as if it's a rectangle that's a single point.

Parameters
pMinMaxPointer to a point that will be used as the minimum and maximum size.
See also
Zero(void), SetRect(float,float) or SetRect(const Vector2D_t *,const Vector2D_t *)

◆ SetRect() [3/3]

void Burger::Vector4D_t::SetRect ( float fX,
float fY )
inline

Set the values to as if it's a rectangle.


Sets the x and z values to fX and y and w to fY. This treats the Vector4D_t as if it's a rectangle that's a single point.

Parameters
fXNew x and z value
fYNew y and w value
See also
Zero(void), SetRect(const Vector2D_t *) or SetRect(const Vector2D_t *,const Vector2D_t *)

◆ SetRight()

void Burger::Vector4D_t::SetRight ( float fRight)
inline

Set the right most X coordinate of a rectangle.


Set the right most X coordinate to a specific value. No bounds checking is performed to prevent unsorted rectangles.

Parameters
fRightRequested right most X coordinate of the rectangle.
See also
GetRight(void) const or SetLeft(float)

◆ SetSize()

void Burger::Vector4D_t::SetSize ( float fWidth,
float fHeight )
inline

Set the size of a rectangle.


Set the right most X coordinate and the bottom most Y coordinate so the rectangle will be the requested width and height. No bounds checking is performed, so unsorted rectangles are possible on overflow or underflow input.

Parameters
fWidthRequested width of the rectangle.
fHeightRequested height of the rectangle.
See also
GetWidth(void) const, GetHeight(void) const, SetWidth(float) or SetHeight(float)

◆ SetTop()

void Burger::Vector4D_t::SetTop ( float fTop)
inline

Set the top most Y coordinate of a rectangle.


Set the top most X coordinate to a specific value. No bounds checking is performed to prevent unsorted rectangles.

Parameters
fTopRequested top most Y coordinate of the rectangle.
See also
GetTop(void) const or SetBottom(float)

◆ SetW()

void Burger::Vector4D_t::SetW ( float fW)
inline

Set the w component of the vector.


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

◆ SetWidth()

void Burger::Vector4D_t::SetWidth ( float fWidth)
inline

Set the width of a rectangle.


Set the right most X coordinate so the rectangle will be the requested width. No bounds checking is performed, so unsorted rectangles are possible on overflow or underflow input.

Parameters
fWidthRequested width of the rectangle.
See also
GetWidth(void) const or SetHeight(float)

◆ SetX()

void Burger::Vector4D_t::SetX ( float 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::Vector4D_t::SetY ( float 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::Vector4D_t::SetZ ( float fZ)
inline

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::Vector4D_t::Sub ( const Vector4D_t * pInput)
inline

Subtract another vector from this one.


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

◆ Sub() [2/4]

void Burger::Vector4D_t::Sub ( const Vector4D_t * pInput,
float fInput )
inline

Subtract 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 subtract the scalar from
fInputScalar to subtract from the vector
See also
Sub(float), Sub(const Vector4D_t *) or Sub(const Vector4D_t *,const Vector4D_t *)

◆ Sub() [3/4]

void Burger::Vector4D_t::Sub ( const Vector4D_t * pInput1,
const Vector4D_t * pInput2 )
inline

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 Vector4D_t *) or Sub(const Vector4D_t *,float)

◆ Sub() [4/4]

void Burger::Vector4D_t::Sub ( float fInput)
inline

Subtract the same scalar value from each of member values.


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

◆ Zero()

void Burger::Vector4D_t::Zero ( void )
inline

Set all values to zero.


See also
Set(float,float,float,float) or Set(float,float,float)

Member Data Documentation

◆ w

float Burger::Vector4D_t::w

32 bit floating point W value for the 4D Vector (BottomY)

◆ x

float Burger::Vector4D_t::x

32 bit floating point X value for the 4D Vector (LeftX)

◆ y

float Burger::Vector4D_t::y

32 bit floating point Y value for the 4D Vector (TopY)

◆ z

float Burger::Vector4D_t::z

32 bit floating point Z value for the 4D Vector (RightX)