diff options
| author | Matthew Kosarek <mattkae@protonmail.com> | 2021-07-01 19:46:08 -0400 |
|---|---|---|
| committer | Matthew Kosarek <mattkae@protonmail.com> | 2021-07-01 19:46:08 -0400 |
| commit | 4878f0fc6a039d220dd7adecb18d19c688ae50b0 (patch) | |
| tree | 993893f1d894aedb350e86c759370c0e8c54c443 /transpiler/MathHelper.h | |
| parent | 9f968320c83ce79f98006dec71674feff4686e3b (diff) | |
(mkosarek) Decent SAT description for now
Diffstat (limited to 'transpiler/MathHelper.h')
| -rw-r--r-- | transpiler/MathHelper.h | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/transpiler/MathHelper.h b/transpiler/MathHelper.h deleted file mode 100644 index b9c9cb6..0000000 --- a/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; - } -} |
