summaryrefslogtreecommitdiff
path: root/frontend/transpiler/MathHelper.h
diff options
context:
space:
mode:
authorMatthew Kosarek <mattkae@protonmail.com>2021-05-16 19:50:15 -0400
committerMatthew Kosarek <mattkae@protonmail.com>2021-05-16 19:50:15 -0400
commita00c0aab1eb5a7a55bef8ca08115bdd722ab5699 (patch)
tree45b5c4cc8c380d0630a8e0185af7229f26dc754a /frontend/transpiler/MathHelper.h
parent4941a1874b6ca9d142d94df70b2aec5e0b35b94e (diff)
Moved the frontend directory up so that it no longer exists
Diffstat (limited to 'frontend/transpiler/MathHelper.h')
-rw-r--r--frontend/transpiler/MathHelper.h33
1 files changed, 0 insertions, 33 deletions
diff --git a/frontend/transpiler/MathHelper.h b/frontend/transpiler/MathHelper.h
deleted file mode 100644
index b9c9cb6..0000000
--- a/frontend/transpiler/MathHelper.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#pragma once
-
-#define PI 3.14159265358979323846f
-
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#define CLAMP(x, upper, lower) (MIN(upper, MAX(x, lower)))
-#define DTOR (PI / 180.0f)
-#define SWAP(x, y, T) do { T SWAP = x; x = y; y = SWAP; } while (0)
-
-namespace MathHelper {
- inline float radiansToDegrees(float radians) {
- return radians * 180.f / PI;
- }
-
- inline float degreesToRadians(float degrees) {
- return degrees * PI / 180.f;
- }
-
- inline int nearestPowerOfTwo(int n) {
- int v = n;
-
- v--;
- v |= v >> 1;
- v |= v >> 2;
- v |= v >> 4;
- v |= v >> 8;
- v |= v >> 16;
- v++; // next power of 2
-
- return v;
- }
-}