@awayjs/scene 0.13.276 → 0.13.277

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- console.debug('AwayJS - Scene - 0.13.276');
1
+ console.debug('AwayJS - Scene - 0.13.277');
2
2
  export { Timeline } from './lib/base/Timeline';
3
3
  export { ControllerBase } from './lib/controllers/ControllerBase';
4
4
  export { FirstPersonController } from './lib/controllers/FirstPersonController';
@@ -14,8 +14,6 @@ export declare class MouseManager {
14
14
  private _pickerLookup;
15
15
  private _pointerDataArray;
16
16
  private _updateDirty;
17
- private _mouseDragCollision;
18
- private _mouseDragging;
19
17
  private _focusNode;
20
18
  allowKeyInput: boolean;
21
19
  private _eventBubbling;
@@ -1 +1 @@
1
- {"version":3,"file":"MouseManager.d.ts","sourceRoot":"","sources":["../../../lib/managers/MouseManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAM9E,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;GAGG;AACH,qBAAa,YAAY;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAe;IACvC,OAAc,aAAa,EAAE,cAAc,CAAC;IAE5C,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,MAAM,CAAC,aAAa,CAAoC;IAChE,OAAO,CAAC,aAAa,CAAoD;IACzE,OAAO,CAAC,iBAAiB,CAAmC;IAE5D,OAAO,CAAC,YAAY,CAAU;IAE9B,OAAO,CAAC,mBAAmB,CAAmB;IAC9C,OAAO,CAAC,cAAc,CAAU;IAChC,OAAO,CAAC,UAAU,CAAgB;IAE3B,aAAa,EAAE,OAAO,CAAM;IAEn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CAAC,eAAe;CAyBvB"}
@@ -39,7 +39,6 @@ var MouseManager = /** @class */ (function () {
39
39
  this.onKeyDown = this.onKeyDown.bind(this);
40
40
  this.onKeyUp = this.onKeyUp.bind(this);
41
41
  this._showCursor = true;
42
- this._mouseDragging = false;
43
42
  //register stage
44
43
  var container = this._stage.container;
45
44
  container.addEventListener('touchstart', this.onMouseDown);
@@ -61,7 +60,7 @@ var MouseManager = /** @class */ (function () {
61
60
  this._isAVM1Dragging = isAVM1Dragging;
62
61
  // we MUST overrider collision target if present, because draggable !== drag emitter
63
62
  if (collision)
64
- this._mouseDragCollision = collision;
63
+ this._pointerDataArray[0].dragCollision = collision;
65
64
  };
66
65
  MouseManager.prototype.stopDragObject = function () {
67
66
  this._isAVM1Dragging = false;
@@ -217,7 +216,7 @@ var MouseManager = /** @class */ (function () {
217
216
  }
218
217
  };
219
218
  MouseManager.prototype._fireMouseEventsInternal = function (pointerData, forcePicker) {
220
- var _a;
219
+ var _a, _b, _c;
221
220
  if (forcePicker === void 0) { forcePicker = null; }
222
221
  var collision;
223
222
  if (forcePicker) {
@@ -236,7 +235,6 @@ var MouseManager = /** @class */ (function () {
236
235
  dispatcher = collision === null || collision === void 0 ? void 0 : collision.rootNode;
237
236
  this.setUpEvent(event, pointerData, collision);
238
237
  if (event.type == pointerData.down.type) {
239
- this._mouseDragging = true;
240
238
  // no event-bubbling. dispatch on stage first
241
239
  if (!this._eventBubbling)
242
240
  this._stage.dispatchEvent(event);
@@ -246,14 +244,14 @@ var MouseManager = /** @class */ (function () {
246
244
  if (!pointerData.isMouse)
247
245
  this.setupAndDispatchEvent(pointerData.over, pointerData, collision);
248
246
  if (pointerData.id == 0)
249
- this._mouseDragCollision = collision;
247
+ pointerData.dragCollision = collision;
250
248
  if (dispatcher)
251
249
  this.dispatchEvent(event, dispatcher);
252
250
  else if (this._eventBubbling)
253
251
  this._stage.dispatchEvent(event);
254
- if (this._mouseDragCollision) {
255
- this.setFocus(this._mouseDragCollision.rootNode);
256
- this.setupAndDispatchEvent(this._dragStart, pointerData, this._mouseDragCollision);
252
+ if (pointerData.dragCollision) {
253
+ this.setFocus(pointerData.dragCollision.rootNode);
254
+ this.setupAndDispatchEvent(this._dragStart, pointerData, pointerData.dragCollision);
257
255
  }
258
256
  }
259
257
  else if (event.type == pointerData.up.type) {
@@ -264,25 +262,23 @@ var MouseManager = /** @class */ (function () {
264
262
  // so we need to recheck the collision ?
265
263
  var upContainerNode = null;
266
264
  var upRootNode = null;
267
- if (this._isAVM1Dragging && this._mouseDragCollision) {
265
+ if (this._isAVM1Dragging && pointerData.dragCollision) {
268
266
  // avm1dragging is in process, dispatch the mouse-up on this.
269
267
  // mouseDragEntity instead of the current collision
270
- upRootNode = this._mouseDragCollision.rootNode;
271
- upContainerNode = this._mouseDragCollision.containerNode;
268
+ upRootNode = pointerData.dragCollision.rootNode;
269
+ upContainerNode = pointerData.dragCollision.containerNode;
272
270
  }
273
- else if (this._mouseDragging && this._mouseDragCollision
274
- && this._mouseDragCollision.rootNode != dispatcher) {
271
+ else if (pointerData.dragCollision && pointerData.dragCollision.rootNode != dispatcher) {
275
272
  // no avm1dragging is in process, but current collision
276
273
  // is not the same as collision that appeared on mouse-down,
277
274
  // need to dispatch a MOUSE_UP_OUTSIDE after mouse up
278
275
  }
279
- else if (this._mouseDragging && this._mouseDragCollision
280
- && this._mouseDragCollision.rootNode == dispatcher) {
276
+ else if (pointerData.dragCollision && pointerData.dragCollision.rootNode == dispatcher) {
281
277
  // no avm1dragging is in process,
282
278
  // current collision is the same as collision that appeared on
283
279
  // mouse-down, need to dispatch a MOUSE_CLICK event after mouse up
284
- upRootNode = this._mouseDragCollision.rootNode;
285
- upContainerNode = this._mouseDragCollision.containerNode;
280
+ upRootNode = pointerData.dragCollision.rootNode;
281
+ upContainerNode = pointerData.dragCollision.containerNode;
286
282
  }
287
283
  if (upRootNode)
288
284
  this.dispatchEvent(event, upRootNode);
@@ -292,14 +288,13 @@ var MouseManager = /** @class */ (function () {
292
288
  this._stage.dispatchEvent(event);
293
289
  if (upContainerNode) {
294
290
  if (!this._isAVM1Dragging)
295
- this.setupAndDispatchEvent(pointerData.click, pointerData, this._mouseDragCollision);
296
- this.setupAndDispatchEvent(this._dragStop, pointerData, this._mouseDragCollision);
291
+ this.setupAndDispatchEvent(pointerData.click, pointerData, pointerData.dragCollision);
292
+ this.setupAndDispatchEvent(this._dragStop, pointerData, pointerData.dragCollision);
297
293
  }
298
- else if (this._mouseDragging && this._mouseDragCollision) {
299
- this.setupAndDispatchEvent(pointerData.upOutside, pointerData, this._mouseDragCollision);
294
+ else if (pointerData.dragCollision) {
295
+ this.setupAndDispatchEvent(pointerData.upOutside, pointerData, pointerData.dragCollision);
300
296
  }
301
- this._mouseDragCollision = null;
302
- this._mouseDragging = false;
297
+ pointerData.dragCollision = null;
303
298
  this._isAVM1Dragging = false;
304
299
  //make sure to clear old touch references when no longer needed
305
300
  if (pointerData.id != 0)
@@ -312,8 +307,8 @@ var MouseManager = /** @class */ (function () {
312
307
  // fire to picker
313
308
  if (dispatcher)
314
309
  this.dispatchEvent(event, dispatcher);
315
- if (this._mouseDragCollision)
316
- this.setupAndDispatchEvent(this._dragMove, pointerData, this._mouseDragCollision);
310
+ if (pointerData.dragCollision)
311
+ this.setupAndDispatchEvent(this._dragMove, pointerData, pointerData.dragCollision);
317
312
  // if bubbling is exist, fire to stage late
318
313
  if (this._eventBubbling)
319
314
  this._stage.dispatchEvent(event);
@@ -336,8 +331,7 @@ var MouseManager = /** @class */ (function () {
336
331
  // Store the info if the collision is a enabled Button (_collisionIsEnabledButton)
337
332
  if (prevCollisionNode) {
338
333
  this.setupAndDispatchEvent(pointerData.out, pointerData, pointerData.prevCollision);
339
- if (this._mouseDragging && this._mouseDragCollision
340
- && this._mouseDragCollision.rootNode == prevCollisionNode)
334
+ if (((_b = pointerData.dragCollision) === null || _b === void 0 ? void 0 : _b.rootNode) == prevCollisionNode)
341
335
  this.setupAndDispatchEvent(this._dragOut, pointerData, pointerData.prevCollision);
342
336
  }
343
337
  if (!prevCollisionNode && collisionNode) {
@@ -378,7 +372,7 @@ var MouseManager = /** @class */ (function () {
378
372
  pointerData.collisionIsEnabledButton = collisionNode ? collisionNode.buttonEnabled : false;
379
373
  if (collisionNode) {
380
374
  this.setupAndDispatchEvent(pointerData.over, pointerData, collision);
381
- if (this._mouseDragging)
375
+ if (pointerData.dragCollision)
382
376
  this.setupAndDispatchEvent(this._dragOver, pointerData, collision);
383
377
  }
384
378
  pointerData.prevCollision = collision;
@@ -391,13 +385,13 @@ var MouseManager = /** @class */ (function () {
391
385
  if (pointerData.collisionIsEnabledButton != isActiveButton && isActiveButton) {
392
386
  if (pointerData.isMouse)
393
387
  this.setupAndDispatchEvent(pointerData.over, pointerData, collision);
394
- else if (this._mouseDragCollision && this._mouseDragCollision.rootNode == collisionNode)
388
+ else if (((_c = pointerData.dragCollision) === null || _c === void 0 ? void 0 : _c.rootNode) == collisionNode)
395
389
  this.setupAndDispatchEvent(this._dragOver, pointerData, collision);
396
390
  }
397
391
  pointerData.collisionIsEnabledButton = isActiveButton;
398
392
  }
399
393
  // set cursor if not dragging mouse ???
400
- if (!this._mouseDragging) {
394
+ if (!pointerData.dragCollision) {
401
395
  this.cursorType = collisionNode ? collisionNode.container.getMouseCursor() : 'auto';
402
396
  }
403
397
  this._updateDirty = false;
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- console.debug('AwayJS - Scene - 0.13.276');
1
+ console.debug('AwayJS - Scene - 0.13.277');
2
2
 
3
3
  export { IDisplayObjectAdapter } from './lib/adapters/IDisplayObjectAdapter';
4
4
  export { IMovieClipAdapter } from './lib/adapters/IMovieClipAdapter';
@@ -27,8 +27,6 @@ export class MouseManager {
27
27
 
28
28
  private _updateDirty: boolean;
29
29
 
30
- private _mouseDragCollision: PickingCollision; // entity hit on mouse-down
31
- private _mouseDragging: boolean; // true while mosue is dragged
32
30
  private _focusNode: ContainerNode; // entity currently in focus
33
31
 
34
32
  public allowKeyInput: boolean=true;
@@ -89,7 +87,7 @@ export class MouseManager {
89
87
 
90
88
  // we MUST overrider collision target if present, because draggable !== drag emitter
91
89
  if (collision)
92
- this._mouseDragCollision = collision;
90
+ this._pointerDataArray[0].dragCollision = collision;
93
91
  }
94
92
 
95
93
  public stopDragObject() {
@@ -138,7 +136,6 @@ export class MouseManager {
138
136
  this.onKeyUp = this.onKeyUp.bind(this);
139
137
 
140
138
  this._showCursor = true;
141
- this._mouseDragging = false;
142
139
 
143
140
  //register stage
144
141
  const container = this._stage.container;
@@ -318,8 +315,6 @@ export class MouseManager {
318
315
  this.setUpEvent(event, pointerData, collision);
319
316
 
320
317
  if (event.type == pointerData.down.type) {
321
- this._mouseDragging = true;
322
-
323
318
  // no event-bubbling. dispatch on stage first
324
319
  if (!this._eventBubbling)
325
320
  this._stage.dispatchEvent(event);
@@ -332,16 +327,16 @@ export class MouseManager {
332
327
  this.setupAndDispatchEvent(pointerData.over, pointerData, collision);
333
328
 
334
329
  if (pointerData.id == 0)
335
- this._mouseDragCollision = collision;
330
+ pointerData.dragCollision = collision;
336
331
 
337
332
  if (dispatcher)
338
333
  this.dispatchEvent(event, dispatcher);
339
334
  else if (this._eventBubbling)
340
335
  this._stage.dispatchEvent(event);
341
336
 
342
- if (this._mouseDragCollision) {
343
- this.setFocus(this._mouseDragCollision.rootNode);
344
- this.setupAndDispatchEvent(this._dragStart, pointerData, this._mouseDragCollision);
337
+ if (pointerData.dragCollision) {
338
+ this.setFocus(pointerData.dragCollision.rootNode);
339
+ this.setupAndDispatchEvent(this._dragStart, pointerData, pointerData.dragCollision);
345
340
  }
346
341
 
347
342
  } else if (event.type == pointerData.up.type) {
@@ -355,23 +350,21 @@ export class MouseManager {
355
350
 
356
351
  let upContainerNode: ContainerNode = null;
357
352
  let upRootNode: ContainerNode = null;
358
- if (this._isAVM1Dragging && this._mouseDragCollision) {
353
+ if (this._isAVM1Dragging && pointerData.dragCollision) {
359
354
  // avm1dragging is in process, dispatch the mouse-up on this.
360
355
  // mouseDragEntity instead of the current collision
361
- upRootNode = this._mouseDragCollision.rootNode;
362
- upContainerNode = this._mouseDragCollision.containerNode;
363
- } else if (this._mouseDragging && this._mouseDragCollision
364
- && this._mouseDragCollision.rootNode != dispatcher) {
356
+ upRootNode = pointerData.dragCollision.rootNode;
357
+ upContainerNode = pointerData.dragCollision.containerNode;
358
+ } else if (pointerData.dragCollision && pointerData.dragCollision.rootNode != dispatcher) {
365
359
  // no avm1dragging is in process, but current collision
366
360
  // is not the same as collision that appeared on mouse-down,
367
361
  // need to dispatch a MOUSE_UP_OUTSIDE after mouse up
368
- } else if (this._mouseDragging && this._mouseDragCollision
369
- && this._mouseDragCollision.rootNode == dispatcher) {
362
+ } else if (pointerData.dragCollision && pointerData.dragCollision.rootNode == dispatcher) {
370
363
  // no avm1dragging is in process,
371
364
  // current collision is the same as collision that appeared on
372
365
  // mouse-down, need to dispatch a MOUSE_CLICK event after mouse up
373
- upRootNode = this._mouseDragCollision.rootNode;
374
- upContainerNode = this._mouseDragCollision.containerNode;
366
+ upRootNode = pointerData.dragCollision.rootNode;
367
+ upContainerNode = pointerData.dragCollision.containerNode;
375
368
  }
376
369
 
377
370
  if (upRootNode)
@@ -383,14 +376,13 @@ export class MouseManager {
383
376
 
384
377
  if (upContainerNode) {
385
378
  if (!this._isAVM1Dragging)
386
- this.setupAndDispatchEvent(pointerData.click, pointerData, this._mouseDragCollision);
387
- this.setupAndDispatchEvent(this._dragStop, pointerData, this._mouseDragCollision);
388
- } else if (this._mouseDragging && this._mouseDragCollision) {
389
- this.setupAndDispatchEvent(pointerData.upOutside, pointerData, this._mouseDragCollision);
379
+ this.setupAndDispatchEvent(pointerData.click, pointerData, pointerData.dragCollision);
380
+ this.setupAndDispatchEvent(this._dragStop, pointerData, pointerData.dragCollision);
381
+ } else if (pointerData.dragCollision) {
382
+ this.setupAndDispatchEvent(pointerData.upOutside, pointerData, pointerData.dragCollision);
390
383
  }
391
384
 
392
- this._mouseDragCollision = null;
393
- this._mouseDragging = false;
385
+ pointerData.dragCollision = null;
394
386
  this._isAVM1Dragging = false;
395
387
 
396
388
  //make sure to clear old touch references when no longer needed
@@ -407,8 +399,8 @@ export class MouseManager {
407
399
  if (dispatcher)
408
400
  this.dispatchEvent(event, dispatcher);
409
401
 
410
- if (this._mouseDragCollision)
411
- this.setupAndDispatchEvent(this._dragMove, pointerData, this._mouseDragCollision);
402
+ if (pointerData.dragCollision)
403
+ this.setupAndDispatchEvent(this._dragMove, pointerData, pointerData.dragCollision);
412
404
 
413
405
  // if bubbling is exist, fire to stage late
414
406
  if (this._eventBubbling)
@@ -440,8 +432,7 @@ export class MouseManager {
440
432
  if (prevCollisionNode) {
441
433
  this.setupAndDispatchEvent(pointerData.out, pointerData, pointerData.prevCollision);
442
434
 
443
- if (this._mouseDragging && this._mouseDragCollision
444
- && this._mouseDragCollision.rootNode == prevCollisionNode)
435
+ if (pointerData.dragCollision?.rootNode == prevCollisionNode)
445
436
  this.setupAndDispatchEvent(this._dragOut, pointerData, pointerData.prevCollision);
446
437
  }
447
438
 
@@ -488,7 +479,7 @@ export class MouseManager {
488
479
  if (collisionNode) {
489
480
  this.setupAndDispatchEvent(pointerData.over, pointerData, collision);
490
481
 
491
- if (this._mouseDragging)
482
+ if (pointerData.dragCollision)
492
483
  this.setupAndDispatchEvent(this._dragOver, pointerData, collision);
493
484
  }
494
485
 
@@ -502,7 +493,7 @@ export class MouseManager {
502
493
  if (pointerData.collisionIsEnabledButton != isActiveButton && isActiveButton) {
503
494
  if (pointerData.isMouse)
504
495
  this.setupAndDispatchEvent(pointerData.over, pointerData, collision);
505
- else if (this._mouseDragCollision && this._mouseDragCollision.rootNode == collisionNode)
496
+ else if (pointerData.dragCollision?.rootNode == collisionNode)
506
497
  this.setupAndDispatchEvent(this._dragOver, pointerData, collision);
507
498
  }
508
499
 
@@ -510,7 +501,7 @@ export class MouseManager {
510
501
  }
511
502
 
512
503
  // set cursor if not dragging mouse ???
513
- if (!this._mouseDragging) {
504
+ if (!pointerData.dragCollision) {
514
505
  this.cursorType = collisionNode ? <any>collisionNode.container.getMouseCursor() : 'auto';
515
506
  }
516
507
 
@@ -937,6 +928,8 @@ class PointerData {
937
928
 
938
929
  prevCollision: PickingCollision;
939
930
 
931
+ dragCollision: PickingCollision;
932
+
940
933
  collisionIsEnabledButton: boolean = false;
941
934
 
942
935
  queuedEvents: Array<PointerEvent> = new Array<PointerEvent>();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awayjs/scene",
3
- "version": "0.13.276",
3
+ "version": "0.13.277",
4
4
  "description": "AwayJS scene classes",
5
5
  "main": "bundle/awayjs-scene.umd.js",
6
6
  "module": "dist/index.js",