From f8784c3255f701f4a7bd8aa08a9970b8ffdc01d7 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 20 May 2021 23:18:14 +0200 Subject: [PATCH] feat(srcVector): Added operators --- BigBaseV2/src/gta/vector.hpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/BigBaseV2/src/gta/vector.hpp b/BigBaseV2/src/gta/vector.hpp index 9ec39766..523f7495 100644 --- a/BigBaseV2/src/gta/vector.hpp +++ b/BigBaseV2/src/gta/vector.hpp @@ -32,6 +32,42 @@ namespace rage scrVector(float x, float y, float z) : x(x), y(y), z(z) {} + + scrVector operator+(const scrVector& other) + { + scrVector vec; + vec.x = this->x + other.x; + vec.y = this->y + other.y; + vec.z = this->z + other.z; + return vec; + } + + scrVector operator-(const scrVector& other) + { + scrVector vec; + vec.x = this->x - other.x; + vec.y = this->y - other.y; + vec.z = this->z - other.z; + return vec; + } + + scrVector operator*(const scrVector& other) + { + scrVector vec; + vec.x = this->x * other.x; + vec.y = this->y * other.y; + vec.z = this->z * other.z; + return vec; + } + + scrVector operator*(const float& other) + { + scrVector vec; + vec.x = this->x * other; + vec.y = this->y * other; + vec.z = this->z * other; + return vec; + } public: float x{}; private: