File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,29 @@ class Vector2 : public ::Vector2 {
6868 return *this ;
6969 }
7070
71+ /* *
72+ * Add vector and float value
73+ */
74+ Vector2 Add (float add) const {
75+ return Vector2AddValue (*this , add);
76+ }
77+
78+ /* *
79+ * Add vector and float value
80+ */
81+ Vector2 operator +(float add) const {
82+ return Vector2AddValue (*this , add);
83+ }
84+
85+ /* *
86+ * Add vector and float value
87+ */
88+ Vector2& operator +=(float add) {
89+ set (Vector2AddValue (*this , add));
90+
91+ return *this ;
92+ }
93+
7194 /* *
7295 * Subtract two vectors (v1 - v2)
7396 */
@@ -87,6 +110,29 @@ class Vector2 : public ::Vector2 {
87110 return *this ;
88111 }
89112
113+ /* *
114+ * Subtract vector by float value
115+ */
116+ [[nodiscard]] Vector2 Subtract (float sub) const {
117+ return Vector2SubtractValue (*this , sub);
118+ }
119+
120+ /* *
121+ * Subtract vector by float value
122+ */
123+ Vector2 operator -(float sub) const {
124+ return Vector2SubtractValue (*this , sub);
125+ }
126+
127+ /* *
128+ * Subtract vector by float value
129+ */
130+ Vector2& operator -=(float sub) {
131+ set (Vector2SubtractValue (*this , sub));
132+
133+ return *this ;
134+ }
135+
90136 /* *
91137 * Negate vector
92138 */
You can’t perform that action at this time.
0 commit comments