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

2 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.
 
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 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 (const Vector2D_t *pInput) noexcept
 Copy a Vector2D_t.
 
void Set (const FixedVector2D_t *pInput) noexcept
 Convert a fixed point vector into a floating point vector.
 
void Negate (void) noexcept
 Negate a 2D vector.
 
void Negate (float fX, float fY) noexcept
 Negate the input and store it in this structure.
 
void Negate (const Vector2D_t *pInput) noexcept
 Make a copy of the input after it's been negated.
 
void Interpolate (const Vector2D_t *pFrom, const Vector2D_t *pTo, float fFactor) noexcept
 Interpolate between two vectors.
 
float Dot (float fX, float fY) const noexcept
 Return a dot product of two 2D vectors.
 
float Dot (const Vector2D_t *pInput) const noexcept
 Return a dot product of two 2D vectors.
 
void Add (const Vector2D_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 Vector2D_t *pInput1, const Vector2D_t *pInput2) noexcept
 Add two vectors and store the result in this vector.
 
void Add (const Vector2D_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 Vector2D_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 Vector2D_t *pInput1, const Vector2D_t *pInput2) noexcept
 Subtract two vectors and store the result in this vector.
 
void Sub (const Vector2D_t *pInput, float fInput) noexcept
 Subtract a vector and a scalar to every member of the vector and store the result in this vector.
 
void Mul (const Vector2D_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 Vector2D_t *pInput1, const Vector2D_t *pInput2) noexcept
 Multiply two vectors and store the result in this vector.
 
void Mul (const Vector2D_t *pInput, float fInput) noexcept
 Multiply a vector and a scalar to every member of the vector and store the result in this vector.
 
float Cross (float fX, float fY) const noexcept
 Return a cross product of two 2D vectors.
 
float Cross (const Vector2D_t *pInput) const noexcept
 Return a cross product of two 2D vectors.
 
float GetLengthSquared (void) const noexcept
 Returns the square of the length of a 2D 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 2D vector to a specific length (High precision)
 
void SetLengthFast (float fInput) noexcept
 Normalize a 2D vector to a specific length (Good precision)
 
float GetDistanceSquared (float fX, float fY) const noexcept
 Returns the square of the distance between two 2D points.
 
float GetDistanceSquared (const Vector2D_t *pInput) const noexcept
 Returns the square of the distance between two 2D points.
 
float GetDistance (float fX, float fY) const noexcept
 Returns the square of the distance between two 2D points.
 
float GetDistance (const Vector2D_t *pInput) const noexcept
 Returns the square of the distance between two 2D points.
 
float GetDistanceFast (float fX, float fY) const noexcept
 Returns the square of the distance between two 2D points (Good precision).
 
float GetDistanceFast (const Vector2D_t *pInput) const noexcept
 Returns the square of the distance between two 2D points (Good precision).
 
void Normalize (void) noexcept
 Normalize a 2D vector.
 
void Normalize (float fX, float fY) noexcept
 Copy a normalized 2D vector.
 
void Normalize (const Vector2D_t *pInput) noexcept
 Copy a normalized 2D vector.
 
void NormalizeFast (void) noexcept
 Normalize a 2D vector (Good precision)
 
void NormalizeFast (float fX, float fY) noexcept
 Copy a normalized 2D vector.
 
void NormalizeFast (const Vector2D_t *pInput) noexcept
 Copy a normalized 2D vector.
 
uint_t BitwiseEqual (const Vector2D_t *pInput) const noexcept
 Compare two Vector2D_t's for bitwise equality.
 
float Determinant (const Vector2D_t *pInput1, const Vector2D_t *pInput2) const noexcept
 Calculate the determinant between three points.
 
uint_t IsPointInTriangle (const Vector2D_t *pVertex1, const Vector2D_t *pVertex2, const Vector2D_t *pVertex3) const noexcept
 Determine if a point is inside of a triangle.
 
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 Vector2D_t &rInput) const noexcept
 Compare two Vector2D_t's for equality.
 
