aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/math/je_math.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-12-14 14:55:42 +0800
committerchai <chaifix@163.com>2018-12-14 14:55:42 +0800
commit870fcdae66edc680cac55defb149e1434e865f37 (patch)
treebb0b45627b98ec4c782466b3bb57daf63c44e460 /src/libjin/math/je_math.h
parenteb8ca083c9be574acd27cf0de41d1f69146cad7a (diff)
*格式化代码
Diffstat (limited to 'src/libjin/math/je_math.h')
-rw-r--r--src/libjin/math/je_math.h98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/libjin/math/je_math.h b/src/libjin/math/je_math.h
index ed46e58..f0a0a4c 100644
--- a/src/libjin/math/je_math.h
+++ b/src/libjin/math/je_math.h
@@ -7,63 +7,63 @@
namespace JinEngine
{
- namespace Math
- {
+ namespace Math
+ {
- #ifdef min
- #undef min
- #endif // min
- #ifdef max
- #undef max
- #endif // max
+ #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 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 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 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 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 bool without(T a, T mi, T ma)
+ {
+ return a < mi || a > ma;
+ }
- template<typename T>
- inline T lowerBound(T a, T lower)
- {
- return a < lower ? lower : 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 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);
- }
+ 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)
{
@@ -83,7 +83,7 @@ namespace JinEngine
return -a;
}
- } // namespace Math
+ } // namespace Math
} // namespace JinEngine
#endif // __JE_UTILS_MATH_H__ \ No newline at end of file