Elaztek Developer Hub
Blamite Game Engine - Strings  00427.01.12.25.2146.blamite
A library containing general purpose utilities and classes for use in multiple projects.
BlamStrings::Utils::Math Namespace Reference

Namespace containing math-related utilities. More...

Functions

STRINGS_API bool FloatIsInteger (float float_value)
 Determines whether or not the specified float is a valid integer. More...
 
STRINGS_API float FloatDegreesToRadians (float float_value)
 Converts a float value from Degrees to Radians. More...
 
STRINGS_API float FloatRadiansToDegrees (float float_value)
 Converts a float value from Radians to Degrees. More...
 
STRINGS_API uint64_t GenerateRandomUInt64 ()
 Generates a random unsigned 64-bit integer. More...
 
STRINGS_API float GetDistance2D (float x1, float y1, float x2, float y2)
 Calculates the distance between two points in 2D space. More...
 
STRINGS_API float GetDistance2D (BlamVector2 first, BlamVector2 second)
 Calculates the distance between two points in 2D space. More...
 
STRINGS_API BlamVector4 GetQuaternionFromRotation (BlamVector3 quaternion)
 Generates a quaternion from XYZ (Yaw, Pitch, Roll) rotation angles. More...
 
STRINGS_API float Normalize (float value, float min, float max)
 Normalizes a value between a minimum and maximum range. More...
 

Detailed Description

Namespace containing math-related utilities.

Function Documentation

◆ FloatDegreesToRadians()

float BlamStrings::Utils::Math::FloatDegreesToRadians ( float  float_value)

Converts a float value from Degrees to Radians.

Parameters
float_value- The value to convert, in degrees.
Returns
The value, converted to radians.
+ Here is the caller graph for this function:

◆ FloatIsInteger()

bool BlamStrings::Utils::Math::FloatIsInteger ( float  float_value)

Determines whether or not the specified float is a valid integer.

Will return false if the float value is more than 0.00001 away from an even number.

Parameters
float_value- The float to evaluate.
Returns
true if the float in an integer, false if it is not.

◆ FloatRadiansToDegrees()

float BlamStrings::Utils::Math::FloatRadiansToDegrees ( float  float_value)

Converts a float value from Radians to Degrees.

Parameters
float_value- The value to convert, in radians.
Returns
The value, converted to degrees.
+ Here is the caller graph for this function:

◆ GenerateRandomUInt64()

uint64_t BlamStrings::Utils::Math::GenerateRandomUInt64 ( )

Generates a random unsigned 64-bit integer.

Returns
A random unsigned 64-bit integer.

◆ GetDistance2D() [1/2]

float BlamStrings::Utils::Math::GetDistance2D ( BlamVector2  first,
BlamVector2  second 
)

Calculates the distance between two points in 2D space.

Parameters
first- The first point.
second- The second point.
Returns
The distance between the first and second set of X/Y coordinates.
+ Here is the call graph for this function:

◆ GetDistance2D() [2/2]

float BlamStrings::Utils::Math::GetDistance2D ( float  x1,
float  y1,
float  x2,
float  y2 
)

Calculates the distance between two points in 2D space.

Parameters
x1- The X coordinate of the first point.
y1- The Y coordinate of the first point.
x2- The X coordinate of the second point.
y2- The Y coordinate of the second point.
Returns
The distance between the first and second set of X/Y coordinates.
+ Here is the caller graph for this function:

◆ GetQuaternionFromRotation()

BlamVector4 BlamStrings::Utils::Math::GetQuaternionFromRotation ( BlamVector3  quaternion)

Generates a quaternion from XYZ (Yaw, Pitch, Roll) rotation angles.

Parameters
rotation- The rotation vector containing yaw, pitch, and roll. All values should be in degrees, not radians.
Returns
A BlamVector4 representing the quaternion.
+ Here is the call graph for this function:

◆ Normalize()

float BlamStrings::Utils::Math::Normalize ( float  value,
float  min,
float  max 
)

Normalizes a value between a minimum and maximum range.

If the provided value is outside of the range (ie, above the max value or below the min value), then it will be clamped to the minimum or maximum value.

Parameters
value- The value to normalize.
min- The lower bound of the range.
max- The upper bound of the range.
Returns
The normalized value between the specified range.