summaryrefslogtreecommitdiff
path: root/frontend/shared_cpp/mathlib.cpp
diff options
context:
space:
mode:
authorMatthew Kosarek <mattkae@protonmail.com>2021-04-26 20:51:09 -0400
committerMatthew Kosarek <mattkae@protonmail.com>2021-04-26 20:51:09 -0400
commita32157049d860c4c9c6ffb0df6c3cdbf53e4ef1d (patch)
treefcdf2a06b07ef143f6615f71a6e26f3a1587b80d /frontend/shared_cpp/mathlib.cpp
parentcdf770d6950befd25779a18ea3972deeb9f143bb (diff)
Getting started on rectangle collisions
Diffstat (limited to 'frontend/shared_cpp/mathlib.cpp')
-rw-r--r--frontend/shared_cpp/mathlib.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/frontend/shared_cpp/mathlib.cpp b/frontend/shared_cpp/mathlib.cpp
new file mode 100644
index 0000000..8222d00
--- /dev/null
+++ b/frontend/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();
+}