#include <random>
Go to the source code of this file.
|
| constexpr float | core::Abs (float v) |
| | Abs is a constexpr function that returns the absolute value. More...
|
| |
|
constexpr bool | core::Equal (float a, float b, float epsilon=0.0000001f) |
| |
| constexpr float | core::Lerp (float start, float end, float t) |
| | Lerp is a function calculating the linear interpolation between two points. More...
|
| |
| template<typename T > |
| constexpr float | core::Clamp (T value, T lower, T upper) |
| | Clamp is a math function that clamps the input value between an upper and lower value. More...
|
| |
|
template<typename T > |
| std::enable_if< std::is_integral< T >::value, T >::type | core::RandomRange (T start, T end) |
| |
|
template<typename T > |
| std::enable_if< std::is_floating_point< T >::value, T >::type | core::RandomRange (T start, T end) |
| |
|
template<typename T > |
| T constexpr | core::SqrtNewtonRaphson (T x, T curr, T prev) |
| |
| template<typename T > |
| T constexpr | core::Sqrt (T x) |
| | Sqrt is a constexpr version of the square root. More...
|
| |
◆ Abs()
| constexpr float core::Abs |
( |
float |
v | ) |
|
|
constexpr |
Abs is a constexpr function that returns the absolute value.
- Parameters
-
| v | is the value that will be transform to absolute value |
- Returns
- the absolute value of v
◆ Clamp()
template<typename T >
| constexpr float core::Clamp |
( |
T |
value, |
|
|
T |
lower, |
|
|
T |
upper |
|
) |
| |
|
constexpr |
Clamp is a math function that clamps the input value between an upper and lower value.
- Template Parameters
-
| T | is the inputs and outputs type |
- Parameters
-
| value | is the input value that will be clamped |
| lower | is the lower bound of the clamp |
| upper | is the upper bound of the clamp |
- Returns
- the clamped value between lower and upper
◆ Lerp()
| constexpr float core::Lerp |
( |
float |
start, |
|
|
float |
end, |
|
|
float |
t |
|
) |
| |
|
constexpr |
Lerp is a function calculating the linear interpolation between two points.
- Parameters
-
| start | is the lower value of the interpolation. |
| end | is the upper value of the interpolation. |
| t | is the ratio of the interpolation. t = 0, return start t = 1, return end t > 1 or t < 0, return an extrapolation of the linear function |
- Returns
- the linear interpolation result
◆ Sqrt()
template<typename T >
| T constexpr core::Sqrt |
( |
T |
x | ) |
|
|
constexpr |
Sqrt is a constexpr version of the square root.
- Template Parameters
-
| T | is the input and output value type |
- Parameters
-
- Returns
- For a finite and non-negative value of "x", returns an approximation for the square root of "x"
- Otherwise, returns NaN