OSSIA
Open Scenario System for Interactive Application
|
This file contains various mathematical constants and utilities
Go to the source code of this file.
Namespaces | |
ossia | |
Functions | |
template<typename T > | |
T | ossia::ipow (T x, int N) noexcept |
template<typename T > | |
auto | ossia::norm (T x, T y) noexcept |
template<typename T > | |
auto | ossia::norm (T x, T y, T z) noexcept |
constexpr size_t | ossia::constexpr_log2 (size_t n) noexcept |
template<typename T > | |
constexpr size_t | ossia::constexpr_abs (T n) noexcept |
template<typename T > | |
constexpr int64_t | ossia::constexpr_floor (T val) noexcept |
template<typename T > | |
constexpr int64_t | ossia::constexpr_ceil (T f) |
template<class T , class U > | |
constexpr OSSIA_INLINE auto | ossia::max (const T a, const U b) noexcept -> typename std::conditional<(sizeof(T) > sizeof(U)), T, U >::type |
max function tailored for values | |
template<class T , class U > | |
constexpr OSSIA_INLINE auto | ossia::min (const T a, const U b) noexcept -> typename std::conditional<(sizeof(T) > sizeof(U)), T, U >::type |
min function tailored for values | |
template<class T > | |
constexpr OSSIA_INLINE T | ossia::clamp (T d, const T min, const T max) noexcept |
clamp Returns the value bounded by a min and a max | |
template<class T > | |
constexpr OSSIA_INLINE T | ossia::wrap (const T val, const T low, const T high) noexcept |
template<class T > | |
constexpr OSSIA_INLINE T | ossia::fold (const T val, const T low, const T high) noexcept |
template<class T > | |
constexpr OSSIA_INLINE std::pair< T, T > | ossia::div (T num, T denom) noexcept |
OSSIA_INLINE float | ossia::log_to_normalized (float min, float range, float val) noexcept |
OSSIA_INLINE float | ossia::normalized_to_log (float min, float range, float val) noexcept |
template<typename T , typename R > | |
constexpr OSSIA_INLINE bool | ossia::valid_index (T idx, const R &range) noexcept |