diff options
author | chai <chaifix@163.com> | 2018-11-18 23:44:40 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-11-18 23:44:40 +0800 |
commit | 8cb74178c2b8e5883a1181af687fa8cfc0c6e5da (patch) | |
tree | f56c536a029148df35bd4e82034a9b563a2381df /src/libjin/Math/je_math.h | |
parent | f0f340dec7821cee103ab9267ef941a917ef4dc4 (diff) |
*修改目录为小写
Diffstat (limited to 'src/libjin/Math/je_math.h')
-rw-r--r-- | src/libjin/Math/je_math.h | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/src/libjin/Math/je_math.h b/src/libjin/Math/je_math.h deleted file mode 100644 index de57e36..0000000 --- a/src/libjin/Math/je_math.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef __JE_UTILS_MATH_H__ -#define __JE_UTILS_MATH_H__ - -#include "je_constant.h" -#include "je_matrix.h" -#include "je_quad.h" - -namespace JinEngine -{ - namespace Math - { - - #ifdef min - #undef min - #endif // min - #ifdef max - #undef max - #endif // max - - template<typename T> - inline T min(T a, T b) - { - return a < b ? a : b; - } - - template<typename T> - inline T max(T a, T b) - { - return a > b ? a : b; - } - - template<typename T> - inline T clamp(T a, T mi, T ma) - { - return min<T>(max<T>(a, mi), ma); - } - - template<typename T> - inline bool within(T a, T mi, T ma) - { - return a >= mi && a <= ma; - } - - template<typename T> - inline bool without(T a, T mi, T ma) - { - return a < mi || a > ma; - } - - template<typename T> - inline T abs(T a) - { - return a > 0 ? a : -a; - } - - template<typename T> - inline T lowerBound(T a, T lower) - { - return a < lower ? lower : a; - } - - template<typename T> - inline T upperBound(T a, T upper) - { - return a > upper ? upper : a; - } - - template<typename T> - inline T lerp(T a, T b, float t) - { - return a + t * (b - a); - } - - inline float lerp(float a, float b, float f) - { - f = clamp<float>(f, 0, 1); - return a + f * (b - a); - } - - } // namespace Math -} // namespace JinEngine - -#endif // __JE_UTILS_MATH_H__ |