@awayjs/scene 0.13.239 → 0.13.240
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/bundle/awayjs-scene.umd.js +262 -303
- package/bundle/awayjs-scene.umd.js.map +1 -1
- package/bundle/awayjs-scene.umd.min.js.map +1 -1
- package/bundle/awayjs-scene.umd.min.js.map.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/display/DisplayObject.d.ts +0 -5
- package/dist/lib/display/DisplayObject.d.ts.map +1 -1
- package/dist/lib/display/DisplayObject.js +0 -17
- package/dist/lib/display/DisplayObjectContainer.d.ts +0 -3
- package/dist/lib/display/DisplayObjectContainer.d.ts.map +1 -1
- package/dist/lib/display/DisplayObjectContainer.js +0 -31
- package/dist/lib/events/FocusEvent.d.ts +3 -1
- package/dist/lib/events/FocusEvent.d.ts.map +1 -1
- package/dist/lib/events/FocusEvent.js +5 -0
- package/dist/lib/events/MouseEvent.d.ts +1 -0
- package/dist/lib/events/MouseEvent.d.ts.map +1 -1
- package/dist/lib/events/MouseEvent.js +7 -0
- package/dist/lib/managers/MouseManager.d.ts +6 -4
- package/dist/lib/managers/MouseManager.d.ts.map +1 -1
- package/dist/lib/managers/MouseManager.js +34 -38
- package/index.ts +1 -1
- package/lib/display/DisplayObject.ts +0 -21
- package/lib/display/DisplayObjectContainer.ts +0 -35
- package/lib/events/FocusEvent.ts +8 -1
- package/lib/events/MouseEvent.ts +8 -0
- package/lib/managers/MouseManager.ts +37 -39
- package/package.json +1 -1
|
@@ -71,42 +71,6 @@ function __await(v) {
|
|
|
71
71
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
/**
|
|
75
|
-
* A FocusEvent is dispatched when a entity is focused
|
|
76
|
-
*/
|
|
77
|
-
var FocusEvent = /** @class */ (function (_super) {
|
|
78
|
-
__extends(FocusEvent, _super);
|
|
79
|
-
/**
|
|
80
|
-
* Create a new MouseEvent object.
|
|
81
|
-
* @param type The type of the MouseEvent.
|
|
82
|
-
*/
|
|
83
|
-
function FocusEvent(type) {
|
|
84
|
-
return _super.call(this, type) || this;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Creates a copy of the MouseEvent object and sets the value of each property to match that of the original.
|
|
88
|
-
*/
|
|
89
|
-
FocusEvent.prototype.clone = function () {
|
|
90
|
-
var result = new FocusEvent(this.type);
|
|
91
|
-
/* TODO: Debug / test - look into isDefaultPrevented
|
|
92
|
-
if (isDefaultPrevented())
|
|
93
|
-
result.preventDefault();
|
|
94
|
-
*/
|
|
95
|
-
result.view = this.view;
|
|
96
|
-
result.entity = this.entity;
|
|
97
|
-
return result;
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Defines the value of the type property of a focusIn3d event object.
|
|
101
|
-
*/
|
|
102
|
-
FocusEvent.FOCUS_IN = 'focusIn3d';
|
|
103
|
-
/**
|
|
104
|
-
* Defines the value of the type property of a focusOut3d event object.
|
|
105
|
-
*/
|
|
106
|
-
FocusEvent.FOCUS_OUT = 'focusOut3d';
|
|
107
|
-
return FocusEvent;
|
|
108
|
-
}(_awayjs_core.EventBase));
|
|
109
|
-
|
|
110
74
|
/**
|
|
111
75
|
* PrefabBase is an abstract base class for prefabs,
|
|
112
76
|
* which are prebuilt display objects that allow easy cloning and updating
|
|
@@ -1485,16 +1449,6 @@ var DisplayObject = /** @class */ (function (_super) {
|
|
|
1485
1449
|
}
|
|
1486
1450
|
return result;
|
|
1487
1451
|
};
|
|
1488
|
-
DisplayObject.prototype.dispatchFrameEvents = function (events) {
|
|
1489
|
-
this.dispatchEvent(events[0]); //ENTER_FRAME
|
|
1490
|
-
this.dispatchEvent(events[1]); //EXIT_FRAME
|
|
1491
|
-
};
|
|
1492
|
-
DisplayObject.prototype.dispatchEnterFrame = function (event) {
|
|
1493
|
-
this.dispatchEvent(event); //ENTER_FRAME
|
|
1494
|
-
};
|
|
1495
|
-
DisplayObject.prototype.dispatchExitFrame = function (event) {
|
|
1496
|
-
this.dispatchEvent(event); //Exit
|
|
1497
|
-
};
|
|
1498
1452
|
DisplayObject.prototype.getMouseCursor = function () {
|
|
1499
1453
|
return 'initial';
|
|
1500
1454
|
};
|
|
@@ -1534,11 +1488,6 @@ var DisplayObject = /** @class */ (function (_super) {
|
|
|
1534
1488
|
if (this._isInFocus == value)
|
|
1535
1489
|
return;
|
|
1536
1490
|
this._isInFocus = value;
|
|
1537
|
-
if (this._isInFocus)
|
|
1538
|
-
DisplayObject.focusEvent.type = FocusEvent.FOCUS_IN;
|
|
1539
|
-
else
|
|
1540
|
-
DisplayObject.focusEvent.type = FocusEvent.FOCUS_OUT;
|
|
1541
|
-
this.dispatchEnterFrame(DisplayObject.focusEvent);
|
|
1542
1491
|
};
|
|
1543
1492
|
Object.defineProperty(DisplayObject.prototype, "alignmentMode", {
|
|
1544
1493
|
/**
|
|
@@ -2783,7 +2732,6 @@ var DisplayObject = /** @class */ (function (_super) {
|
|
|
2783
2732
|
DisplayObject.prototype._getDefaultBoundingVolume = function () {
|
|
2784
2733
|
return _awayjs_view.BoundingVolumeType.BOX_BOUNDS_FAST;
|
|
2785
2734
|
};
|
|
2786
|
-
DisplayObject.focusEvent = new FocusEvent(FocusEvent.FOCUS_IN);
|
|
2787
2735
|
return DisplayObject;
|
|
2788
2736
|
}(_awayjs_core.AssetBase));
|
|
2789
2737
|
|
|
@@ -2838,37 +2786,6 @@ var DisplayObjectContainer = /** @class */ (function (_super) {
|
|
|
2838
2786
|
enumerable: true,
|
|
2839
2787
|
configurable: true
|
|
2840
2788
|
});
|
|
2841
|
-
DisplayObjectContainer.prototype.dispatchFrameEvents = function (events) {
|
|
2842
|
-
this.dispatchEvent(events[0]); //ENTER_FRAME
|
|
2843
|
-
var i = this._children.length;
|
|
2844
|
-
while (i > 0) {
|
|
2845
|
-
i--;
|
|
2846
|
-
this._children[i].dispatchFrameEvents(events);
|
|
2847
|
-
}
|
|
2848
|
-
this.dispatchEvent(events[1]); //EXIT_FRAME
|
|
2849
|
-
};
|
|
2850
|
-
DisplayObjectContainer.prototype.dispatchEnterFrame = function (event) {
|
|
2851
|
-
var i = this._children.length;
|
|
2852
|
-
while (i > 0) {
|
|
2853
|
-
i--;
|
|
2854
|
-
// the dispatched Event might change the childs, so make sure they still exits
|
|
2855
|
-
if (i < this._children.length) {
|
|
2856
|
-
this._children[i].dispatchEnterFrame(event);
|
|
2857
|
-
}
|
|
2858
|
-
}
|
|
2859
|
-
this.dispatchEvent(event); //ENTER_FRAME
|
|
2860
|
-
};
|
|
2861
|
-
DisplayObjectContainer.prototype.dispatchExitFrame = function (event) {
|
|
2862
|
-
var i = this._children.length;
|
|
2863
|
-
while (i > 0) {
|
|
2864
|
-
i--;
|
|
2865
|
-
// the dispatched Event might change the childs, so make sure they still exits
|
|
2866
|
-
if (i < this._children.length) {
|
|
2867
|
-
this._children[i].dispatchExitFrame(event);
|
|
2868
|
-
}
|
|
2869
|
-
}
|
|
2870
|
-
this.dispatchEvent(event); //Exit
|
|
2871
|
-
};
|
|
2872
2789
|
Object.defineProperty(DisplayObjectContainer.prototype, "mouseChildren", {
|
|
2873
2790
|
/**
|
|
2874
2791
|
* Determines whether or not the children of the object are mouse, or user
|
|
@@ -6377,188 +6294,6 @@ var LoaderContainer = /** @class */ (function (_super) {
|
|
|
6377
6294
|
return LoaderContainer;
|
|
6378
6295
|
}(DisplayObjectContainer));
|
|
6379
6296
|
|
|
6380
|
-
/**
|
|
6381
|
-
* A MouseEvent is dispatched when a mouse event occurs over a mouseEnabled object in View.
|
|
6382
|
-
* TODO: we don't have screenZ data, tho this should be easy to implement
|
|
6383
|
-
*/
|
|
6384
|
-
var MouseEvent$1 = /** @class */ (function (_super) {
|
|
6385
|
-
__extends(MouseEvent, _super);
|
|
6386
|
-
/**
|
|
6387
|
-
* Create a new MouseEvent object.
|
|
6388
|
-
* @param type The type of the MouseEvent.
|
|
6389
|
-
*/
|
|
6390
|
-
function MouseEvent(type) {
|
|
6391
|
-
var _this = _super.call(this, type) || this;
|
|
6392
|
-
/**
|
|
6393
|
-
* Current button that fire event
|
|
6394
|
-
*/
|
|
6395
|
-
_this.button = 0;
|
|
6396
|
-
return _this;
|
|
6397
|
-
}
|
|
6398
|
-
Object.defineProperty(MouseEvent.prototype, "bubbles", {
|
|
6399
|
-
/**
|
|
6400
|
-
* @inheritDoc
|
|
6401
|
-
*/
|
|
6402
|
-
get: function () {
|
|
6403
|
-
var doesBubble = this._iAllowedToPropagate && this._iAllowedToImmediatlyPropagate;
|
|
6404
|
-
this._iAllowedToPropagate = true;
|
|
6405
|
-
this._iAllowedToImmediatlyPropagate = true;
|
|
6406
|
-
// Don't bubble if propagation has been stopped.
|
|
6407
|
-
return doesBubble;
|
|
6408
|
-
},
|
|
6409
|
-
enumerable: true,
|
|
6410
|
-
configurable: true
|
|
6411
|
-
});
|
|
6412
|
-
/**
|
|
6413
|
-
* @inheritDoc
|
|
6414
|
-
*/
|
|
6415
|
-
MouseEvent.prototype.stopPropagation = function () {
|
|
6416
|
-
this._iAllowedToPropagate = false;
|
|
6417
|
-
if (this._iParentEvent)
|
|
6418
|
-
this._iParentEvent.stopPropagation();
|
|
6419
|
-
};
|
|
6420
|
-
/**
|
|
6421
|
-
* @inheritDoc
|
|
6422
|
-
*/
|
|
6423
|
-
MouseEvent.prototype.stopImmediatePropagation = function () {
|
|
6424
|
-
this._iAllowedToPropagate = false;
|
|
6425
|
-
this._iAllowedToImmediatlyPropagate = false;
|
|
6426
|
-
if (this._iParentEvent)
|
|
6427
|
-
this._iParentEvent.stopImmediatePropagation();
|
|
6428
|
-
};
|
|
6429
|
-
/**
|
|
6430
|
-
* Creates a copy of the MouseEvent object and sets the value of each property to match that of the original.
|
|
6431
|
-
*/
|
|
6432
|
-
MouseEvent.prototype.clone = function () {
|
|
6433
|
-
var result = new MouseEvent(this.type);
|
|
6434
|
-
/* TODO: Debug / test - look into isDefaultPrevented
|
|
6435
|
-
if (isDefaultPrevented())
|
|
6436
|
-
result.preventDefault();
|
|
6437
|
-
*/
|
|
6438
|
-
result.screenX = this.screenX;
|
|
6439
|
-
result.screenY = this.screenY;
|
|
6440
|
-
result.view = this.view;
|
|
6441
|
-
result.entityNode = this.entityNode;
|
|
6442
|
-
result.rootNode = this.rootNode;
|
|
6443
|
-
result.traversable = this.traversable;
|
|
6444
|
-
result.material = this.material;
|
|
6445
|
-
result.uv = this.uv;
|
|
6446
|
-
result.position = this.position;
|
|
6447
|
-
result.normal = this.normal;
|
|
6448
|
-
result.elementIndex = this.elementIndex;
|
|
6449
|
-
result.delta = this.delta;
|
|
6450
|
-
result.ctrlKey = this.ctrlKey;
|
|
6451
|
-
result.shiftKey = this.shiftKey;
|
|
6452
|
-
result._iParentEvent = this;
|
|
6453
|
-
result._iAllowedToPropagate = this._iAllowedToPropagate;
|
|
6454
|
-
result.button = this.button;
|
|
6455
|
-
return result;
|
|
6456
|
-
};
|
|
6457
|
-
Object.defineProperty(MouseEvent.prototype, "scenePosition", {
|
|
6458
|
-
/**
|
|
6459
|
-
* The position in scene space where the event took place
|
|
6460
|
-
*/
|
|
6461
|
-
get: function () {
|
|
6462
|
-
return this.entityNode.parent.getMatrix3D().transformVector(this.position);
|
|
6463
|
-
},
|
|
6464
|
-
enumerable: true,
|
|
6465
|
-
configurable: true
|
|
6466
|
-
});
|
|
6467
|
-
Object.defineProperty(MouseEvent.prototype, "sceneNormal", {
|
|
6468
|
-
/**
|
|
6469
|
-
* The normal in scene space where the event took place
|
|
6470
|
-
*/
|
|
6471
|
-
get: function () {
|
|
6472
|
-
var sceneNormal = this.entityNode.parent.getMatrix3D().deltaTransformVector(this.normal);
|
|
6473
|
-
sceneNormal.normalize();
|
|
6474
|
-
return sceneNormal;
|
|
6475
|
-
},
|
|
6476
|
-
enumerable: true,
|
|
6477
|
-
configurable: true
|
|
6478
|
-
});
|
|
6479
|
-
/**
|
|
6480
|
-
* Defines the value of the type property of a mouseOver3d event object.
|
|
6481
|
-
*/
|
|
6482
|
-
MouseEvent.MOUSE_OVER = 'mouseOver3d';
|
|
6483
|
-
/**
|
|
6484
|
-
* Defines the value of the type property of a mouseOut3d event object.
|
|
6485
|
-
*/
|
|
6486
|
-
MouseEvent.MOUSE_OUT = 'mouseOut3d';
|
|
6487
|
-
/**
|
|
6488
|
-
* Defines the value of the type property of a rollOver3d event object.
|
|
6489
|
-
*/
|
|
6490
|
-
MouseEvent.ROLL_OVER = 'rollOver3d';
|
|
6491
|
-
/**
|
|
6492
|
-
* Defines the value of the type property of a rollOut3d event object.
|
|
6493
|
-
*/
|
|
6494
|
-
MouseEvent.ROLL_OUT = 'rollOut3d';
|
|
6495
|
-
/**
|
|
6496
|
-
* Defines the value of the type property of a mouseUp3d event object.
|
|
6497
|
-
*/
|
|
6498
|
-
MouseEvent.MOUSE_UP = 'mouseUp3d';
|
|
6499
|
-
/**
|
|
6500
|
-
* Defines the value of the type property of a mouseUp3d event object.
|
|
6501
|
-
*/
|
|
6502
|
-
MouseEvent.MOUSE_UP_OUTSIDE = 'mouseUpOutside3d';
|
|
6503
|
-
/**
|
|
6504
|
-
* Defines the value of the type property of a mouseDown3d event object.
|
|
6505
|
-
*/
|
|
6506
|
-
MouseEvent.MOUSE_DOWN = 'mouseDown3d';
|
|
6507
|
-
/**
|
|
6508
|
-
* Defines the value of the type property of a mouseMove3d event object.
|
|
6509
|
-
*/
|
|
6510
|
-
MouseEvent.MOUSE_MOVE = 'mouseMove3d';
|
|
6511
|
-
/**
|
|
6512
|
-
* Defines the value of the type property of a dragMove3d event object.
|
|
6513
|
-
*/
|
|
6514
|
-
MouseEvent.DRAG_MOVE = 'dragMove3d';
|
|
6515
|
-
/**
|
|
6516
|
-
* Defines the value of the type property of a dragOut3d event object.
|
|
6517
|
-
*/
|
|
6518
|
-
MouseEvent.DRAG_OUT = 'dragOut3d';
|
|
6519
|
-
/**
|
|
6520
|
-
* Defines the value of the type property of a dragOver3d event object.
|
|
6521
|
-
*/
|
|
6522
|
-
MouseEvent.DRAG_OVER = 'dragOver3d';
|
|
6523
|
-
/**
|
|
6524
|
-
* Defines the value of the type property of a dragStart3d event object.
|
|
6525
|
-
*/
|
|
6526
|
-
MouseEvent.DRAG_START = 'dragStart3d';
|
|
6527
|
-
/**
|
|
6528
|
-
* Defines the value of the type property of a dragStop3d event object.
|
|
6529
|
-
*/
|
|
6530
|
-
MouseEvent.DRAG_STOP = 'dragStop3d';
|
|
6531
|
-
/**
|
|
6532
|
-
* Defines the value of the type property of a focusIn3d event object.
|
|
6533
|
-
*/
|
|
6534
|
-
MouseEvent.FOCUS_IN = 'focusIn3d';
|
|
6535
|
-
/**
|
|
6536
|
-
* Defines the value of the type property of a focusOut3d event object.
|
|
6537
|
-
*/
|
|
6538
|
-
MouseEvent.FOCUS_OUT = 'focusOut3d';
|
|
6539
|
-
/**
|
|
6540
|
-
* Defines the value of the type property of a rollOver3d event object.
|
|
6541
|
-
*/
|
|
6542
|
-
// public static ROLL_OVER : string = "rollOver3d";
|
|
6543
|
-
/**
|
|
6544
|
-
* Defines the value of the type property of a rollOut3d event object.
|
|
6545
|
-
*/
|
|
6546
|
-
// public static ROLL_OUT : string = "rollOut3d";
|
|
6547
|
-
/**
|
|
6548
|
-
* Defines the value of the type property of a click3d event object.
|
|
6549
|
-
*/
|
|
6550
|
-
MouseEvent.CLICK = 'click3d';
|
|
6551
|
-
/**
|
|
6552
|
-
* Defines the value of the type property of a doubleClick3d event object.
|
|
6553
|
-
*/
|
|
6554
|
-
MouseEvent.DOUBLE_CLICK = 'doubleClick3d';
|
|
6555
|
-
/**
|
|
6556
|
-
* Defines the value of the type property of a mouseWheel3d event object.
|
|
6557
|
-
*/
|
|
6558
|
-
MouseEvent.MOUSE_WHEEL = 'mouseWheel3d';
|
|
6559
|
-
return MouseEvent;
|
|
6560
|
-
}(_awayjs_core.EventBase));
|
|
6561
|
-
|
|
6562
6297
|
var FrameScriptManager = /** @class */ (function () {
|
|
6563
6298
|
function FrameScriptManager() {
|
|
6564
6299
|
}
|
|
@@ -6935,6 +6670,194 @@ var FrameScriptManager = /** @class */ (function () {
|
|
|
6935
6670
|
return FrameScriptManager;
|
|
6936
6671
|
}());
|
|
6937
6672
|
|
|
6673
|
+
/**
|
|
6674
|
+
* A MouseEvent is dispatched when a mouse event occurs over a mouseEnabled object in View.
|
|
6675
|
+
* TODO: we don't have screenZ data, tho this should be easy to implement
|
|
6676
|
+
*/
|
|
6677
|
+
var MouseEvent$1 = /** @class */ (function (_super) {
|
|
6678
|
+
__extends(MouseEvent, _super);
|
|
6679
|
+
/**
|
|
6680
|
+
* Create a new MouseEvent object.
|
|
6681
|
+
* @param type The type of the MouseEvent.
|
|
6682
|
+
*/
|
|
6683
|
+
function MouseEvent(type) {
|
|
6684
|
+
var _this = _super.call(this, type) || this;
|
|
6685
|
+
/**
|
|
6686
|
+
* Current button that fire event
|
|
6687
|
+
*/
|
|
6688
|
+
_this.button = 0;
|
|
6689
|
+
return _this;
|
|
6690
|
+
}
|
|
6691
|
+
Object.defineProperty(MouseEvent.prototype, "bubbles", {
|
|
6692
|
+
/**
|
|
6693
|
+
* @inheritDoc
|
|
6694
|
+
*/
|
|
6695
|
+
get: function () {
|
|
6696
|
+
var doesBubble = this._iAllowedToPropagate && this._iAllowedToImmediatlyPropagate;
|
|
6697
|
+
this._iAllowedToPropagate = true;
|
|
6698
|
+
this._iAllowedToImmediatlyPropagate = true;
|
|
6699
|
+
// Don't bubble if propagation has been stopped.
|
|
6700
|
+
return doesBubble;
|
|
6701
|
+
},
|
|
6702
|
+
enumerable: true,
|
|
6703
|
+
configurable: true
|
|
6704
|
+
});
|
|
6705
|
+
/**
|
|
6706
|
+
* @inheritDoc
|
|
6707
|
+
*/
|
|
6708
|
+
MouseEvent.prototype.stopPropagation = function () {
|
|
6709
|
+
this._iAllowedToPropagate = false;
|
|
6710
|
+
if (this._iParentEvent)
|
|
6711
|
+
this._iParentEvent.stopPropagation();
|
|
6712
|
+
};
|
|
6713
|
+
/**
|
|
6714
|
+
* @inheritDoc
|
|
6715
|
+
*/
|
|
6716
|
+
MouseEvent.prototype.stopImmediatePropagation = function () {
|
|
6717
|
+
this._iAllowedToPropagate = false;
|
|
6718
|
+
this._iAllowedToImmediatlyPropagate = false;
|
|
6719
|
+
if (this._iParentEvent)
|
|
6720
|
+
this._iParentEvent.stopImmediatePropagation();
|
|
6721
|
+
};
|
|
6722
|
+
/**
|
|
6723
|
+
* Creates a copy of the MouseEvent object and sets the value of each property to match that of the original.
|
|
6724
|
+
*/
|
|
6725
|
+
MouseEvent.prototype.clone = function () {
|
|
6726
|
+
var result = new MouseEvent(this.type);
|
|
6727
|
+
/* TODO: Debug / test - look into isDefaultPrevented
|
|
6728
|
+
if (isDefaultPrevented())
|
|
6729
|
+
result.preventDefault();
|
|
6730
|
+
*/
|
|
6731
|
+
result.screenX = this.screenX;
|
|
6732
|
+
result.screenY = this.screenY;
|
|
6733
|
+
result.view = this.view;
|
|
6734
|
+
result.entityNode = this.entityNode;
|
|
6735
|
+
result.rootNode = this.rootNode;
|
|
6736
|
+
result.traversable = this.traversable;
|
|
6737
|
+
result.material = this.material;
|
|
6738
|
+
result.uv = this.uv;
|
|
6739
|
+
result.position = this.position;
|
|
6740
|
+
result.normal = this.normal;
|
|
6741
|
+
result.elementIndex = this.elementIndex;
|
|
6742
|
+
result.delta = this.delta;
|
|
6743
|
+
result.ctrlKey = this.ctrlKey;
|
|
6744
|
+
result.shiftKey = this.shiftKey;
|
|
6745
|
+
result._iParentEvent = this;
|
|
6746
|
+
result._iAllowedToPropagate = this._iAllowedToPropagate;
|
|
6747
|
+
result.button = this.button;
|
|
6748
|
+
return result;
|
|
6749
|
+
};
|
|
6750
|
+
Object.defineProperty(MouseEvent.prototype, "scenePosition", {
|
|
6751
|
+
/**
|
|
6752
|
+
* The position in scene space where the event took place
|
|
6753
|
+
*/
|
|
6754
|
+
get: function () {
|
|
6755
|
+
return this.entityNode.parent.getMatrix3D().transformVector(this.position);
|
|
6756
|
+
},
|
|
6757
|
+
enumerable: true,
|
|
6758
|
+
configurable: true
|
|
6759
|
+
});
|
|
6760
|
+
Object.defineProperty(MouseEvent.prototype, "sceneNormal", {
|
|
6761
|
+
/**
|
|
6762
|
+
* The normal in scene space where the event took place
|
|
6763
|
+
*/
|
|
6764
|
+
get: function () {
|
|
6765
|
+
var sceneNormal = this.entityNode.parent.getMatrix3D().deltaTransformVector(this.normal);
|
|
6766
|
+
sceneNormal.normalize();
|
|
6767
|
+
return sceneNormal;
|
|
6768
|
+
},
|
|
6769
|
+
enumerable: true,
|
|
6770
|
+
configurable: true
|
|
6771
|
+
});
|
|
6772
|
+
MouseEvent.prototype._dispatchEvent = function (dispatcher) {
|
|
6773
|
+
if (!dispatcher.isMouseDisabled()) {
|
|
6774
|
+
dispatcher.container.dispatchEvent(this);
|
|
6775
|
+
FrameScriptManager.execute_queue();
|
|
6776
|
+
}
|
|
6777
|
+
};
|
|
6778
|
+
/**
|
|
6779
|
+
* Defines the value of the type property of a mouseOver3d event object.
|
|
6780
|
+
*/
|
|
6781
|
+
MouseEvent.MOUSE_OVER = 'mouseOver3d';
|
|
6782
|
+
/**
|
|
6783
|
+
* Defines the value of the type property of a mouseOut3d event object.
|
|
6784
|
+
*/
|
|
6785
|
+
MouseEvent.MOUSE_OUT = 'mouseOut3d';
|
|
6786
|
+
/**
|
|
6787
|
+
* Defines the value of the type property of a rollOver3d event object.
|
|
6788
|
+
*/
|
|
6789
|
+
MouseEvent.ROLL_OVER = 'rollOver3d';
|
|
6790
|
+
/**
|
|
6791
|
+
* Defines the value of the type property of a rollOut3d event object.
|
|
6792
|
+
*/
|
|
6793
|
+
MouseEvent.ROLL_OUT = 'rollOut3d';
|
|
6794
|
+
/**
|
|
6795
|
+
* Defines the value of the type property of a mouseUp3d event object.
|
|
6796
|
+
*/
|
|
6797
|
+
MouseEvent.MOUSE_UP = 'mouseUp3d';
|
|
6798
|
+
/**
|
|
6799
|
+
* Defines the value of the type property of a mouseUp3d event object.
|
|
6800
|
+
*/
|
|
6801
|
+
MouseEvent.MOUSE_UP_OUTSIDE = 'mouseUpOutside3d';
|
|
6802
|
+
/**
|
|
6803
|
+
* Defines the value of the type property of a mouseDown3d event object.
|
|
6804
|
+
*/
|
|
6805
|
+
MouseEvent.MOUSE_DOWN = 'mouseDown3d';
|
|
6806
|
+
/**
|
|
6807
|
+
* Defines the value of the type property of a mouseMove3d event object.
|
|
6808
|
+
*/
|
|
6809
|
+
MouseEvent.MOUSE_MOVE = 'mouseMove3d';
|
|
6810
|
+
/**
|
|
6811
|
+
* Defines the value of the type property of a dragMove3d event object.
|
|
6812
|
+
*/
|
|
6813
|
+
MouseEvent.DRAG_MOVE = 'dragMove3d';
|
|
6814
|
+
/**
|
|
6815
|
+
* Defines the value of the type property of a dragOut3d event object.
|
|
6816
|
+
*/
|
|
6817
|
+
MouseEvent.DRAG_OUT = 'dragOut3d';
|
|
6818
|
+
/**
|
|
6819
|
+
* Defines the value of the type property of a dragOver3d event object.
|
|
6820
|
+
*/
|
|
6821
|
+
MouseEvent.DRAG_OVER = 'dragOver3d';
|
|
6822
|
+
/**
|
|
6823
|
+
* Defines the value of the type property of a dragStart3d event object.
|
|
6824
|
+
*/
|
|
6825
|
+
MouseEvent.DRAG_START = 'dragStart3d';
|
|
6826
|
+
/**
|
|
6827
|
+
* Defines the value of the type property of a dragStop3d event object.
|
|
6828
|
+
*/
|
|
6829
|
+
MouseEvent.DRAG_STOP = 'dragStop3d';
|
|
6830
|
+
/**
|
|
6831
|
+
* Defines the value of the type property of a focusIn3d event object.
|
|
6832
|
+
*/
|
|
6833
|
+
MouseEvent.FOCUS_IN = 'focusIn3d';
|
|
6834
|
+
/**
|
|
6835
|
+
* Defines the value of the type property of a focusOut3d event object.
|
|
6836
|
+
*/
|
|
6837
|
+
MouseEvent.FOCUS_OUT = 'focusOut3d';
|
|
6838
|
+
/**
|
|
6839
|
+
* Defines the value of the type property of a rollOver3d event object.
|
|
6840
|
+
*/
|
|
6841
|
+
// public static ROLL_OVER : string = "rollOver3d";
|
|
6842
|
+
/**
|
|
6843
|
+
* Defines the value of the type property of a rollOut3d event object.
|
|
6844
|
+
*/
|
|
6845
|
+
// public static ROLL_OUT : string = "rollOut3d";
|
|
6846
|
+
/**
|
|
6847
|
+
* Defines the value of the type property of a click3d event object.
|
|
6848
|
+
*/
|
|
6849
|
+
MouseEvent.CLICK = 'click3d';
|
|
6850
|
+
/**
|
|
6851
|
+
* Defines the value of the type property of a doubleClick3d event object.
|
|
6852
|
+
*/
|
|
6853
|
+
MouseEvent.DOUBLE_CLICK = 'doubleClick3d';
|
|
6854
|
+
/**
|
|
6855
|
+
* Defines the value of the type property of a mouseWheel3d event object.
|
|
6856
|
+
*/
|
|
6857
|
+
MouseEvent.MOUSE_WHEEL = 'mouseWheel3d';
|
|
6858
|
+
return MouseEvent;
|
|
6859
|
+
}(_awayjs_core.EventBase));
|
|
6860
|
+
|
|
6938
6861
|
var MovieClip = /** @class */ (function (_super) {
|
|
6939
6862
|
__extends(MovieClip, _super);
|
|
6940
6863
|
function MovieClip(timeline, spriteMode) {
|
|
@@ -14405,6 +14328,46 @@ var CastError = /** @class */ (function (_super) {
|
|
|
14405
14328
|
return CastError;
|
|
14406
14329
|
}(_awayjs_core.ErrorBase));
|
|
14407
14330
|
|
|
14331
|
+
/**
|
|
14332
|
+
* A FocusEvent is dispatched when a entity is focused
|
|
14333
|
+
*/
|
|
14334
|
+
var FocusEvent = /** @class */ (function (_super) {
|
|
14335
|
+
__extends(FocusEvent, _super);
|
|
14336
|
+
/**
|
|
14337
|
+
* Create a new MouseEvent object.
|
|
14338
|
+
* @param type The type of the MouseEvent.
|
|
14339
|
+
*/
|
|
14340
|
+
function FocusEvent(type) {
|
|
14341
|
+
return _super.call(this, type) || this;
|
|
14342
|
+
}
|
|
14343
|
+
/**
|
|
14344
|
+
* Creates a copy of the MouseEvent object and sets the value of each property to match that of the original.
|
|
14345
|
+
*/
|
|
14346
|
+
FocusEvent.prototype.clone = function () {
|
|
14347
|
+
var result = new FocusEvent(this.type);
|
|
14348
|
+
/* TODO: Debug / test - look into isDefaultPrevented
|
|
14349
|
+
if (isDefaultPrevented())
|
|
14350
|
+
result.preventDefault();
|
|
14351
|
+
*/
|
|
14352
|
+
result.view = this.view;
|
|
14353
|
+
result.entity = this.entity;
|
|
14354
|
+
return result;
|
|
14355
|
+
};
|
|
14356
|
+
FocusEvent.prototype._dispatchEvent = function (dispatcher) {
|
|
14357
|
+
dispatcher.container.dispatchEvent(this);
|
|
14358
|
+
FrameScriptManager.execute_queue();
|
|
14359
|
+
};
|
|
14360
|
+
/**
|
|
14361
|
+
* Defines the value of the type property of a focusIn3d event object.
|
|
14362
|
+
*/
|
|
14363
|
+
FocusEvent.FOCUS_IN = 'focusIn3d';
|
|
14364
|
+
/**
|
|
14365
|
+
* Defines the value of the type property of a focusOut3d event object.
|
|
14366
|
+
*/
|
|
14367
|
+
FocusEvent.FOCUS_OUT = 'focusOut3d';
|
|
14368
|
+
return FocusEvent;
|
|
14369
|
+
}(_awayjs_core.EventBase));
|
|
14370
|
+
|
|
14408
14371
|
var ResizeEvent = /** @class */ (function (_super) {
|
|
14409
14372
|
__extends(ResizeEvent, _super);
|
|
14410
14373
|
function ResizeEvent(type, oldHeight, oldWidth) {
|
|
@@ -15188,6 +15151,8 @@ var MouseManager = /** @class */ (function () {
|
|
|
15188
15151
|
this._dragMove = new MouseEvent$1(MouseEvent$1.DRAG_MOVE);
|
|
15189
15152
|
this._dragStart = new MouseEvent$1(MouseEvent$1.DRAG_START);
|
|
15190
15153
|
this._dragStop = new MouseEvent$1(MouseEvent$1.DRAG_STOP);
|
|
15154
|
+
this._focusIn = new FocusEvent(FocusEvent.FOCUS_IN);
|
|
15155
|
+
this._focusOut = new FocusEvent(FocusEvent.FOCUS_OUT);
|
|
15191
15156
|
this._useSoftkeyboard = false;
|
|
15192
15157
|
this._isAVM1Dragging = false;
|
|
15193
15158
|
this._isDown = false;
|
|
@@ -15331,26 +15296,30 @@ var MouseManager = /** @class */ (function () {
|
|
|
15331
15296
|
return this._instancePool[stage.id]
|
|
15332
15297
|
|| (this._instancePool[stage.id] = new MouseManager(stage));
|
|
15333
15298
|
};
|
|
15334
|
-
MouseManager.prototype.setFocus = function (
|
|
15335
|
-
if (this.
|
|
15299
|
+
MouseManager.prototype.setFocus = function (node) {
|
|
15300
|
+
if (this._focusNode == node)
|
|
15336
15301
|
return;
|
|
15337
|
-
|
|
15338
|
-
if
|
|
15339
|
-
|
|
15340
|
-
|
|
15341
|
-
|
|
15342
|
-
|
|
15343
|
-
|
|
15302
|
+
// in FP6, a mouseclick on non focus-able object still steal the focus
|
|
15303
|
+
// in newer FP they only steal the focus if the the new hit is focusable
|
|
15304
|
+
if (this._allowFocusOnUnfocusable || this._focusNode.container.tabEnabled) {
|
|
15305
|
+
if (this._focusNode) {
|
|
15306
|
+
this.dispatchEvent(this._focusOut, this._focusNode);
|
|
15307
|
+
this._focusNode.container.setFocus(false, true);
|
|
15308
|
+
}
|
|
15309
|
+
this._focusNode = node;
|
|
15310
|
+
if (this._focusNode) {
|
|
15311
|
+
this.dispatchEvent(this._focusIn, this._focusNode);
|
|
15312
|
+
this._focusNode.container.setFocus(true, true);
|
|
15313
|
+
}
|
|
15344
15314
|
}
|
|
15345
15315
|
};
|
|
15346
15316
|
MouseManager.prototype.getFocus = function () {
|
|
15347
|
-
return this.
|
|
15317
|
+
return this._focusNode;
|
|
15348
15318
|
};
|
|
15349
15319
|
MouseManager.prototype.dispatchEvent = function (event, dispatcher) {
|
|
15350
15320
|
if (!this._eventBubbling) {
|
|
15351
15321
|
if (dispatcher) {
|
|
15352
|
-
|
|
15353
|
-
FrameScriptManager.execute_queue();
|
|
15322
|
+
event._dispatchEvent(dispatcher);
|
|
15354
15323
|
}
|
|
15355
15324
|
return;
|
|
15356
15325
|
}
|
|
@@ -15358,10 +15327,7 @@ var MouseManager = /** @class */ (function () {
|
|
|
15358
15327
|
if (event.commonAncestor && dispatcher == event.commonAncestor) {
|
|
15359
15328
|
return;
|
|
15360
15329
|
}
|
|
15361
|
-
|
|
15362
|
-
dispatcher.container.dispatchEvent(event);
|
|
15363
|
-
FrameScriptManager.execute_queue();
|
|
15364
|
-
}
|
|
15330
|
+
event._dispatchEvent(dispatcher);
|
|
15365
15331
|
if (!event._iAllowedToPropagate) {
|
|
15366
15332
|
dispatcher = null;
|
|
15367
15333
|
}
|
|
@@ -15383,7 +15349,7 @@ var MouseManager = /** @class */ (function () {
|
|
|
15383
15349
|
};
|
|
15384
15350
|
MouseManager.prototype.fireMouseEvents = function (forcePicker) {
|
|
15385
15351
|
if (forcePicker === void 0) { forcePicker = null; }
|
|
15386
|
-
var _a, _b, _c, _d
|
|
15352
|
+
var _a, _b, _c, _d;
|
|
15387
15353
|
var collision;
|
|
15388
15354
|
if (forcePicker) {
|
|
15389
15355
|
collision = forcePicker.getViewCollision(this._stage.screenX, this._stage.screenY);
|
|
@@ -15420,17 +15386,10 @@ var MouseManager = /** @class */ (function () {
|
|
|
15420
15386
|
}
|
|
15421
15387
|
else if (this._eventBubbling)
|
|
15422
15388
|
this._stage.dispatchEvent(event);
|
|
15423
|
-
|
|
15424
|
-
|
|
15425
|
-
if (this._allowFocusOnUnfocusable || ((_b = this._mouseDragCollision) === null || _b === void 0 ? void 0 : _b.rootNode.container.tabEnabled)) {
|
|
15426
|
-
if (this._focusContainer)
|
|
15427
|
-
this._focusContainer.setFocus(false, true);
|
|
15428
|
-
this._focusContainer = (_d = (_c = this._mouseDragCollision) === null || _c === void 0 ? void 0 : _c.rootNode) === null || _d === void 0 ? void 0 : _d.container;
|
|
15429
|
-
if (this._focusContainer)
|
|
15430
|
-
this._focusContainer.setFocus(true, true);
|
|
15431
|
-
}
|
|
15432
|
-
if (this._mouseDragCollision)
|
|
15389
|
+
if (this._mouseDragCollision) {
|
|
15390
|
+
this.setFocus((_b = this._mouseDragCollision) === null || _b === void 0 ? void 0 : _b.rootNode);
|
|
15433
15391
|
this.setupAndDispatchEvent(this._dragStart, event, this._mouseDragCollision);
|
|
15392
|
+
}
|
|
15434
15393
|
}
|
|
15435
15394
|
else if (event.type == MouseEvent$1.MOUSE_UP) {
|
|
15436
15395
|
// no event-bubbling. dispatch on stage first
|
|
@@ -15508,8 +15467,8 @@ var MouseManager = /** @class */ (function () {
|
|
|
15508
15467
|
this._queuedEvents.length = 0;
|
|
15509
15468
|
this._rollOut.commonAncestor = null;
|
|
15510
15469
|
this._rollOver.commonAncestor = null;
|
|
15511
|
-
var collisionNode = (
|
|
15512
|
-
var prevCollisionNode = (
|
|
15470
|
+
var collisionNode = (_c = collision) === null || _c === void 0 ? void 0 : _c.rootNode;
|
|
15471
|
+
var prevCollisionNode = (_d = this._prevCollision) === null || _d === void 0 ? void 0 : _d.rootNode;
|
|
15513
15472
|
if (collisionNode != prevCollisionNode) {
|
|
15514
15473
|
// If colliding object has changed, queue OVER and OUT events.
|
|
15515
15474
|
// If the mouse is dragged (mouse-down is hold), use DRAG_OVER and DRAG_OUT instead of MOUSE_OVER MOUSE_OUT
|
|
@@ -15807,15 +15766,15 @@ var MouseManager = /** @class */ (function () {
|
|
|
15807
15766
|
default:
|
|
15808
15767
|
break;
|
|
15809
15768
|
}
|
|
15810
|
-
if (this.
|
|
15811
|
-
//console.log("dispatch keydown on ", this.
|
|
15769
|
+
if (this._focusNode || this._stage) {
|
|
15770
|
+
//console.log("dispatch keydown on ", this._focusNode);
|
|
15812
15771
|
var newEvent = new KeyboardEvent(KeyboardEvent.KEYDOWN, event.key, event.code);
|
|
15813
15772
|
newEvent.isShift = event.shiftKey;
|
|
15814
15773
|
newEvent.isCTRL = event.ctrlKey;
|
|
15815
15774
|
newEvent.isAlt = event.altKey;
|
|
15816
15775
|
newEvent.keyCode = event.keyCode;
|
|
15817
|
-
if (this.
|
|
15818
|
-
this.
|
|
15776
|
+
if (this._focusNode)
|
|
15777
|
+
this._focusNode.container.dispatchEvent(newEvent);
|
|
15819
15778
|
if (this._stage)
|
|
15820
15779
|
this._stage.dispatchEvent(newEvent);
|
|
15821
15780
|
}
|
|
@@ -15835,15 +15794,15 @@ var MouseManager = /** @class */ (function () {
|
|
|
15835
15794
|
default:
|
|
15836
15795
|
break;
|
|
15837
15796
|
}
|
|
15838
|
-
if (this.
|
|
15839
|
-
//console.log("dispatch keydown on ", this.
|
|
15797
|
+
if (this._focusNode || this._stage) {
|
|
15798
|
+
//console.log("dispatch keydown on ", this._focusNode);
|
|
15840
15799
|
var newEvent = new KeyboardEvent(KeyboardEvent.KEYUP, event.key, event.code);
|
|
15841
15800
|
newEvent.isShift = event.shiftKey;
|
|
15842
15801
|
newEvent.isCTRL = event.ctrlKey;
|
|
15843
15802
|
newEvent.isAlt = event.altKey;
|
|
15844
15803
|
newEvent.keyCode = event.keyCode;
|
|
15845
|
-
if (this.
|
|
15846
|
-
this.
|
|
15804
|
+
if (this._focusNode)
|
|
15805
|
+
this._focusNode.container.dispatchEvent(newEvent);
|
|
15847
15806
|
if (this._stage)
|
|
15848
15807
|
this._stage.dispatchEvent(newEvent);
|
|
15849
15808
|
}
|
|
@@ -18393,7 +18352,7 @@ var Scene = /** @class */ (function () {
|
|
|
18393
18352
|
_awayjs_graphics.MaterialManager.materialClass = _awayjs_materials.MethodMaterial;
|
|
18394
18353
|
_awayjs_graphics.MaterialManager.textureClass = _awayjs_renderer.ImageTexture2D;
|
|
18395
18354
|
|
|
18396
|
-
console.debug('AwayJS - Scene - 0.13.
|
|
18355
|
+
console.debug('AwayJS - Scene - 0.13.240');
|
|
18397
18356
|
|
|
18398
18357
|
exports.Timeline = Timeline;
|
|
18399
18358
|
exports.ControllerBase = ControllerBase;
|