DDraceNetwork Docs
math.h File Reference
#include <algorithm>
#include <cmath>
#include <cstdlib>
Include dependency graph for math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  fxp
 

Functions

constexpr int round_to_int (float f)
 
constexpr int round_truncate (float f)
 
template<typename T , typename TB >
constexpr T mix (const T a, const T b, TB amount)
 
template<typename T , typename TB >
bezier (const T p0, const T p1, const T p2, const T p3, TB amount)
 
template<typename T , typename TB >
mix_polynomial (const TB time[], const T data[], int samples, TB amount, T init)
 
float random_float ()
 
float random_float (float min, float max)
 
float random_float (float max)
 
float random_angle ()
 
constexpr int f2fx (float v)
 
constexpr float fx2f (int v)
 
constexpr int i2fx (int v)
 
constexpr int fx2i (int v)
 
template<typename T >
constexpr T minimum (T a, T b)
 
template<typename T >
constexpr T minimum (T a, T b, T c)
 
template<typename T >
constexpr T maximum (T a, T b)
 
template<typename T >
constexpr T maximum (T a, T b, T c)
 
template<typename T >
constexpr T absolute (T a)
 
template<typename T >
constexpr T in_range (T a, T lower, T upper)
 
template<typename T >
constexpr T in_range (T a, T upper)
 

Variables

constexpr float pi = 3.1415926535897932384626433f
 
constexpr int fxpscale = 1 << 10
 

Function Documentation

◆ absolute()

template<typename T >
constexpr T absolute ( a)
inlineconstexpr

◆ bezier()

template<typename T , typename TB >
T bezier ( const T  p0,
const T  p1,
const T  p2,
const T  p3,
TB  amount 
)
inline

◆ f2fx()

constexpr int f2fx ( float  v)
inlineconstexpr

◆ fx2f()

constexpr float fx2f ( int  v)
inlineconstexpr

◆ fx2i()

constexpr int fx2i ( int  v)
inlineconstexpr

◆ i2fx()

constexpr int i2fx ( int  v)
inlineconstexpr

◆ in_range() [1/2]

template<typename T >
constexpr T in_range ( a,
lower,
upper 
)
inlineconstexpr

◆ in_range() [2/2]

template<typename T >
constexpr T in_range ( a,
upper 
)
inlineconstexpr

◆ maximum() [1/2]

template<typename T >
constexpr T maximum ( a,
b 
)
inlineconstexpr

◆ maximum() [2/2]

template<typename T >
constexpr T maximum ( a,
b,
c 
)
inlineconstexpr

◆ minimum() [1/2]

template<typename T >
constexpr T minimum ( a,
b 
)
inlineconstexpr

◆ minimum() [2/2]

template<typename T >
constexpr T minimum ( a,
b,
c 
)
inlineconstexpr

◆ mix()

template<typename T , typename TB >
constexpr T mix ( const T  a,
const T  b,
TB  amount 
)
inlineconstexpr

◆ mix_polynomial()

template<typename T , typename TB >
T mix_polynomial ( const TB  time[],
const T  data[],
int  samples,
TB  amount,
init 
)
inline

◆ random_angle()

float random_angle ( )
inline

◆ random_float() [1/3]

float random_float ( )
inline

◆ random_float() [2/3]

float random_float ( float  max)
inline

◆ random_float() [3/3]

float random_float ( float  min,
float  max 
)
inline

◆ round_to_int()

constexpr int round_to_int ( float  f)
inlineconstexpr

◆ round_truncate()

constexpr int round_truncate ( float  f)
inlineconstexpr

Variable Documentation

◆ fxpscale

constexpr int fxpscale = 1 << 10
constexpr

◆ pi

constexpr float pi = 3.1415926535897932384626433f
constexpr