mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-12-05 17:25:42 +00:00
Add vector add/sub float operations
- Vector2 add/sub float operations - Vector3 add/sub float operations
This commit is contained in:
@@ -68,6 +68,29 @@ public:
|
||||
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 @@ public:
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -60,6 +60,26 @@ public:
|
||||
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 @@ public:
|
||||
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)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user