melonjs 10.2.2 → 10.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +6 -6
  2. package/dist/melonjs.js +2907 -3383
  3. package/dist/melonjs.min.js +4 -4
  4. package/dist/melonjs.module.d.ts +3620 -4528
  5. package/dist/melonjs.module.js +3210 -3331
  6. package/package.json +19 -19
  7. package/src/audio/audio.js +30 -31
  8. package/src/camera/camera2d.js +47 -58
  9. package/src/entity/draggable.js +11 -21
  10. package/src/entity/droptarget.js +12 -22
  11. package/src/entity/entity.js +32 -38
  12. package/src/game.js +21 -22
  13. package/src/{shapes → geometries}/ellipse.js +40 -47
  14. package/src/{shapes → geometries}/line.js +9 -12
  15. package/src/{shapes → geometries}/poly.js +100 -53
  16. package/src/{shapes → geometries}/rectangle.js +42 -45
  17. package/src/index.js +9 -20
  18. package/src/input/gamepad.js +11 -10
  19. package/src/input/input.js +2 -3
  20. package/src/input/keyboard.js +113 -113
  21. package/src/input/pointer.js +61 -29
  22. package/src/input/pointerevent.js +92 -29
  23. package/src/lang/deprecated.js +44 -14
  24. package/src/level/level.js +23 -24
  25. package/src/level/tiled/TMXGroup.js +7 -9
  26. package/src/level/tiled/TMXLayer.js +30 -33
  27. package/src/level/tiled/TMXObject.js +59 -53
  28. package/src/level/tiled/TMXTile.js +18 -19
  29. package/src/level/tiled/TMXTileMap.js +38 -46
  30. package/src/level/tiled/TMXTileset.js +12 -16
  31. package/src/level/tiled/TMXTilesetGroup.js +9 -10
  32. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +7 -9
  33. package/src/level/tiled/renderer/TMXIsometricRenderer.js +7 -9
  34. package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +4 -6
  35. package/src/level/tiled/renderer/TMXRenderer.js +24 -26
  36. package/src/level/tiled/renderer/TMXStaggeredRenderer.js +1 -5
  37. package/src/loader/loader.js +17 -16
  38. package/src/loader/loadingscreen.js +8 -10
  39. package/src/math/color.js +47 -67
  40. package/src/math/math.js +15 -16
  41. package/src/math/matrix2.js +53 -59
  42. package/src/math/matrix3.js +56 -63
  43. package/src/math/observable_vector2.js +87 -77
  44. package/src/math/observable_vector3.js +97 -80
  45. package/src/math/vector2.js +107 -97
  46. package/src/math/vector3.js +116 -100
  47. package/src/particles/emitter.js +66 -76
  48. package/src/particles/particle.js +4 -6
  49. package/src/particles/particlecontainer.js +2 -4
  50. package/src/physics/body.js +47 -146
  51. package/src/physics/bounds.js +48 -50
  52. package/src/physics/collision.js +13 -14
  53. package/src/physics/detector.js +14 -14
  54. package/src/physics/quadtree.js +18 -21
  55. package/src/physics/sat.js +30 -30
  56. package/src/physics/world.js +24 -29
  57. package/src/plugin/plugin.js +11 -15
  58. package/src/renderable/GUI.js +41 -47
  59. package/src/renderable/collectable.js +5 -10
  60. package/src/renderable/colorlayer.js +10 -15
  61. package/src/renderable/container.js +87 -73
  62. package/src/renderable/imagelayer.js +25 -32
  63. package/src/renderable/nineslicesprite.js +41 -42
  64. package/src/renderable/renderable.js +113 -124
  65. package/src/renderable/sprite.js +62 -69
  66. package/src/renderable/trigger.js +26 -32
  67. package/src/state/stage.js +13 -18
  68. package/src/state/state.js +26 -27
  69. package/src/system/device.js +76 -133
  70. package/src/system/event.js +81 -70
  71. package/src/system/pooling.js +11 -12
  72. package/src/system/save.js +3 -4
  73. package/src/system/timer.js +19 -20
  74. package/src/text/bitmaptext.js +57 -55
  75. package/src/text/bitmaptextdata.js +10 -11
  76. package/src/text/glyph.js +3 -0
  77. package/src/text/text.js +49 -55
  78. package/src/tweens/easing.js +1 -1
  79. package/src/tweens/interpolation.js +1 -1
  80. package/src/tweens/tween.js +44 -46
  81. package/src/utils/agent.js +3 -4
  82. package/src/utils/array.js +4 -5
  83. package/src/utils/file.js +3 -4
  84. package/src/utils/function.js +4 -5
  85. package/src/utils/string.js +7 -9
  86. package/src/utils/utils.js +4 -5
  87. package/src/video/canvas/canvas_renderer.js +60 -62
  88. package/src/video/renderer.js +53 -58
  89. package/src/video/texture.js +98 -112
  90. package/src/video/texture_cache.js +4 -6
  91. package/src/video/video.js +16 -17
  92. package/src/video/webgl/buffer/vertex.js +2 -2
  93. package/src/video/webgl/glshader.js +37 -39
  94. package/src/video/webgl/webgl_compositor.js +128 -110
  95. package/src/video/webgl/webgl_renderer.js +126 -106
