summaryrefslogtreecommitdiff
path: root/Runtime/Math/MathHelper.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-03 09:52:26 +0800
committerchai <chaifix@163.com>2021-11-03 09:52:26 +0800
commitc10e0d92f46e5eaf25a69e1fafe5f4dbd8eaab9d (patch)
tree2eb1a91339b35fea68f48b2774355f496519db83 /Runtime/Math/MathHelper.h
parent3898f2c648b1a731dead8337aad8912d2b8b80d7 (diff)
*misc
Diffstat (limited to 'Runtime/Math/MathHelper.h')
-rw-r--r--Runtime/Math/MathHelper.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Runtime/Math/MathHelper.h b/Runtime/Math/MathHelper.h
new file mode 100644
index 0000000..3f8754a
--- /dev/null
+++ b/Runtime/Math/MathHelper.h
@@ -0,0 +1,11 @@
+#pragma once
+
+#define max(a, b)\
+(a)>(b)?(a):(b)
+
+#define min(a, b)\
+(a)<(b)?(a):(b)
+
+#define clamp(v, lo, hi)\
+max((lo), min((v), (hi)))
+