From 7d5f055547e70fa93ee9ac944e62f8d657b9dc55 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 19 Oct 2018 08:36:44 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/math/math.h | 77 -------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 src/libjin/math/math.h (limited to 'src/libjin/math/math.h') diff --git a/src/libjin/math/math.h b/src/libjin/math/math.h deleted file mode 100644 index c1b5084..0000000 --- a/src/libjin/math/math.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __LIBJIN_UTILS_MATH_H -#define __LIBJIN_UTILS_MATH_H - -#include "constant.h" -#include "matrix.h" -#include "quad.h" - -namespace jin -{ - namespace math - { - - #ifdef min - # undef min - #endif // min - #ifdef max - # undef max - #endif // max - - template - inline T min(T a, T b) - { - return a < b ? a : b; - } - - template - inline T max(T a, T b) - { - return a > b ? a : b; - } - - template - inline T clamp(T a, T mi, T ma) - { - return min(max(a, mi), ma); - } - - template - inline bool within(T a, T mi, T ma) - { - return a >= mi && a <= ma; - } - - template - inline bool without(T a, T mi, T ma) - { - return a < mi || a > ma; - } - - template - inline T abs(T a) - { - return a > 0 ? a : -a; - } - - template - inline T lowerBound(T a, T lower) - { - return a < lower ? lower : a; - } - - template - inline T upperBound(T a, T upper) - { - return a > upper ? upper : a; - } - - template - inline T lerp(T a, T b, float t) - { - return a + t * (b - a); - } - - } // namespace math -} // namespace jin - -#endif \ No newline at end of file -- cgit v1.1-26-g67d0