uint_t operator!= (const Vector2D_t &rInput) const noexcept
 Compare two Vector2D_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 2D Vector
 
float y
 32 bit floating point Y value for the 2D Vector
 

Detailed Description

2 dimensional floating point vector


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

Member Function Documentation

◆ Add() [1/4]

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

Add another vector to this one.


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

◆ Add() [2/4]

void Burger::Vector2D_t::Add ( const Vector2D_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 Vector2D_t *) or Add(const Vector2D_t *,const Vector2D_t *)

◆ Add() [3/4]

void Burger::Vector2D_t::Add ( const Vector2D_t * pInput1,
const Vector2D_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 Vector2D_t *) or Add(const Vector2D_t *,float)

◆ Add() [4/4]

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

Add the same scalar value to each of member values.


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

◆ BitwiseEqual()

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

Compare two Vector2D_t's for bitwise equality.


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

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

◆ Cross() [1/2]

float Burger::Vector2D_t::Cross ( const Vector2D_t * pInput) const
inlinenoexcept

Return a cross product of two 2D vectors.


Calculate the cross product between two 2D vectors as if they were two 3D vectors and the z components were zero. The end result is the new z component for the perpendicular vector

Parameters
pInputValid pointer to a Vector2D_t structure to perform a cross product against
Returns
Cross product of the two vectors
See also
Cross(float,float) const

◆ Cross() [2/2]

float Burger::Vector2D_t::Cross ( float fX,
float fY ) const
inlinenoexcept

Return a cross product of two 2D vectors.


Calculate the cross product between two 2D vectors as if they were two 3D vectors and the z components were zero. The end result is the new z component for the perpendicular vector

Parameters
fXX value to cross against
fYY value to cross against
Returns
Cross product of the two vectors
See also
Cross(const Vector2D_t *) const

◆ Determinant()

float Burger::Vector2D_t::Determinant ( const Vector2D_t * pInput1,
const Vector2D_t * pInput2 ) const
inlinenoexcept

Calculate the determinant between three points.


Using the formula ((pInput1->x-x) * (pInput2->y-y)) - ((pInput1->y-y) * (pInput2->x-x)), calculate the determinant and return the result. Used for determining if a point is on a side of a vector or on the vector.

Parameters
pInput1Pointer to the point that produces the primary vector.
pInput2Pointer to the point that produces the vector to test with.
Returns
Zero if they are identical directions, negative for one side, positive for the other side.

◆ Dot() [1/2]

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

Return a dot product of two 2D vectors.


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

◆ Dot() [2/2]

float Burger::Vector2D_t::Dot ( float fX,
float fY ) const
inlinenoexcept

Return a dot product of two 2D vectors.


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

◆ GetDistance() [1/2]

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

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


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

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

◆ GetDistance() [2/2]

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

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


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

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

◆ GetDistanceFast() [1/2]

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

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


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

◆ GetDistanceFast() [2/2]

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

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


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

◆ GetDistanceSquared() [1/2]

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

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


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

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

◆ GetDistanceSquared() [2/2]

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

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


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

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

◆ GetLength()

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

Return the length of a vector (High precision)


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

◆ GetLengthFast()

float Burger::Vector2D_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)
See also
GetLength(void) const or GetLengthSquared(void) const

◆ GetLengthSquared()

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

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


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

◆ GetX()

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

Return the x component of the vector.


Returns
The x component of the vector.
See also
GetY(void) const or SetX(float)

◆ GetY()

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

Return the y component of the vector.


Returns
The y component of the vector.
See also
GetX(void) const or SetY(float)

◆ Interpolate()

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

◆ IsPointInTriangle()

uint_t BURGER_API Burger::Vector2D_t::IsPointInTriangle ( const Vector2D_t * pVertex1,
const Vector2D_t * pVertex2,
const Vector2D_t * pVertex3 ) const
noexcept

Determine if a point is inside of a triangle.


Test the point against the three arcs generated by the three triangle points and if the point is within all of the arcs, return TRUE since the point is inside the triangle.

