Collection of math tools.
More...
|
static float | MathTools::FastSqrt (float x) |
| Calculate Sqrt without std::sqrt.
|
|
static float | MathTools::RandFloat (float lower, float upper) |
| Generates Random Floating Point Number using std::random_device.
|
|
static float | MathTools::DegToRad (float a) |
| Converts angle in degrees to angle in radians.
|
|
static float | MathTools::RadToDeg (float a) |
| Converts angle in radians to angle in degrees.
|
|
static std::vector< Vect > | MathTools::ScreenToWorldPersp (float x, float y) |
| Takes a screen position and returns the world position at the near and far clip plane.
|
|
Collection of math tools.
◆ DegToRad()
float MathTools::DegToRad |
( |
float | a | ) |
|
|
static |
Converts angle in degrees to angle in radians.
- Parameters
-
- Returns
- float
◆ FastSqrt()
float MathTools::FastSqrt |
( |
float | x | ) |
|
|
static |
Calculate Sqrt without std::sqrt.
union { float f; uint32_t i; } u = { x };
u.i = 0x1FBD1DF5 + (u.i >> 1);
return u.f;
}
- Parameters
-
- Returns
- float
◆ RadToDeg()
float MathTools::RadToDeg |
( |
float | a | ) |
|
|
static |
Converts angle in radians to angle in degrees.
- Parameters
-
- Returns
- float
◆ RandFloat()
float MathTools::RandFloat |
( |
float | lower, |
|
|
float | upper ) |
|
static |
Generates Random Floating Point Number using std::random_device.
- Parameters
-
- Returns
- float
◆ ScreenToWorldPersp()
std::vector< Vect > MathTools::ScreenToWorldPersp |
( |
float | x, |
|
|
float | y ) |
|
static |
Takes a screen position and returns the world position at the near and far clip plane.
- Parameters
-
- Returns
- std::vector<Vect>