CSEngine
Loading...
Searching...
No Matches
MoreMath.h
1//
2// Created by ounols on 19. 3. 23.
3//
4
5#ifndef CSENGINE_APP_MOREMATH_H
6#define CSENGINE_APP_MOREMATH_H
7
8#ifdef _WIN32
9#define M_PI 3.14159265358979323846
10#endif
11
12
13template <typename T>
14static int sign(T val) {
15 return (T(0) < val) - (val < T(0));
16}
17
18template <typename T>
19static constexpr T ValueSelect(T comparand, T valueGEZero, T valueLTZero) {
20 return comparand >= 0.f ? valueGEZero : valueLTZero;
21}
22
23#endif //CSENGINE_APP_MOREMATH_H