Copperfield Engine
0.1
C++ Game Engine
Loading...
Searching...
No Matches
math_utils.h
1
#ifndef __MATHUTILS_H__
2
#define __MATHUTILS_H__ 1
3
4
#include <math.h>
5
6
namespace
coma
{
7
static
constexpr
float
pi = 3.14159265358979323846f;
8
static
float
Clamp(
float
value,
float
minVal,
float
maxVal);
9
static
float
Radians(
float
degrees);
10
11
inline
float
Clamp(
const
float
value,
const
float
minVal,
const
float
maxVal) {
12
if
(value >= maxVal) {
13
return
maxVal;
14
}
15
if
(value <= minVal) {
16
return
minVal;
17
}
18
return
value;
19
}
20
21
inline
float
Radians(
float
degrees) {
22
return
degrees * (pi/180.0f);
23
}
24
}
// namespace coma
25
#endif
coma
copperdielf Math Library
Definition:
buffer.hpp:5
include
math
math_utils.h
Generated by
1.9.5