melonjs 10.10.0 → 10.11.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.
- package/README.md +4 -3
- package/dist/melonjs.js +817 -1922
- package/dist/melonjs.min.js +4 -4
- package/dist/melonjs.module.d.ts +339 -1183
- package/dist/melonjs.module.js +745 -1846
- package/package.json +12 -15
- package/src/audio/audio.js +0 -1
- package/src/camera/camera2d.js +1 -16
- package/src/entity/entity.js +1 -4
- package/src/geometries/ellipse.js +2 -11
- package/src/geometries/line.js +1 -4
- package/src/geometries/path2d.js +0 -10
- package/src/geometries/poly.js +5 -22
- package/src/geometries/rectangle.js +2 -14
- package/src/geometries/roundrect.js +2 -6
- package/src/index.js +0 -1
- package/src/input/gamepad.js +3 -14
- package/src/input/keyboard.js +1 -9
- package/src/input/pointer.js +0 -1
- package/src/input/pointerevent.js +14 -23
- package/src/lang/deprecated.js +4 -3
- package/src/level/level.js +0 -9
- package/src/level/tiled/TMXGroup.js +0 -4
- package/src/level/tiled/TMXLayer.js +0 -8
- package/src/level/tiled/TMXObject.js +0 -3
- package/src/level/tiled/TMXTile.js +4 -5
- package/src/level/tiled/TMXTileMap.js +1 -7
- package/src/level/tiled/TMXTileset.js +0 -5
- package/src/level/tiled/TMXTilesetGroup.js +1 -4
- package/src/level/tiled/TMXUtils.js +0 -3
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +2 -3
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +0 -1
- package/src/level/tiled/renderer/TMXRenderer.js +1 -7
- package/src/loader/loader.js +0 -11
- package/src/loader/loadingscreen.js +1 -1
- package/src/math/color.js +5 -26
- package/src/math/math.js +0 -10
- package/src/math/matrix2.js +12 -27
- package/src/math/matrix3.js +1 -22
- package/src/math/observable_vector2.js +0 -29
- package/src/math/observable_vector3.js +0 -29
- package/src/math/vector2.js +3 -40
- package/src/math/vector3.js +4 -41
- package/src/particles/emitter.js +1 -1
- package/src/physics/body.js +1 -1
- package/src/physics/bounds.js +5 -19
- package/src/physics/collision.js +0 -1
- package/src/physics/detector.js +0 -4
- package/src/physics/quadtree.js +0 -7
- package/src/physics/sat.js +3 -3
- package/src/physics/world.js +0 -4
- package/src/plugin/plugin.js +0 -2
- package/src/polyfill/roundrect.js +4 -2
- package/src/renderable/GUI.js +0 -5
- package/src/renderable/collectable.js +1 -0
- package/src/renderable/container.js +0 -28
- package/src/renderable/dragndrop.js +0 -9
- package/src/renderable/imagelayer.js +1 -5
- package/src/renderable/light2d.js +1 -2
- package/src/renderable/renderable.js +0 -22
- package/src/renderable/sprite.js +0 -12
- package/src/renderable/trigger.js +1 -1
- package/src/state/stage.js +0 -4
- package/src/state/state.js +3 -20
- package/src/system/device.js +14 -53
- package/src/system/event.js +11 -0
- package/src/system/pooling.js +19 -8
- package/src/system/save.js +9 -11
- package/src/system/timer.js +239 -218
- package/src/text/bitmaptextdata.js +1 -4
- package/src/text/glyph.js +2 -2
- package/src/text/text.js +7 -5
- package/src/text/textmetrics.js +0 -2
- package/src/tweens/easing.js +1 -1
- package/src/tweens/interpolation.js +2 -2
- package/src/tweens/tween.js +1 -13
- package/src/utils/agent.js +1 -3
- package/src/utils/array.js +0 -3
- package/src/utils/file.js +0 -2
- package/src/utils/function.js +0 -2
- package/src/utils/string.js +0 -6
- package/src/utils/utils.js +0 -3
- package/src/video/canvas/canvas_renderer.js +4 -39
- package/src/video/renderer.js +1 -23
- package/src/video/texture/cache.js +0 -1
- package/src/video/texture/canvas_texture.js +16 -4
- package/src/video/video.js +3 -3
- package/src/video/webgl/glshader.js +0 -5
- package/src/video/webgl/utils/uniforms.js +3 -6
- package/src/video/webgl/webgl_compositor.js +0 -14
- package/src/video/webgl/webgl_renderer.js +0 -42
package/src/math/matrix2.js
CHANGED
|
@@ -68,7 +68,6 @@ class Matrix2d {
|
|
|
68
68
|
* <img src="images/identity-matrix_2x.png"/>
|
|
69
69
|
* @name identity
|
|
70
70
|
* @memberof Matrix2d
|
|
71
|
-
* @function
|
|
72
71
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
73
72
|
*/
|
|
74
73
|
identity() {
|
|
@@ -84,7 +83,6 @@ class Matrix2d {
|
|
|
84
83
|
* set the matrix to the specified value
|
|
85
84
|
* @name setTransform
|
|
86
85
|
* @memberof Matrix2d
|
|
87
|
-
* @function
|
|
88
86
|
* @param {number} a
|
|
89
87
|
* @param {number} b
|
|
90
88
|
* @param {number} c
|
|
@@ -128,7 +126,6 @@ class Matrix2d {
|
|
|
128
126
|
* Copies over the values from another me.Matrix2d.
|
|
129
127
|
* @name copy
|
|
130
128
|
* @memberof Matrix2d
|
|
131
|
-
* @function
|
|
132
129
|
* @param {Matrix2d} m the matrix object to copy from
|
|
133
130
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
134
131
|
*/
|
|
@@ -141,7 +138,6 @@ class Matrix2d {
|
|
|
141
138
|
* Copies over the upper-left 3x3 values from the given me.Matrix3d
|
|
142
139
|
* @name fromMat3d
|
|
143
140
|
* @memberof Matrix2d
|
|
144
|
-
* @function
|
|
145
141
|
* @param {Matrix3d} m the matrix object to copy from
|
|
146
142
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
147
143
|
*/
|
|
@@ -166,7 +162,6 @@ class Matrix2d {
|
|
|
166
162
|
* multiply both matrix
|
|
167
163
|
* @name multiply
|
|
168
164
|
* @memberof Matrix2d
|
|
169
|
-
* @function
|
|
170
165
|
* @param {Matrix2d} m the other matrix
|
|
171
166
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
172
167
|
*/
|
|
@@ -198,7 +193,6 @@ class Matrix2d {
|
|
|
198
193
|
* Transpose the value of this matrix.
|
|
199
194
|
* @name transpose
|
|
200
195
|
* @memberof Matrix2d
|
|
201
|
-
* @function
|
|
202
196
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
203
197
|
*/
|
|
204
198
|
transpose() {
|
|
@@ -221,7 +215,6 @@ class Matrix2d {
|
|
|
221
215
|
* invert this matrix, causing it to apply the opposite transformation.
|
|
222
216
|
* @name invert
|
|
223
217
|
* @memberof Matrix2d
|
|
224
|
-
* @function
|
|
225
218
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
226
219
|
*/
|
|
227
220
|
invert() {
|
|
@@ -253,20 +246,24 @@ class Matrix2d {
|
|
|
253
246
|
}
|
|
254
247
|
|
|
255
248
|
/**
|
|
256
|
-
* apply the current transform to the given 2d vector
|
|
249
|
+
* apply the current transform to the given 2d or 3d vector
|
|
257
250
|
* @name apply
|
|
258
251
|
* @memberof Matrix2d
|
|
259
|
-
* @
|
|
260
|
-
* @
|
|
261
|
-
* @returns {Vector2d} result vector object.
|
|
252
|
+
* @param {Vector2d|Vector3d} v the vector object to be transformed
|
|
253
|
+
* @returns {Vector2d|Vector3d} result vector object.
|
|
262
254
|
*/
|
|
263
255
|
apply(v) {
|
|
264
256
|
var a = this.val,
|
|
265
257
|
x = v.x,
|
|
266
|
-
y = v.y
|
|
258
|
+
y = v.y,
|
|
259
|
+
z = (typeof v.z !== "undefined") ? v.z : 1;
|
|
260
|
+
|
|
261
|
+
v.x = x * a[0] + y * a[3] + z * a[6];
|
|
262
|
+
v.y = x * a[1] + y * a[4] + z * a[7];
|
|
267
263
|
|
|
268
|
-
v.
|
|
269
|
-
|
|
264
|
+
if (typeof v.z !== "undefined") {
|
|
265
|
+
v.z = x * a[2] + y * a[5] + z * a[8];
|
|
266
|
+
}
|
|
270
267
|
|
|
271
268
|
return v;
|
|
272
269
|
}
|
|
@@ -275,7 +272,6 @@ class Matrix2d {
|
|
|
275
272
|
* apply the inverted current transform to the given 2d vector
|
|
276
273
|
* @name applyInverse
|
|
277
274
|
* @memberof Matrix2d
|
|
278
|
-
* @function
|
|
279
275
|
* @param {Vector2d} v the vector object to be transformed
|
|
280
276
|
* @returns {Vector2d} result vector object.
|
|
281
277
|
*/
|
|
@@ -296,7 +292,6 @@ class Matrix2d {
|
|
|
296
292
|
* scale the matrix
|
|
297
293
|
* @name scale
|
|
298
294
|
* @memberof Matrix2d
|
|
299
|
-
* @function
|
|
300
295
|
* @param {number} x a number representing the abscissa of the scaling vector.
|
|
301
296
|
* @param {number} [y=x] a number representing the ordinate of the scaling vector.
|
|
302
297
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
@@ -318,7 +313,6 @@ class Matrix2d {
|
|
|
318
313
|
* adds a 2D scaling transformation.
|
|
319
314
|
* @name scaleV
|
|
320
315
|
* @memberof Matrix2d
|
|
321
|
-
* @function
|
|
322
316
|
* @param {Vector2d} v scaling vector
|
|
323
317
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
324
318
|
*/
|
|
@@ -330,7 +324,6 @@ class Matrix2d {
|
|
|
330
324
|
* specifies a 2D scale operation using the [sx, 1] scaling vector
|
|
331
325
|
* @name scaleX
|
|
332
326
|
* @memberof Matrix2d
|
|
333
|
-
* @function
|
|
334
327
|
* @param {number} x x scaling vector
|
|
335
328
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
336
329
|
*/
|
|
@@ -342,7 +335,6 @@ class Matrix2d {
|
|
|
342
335
|
* specifies a 2D scale operation using the [1,sy] scaling vector
|
|
343
336
|
* @name scaleY
|
|
344
337
|
* @memberof Matrix2d
|
|
345
|
-
* @function
|
|
346
338
|
* @param {number} y y scaling vector
|
|
347
339
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
348
340
|
*/
|
|
@@ -354,7 +346,6 @@ class Matrix2d {
|
|
|
354
346
|
* rotate the matrix (counter-clockwise) by the specified angle (in radians).
|
|
355
347
|
* @name rotate
|
|
356
348
|
* @memberof Matrix2d
|
|
357
|
-
* @function
|
|
358
349
|
* @param {number} angle Rotation angle in radians.
|
|
359
350
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
360
351
|
*/
|
|
@@ -385,7 +376,7 @@ class Matrix2d {
|
|
|
385
376
|
* translate the matrix position on the horizontal and vertical axis
|
|
386
377
|
* @name translate
|
|
387
378
|
* @memberof Matrix2d
|
|
388
|
-
* @
|
|
379
|
+
* @method
|
|
389
380
|
* @param {number} x the x coordindates to translate the matrix by
|
|
390
381
|
* @param {number} y the y coordindates to translate the matrix by
|
|
391
382
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
@@ -394,7 +385,6 @@ class Matrix2d {
|
|
|
394
385
|
* translate the matrix by a vector on the horizontal and vertical axis
|
|
395
386
|
* @name translateV
|
|
396
387
|
* @memberof Matrix2d
|
|
397
|
-
* @function
|
|
398
388
|
* @param {Vector2d} v the vector to translate the matrix by
|
|
399
389
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
400
390
|
*/
|
|
@@ -422,7 +412,6 @@ class Matrix2d {
|
|
|
422
412
|
* returns true if the matrix is an identity matrix.
|
|
423
413
|
* @name isIdentity
|
|
424
414
|
* @memberof Matrix2d
|
|
425
|
-
* @function
|
|
426
415
|
* @returns {boolean}
|
|
427
416
|
*/
|
|
428
417
|
isIdentity() {
|
|
@@ -445,7 +434,6 @@ class Matrix2d {
|
|
|
445
434
|
* return true if the two matrices are identical
|
|
446
435
|
* @name equals
|
|
447
436
|
* @memberof Matrix2d
|
|
448
|
-
* @function
|
|
449
437
|
* @param {Matrix2d} m the other matrix
|
|
450
438
|
* @returns {boolean} true if both are equals
|
|
451
439
|
*/
|
|
@@ -470,7 +458,6 @@ class Matrix2d {
|
|
|
470
458
|
* Clone the Matrix
|
|
471
459
|
* @name clone
|
|
472
460
|
* @memberof Matrix2d
|
|
473
|
-
* @function
|
|
474
461
|
* @returns {Matrix2d}
|
|
475
462
|
*/
|
|
476
463
|
clone() {
|
|
@@ -481,7 +468,6 @@ class Matrix2d {
|
|
|
481
468
|
* return an array representation of this Matrix
|
|
482
469
|
* @name toArray
|
|
483
470
|
* @memberof Matrix2d
|
|
484
|
-
* @function
|
|
485
471
|
* @returns {Float32Array}
|
|
486
472
|
*/
|
|
487
473
|
toArray() {
|
|
@@ -492,7 +478,6 @@ class Matrix2d {
|
|
|
492
478
|
* convert the object to a string representation
|
|
493
479
|
* @name toString
|
|
494
480
|
* @memberof Matrix2d
|
|
495
|
-
* @function
|
|
496
481
|
* @returns {string}
|
|
497
482
|
*/
|
|
498
483
|
toString() {
|
package/src/math/matrix3.js
CHANGED
|
@@ -71,7 +71,6 @@ class Matrix3d {
|
|
|
71
71
|
* <img src="images/identity-matrix_2x.png"/>
|
|
72
72
|
* @name identity
|
|
73
73
|
* @memberof Matrix3d
|
|
74
|
-
* @function
|
|
75
74
|
* @returns {Matrix3d} Reference to this object for method chaining
|
|
76
75
|
*/
|
|
77
76
|
identity() {
|
|
@@ -87,7 +86,6 @@ class Matrix3d {
|
|
|
87
86
|
* set the matrix to the specified value
|
|
88
87
|
* @name setTransform
|
|
89
88
|
* @memberof Matrix3d
|
|
90
|
-
* @function
|
|
91
89
|
* @param {number} m00
|
|
92
90
|
* @param {number} m01
|
|
93
91
|
* @param {number} m02
|
|
@@ -133,7 +131,6 @@ class Matrix3d {
|
|
|
133
131
|
* Copies over the values from another me.Matrix3d.
|
|
134
132
|
* @name copy
|
|
135
133
|
* @memberof Matrix3d
|
|
136
|
-
* @function
|
|
137
134
|
* @param {Matrix3d} m the matrix object to copy from
|
|
138
135
|
* @returns {Matrix3d} Reference to this object for method chaining
|
|
139
136
|
*/
|
|
@@ -146,7 +143,6 @@ class Matrix3d {
|
|
|
146
143
|
* Copies over the upper-left 2x2 values from the given me.Matrix2d
|
|
147
144
|
* @name fromMat2d
|
|
148
145
|
* @memberof Matrix3d
|
|
149
|
-
* @function
|
|
150
146
|
* @param {Matrix2d} m the matrix object to copy from
|
|
151
147
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
152
148
|
*/
|
|
@@ -165,7 +161,6 @@ class Matrix3d {
|
|
|
165
161
|
* multiply both matrix
|
|
166
162
|
* @name multiply
|
|
167
163
|
* @memberof Matrix3d
|
|
168
|
-
* @function
|
|
169
164
|
* @param {Matrix3d} m Other matrix
|
|
170
165
|
* @returns {Matrix3d} Reference to this object for method chaining
|
|
171
166
|
*/
|
|
@@ -221,7 +216,6 @@ class Matrix3d {
|
|
|
221
216
|
* Transpose the value of this matrix.
|
|
222
217
|
* @name transpose
|
|
223
218
|
* @memberof Matrix3d
|
|
224
|
-
* @function
|
|
225
219
|
* @returns {Matrix3d} Reference to this object for method chaining
|
|
226
220
|
*/
|
|
227
221
|
transpose() {
|
|
@@ -253,7 +247,6 @@ class Matrix3d {
|
|
|
253
247
|
* invert this matrix, causing it to apply the opposite transformation.
|
|
254
248
|
* @name invert
|
|
255
249
|
* @memberof Matrix3d
|
|
256
|
-
* @function
|
|
257
250
|
* @returns {Matrix3d} Reference to this object for method chaining
|
|
258
251
|
*/
|
|
259
252
|
invert() {
|
|
@@ -313,7 +306,6 @@ class Matrix3d {
|
|
|
313
306
|
* apply the current transform to the given 2d or 3d vector
|
|
314
307
|
* @name apply
|
|
315
308
|
* @memberof Matrix3d
|
|
316
|
-
* @function
|
|
317
309
|
* @param {Vector2d|Vector3d} v the vector object to be transformed
|
|
318
310
|
* @returns {Vector2d|Vector3d} result vector object.
|
|
319
311
|
*/
|
|
@@ -339,7 +331,6 @@ class Matrix3d {
|
|
|
339
331
|
* apply the inverted current transform to the given 2d or 3d vector
|
|
340
332
|
* @name applyInverse
|
|
341
333
|
* @memberof Matrix3d
|
|
342
|
-
* @function
|
|
343
334
|
* @param {Vector2d|Vector3d} v the vector object to be transformed
|
|
344
335
|
* @returns {Vector2d|Vector3d} result vector object.
|
|
345
336
|
*/
|
|
@@ -360,7 +351,6 @@ class Matrix3d {
|
|
|
360
351
|
* <img src="images/glOrtho.gif"/><br>
|
|
361
352
|
* @name ortho
|
|
362
353
|
* @memberof Matrix3d
|
|
363
|
-
* @function
|
|
364
354
|
* @param {number} left farthest left on the x-axis
|
|
365
355
|
* @param {number} right farthest right on the x-axis
|
|
366
356
|
* @param {number} bottom farthest down on the y-axis
|
|
@@ -399,7 +389,6 @@ class Matrix3d {
|
|
|
399
389
|
* scale the matrix
|
|
400
390
|
* @name scale
|
|
401
391
|
* @memberof Matrix3d
|
|
402
|
-
* @function
|
|
403
392
|
* @param {number} x a number representing the abscissa of the scaling vector.
|
|
404
393
|
* @param {number} [y=x] a number representing the ordinate of the scaling vector.
|
|
405
394
|
* @param {number} [z=0] a number representing the depth vector
|
|
@@ -433,7 +422,6 @@ class Matrix3d {
|
|
|
433
422
|
* adds a 2D scaling transformation.
|
|
434
423
|
* @name scaleV
|
|
435
424
|
* @memberof Matrix3d
|
|
436
|
-
* @function
|
|
437
425
|
* @param {Vector2d|Vector3d} v scaling vector
|
|
438
426
|
* @returns {Matrix3d} Reference to this object for method chaining
|
|
439
427
|
*/
|
|
@@ -445,7 +433,6 @@ class Matrix3d {
|
|
|
445
433
|
* specifies a 2D scale operation using the [sx, 1] scaling vector
|
|
446
434
|
* @name scaleX
|
|
447
435
|
* @memberof Matrix3d
|
|
448
|
-
* @function
|
|
449
436
|
* @param {number} x x scaling vector
|
|
450
437
|
* @returns {Matrix3d} Reference to this object for method chaining
|
|
451
438
|
*/
|
|
@@ -457,7 +444,6 @@ class Matrix3d {
|
|
|
457
444
|
* specifies a 2D scale operation using the [1,sy] scaling vector
|
|
458
445
|
* @name scaleY
|
|
459
446
|
* @memberof Matrix3d
|
|
460
|
-
* @function
|
|
461
447
|
* @param {number} y y scaling vector
|
|
462
448
|
* @returns {Matrix3d} Reference to this object for method chaining
|
|
463
449
|
*/
|
|
@@ -469,7 +455,6 @@ class Matrix3d {
|
|
|
469
455
|
* rotate this matrix (counter-clockwise) by the specified angle (in radians).
|
|
470
456
|
* @name rotate
|
|
471
457
|
* @memberof Matrix3d
|
|
472
|
-
* @function
|
|
473
458
|
* @param {number} angle Rotation angle in radians.
|
|
474
459
|
* @param {Vector3d} v the axis to rotate around
|
|
475
460
|
* @returns {Matrix3d} Reference to this object for method chaining
|
|
@@ -549,7 +534,7 @@ class Matrix3d {
|
|
|
549
534
|
* translate the matrix position using the given vector
|
|
550
535
|
* @name translate
|
|
551
536
|
* @memberof Matrix3d
|
|
552
|
-
* @
|
|
537
|
+
* @method
|
|
553
538
|
* @param {number} x a number representing the abscissa of the vector.
|
|
554
539
|
* @param {number} [y=x] a number representing the ordinate of the vector.
|
|
555
540
|
* @param {number} [z=0] a number representing the depth of the vector
|
|
@@ -559,7 +544,6 @@ class Matrix3d {
|
|
|
559
544
|
* translate the matrix by a vector on the horizontal and vertical axis
|
|
560
545
|
* @name translateV
|
|
561
546
|
* @memberof Matrix3d
|
|
562
|
-
* @function
|
|
563
547
|
* @param {Vector2d|Vector3d} v the vector to translate the matrix by
|
|
564
548
|
* @returns {Matrix3d} Reference to this object for method chaining
|
|
565
549
|
*/
|
|
@@ -591,7 +575,6 @@ class Matrix3d {
|
|
|
591
575
|
* returns true if the matrix is an identity matrix.
|
|
592
576
|
* @name isIdentity
|
|
593
577
|
* @memberof Matrix3d
|
|
594
|
-
* @function
|
|
595
578
|
* @returns {boolean}
|
|
596
579
|
*/
|
|
597
580
|
isIdentity() {
|
|
@@ -621,7 +604,6 @@ class Matrix3d {
|
|
|
621
604
|
* return true if the two matrices are identical
|
|
622
605
|
* @name equals
|
|
623
606
|
* @memberof Matrix3d
|
|
624
|
-
* @function
|
|
625
607
|
* @param {Matrix3d} m the other matrix
|
|
626
608
|
* @returns {boolean} true if both are equals
|
|
627
609
|
*/
|
|
@@ -653,7 +635,6 @@ class Matrix3d {
|
|
|
653
635
|
* Clone the Matrix
|
|
654
636
|
* @name clone
|
|
655
637
|
* @memberof Matrix3d
|
|
656
|
-
* @function
|
|
657
638
|
* @returns {Matrix3d}
|
|
658
639
|
*/
|
|
659
640
|
clone() {
|
|
@@ -664,7 +645,6 @@ class Matrix3d {
|
|
|
664
645
|
* return an array representation of this Matrix
|
|
665
646
|
* @name toArray
|
|
666
647
|
* @memberof Matrix3d
|
|
667
|
-
* @function
|
|
668
648
|
* @returns {Float32Array}
|
|
669
649
|
*/
|
|
670
650
|
toArray() {
|
|
@@ -675,7 +655,6 @@ class Matrix3d {
|
|
|
675
655
|
* convert the object to a string representation
|
|
676
656
|
* @name toString
|
|
677
657
|
* @memberof Matrix3d
|
|
678
|
-
* @function
|
|
679
658
|
* @returns {string}
|
|
680
659
|
*/
|
|
681
660
|
toString() {
|
|
@@ -97,7 +97,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
97
97
|
* set the vector value without triggering the callback
|
|
98
98
|
* @name setMuted
|
|
99
99
|
* @memberof ObservableVector2d
|
|
100
|
-
* @function
|
|
101
100
|
* @param {number} x x value of the vector
|
|
102
101
|
* @param {number} y y value of the vector
|
|
103
102
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
@@ -112,7 +111,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
112
111
|
* set the callback to be executed when the vector is changed
|
|
113
112
|
* @name setCallback
|
|
114
113
|
* @memberof ObservableVector2d
|
|
115
|
-
* @function
|
|
116
114
|
* @param {Function} fn callback
|
|
117
115
|
* @param {Function} [scope=null] scope
|
|
118
116
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
@@ -132,7 +130,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
132
130
|
* Add the passed vector to this vector
|
|
133
131
|
* @name add
|
|
134
132
|
* @memberof ObservableVector2d
|
|
135
|
-
* @function
|
|
136
133
|
* @param {ObservableVector2d} v
|
|
137
134
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
138
135
|
*/
|
|
@@ -144,7 +141,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
144
141
|
* Substract the passed vector to this vector
|
|
145
142
|
* @name sub
|
|
146
143
|
* @memberof ObservableVector2d
|
|
147
|
-
* @function
|
|
148
144
|
* @param {ObservableVector2d} v
|
|
149
145
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
150
146
|
*/
|
|
@@ -156,7 +152,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
156
152
|
* Multiply this vector values by the given scalar
|
|
157
153
|
* @name scale
|
|
158
154
|
* @memberof ObservableVector2d
|
|
159
|
-
* @function
|
|
160
155
|
* @param {number} x
|
|
161
156
|
* @param {number} [y=x]
|
|
162
157
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
@@ -169,7 +164,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
169
164
|
* Multiply this vector values by the passed vector
|
|
170
165
|
* @name scaleV
|
|
171
166
|
* @memberof ObservableVector2d
|
|
172
|
-
* @function
|
|
173
167
|
* @param {ObservableVector2d} v
|
|
174
168
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
175
169
|
*/
|
|
@@ -181,7 +175,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
181
175
|
* Divide this vector values by the passed value
|
|
182
176
|
* @name div
|
|
183
177
|
* @memberof ObservableVector2d
|
|
184
|
-
* @function
|
|
185
178
|
* @param {number} n the value to divide the vector by
|
|
186
179
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
187
180
|
*/
|
|
@@ -193,7 +186,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
193
186
|
* Update this vector values to absolute values
|
|
194
187
|
* @name abs
|
|
195
188
|
* @memberof ObservableVector2d
|
|
196
|
-
* @function
|
|
197
189
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
198
190
|
*/
|
|
199
191
|
abs() {
|
|
@@ -204,7 +196,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
204
196
|
* Clamp the vector value within the specified value range
|
|
205
197
|
* @name clamp
|
|
206
198
|
* @memberof ObservableVector2d
|
|
207
|
-
* @function
|
|
208
199
|
* @param {number} low
|
|
209
200
|
* @param {number} high
|
|
210
201
|
* @returns {ObservableVector2d} new me.ObservableVector2d
|
|
@@ -217,7 +208,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
217
208
|
* Clamp this vector value within the specified value range
|
|
218
209
|
* @name clampSelf
|
|
219
210
|
* @memberof ObservableVector2d
|
|
220
|
-
* @function
|
|
221
211
|
* @param {number} low
|
|
222
212
|
* @param {number} high
|
|
223
213
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
@@ -230,7 +220,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
230
220
|
* Update this vector with the minimum value between this and the passed vector
|
|
231
221
|
* @name minV
|
|
232
222
|
* @memberof ObservableVector2d
|
|
233
|
-
* @function
|
|
234
223
|
* @param {ObservableVector2d} v
|
|
235
224
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
236
225
|
*/
|
|
@@ -242,7 +231,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
242
231
|
* Update this vector with the maximum value between this and the passed vector
|
|
243
232
|
* @name maxV
|
|
244
233
|
* @memberof ObservableVector2d
|
|
245
|
-
* @function
|
|
246
234
|
* @param {ObservableVector2d} v
|
|
247
235
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
248
236
|
*/
|
|
@@ -254,7 +242,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
254
242
|
* Floor the vector values
|
|
255
243
|
* @name floor
|
|
256
244
|
* @memberof ObservableVector2d
|
|
257
|
-
* @function
|
|
258
245
|
* @returns {ObservableVector2d} new me.ObservableVector2d
|
|
259
246
|
*/
|
|
260
247
|
floor() {
|
|
@@ -265,7 +252,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
265
252
|
* Floor this vector values
|
|
266
253
|
* @name floorSelf
|
|
267
254
|
* @memberof ObservableVector2d
|
|
268
|
-
* @function
|
|
269
255
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
270
256
|
*/
|
|
271
257
|
floorSelf() {
|
|
@@ -276,7 +262,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
276
262
|
* Ceil the vector values
|
|
277
263
|
* @name ceil
|
|
278
264
|
* @memberof ObservableVector2d
|
|
279
|
-
* @function
|
|
280
265
|
* @returns {ObservableVector2d} new me.ObservableVector2d
|
|
281
266
|
*/
|
|
282
267
|
ceil() {
|
|
@@ -287,7 +272,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
287
272
|
* Ceil this vector values
|
|
288
273
|
* @name ceilSelf
|
|
289
274
|
* @memberof ObservableVector2d
|
|
290
|
-
* @function
|
|
291
275
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
292
276
|
*/
|
|
293
277
|
ceilSelf() {
|
|
@@ -298,7 +282,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
298
282
|
* Negate the vector values
|
|
299
283
|
* @name negate
|
|
300
284
|
* @memberof ObservableVector2d
|
|
301
|
-
* @function
|
|
302
285
|
* @returns {ObservableVector2d} new me.ObservableVector2d
|
|
303
286
|
*/
|
|
304
287
|
negate() {
|
|
@@ -309,7 +292,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
309
292
|
* Negate this vector values
|
|
310
293
|
* @name negateSelf
|
|
311
294
|
* @memberof ObservableVector2d
|
|
312
|
-
* @function
|
|
313
295
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
314
296
|
*/
|
|
315
297
|
negateSelf() {
|
|
@@ -320,7 +302,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
320
302
|
* Copy the x,y values of the passed vector to this one
|
|
321
303
|
* @name copy
|
|
322
304
|
* @memberof ObservableVector2d
|
|
323
|
-
* @function
|
|
324
305
|
* @param {ObservableVector2d} v
|
|
325
306
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
326
307
|
*/
|
|
@@ -332,7 +313,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
332
313
|
* return true if the two vectors are the same
|
|
333
314
|
* @name equals
|
|
334
315
|
* @memberof ObservableVector2d
|
|
335
|
-
* @function
|
|
336
316
|
* @param {ObservableVector2d} v
|
|
337
317
|
* @returns {boolean}
|
|
338
318
|
*/
|
|
@@ -345,7 +325,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
345
325
|
* (Effectively rotates it 90 degrees in a clockwise direction)
|
|
346
326
|
* @name perp
|
|
347
327
|
* @memberof ObservableVector2d
|
|
348
|
-
* @function
|
|
349
328
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
350
329
|
*/
|
|
351
330
|
perp() {
|
|
@@ -356,7 +335,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
356
335
|
* Rotate this vector (counter-clockwise) by the specified angle (in radians).
|
|
357
336
|
* @name rotate
|
|
358
337
|
* @memberof ObservableVector2d
|
|
359
|
-
* @function
|
|
360
338
|
* @param {number} angle The angle to rotate (in radians)
|
|
361
339
|
* @param {Vector2d|ObservableVector2d} [v] an optional point to rotate around
|
|
362
340
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
@@ -383,7 +361,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
383
361
|
* return the dot product of this vector and the passed one
|
|
384
362
|
* @name dot
|
|
385
363
|
* @memberof ObservableVector2d
|
|
386
|
-
* @function
|
|
387
364
|
* @param {Vector2d|ObservableVector2d} v
|
|
388
365
|
* @returns {number} The dot product.
|
|
389
366
|
*/
|
|
@@ -395,7 +372,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
395
372
|
* return the cross product of this vector and the passed one
|
|
396
373
|
* @name cross
|
|
397
374
|
* @memberof ObservableVector2d
|
|
398
|
-
* @function
|
|
399
375
|
* @param {Vector2d|ObservableVector2d} v
|
|
400
376
|
* @returns {number} The cross product.
|
|
401
377
|
*/
|
|
@@ -407,7 +383,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
407
383
|
* Linearly interpolate between this vector and the given one.
|
|
408
384
|
* @name lerp
|
|
409
385
|
* @memberof ObservableVector2d
|
|
410
|
-
* @function
|
|
411
386
|
* @param {Vector2d|ObservableVector2d} v
|
|
412
387
|
* @param {number} alpha distance along the line (alpha = 0 will be this vector, and alpha = 1 will be the given one).
|
|
413
388
|
* @returns {ObservableVector2d} Reference to this object for method chaining
|
|
@@ -422,7 +397,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
422
397
|
* return the distance between this vector and the passed one
|
|
423
398
|
* @name distance
|
|
424
399
|
* @memberof ObservableVector2d
|
|
425
|
-
* @function
|
|
426
400
|
* @param {ObservableVector2d} v
|
|
427
401
|
* @returns {number}
|
|
428
402
|
*/
|
|
@@ -434,7 +408,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
434
408
|
* return a clone copy of this vector
|
|
435
409
|
* @name clone
|
|
436
410
|
* @memberof ObservableVector2d
|
|
437
|
-
* @function
|
|
438
411
|
* @returns {ObservableVector2d} new me.ObservableVector2d
|
|
439
412
|
*/
|
|
440
413
|
clone() {
|
|
@@ -445,7 +418,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
445
418
|
* return a `me.Vector2d` copy of this `me.ObservableVector2d` object
|
|
446
419
|
* @name toVector2d
|
|
447
420
|
* @memberof ObservableVector2d
|
|
448
|
-
* @function
|
|
449
421
|
* @returns {Vector2d} new me.Vector2d
|
|
450
422
|
*/
|
|
451
423
|
toVector2d() {
|
|
@@ -456,7 +428,6 @@ class ObservableVector2d extends Vector2d {
|
|
|
456
428
|
* convert the object to a string representation
|
|
457
429
|
* @name toString
|
|
458
430
|
* @memberof ObservableVector2d
|
|
459
|
-
* @function
|
|
460
431
|
* @returns {string}
|
|
461
432
|
*/
|
|
462
433
|
toString() {
|