From a32157049d860c4c9c6ffb0df6c3cdbf53e4ef1d Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Mon, 26 Apr 2021 20:51:09 -0400 Subject: Getting started on rectangle collisions --- frontend/shared_cpp/mathlib.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 frontend/shared_cpp/mathlib.cpp (limited to 'frontend/shared_cpp/mathlib.cpp') 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 + +Vector2 getRandomNormalVector2() { + Vector2 retval = { + static_cast(rand()) / static_cast(RAND_MAX), + static_cast(rand()) / static_cast(RAND_MAX) + }; + + return retval.normalize(); +} -- cgit v1.2.1