Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
MathUtil.h File Reference
#include <numbers>
Include dependency graph for MathUtil.h:

Go to the source code of this file.

Macros

#define DEGTORAD(a)   ((a) * (std::numbers::pi_v<float> / 180.0f))
 
#define RADTODEG(a)   ((a) * (180.0f / std::numbers::pi_v<float>))
 
#define SQR(x)   ((x) * (x))
 

Functions

template<typename T >
T Interpolate (const T &a, const T &b, float t)
 
template<typename T >
T Clamp (T value, T min, T max)
 
template<typename T >
T SmoothStep (T edge0, T edge1, T value)
 
template<typename T >
T Sign (const T value)
 

Macro Definition Documentation

◆ DEGTORAD

#define DEGTORAD (   a)    ((a) * (std::numbers::pi_v<float> / 180.0f))

◆ RADTODEG

#define RADTODEG (   a)    ((a) * (180.0f / std::numbers::pi_v<float>))

◆ SQR

#define SQR (   x)    ((x) * (x))

Function Documentation

◆ Clamp()

template<typename T >
T Clamp ( T  value,
T  min,
T  max 
)
inline

◆ Interpolate()

template<typename T >
T Interpolate ( const T &  a,
const T &  b,
float  t 
)
inline

◆ Sign()

template<typename T >
T Sign ( const T  value)
inline

◆ SmoothStep()

template<typename T >
T SmoothStep ( T  edge0,
T  edge1,
T  value 
)
inline