We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f72e3c3 + b6cb09d commit 9ffb4aeCopy full SHA for 9ffb4ae
src/Objects/PVector.js
@@ -106,6 +106,10 @@ module.exports = function(options, undef) {
106
this.x += v.x;
107
this.y += v.y;
108
this.z += v.z;
109
+ } else if (arguments.length === 2) {
110
+ // 2D Vector
111
+ this.x += v;
112
+ this.y += y;
113
} else {
114
this.x += v;
115
this.y += y;
@@ -117,6 +121,10 @@ module.exports = function(options, undef) {
117
121
this.x -= v.x;
118
122
this.y -= v.y;
119
123
this.z -= v.z;
124
125
126
+ this.x -= v;
127
+ this.y -= y;
120
128
129
this.x -= v;
130
this.y -= y;
@@ -234,4 +242,3 @@ module.exports = function(options, undef) {
234
242
235
243
return PVector;
236
244
};
237
-
0 commit comments