|
soo
3D game math library
|
Namespace for utility functions. More...
Functions | |
| template<typename T> requires std::is_arithmetic_v<T> | |
| bool | isEqual (const T a, const T b, const T tolerance=DEFAULT_TOLERANCE) |
| template<std::ranges::range Range> requires std::is_arithmetic_v<std::ranges::range_value_t<Range>> | |
| bool | isEqual (const Range &a, const Range &b, const std::ranges::range_value_t< Range > tolerance=DEFAULT_TOLERANCE) |
| template<typename T> requires std::is_arithmetic_v<T> | |
| bool | isZero (const T num, const T tolerance=DEFAULT_TOLERANCE) |
| template<typename T, std::floating_point FP> | |
| T | lerp (const T a, const T b, const FP alpha) |
Variables | |
| constexpr double | DEFAULT_TOLERANCE = 1e-8 |
Namespace for utility functions.
| bool soo::util::isEqual | ( | const Range & | a, |
| const Range & | b, | ||
| const std::ranges::range_value_t< Range > | tolerance = DEFAULT_TOLERANCE ) |
Compares elements of two containers.
| Range | Elements' type must be arithmetic. |
| bool soo::util::isEqual | ( | const T | a, |
| const T | b, | ||
| const T | tolerance = DEFAULT_TOLERANCE ) |
| T | Arithmetic types only. |
| bool soo::util::isZero | ( | const T | num, |
| const T | tolerance = DEFAULT_TOLERANCE ) |
| T | Arithmetic types only. |
| T soo::util::lerp | ( | const T | a, |
| const T | b, | ||
| const FP | alpha ) |
Linear interpolation between two values.
| T | Floating-point type. |
| a | First value. |
| b | Second value. |
| alpha | Interpolation factor (0.0 ~ 1.0). |
|
constexpr |
Used as the default arguments in comparison functions.