Note
This function will also return TRUE if the point is on the triangle edges.
Parameters
pVertex1Pointer to the first vertex of the triangle.
pVertex2Pointer to the second vertex of the triangle.
pVertex3Pointer to the third vertex of the triangle.
Returns
TRUE if the point is inside the triangle, FALSE if not.

◆ Mul() [1/4]

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

Multiply another vector to this one.


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

◆ Mul() [2/4]

void Burger::Vector2D_t::Mul ( const Vector2D_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 Vector2D_t *) or Mul(const Vector2D_t *,const Vector2D_t *)

◆ Mul() [3/4]

void Burger::Vector2D_t::Mul ( const Vector2D_t * pInput1,
const Vector2D_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 Vector2D_t *) or Mul(const Vector2D_t *,float)

◆ Mul() [4/4]

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

Multiply the same scalar value to each of member values.


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

◆ Negate() [1/3]

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

◆ Negate() [2/3]

void Burger::Vector2D_t::Negate ( float fX,
float fY )
inlinenoexcept

Negate the input and store it in this structure.


Set the x and y value to -fX and -fY respectively

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

◆ Negate() [3/3]

void Burger::Vector2D_t::Negate ( void )
inlinenoexcept

Negate a 2D vector.


Set the x and y value to -x and -y respectively

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

◆ Normalize() [1/3]

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

Copy a normalized 2D vector.


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

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

◆ Normalize() [2/3]

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

Copy a normalized 2D vector.


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

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

◆ Normalize() [3/3]

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

Normalize a 2D vector.


Set the 2D vector's length to 1.0f

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

◆ NormalizeFast() [1/3]

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

Copy a normalized 2D vector.


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

◆ NormalizeFast() [2/3]

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

Copy a normalized 2D vector.


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

◆ NormalizeFast() [3/3]

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

Normalize a 2D vector (Good precision)


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

◆ One()

void Burger::Vector2D_t::One ( void )
inlinenoexcept

Set all values to 1.0f.


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

◆ operator const float *()

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

Convert to a const float pointer.


This convenience operator converts the Vector2D_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::Vector2D_t::operator!= ( const Vector2D_t & rInput) const
inlinenoexcept

Compare two Vector2D_t's for inequality.


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

◆ operator==()

uint_t Burger::Vector2D_t::operator== ( const Vector2D_t & rInput) const
inlinenoexcept

Compare two Vector2D_t's for equality.


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

◆ operator[]() [1/2]

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

Access the members as an array.


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

◆ operator[]() [2/2]

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

Access the members as an array.


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

◆ Set() [1/4]

void BURGER_API Burger::Vector2D_t::Set ( const FixedVector2D_t * pInput)
noexcept

Convert a fixed point vector into a floating point vector.


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

◆ Set() [2/4]

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

Copy a Vector2D_t.


Make a copy of a Vector2D_t

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

◆ Set() [3/4]

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

Set all of the members to specific value.


Sets the x and y values to a specific value

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

◆ Set() [4/4]

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

Set the values to specific values.


Sets the x and y values to specific values

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

◆ SetLength()

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

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


Set the 2D 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::Vector2D_t::SetLengthFast ( float fInput)
noexcept

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


Set the 2D 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::Vector2D_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 or SetY(float)

◆ SetY()

void Burger::Vector2D_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 or SetX(float)

◆ Sub() [1/4]

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

Subtract another vector from this one.


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

◆ Sub() [2/4]

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

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

◆ Sub() [3/4]

void Burger::Vector2D_t::Sub ( const Vector2D_t * pInput1,
const Vector2D_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 Vector2D_t *) or Sub(const Vector2D_t *,float)

◆ Sub() [4/4]

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

Subtract the same scalar value from each of member values.


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

◆ Zero()

void Burger::Vector2D_t::Zero ( void )
inlinenoexcept

Set all values to zero.


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

Member Data Documentation

◆ x

float Burger::Vector2D_t::x

32 bit floating point X value for the 2D Vector

◆ y

float Burger::Vector2D_t::y

32 bit floating point Y value for the 2D Vector