diff --git a/include/Vector2.hpp b/include/Vector2.hpp index b351edd9..bcbb8387 100644 --- a/include/Vector2.hpp +++ b/include/Vector2.hpp @@ -68,6 +68,29 @@ class Vector2 : public ::Vector2 { return *this; } + /** + * Add vector and float value + */ + Vector2 Add(float value) const { + return Vector2AddValue(*this, value); + } + + /** + * Add vector and float value + */ + Vector2 operator+(float value) const { + return Vector2AddValue(*this, value); + } + + /** + * Add vector and float value + */ + Vector2& operator+=(float value) { + set(Vector2AddValue(*this, value)); + + return *this; + } + /** * Subtract two vectors (v1 - v2) */ @@ -87,6 +110,29 @@ class Vector2 : public ::Vector2 { return *this; } + /** + * Subtract vector by float value + */ + [[nodiscard]] Vector2 Subtract(float value) const { + return Vector2SubtractValue(*this, value); + } + + /** + * Subtract vector by float value + */ + Vector2 operator-(float value) const { + return Vector2SubtractValue(*this, value); + } + + /** + * Subtract vector by float value + */ + Vector2& operator-=(float value) { + set(Vector2SubtractValue(*this, value)); + + return *this; + } + /** * Negate vector */ diff --git a/include/Vector3.hpp b/include/Vector3.hpp index 3ef06fa5..c4fbb8f3 100644 --- a/include/Vector3.hpp +++ b/include/Vector3.hpp @@ -60,6 +60,26 @@ class Vector3 : public ::Vector3 { return *this; } + /** + * Add vector and float value + */ + [[nodiscard]] Vector3 Add(float value) const { + return Vector3AddValue(*this, value); + } + + /** + * Add vector and float value + */ + Vector3 operator+(float value) const { + return Vector3AddValue(*this, value); + } + + Vector3& operator+=(float value) { + set(Vector3AddValue(*this, value)); + + return *this; + } + /** * Subtract two vectors. */ @@ -76,6 +96,26 @@ class Vector3 : public ::Vector3 { return *this; } + /** + * Subtract vector by float value + */ + [[nodiscard]] Vector3 Subtract(float value) const { + return Vector3SubtractValue(*this, value); + } + + /** + * Subtract vector by float value + */ + Vector3 operator-(float value) const { + return Vector3SubtractValue(*this, value); + } + + Vector3& operator-=(float value) { + set(Vector3SubtractValue(*this, value)); + + return *this; + } + /** * Negate provided vector (invert direction) */