@@ -4,16 +4,14 @@ import pool from "./../system/pooling.js";
4
4
  /**
5
5
  * @classdesc
6
6
  * a generic 2D Vector Object
7
- * @class Vector2d
8
- * @memberOf me
9
- * @constructor
10
- * @param {number} [x=0] x value of the vector
11
- * @param {number} [y=0] y value of the vector
12
7
  */
13
8
  class Vector2d {
14
-
15
- constructor(...args) {
16
- this.onResetEvent(...args);
9
+ /**
10
+ * @param {number} [x=0] x value of the vector
11
+ * @param {number} [y=0] y value of the vector
12
+ */
13
+ constructor(x = 0, y = 0) {
14
+ this.onResetEvent(x, y);
17
15
  }
18
16
 
19
17
  /**
@@ -38,11 +36,11 @@ class Vector2d {
38
36
  /**
39
37
  * set the Vector x and y properties to the given values<br>
40
38
  * @name set
41
- * @memberOf me.Vector2d
39
+ * @memberof Vector2d
42
40
  * @function
43
41
  * @param {number} x
44
42
  * @param {number} y
45
- * @returns {me.Vector2d} Reference to this object for method chaining
43
+ * @returns {Vector2d} Reference to this object for method chaining
46
44
  */
47
45
  set(x, y) {
48
46
  if (x !== +x || y !== +y) {
@@ -56,7 +54,7 @@ class Vector2d {
56
54
  * @public
57
55
  * @type {number}
58
56
  * @name x
59
- * @memberOf me.Vector2d
57
+ * @memberof Vector2d
60
58
  */
61
59
  //this.x = x;
62
60
 
@@ -65,7 +63,7 @@ class Vector2d {
65
63
  * @public
66
64
  * @type {number}
67
65
  * @name y
68
- * @memberOf me.Vector2d
66
+ * @memberof Vector2d
69
67
  */
70
68
  //this.y = y;
71
69
 
@@ -75,9 +73,9 @@ class Vector2d {
75
73
  /**
76
74
  * set the Vector x and y properties to 0
77
75
  * @name setZero
78
- * @memberOf me.Vector2d
76
+ * @memberof Vector2d
79
77
  * @function
80
- * @returns {me.Vector2d} Reference to this object for method chaining
78
+ * @returns {Vector2d} Reference to this object for method chaining
81
79
  */
82
80
  setZero() {
83
81
  return this.set(0, 0);
@@ -86,10 +84,10 @@ class Vector2d {
86
84
  /**
87
85
  * set the Vector x and y properties using the passed vector
88
86
  * @name setV
89
- * @memberOf me.Vector2d
87
+ * @memberof Vector2d
90
88
  * @function
91
- * @param {me.Vector2d} v
92
- * @returns {me.Vector2d} Reference to this object for method chaining
89
+ * @param {Vector2d} v
90
+ * @returns {Vector2d} Reference to this object for method chaining
93
91
  */
94
92
  setV(v) {
95
93
  return this._set(v.x, v.y);
@@ -98,10 +96,10 @@ class Vector2d {
98
96
  /**
99
97
  * Add the passed vector to this vector
100
98
  * @name add
101
- * @memberOf me.Vector2d
99
+ * @memberof Vector2d
102
100
  * @function
103
- * @param {me.Vector2d} v
104
- * @returns {me.Vector2d} Reference to this object for method chaining
101
+ * @param {Vector2d} v
102
+ * @returns {Vector2d} Reference to this object for method chaining
105
103
  */
106
104
  add(v) {
107
105
  return this._set(this.x + v.x, this.y + v.y);
@@ -110,10 +108,10 @@ class Vector2d {
110
108
  /**
111
109
  * Substract the passed vector to this vector
112
110
  * @name sub
113
- * @memberOf me.Vector2d
111
+ * @memberof Vector2d
114
112
  * @function
115
- * @param {me.Vector2d} v
116
- * @returns {me.Vector2d} Reference to this object for method chaining
113
+ * @param {Vector2d} v
114
+ * @returns {Vector2d} Reference to this object for method chaining
117
115
  */
118
116
  sub(v) {
119
117
  return this._set(this.x - v.x, this.y - v.y);
@@ -122,11 +120,11 @@ class Vector2d {
122
120
  /**
123
121
  * Multiply this vector values by the given scalar
124
122
  * @name scale
125
- * @memberOf me.Vector2d
123
+ * @memberof Vector2d
126
124
  * @function
127
125
  * @param {number} x
128
126
  * @param {number} [y=x]
129
- * @returns {me.Vector2d} Reference to this object for method chaining
127
+ * @returns {Vector2d} Reference to this object for method chaining
130
128
  */
131
129
  scale(x, y) {
132
130
  return this._set(this.x * x, this.y * (typeof (y) !== "undefined" ? y : x));
@@ -135,9 +133,9 @@ class Vector2d {
135
133
  /**
136
134
  * Convert this vector into isometric coordinate space
137
135
  * @name toIso
138
- * @memberOf me.Vector2d
136
+ * @memberof Vector2d
139
137
  * @function
140
- * @returns {me.Vector2d} Reference to this object for method chaining
138
+ * @returns {Vector2d} Reference to this object for method chaining
141
139
  */
142
140
  toIso() {
143
141
  return this._set(this.x - this.y, (this.x + this.y) * 0.5);
@@ -146,9 +144,9 @@ class Vector2d {
146
144
  /**
147
145
  * Convert this vector into 2d coordinate space
148
146
  * @name to2d
149
- * @memberOf me.Vector2d
147
+ * @memberof Vector2d
150
148
  * @function
151
- * @returns {me.Vector2d} Reference to this object for method chaining
149
+ * @returns {Vector2d} Reference to this object for method chaining
152
150
  */
153
151
  to2d() {
154
152
  return this._set(this.y + this.x / 2, this.y - this.x / 2);
@@ -157,10 +155,10 @@ class Vector2d {
157
155
  /**
158
156
  * Multiply this vector values by the passed vector
159
157
  * @name scaleV
160
- * @memberOf me.Vector2d
158
+ * @memberof Vector2d
161
159
  * @function
162
- * @param {me.Vector2d} v
163
- * @returns {me.Vector2d} Reference to this object for method chaining
160
+ * @param {Vector2d} v
161
+ * @returns {Vector2d} Reference to this object for method chaining
164
162
  */
165
163
  scaleV(v) {
166
164
  return this._set(this.x * v.x, this.y * v.y);
@@ -169,10 +167,10 @@ class Vector2d {
169
167
  /**
170
168
  * Divide this vector values by the passed value
171
169
  * @name div
172
- * @memberOf me.Vector2d
170
+ * @memberof Vector2d
173
171
  * @function
174
172
  * @param {number} n the value to divide the vector by
175
- * @returns {me.Vector2d} Reference to this object for method chaining
173
+ * @returns {Vector2d} Reference to this object for method chaining
176
174
  */
177
175
  div(n) {
178
176
  return this._set(this.x / n, this.y / n);
@@ -181,9 +179,9 @@ class Vector2d {
181
179
  /**
182
180
  * Update this vector values to absolute values
183
181
  * @name abs
184
- * @memberOf me.Vector2d
182
+ * @memberof Vector2d
185
183
  * @function
186
- * @returns {me.Vector2d} Reference to this object for method chaining
184
+ * @returns {Vector2d} Reference to this object for method chaining
187
185
  */
188
186
  abs() {
189
187
  return this._set((this.x < 0) ? -this.x : this.x, (this.y < 0) ? -this.y : this.y);
@@ -192,11 +190,11 @@ class Vector2d {
192
190
  /**
193
191
  * Clamp the vector value within the specified value range
194
192
  * @name clamp
195
- * @memberOf me.Vector2d
193
+ * @memberof Vector2d
196
194
  * @function
197
195
  * @param {number} low
198
196
  * @param {number} high
199
- * @returns {me.Vector2d} new me.Vector2d
197
+ * @returns {Vector2d} new me.Vector2d
200
198
  */
201
199
  clamp(low, high) {
202
200
  return new Vector2d(clamp(this.x, low, high), clamp(this.y, low, high));
@@ -205,11 +203,11 @@ class Vector2d {
205
203
  /**
206
204
  * Clamp this vector value within the specified value range
207
205
  * @name clampSelf
208
- * @memberOf me.Vector2d
206
+ * @memberof Vector2d
209
207
  * @function
210
208
  * @param {number} low
211
209
  * @param {number} high
212
- * @returns {me.Vector2d} Reference to this object for method chaining
210
+ * @returns {Vector2d} Reference to this object for method chaining
213
211
  */
214
212
  clampSelf(low, high) {
215
213
  return this._set(clamp(this.x, low, high), clamp(this.y, low, high));
@@ -218,10 +216,10 @@ class Vector2d {
218
216
  /**
219
217
  * Update this vector with the minimum value between this and the passed vector
220
218
  * @name minV
221
- * @memberOf me.Vector2d
219
+ * @memberof Vector2d
222
220
  * @function
223
- * @param {me.Vector2d} v
224
- * @returns {me.Vector2d} Reference to this object for method chaining
221
+ * @param {Vector2d} v
222
+ * @returns {Vector2d} Reference to this object for method chaining
225
223
  */
226
224
  minV(v) {
227
225
  return this._set((this.x < v.x) ? this.x : v.x, (this.y < v.y) ? this.y : v.y);
@@ -230,10 +228,10 @@ class Vector2d {
230
228
  /**
231
229
  * Update this vector with the maximum value between this and the passed vector
232
230
  * @name maxV
233
- * @memberOf me.Vector2d
231
+ * @memberof Vector2d
234
232
  * @function
235
- * @param {me.Vector2d} v
236
- * @returns {me.Vector2d} Reference to this object for method chaining
233
+ * @param {Vector2d} v
234
+ * @returns {Vector2d} Reference to this object for method chaining
237
235
  */
238
236
  maxV(v) {
239
237
  return this._set((this.x > v.x) ? this.x : v.x, (this.y > v.y) ? this.y : v.y);
@@ -242,9 +240,9 @@ class Vector2d {
242
240
  /**
243
241
  * Floor the vector values
244
242
  * @name floor
245
- * @memberOf me.Vector2d
243
+ * @memberof Vector2d
246
244
  * @function
247
- * @returns {me.Vector2d} new me.Vector2d
245
+ * @returns {Vector2d} new me.Vector2d
248
246
  */
249
247
  floor() {
250
248
  return new Vector2d(Math.floor(this.x), Math.floor(this.y));
@@ -253,9 +251,9 @@ class Vector2d {
253
251
  /**
254
252
  * Floor this vector values
255
253
  * @name floorSelf
256
- * @memberOf me.Vector2d
254
+ * @memberof Vector2d
257
255
  * @function
258
- * @returns {me.Vector2d} Reference to this object for method chaining
256
+ * @returns {Vector2d} Reference to this object for method chaining
259
257
  */
260
258
  floorSelf() {
261
259
  return this._set(Math.floor(this.x), Math.floor(this.y));
@@ -264,9 +262,9 @@ class Vector2d {
264
262
  /**
265
263
  * Ceil the vector values
266
264
  * @name ceil
267
- * @memberOf me.Vector2d
265
+ * @memberof Vector2d
268
266
  * @function
269
- * @returns {me.Vector2d} new me.Vector2d
267
+ * @returns {Vector2d} new me.Vector2d
270
268
  */
271
269
  ceil() {
272
270
  return new Vector2d(Math.ceil(this.x), Math.ceil(this.y));
@@ -275,9 +273,9 @@ class Vector2d {
275
273
  /**
276
274
  * Ceil this vector values
277
275
  * @name ceilSelf
278
- * @memberOf me.Vector2d
276
+ * @memberof Vector2d
279
277
  * @function
280
- * @returns {me.Vector2d} Reference to this object for method chaining
278
+ * @returns {Vector2d} Reference to this object for method chaining
281
279
  */
282
280
  ceilSelf() {
283
281
  return this._set(Math.ceil(this.x), Math.ceil(this.y));
@@ -286,9 +284,9 @@ class Vector2d {
286
284
  /**
287
285
  * Negate the vector values
288
286
  * @name negate
289
- * @memberOf me.Vector2d
287
+ * @memberof Vector2d
290
288
  * @function
291
- * @returns {me.Vector2d} new me.Vector2d
289
+ * @returns {Vector2d} new me.Vector2d
292
290
  */
293
291
  negate() {
294
292
  return new Vector2d(-this.x, -this.y);
@@ -297,9 +295,9 @@ class Vector2d {
297
295
  /**
298
296
  * Negate this vector values
299
297
  * @name negateSelf
300
- * @memberOf me.Vector2d
298
+ * @memberof Vector2d
301
299
  * @function
302
- * @returns {me.Vector2d} Reference to this object for method chaining
300
+ * @returns {Vector2d} Reference to this object for method chaining
303
301
  */
304
302
  negateSelf() {
305
303
  return this._set(-this.x, -this.y);
@@ -308,10 +306,10 @@ class Vector2d {
308
306
  /**
309
307
  * Copy the x,y values of the passed vector to this one
310
308
  * @name copy
311
- * @memberOf me.Vector2d
309
+ * @memberof Vector2d
312
310
  * @function
313
- * @param {me.Vector2d} v
314
- * @returns {me.Vector2d} Reference to this object for method chaining
311
+ * @param {Vector2d} v
312
+ * @returns {Vector2d} Reference to this object for method chaining
315
313
  */
316
314
  copy(v) {
317
315
  return this._set(v.x, v.y);
@@ -320,15 +318,15 @@ class Vector2d {
320
318
  /**
321
319
  * return true if the two vectors are the same
322
320
  * @name equals
323
- * @memberOf me.Vector2d
321
+ * @memberof Vector2d
324
322
  * @function
325
- * @param {me.Vector2d} v
323
+ * @param {Vector2d} v
326
324
  * @returns {boolean}
327
325
  */
328
326
  /**
329
327
  * return true if this vector is equal to the given values
330
328
  * @name equals
331
- * @memberOf me.Vector2d
329
+ * @memberof Vector2d
332
330
  * @function
333
331
  * @param {number} x
334
332
  * @param {number} y
@@ -351,9 +349,9 @@ class Vector2d {
351
349
  /**
352
350
  * normalize this vector (scale the vector so that its magnitude is 1)
353
351
  * @name normalize
354
- * @memberOf me.Vector2d
352
+ * @memberof Vector2d
355
353
  * @function
356
- * @returns {me.Vector2d} Reference to this object for method chaining
354
+ * @returns {Vector2d} Reference to this object for method chaining
357
355
  */
358
356
  normalize() {
359
357
  return this.div(this.length() || 1);
@@ -363,9 +361,9 @@ class Vector2d {
363
361
  * change this vector to be perpendicular to what it was before.<br>
364
362
  * (Effectively rotates it 90 degrees in a clockwise direction)
365
363
  * @name perp
366
- * @memberOf me.Vector2d
364
+ * @memberof Vector2d
367
365
  * @function
368
- * @returns {me.Vector2d} Reference to this object for method chaining
366
+ * @returns {Vector2d} Reference to this object for method chaining
369
367
  */
370
368
  perp() {
371
369
  return this._set(this.y, -this.x);
@@ -374,11 +372,11 @@ class Vector2d {
374
372
  /**
375
373
  * Rotate this vector (counter-clockwise) by the specified angle (in radians).
376
374
  * @name rotate
377
- * @memberOf me.Vector2d
375
+ * @memberof Vector2d
378
376
  * @function
379
377
  * @param {number} angle The angle to rotate (in radians)
380
- * @param {me.Vector2d|me.ObservableVector2d} [v] an optional point to rotate around
381
- * @returns {me.Vector2d} Reference to this object for method chaining
378
+ * @param {Vector2d|ObservableVector2d} [v] an optional point to rotate around
379
+ * @returns {Vector2d} Reference to this object for method chaining
382
380
  */
383
381
  rotate(angle, v) {
384
382
  var cx = 0;
@@ -400,31 +398,43 @@ class Vector2d {
400
398
 
401
399
  /**
402
400
  * return the dot product of this vector and the passed one
403
- * @name dotProduct
404
- * @memberOf me.Vector2d
401
+ * @name dot
402
+ * @memberof Vector2d
405
403
  * @function
406
- * @param {me.Vector2d} v
404
+ * @param {Vector2d} v
407
405
  * @returns {number} The dot product.
408
406
  */
409
- dotProduct(v) {
407
+ dot(v) {
410
408
  return this.x * v.x + this.y * v.y;
411
409
  }
412
410
 
411
+ /**
412
+ * return the cross product of this vector and the passed one
413
+ * @name cross
414
+ * @memberof Vector2d
415
+ * @function
416
+ * @param {Vector2d} v
417
+ * @returns {number} The cross product.
418
+ */
419
+ cross(v) {
420
+ return this.x * v.y - this.y * v.x;
421
+ }
422
+
413
423
  /**
414
424
  * return the square length of this vector
415
425
  * @name length2
416
- * @memberOf me.Vector2d
426
+ * @memberof Vector2d
417
427
  * @function
418
428
  * @returns {number} The length^2 of this vector.
419
429
  */
420
430
  length2() {
421
- return this.dotProduct(this);
431
+ return this.dot(this);
422
432
  }
423
433
 
424
434
  /**
425
435
  * return the length (magnitude) of this vector
426
436
  * @name length
427
- * @memberOf me.Vector2d
437
+ * @memberof Vector2d
428
438
  * @function
429
439
  * @returns {number} the length of this vector
430
440
  */
@@ -435,11 +445,11 @@ class Vector2d {
435
445
  /**
436
446
  * Linearly interpolate between this vector and the given one.
437
447
  * @name lerp
438
- * @memberOf me.Vector2d
448
+ * @memberof Vector2d
439
449
  * @function
440
- * @param {me.Vector2d} v
450
+ * @param {Vector2d} v
441
451
  * @param {number} alpha distance along the line (alpha = 0 will be this vector, and alpha = 1 will be the given one).
442
- * @returns {me.Vector2d} Reference to this object for method chaining
452
+ * @returns {Vector2d} Reference to this object for method chaining
443
453
  */
444
454
  lerp(v, alpha) {
445
455
  this.x += ( v.x - this.x ) * alpha;
@@ -450,9 +460,9 @@ class Vector2d {
450
460
  /**
451
461
  * return the distance between this vector and the passed one
452
462
  * @name distance
453
- * @memberOf me.Vector2d
463
+ * @memberof Vector2d
454
464
  * @function
455
- * @param {me.Vector2d} v
465
+ * @param {Vector2d} v
456
466
  * @returns {number}
457
467
  */
458
468
  distance(v) {
@@ -463,46 +473,46 @@ class Vector2d {
463
473
  /**
464
474
  * return the angle between this vector and the passed one
465
475
  * @name angle
466
- * @memberOf me.Vector2d
476
+ * @memberof Vector2d
467
477
  * @function
468
- * @param {me.Vector2d} v
478
+ * @param {Vector2d} v
469
479
  * @returns {number} angle in radians
470
480
  */
471
481
  angle(v) {
472
- return Math.acos(clamp(this.dotProduct(v) / (this.length() * v.length()), -1, 1));
482
+ return Math.acos(clamp(this.dot(v) / (this.length() * v.length()), -1, 1));
473
483
  }
474
484
 
475
485
  /**
476
486
  * project this vector on to another vector.
477
487
  * @name project
478
- * @memberOf me.Vector2d
488
+ * @memberof Vector2d
479
489
  * @function
480
- * @param {me.Vector2d} v The vector to project onto.
481
- * @returns {me.Vector2d} Reference to this object for method chaining
490
+ * @param {Vector2d} v The vector to project onto.
491
+ * @returns {Vector2d} Reference to this object for method chaining
482
492
  */
483
493
  project(v) {
484
- return this.scale(this.dotProduct(v) / v.length2());
494
+ return this.scale(this.dot(v) / v.length2());
485
495
  }
486
496
 
487
497
  /**
488
498
  * Project this vector onto a vector of unit length.<br>
489
499
  * This is slightly more efficient than `project` when dealing with unit vectors.
490
500
  * @name projectN
491
- * @memberOf me.Vector2d
501
+ * @memberof Vector2d
492
502
  * @function
493
- * @param {me.Vector2d} v The unit vector to project onto.
494
- * @returns {me.Vector2d} Reference to this object for method chaining
503
+ * @param {Vector2d} v The unit vector to project onto.
504
+ * @returns {Vector2d} Reference to this object for method chaining
495
505
  */
496
506
  projectN(v) {
497
- return this.scale(this.dotProduct(v));
507
+ return this.scale(this.dot(v));
498
508
  }
499
509
 
500
510
  /**
501
511
  * return a clone copy of this vector
502
512
  * @name clone
503
- * @memberOf me.Vector2d
513
+ * @memberof Vector2d
504
514
  * @function
505
- * @returns {me.Vector2d} new me.Vector2d
515
+ * @returns {Vector2d} new me.Vector2d
506
516
  */
507
517
  clone() {
508
518
  return pool.pull("Vector2d", this.x, this.y);
@@ -511,7 +521,7 @@ class Vector2d {
511
521
  /**
512
522
  * convert the object to a string representation
513
523
  * @name toString
514
- * @memberOf me.Vector2d
524
+ * @memberof Vector2d
515
525
  * @function
516
526
  * @returns {string}
517
527
  */