summaryrefslogtreecommitdiff
path: root/shared_cpp/mathlib.cpp
diff options
context:
space:
mode:
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
index 3402f0e..5996ba3 100644
--- a/shared_cpp/mathlib.cpp
+++ b/shared_cpp/mathlib.cpp
@@ -12,6 +12,13 @@
// ***************************************
// Vector2
+Vector2::Vector2() { }
+
+Vector2::Vector2(float inX, float inY) {
+ x = inX;
+ y = inY;
+}
+
Vector2 getRandomNormalVector2() {
Vector2 retval = {
static_cast<float>(rand()) / static_cast<float>(RAND_MAX),
@@ -291,6 +298,10 @@ Vector4 Vector4::cross(const Vector4& other) {
};
}
+Vector4 lerp(Vector4 start, Vector4 end, float t) {
+ return (end - start) * t + start;
+}
+
Vector4 Vector4::operator+(const Vector4& v2) {
return add(v2);
}