summaryrefslogtreecommitdiff
path: root/shared_cpp/mathlib.cpp
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 /shared_cpp/mathlib.cpp
parent4941a1874b6ca9d142d94df70b2aec5e0b35b94e (diff)
Moved the frontend directory up so that it no longer exists
Diffstat (limited to 'shared_cpp/mathlib.cpp')
-rw-r--r--shared_cpp/mathlib.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/shared_cpp/mathlib.cpp b/shared_cpp/mathlib.cpp
new file mode 100644
index 0000000..8222d00
--- /dev/null
+++ b/shared_cpp/mathlib.cpp
@@ -0,0 +1,11 @@
+#include "mathlib.h"
+#include <cstdlib>
+
+Vector2 getRandomNormalVector2() {
+ Vector2 retval = {
+ static_cast<float>(rand()) / static_cast<float>(RAND_MAX),
+ static_cast<float>(rand()) / static_cast<float>(RAND_MAX)
+ };
+
+ return retval.normalize();
+}