|
template<class T > |
bool | Dviglo::Equals (T lhs, T rhs) |
|
template<class T , class U > |
T | Dviglo::Lerp (T lhs, T rhs, U t) |
|
template<class T > |
T | Dviglo::InverseLerp (T lhs, T rhs, T x) |
|
template<class T , class U > |
T | Dviglo::Min (T lhs, U rhs) |
|
template<class T , class U > |
T | Dviglo::Max (T lhs, U rhs) |
|
template<class T > |
T | Dviglo::Abs (T value) |
|
template<class T > |
T | Dviglo::Sign (T value) |
|
template<class T > |
T | Dviglo::ToRadians (const T degrees) |
| Convert degrees to radians.
|
|
template<class T > |
T | Dviglo::ToDegrees (const T radians) |
| Convert radians to degrees.
|
|
unsigned | Dviglo::FloatToRawIntBits (float value) |
| Return a representation of the specified floating-point value as a single format bit layout.
|
|
template<class T > |
bool | Dviglo::IsNaN (T value) |
|
template<class T > |
bool | Dviglo::IsInf (T value) |
| Check whether a floating point value is positive or negative infinity.
|
|
template<class T > |
T | Dviglo::Clamp (T value, T min, T max) |
|
template<class T > |
T | Dviglo::SmoothStep (T lhs, T rhs, T t) |
|
template<class T > |
T | Dviglo::Sin (T angle) |
|
template<class T > |
T | Dviglo::Cos (T angle) |
|
template<class T > |
T | Dviglo::Tan (T angle) |
|
template<class T > |
T | Dviglo::Asin (T x) |
|
template<class T > |
T | Dviglo::Acos (T x) |
|
template<class T > |
T | Dviglo::Atan (T x) |
|
template<class T > |
T | Dviglo::Atan2 (T y, T x) |
|
template<class T > |
T | Dviglo::Pow (T x, T y) |
|
template<class T > |
T | Dviglo::Ln (T x) |
|
template<class T > |
T | Dviglo::Sqrt (T x) |
|
template<class T , typename std::enable_if< std::is_floating_point< T >::value >::type * = nullptr> |
T | Dviglo::Mod (T x, T y) |
| Return remainder of X/Y for float values. More...
|
|
template<class T > |
T | Dviglo::AbsMod (T x, T y) |
| Return always positive remainder of X/Y.
|
|
template<class T > |
T | Dviglo::Fract (T value) |
|
template<class T > |
T | Dviglo::Floor (T x) |
|
template<class T > |
int | Dviglo::FloorToInt (T x) |
|
template<class T > |
T | Dviglo::Round (T x) |
|
template<class Iterator > |
auto | Dviglo::Average (Iterator begin, Iterator end) -> typename std::decay< decltype(*begin)>::type |
| Compute average value of the range.
|
|
template<class T > |
int | Dviglo::RoundToInt (T x) |
|
template<class T > |
T | Dviglo::RoundToNearestMultiple (T x, T multiple) |
| Round value to nearest multiple.
|
|
template<class T > |
T | Dviglo::Ceil (T x) |
|
template<class T > |
int | Dviglo::CeilToInt (T x) |
|
bool | Dviglo::IsPowerOfTwo (unsigned value) |
| Check whether an unsigned integer is a power of two.
|
|
unsigned | Dviglo::NextPowerOfTwo (unsigned value) |
| Round up to next power of two.
|
|
unsigned | Dviglo::ClosestPowerOfTwo (unsigned value) |
| Round up or down to the closest power of two.
|
|
unsigned | Dviglo::LogBaseTwo (unsigned value) |
| Return log base two or the MSB position of the given value.
|
|
unsigned | Dviglo::CountSetBits (unsigned value) |
| Count the number of set bits in a mask.
|
|
constexpr unsigned | Dviglo::SDBMHash (unsigned hash, unsigned char c) |
| Update a hash with the given 8-bit value using the SDBM algorithm.
|
|
float | Dviglo::Random () |
| Return a random float between 0.0 (inclusive) and 1.0 (exclusive).
|
|
float | Dviglo::Random (float range) |
| Return a random float between 0.0 and range, inclusive from both ends.
|
|
float | Dviglo::Random (float min, float max) |
| Return a random float between min and max, inclusive from both ends.
|
|
int | Dviglo::Random (int range) |
|
int | Dviglo::Random (int min, int max) |
|
float | Dviglo::RandomNormal (float meanValue, float variance) |
| Return a random normal distributed number with the given mean value and variance.
|
|
unsigned short | Dviglo::FloatToHalf (float value) |
| Convert float to half float. From https://gist.github.com/martinkallman/5049614.
|
|
float | Dviglo::HalfToFloat (unsigned short value) |
| Convert half float to float. From https://gist.github.com/martinkallman/5049614.
|
|
void | Dviglo::SinCos (float angle, float &sin, float &cos) |
| Calculate both sine and cosine, with angle in degrees.
|
|
|
static const float | Dviglo::M_PI = 3.14159265358979323846264338327950288f |
|
static const float | Dviglo::M_HALF_PI = M_PI * 0.5f |
|
static const int | Dviglo::M_MIN_INT = 0x80000000 |
|
static const int | Dviglo::M_MAX_INT = 0x7fffffff |
|
static const unsigned | Dviglo::M_MIN_UNSIGNED = 0x00000000 |
|
static const unsigned | Dviglo::M_MAX_UNSIGNED = 0xffffffff |
|
static const float | Dviglo::M_EPSILON = 0.000001f |
|
static const float | Dviglo::M_LARGE_EPSILON = 0.00005f |
|
static const float | Dviglo::M_MIN_NEARCLIP = 0.01f |
|
static const float | Dviglo::M_MAX_FOV = 160.0f |
|
static const float | Dviglo::M_LARGE_VALUE = 100000000.0f |
|
static const float | Dviglo::M_INFINITY = (float)HUGE_VAL |
|
static const float | Dviglo::M_DEGTORAD = M_PI / 180.0f |
|
static const float | Dviglo::M_DEGTORAD_2 = M_PI / 360.0f |
|
static const float | Dviglo::M_RADTODEG = 1.0f / M_DEGTORAD |
|