Recast  1
Game with custom magic
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
MathUtils.hpp
Go to the documentation of this file.
1 //
2 // Created by Oleg Morozenkov on 03.04.17.
3 //
4 
5 #ifndef RECAST_MATHUTILS_H
6 #define RECAST_MATHUTILS_H
7 
8 
9 #include <cmath>
10 #include <cassert>
11 
15 namespace MathUtils {
16 
26  template<typename T>
27  inline T lerp(T a, T b, double t) {
28  return T((1 - t) * a + t * b);
29  }
30 
36  inline double randomFloat() {
37  return (double) rand() / RAND_MAX;
38  }
39 
40 };
41 
42 
43 #endif //RECAST_MATHUTILS_H
double randomFloat()
Definition: MathUtils.hpp:36
T lerp(T a, T b, double t)
Definition: MathUtils.hpp:27