@openglobus/og 0.12.3 → 0.13.1

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 (93) hide show
  1. package/README.md +0 -2
  2. package/dist/@openglobus/og.esm.js +2 -2
  3. package/dist/@openglobus/og.esm.js.map +1 -1
  4. package/dist/@openglobus/og.umd.js +2 -2
  5. package/dist/@openglobus/og.umd.js.map +1 -1
  6. package/package.json +7 -7
  7. package/src/og/Extent.js +3 -3
  8. package/src/og/Globe.js +277 -275
  9. package/src/og/ImageCanvas.js +3 -3
  10. package/src/og/LonLat.js +9 -9
  11. package/src/og/QueueArray.js +2 -2
  12. package/src/og/Rectangle.js +5 -5
  13. package/src/og/bv/Box.js +1 -1
  14. package/src/og/bv/Sphere.js +2 -2
  15. package/src/og/camera/Camera.js +1 -1
  16. package/src/og/camera/PlanetCamera.js +649 -646
  17. package/src/og/control/LayerSwitcher.js +1 -1
  18. package/src/og/control/MouseNavigation.js +22 -13
  19. package/src/og/control/MouseWheelZoomControl.js +2 -2
  20. package/src/og/control/ScaleControl.js +1 -1
  21. package/src/og/control/TouchNavigation.js +319 -319
  22. package/src/og/control/ZoomControl.js +132 -132
  23. package/src/og/control/visibleExtent/Segment.js +12 -12
  24. package/src/og/ellipsoid/Ellipsoid.js +577 -567
  25. package/src/og/entity/BillboardHandler.js +878 -1051
  26. package/src/og/entity/Entity.js +1 -1
  27. package/src/og/entity/EntityCollection.js +847 -857
  28. package/src/og/entity/GeoObjectHandler.js +2 -2
  29. package/src/og/entity/LabelHandler.js +888 -1040
  30. package/src/og/entity/LabelWorker.js +0 -6
  31. package/src/og/entity/PointCloud.js +495 -495
  32. package/src/og/entity/Polyline.js +2218 -2222
  33. package/src/og/entity/RayHandler.js +1 -1
  34. package/src/og/layer/CanvasTiles.js +6 -3
  35. package/src/og/layer/GeoImage.js +1 -1
  36. package/src/og/layer/KML.js +5 -5
  37. package/src/og/layer/Layer.js +804 -752
  38. package/src/og/layer/Vector.js +997 -1010
  39. package/src/og/layer/XYZ.js +359 -357
  40. package/src/og/math/Line2.js +4 -4
  41. package/src/og/math/Quat.js +2 -2
  42. package/src/og/math/Ray.js +2 -2
  43. package/src/og/math/Vec2.js +524 -524
  44. package/src/og/math/Vec3.js +900 -900
  45. package/src/og/math/Vec4.js +261 -261
  46. package/src/og/math.js +397 -398
  47. package/src/og/quadTree/EntityCollectionNode.js +389 -387
  48. package/src/og/renderer/Renderer.js +14 -20
  49. package/src/og/renderer/RendererEvents.js +1034 -1045
  50. package/src/og/scene/Planet.js +12 -9
  51. package/src/og/scene/RenderNode.js +347 -354
  52. package/src/og/segment/Segment.js +3 -1
  53. package/src/og/segment/SegmentLonLat.js +1 -4
  54. package/src/og/shaders/billboard.js +220 -204
  55. package/src/og/shaders/drawnode.js +603 -603
  56. package/src/og/shaders/label.js +595 -456
  57. package/src/og/shaders/polyline.js +365 -361
  58. package/src/og/terrain/MapboxTerrain.js +1 -1
  59. package/src/og/utils/FontAtlas.js +209 -200
  60. package/src/og/utils/GeoImageCreator.js +4 -5
  61. package/src/og/utils/TextureAtlas.js +4 -4
  62. package/src/og/utils/VectorTileCreator.js +414 -414
  63. package/src/og/utils/shared.js +1 -1
  64. package/src/og/webgl/Handler.js +28 -60
  65. package/src/og/webgl/Multisample.js +260 -260
  66. package/src/og/webgl/Program.js +411 -396
  67. package/types/bv/Box.d.ts +1 -1
  68. package/types/bv/Sphere.d.ts +1 -1
  69. package/types/camera/PlanetCamera.d.ts +3 -3
  70. package/types/control/LayerSwitcher.d.ts +1 -1
  71. package/types/ellipsoid/Ellipsoid.d.ts +9 -2
  72. package/types/entity/BillboardHandler.d.ts +0 -4
  73. package/types/entity/EntityCollection.d.ts +0 -8
  74. package/types/entity/LabelHandler.d.ts +0 -2
  75. package/types/entity/Polyline.d.ts +1 -1
  76. package/types/layer/KML.d.ts +11 -11
  77. package/types/layer/Layer.d.ts +5 -0
  78. package/types/layer/Vector.d.ts +1 -8
  79. package/types/math/Line2.d.ts +4 -4
  80. package/types/math/Ray.d.ts +2 -2
  81. package/types/math/Vec2.d.ts +1 -1
  82. package/types/math/Vec3.d.ts +1 -1
  83. package/types/math/Vec4.d.ts +2 -2
  84. package/types/math.d.ts +1 -1
  85. package/types/renderer/Renderer.d.ts +1 -1
  86. package/types/renderer/RendererEvents.d.ts +1 -1
  87. package/types/shaders/label.d.ts +1 -1
  88. package/types/utils/FontAtlas.d.ts +3 -2
  89. package/types/utils/TextureAtlas.d.ts +3 -3
  90. package/types/utils/VectorTileCreator.d.ts +4 -4
  91. package/types/utils/shared.d.ts +1 -1
  92. package/types/webgl/Handler.d.ts +6 -31
  93. package/types/webgl/Program.d.ts +2 -0
@@ -1,1062 +1,1051 @@
1
- /**
2
- * @module og/renderer/RendererEvents
3
- */
4
-
5
- "use strict";
6
-
7
- import { Events } from "../Events.js";
8
- import { input } from "../input/input.js";
9
- import { KeyboardHandler } from "../input/KeyboardHandler.js";
10
- import { MouseHandler } from "../input/MouseHandler.js";
11
- import { TouchHandler } from "../input/TouchHandler.js";
12
- import { Vec2 } from "../math/Vec2.js";
13
- import { Vec3 } from "../math/Vec3.js";
14
-
15
- const LB_M = 0b0001;
16
- const RB_M = 0b0010;
17
- const MB_M = 0b0100;
18
-
19
- /**
20
- * Renderer events handler.
21
- * @class
22
- * @param {Renderer} renderer - Renderer object, events that works for.
23
- */
24
- class RendererEvents extends Events {
25
- constructor(renderer) {
26
- super(EVENT_NAMES);
27
-
28
- /**
29
- * Assigned renderer.
30
- * @public
31
- * @type {Renderer}
32
- */
33
- this.renderer = renderer;
34
-
35
- /**
36
- * Low level touch events handler.
37
- * @private
38
- * @type {input.TouchHandler}
39
- */
40
- this._touchHandler = new TouchHandler(renderer.handler.canvas);
41
-
42
- /**
43
- * Low level mouse events handler.
44
- * @private
45
- * @type {input.MouseHandler}
46
- */
47
- this._mouseHandler = new MouseHandler(renderer.handler.canvas);
48
-
49
- /**
50
- * Low level keyboard events handler.
51
- * @private
52
- * @type {input.KeyboardHandler}
53
- */
54
- this._keyboardHandler = new KeyboardHandler();
55
-
56
- this._active = true;
57
-
58
- this.clickRadius = 15;
59
-
60
- /**
61
- * Current mouse state.
62
- * @public
63
- * @enum {Object}
64
- */
65
- this.mouseState = {
66
- anyEvent: () => {
67
- let ms = this.mouseState;
68
- return (
69
- ms.leftButtonUp ||
70
- ms.rightButtonUp ||
71
- ms.middleButtonUp ||
72
- ms.leftButtonDown ||
73
- ms.rightButtonDown ||
74
- ms.middleButtonDown ||
75
- ms.leftButtonHold ||
76
- ms.rightButtonHold ||
77
- ms.middleButtonHold ||
78
- ms.leftButtonDoubleClick ||
79
- ms.rightButtonDoubleClick ||
80
- ms.middleButtonDoubleClick ||
81
- ms.leftButtonClick ||
82
- ms.rightButtonClick ||
83
- ms.middleButtonClick ||
84
- ms.moving ||
85
- ms.justStopped
86
- );
87
- },
88
- /** Current screen mouse X position. */
89
- clientX: 0,
90
- /** Current screen mouse Y position. */
91
- clientY: 0,
92
- /** Current viewport mouse X position. */
93
- x: 0,
94
- /** Current viewport mouse Y position. */
95
- y: 0,
96
- /** Current mouse X position from 0 to 1 */
97
- nx: 0,
98
- /** Current mouse Y position from 0 to 1 */
99
- ny: 0,
100
- /** Previous mouse X position. */
101
- prev_x: 0,
102
- /** Previous mouse Y position. */
103
- prev_y: 0,
104
- /** Screen mouse position world direction. */
105
- direction: new Vec3(),
106
- /** Left mouse button has stopped pushing down right now.*/
107
- leftButtonUp: false,
108
- /** Right mouse button has stopped pushing down right now.*/
109
- rightButtonUp: false,
110
- /** Middle mouse button has stopped pushing down right now.*/
111
- middleButtonUp: false,
112
- /** Left mouse button has pushed now.*/
113
- leftButtonDown: false,
114
- /** Right mouse button has pushed now.*/
115
- rightButtonDown: false,
116
- /** Middle mouse button has pushed now.*/
117
- middleButtonDown: false,
118
- /** Left mouse button is pushing.*/
119
- leftButtonHold: false,
120
- /** Right mouse button is pushing.*/
121
- rightButtonHold: false,
122
- /** Middle mouse button is pushing.*/
123
- middleButtonHold: false,
124
- /** Left mouse button has clicked twice now.*/
125
- leftButtonDoubleClick: false,
126
- /** Right mouse button has clicked twice now.*/
127
- rightButtonDoubleClick: false,
128
- /** Middle mouse button has clicked twice now.*/
129
- middleButtonDoubleClick: false,
130
- /** Left mouse button has clicked now. */
131
- leftButtonClick: false,
132
- /** Right mouse button has clicked now. */
133
- rightButtonClick: false,
134
- /** Middle mouse button has clicked now. */
135
- middleButtonClick: false,
136
- /** Mouse is moving now. */
137
- moving: false,
138
- /** Mouse has just stopped now. */
139
- justStopped: false,
140
- /** Mose double click delay response time.*/
141
- doubleClickDelay: 500,
142
- /** Mose click delay response time.*/
143
- clickDelay: 200,
144
- /** Mouse wheel. */
145
- wheelDelta: 0,
146
- /** JavaScript mouse system event message. */
147
- sys: null,
148
- /** Current picking object. */
149
- pickingObject: null,
150
- /** Renderer instanve. */
151
- renderer: renderer
152
- };
153
-
154
- /**
155
- * Current touch state.
156
- * @public
157
- * @enum {Object}
158
- */
159
- this.touchState = {
160
- /** Touching is moving now. */
161
- moving: false,
162
- /** Touch has ended right now.*/
163
- touchEnd: false,
164
- /** Touch has started right now.*/
165
- touchStart: false,
166
- /** Touch canceled.*/
167
- touchCancel: false,
168
- /** Touched twice.*/
169
- doubleTouch: false,
170
- /** Double touching responce delay.*/
171
- doubleTouchDelay: 550,
172
- /** Double touching responce radius in screen pixels.*/
173
- doubleTouchRadius: 10,
174
- /** Current touch X - coordinate. */
175
- x: 0,
176
- /** Current touch Y - coordinate. */
177
- y: 0,
178
- /** Current touch X - coordinate from 0 to 1 */
179
- nx: 0,
180
- /** Current touch Y - coordinate from 0 to 1 */
181
- ny: 0,
182
- /** Previous touch X coordinate. */
183
- prev_x: 0,
184
- /** Previous touch Y coordinate. */
185
- prev_y: 0,
186
- /** JavaScript touching system event message. */
187
- sys: null,
188
- /** Current touched(picking) object. */
189
- pickingObject: null,
190
- /** Renderer instanve. */
191
- renderer: renderer
192
- };
193
-
194
- this._dblTchCoords = new Vec2();
195
- this._oneTouchStart = false;
196
- this._dblTchBegins = 0;
197
- /**
198
- * @type {number}
199
- */
200
- this._mousestopThread = null;
201
- this._ldblClkBegins = 0;
202
- this._rdblClkBegins = 0;
203
- this._mdblClkBegins = 0;
204
- this._lClkBegins = 0;
205
- this._rClkBegins = 0;
206
- this._mClkBegins = 0;
207
- this._lclickX = 0;
208
- this._lclickY = 0;
209
- this._rclickX = 0;
210
- this._rclickY = 0;
211
- this._mclickX = 0;
212
- this._mclickY = 0;
213
- }
214
-
215
- get active() {
216
- return this._active;
217
- }
218
-
219
- set active(act) {
220
- this._active = act;
221
- this._keyboardHandler.setActivity(act);
222
- }
223
-
224
- /**
225
- * Used in render node frame.
226
- * @public
227
- */
228
- handleEvents() {
229
- if (this._active) {
230
- this.mouseState.direction = this.renderer.activeCamera.unproject(
231
- this.mouseState.x,
232
- this.mouseState.y
233
- );
234
- this.entityPickingEvents();
235
- this._keyboardHandler.handleEvents();
236
- this.handleMouseEvents();
237
- this.handleTouchEvents();
238
- }
239
- }
240
-
241
- /**
242
- * Set render event callback.
243
- * @public
244
- * @param {string} name - Event name
245
- * @param {eventCallback} callback - Callback function
246
- * @param {number} [key] - Key code from og.input
247
- * @param {*} sender - Callback context
248
- * @param {number} [priority] - Event callback priority
249
- */
250
- on(name, p0, p1, p2, p3) {
251
- if (name === "keypress" || name === "charkeypress" || name === "keyfree") {
252
- this._keyboardHandler.addEvent(name, p2, p1, p0, p3);
253
- } else {
254
- super.on(name, p0, p1, p2);
255
- }
256
- }
257
-
258
- /**
259
- * TODO: DOESNT WORK!!!
260
- * @param {any} name
261
- * @param {any} callback
262
- */
263
- off(name, callback) {
264
- if (name === "keypress" || name === "charkeypress" || name === "keyfree") {
265
- this._keyboardHandler.removeEvent(name, callback);
266
- } else {
267
- super.off(name, callback);
268
- }
269
- }
270
-
271
- /**
272
- * Check key is pressed.
273
- * @public
274
- * @param {number} keyCode - Key code
275
- * @return {boolean}
276
- */
277
- isKeyPressed(keyCode) {
278
- return this._keyboardHandler.isKeyPressed(keyCode);
279
- }
280
-
281
- releaseKeys() {
282
- this._keyboardHandler.releaseKeys();
283
- }
284
-
285
- /**
286
- * Renderer events initialization.
287
- * @public
288
- */
289
- initialize() {
290
- this._mouseHandler.setEvent("mouseup", this, this.onMouseUp);
291
- this._mouseHandler.setEvent("mousemove", this, this.onMouseMove);
292
- this._mouseHandler.setEvent("mousedown", this, this.onMouseDown);
293
- this._mouseHandler.setEvent("mousewheel", this, this.onMouseWheel);
294
- this._mouseHandler.setEvent("mouseleave", this, this.onMouseLeave);
295
- this._mouseHandler.setEvent("mouseenter", this, this.onMouseEnter);
296
-
297
- this._touchHandler.setEvent("touchstart", this, this.onTouchStart);
298
- this._touchHandler.setEvent("touchend", this, this.onTouchEnd);
299
- this._touchHandler.setEvent("touchcancel", this, this.onTouchCancel);
300
- this._touchHandler.setEvent("touchmove", this, this.onTouchMove);
301
- }
302
-
303
- /**
304
- * @private
305
- */
306
- onMouseWheel(event) {
307
- this.mouseState.wheelDelta = event.wheelDelta;
308
- }
309
-
310
- /**
311
- * @protected
312
- */
313
- updateButtonsStates(buttons) {
314
- var ms = this.mouseState;
315
- if (buttons & LB_M) {
316
- ms.leftButtonDown = true;
317
- } else {
318
- ms.leftButtonHold = false;
319
- ms.leftButtonDown = false;
320
- }
321
-
322
- if (buttons & RB_M) {
323
- ms.rightButtonDown = true;
324
- } else {
325
- ms.rightButtonHold = false;
326
- ms.rightButtonDown = false;
327
- }
328
-
329
- if (buttons & MB_M) {
330
- ms.middleButtonDown = true;
331
- } else {
332
- ms.middleButtonHold = false;
333
- ms.middleButtonDown = false;
334
- }
335
- }
336
-
337
- /**
338
- * @private
339
- */
340
- onMouseMove(event, sys) {
341
- var ms = this.mouseState;
342
- this.updateButtonsStates(sys.buttons);
343
- ms.sys = event;
344
-
345
- let ex = event.clientX,
346
- ey = event.clientY,
347
- r = this.clickRadius;
348
-
349
- if (Math.abs(this._lclickX - ex) >= r && Math.abs(this._lclickY - ey) >= r) {
350
- this._ldblClkBegins = 0;
351
- this._lClkBegins = 0;
352
- }
353
-
354
- if (Math.abs(this._rclickX - ex) >= r && Math.abs(this._rclickY - ey) >= r) {
355
- this._rdblClkBegins = 0;
356
- this._rClkBegins = 0;
357
- }
358
-
359
- if (Math.abs(this._mclickX - ex) >= r && Math.abs(this._mclickY - ey) >= r) {
360
- this._mdblClkBegins = 0;
361
- this._mClkBegins = 0;
362
- }
363
-
364
- if (ms.clientX === event.clientX && ms.clientY === event.clientY) {
365
- return;
1
+ /**
2
+ * @module og/renderer/RendererEvents
3
+ */
4
+
5
+ "use strict";
6
+
7
+ import { Events } from "../Events.js";
8
+ import { input } from "../input/input.js";
9
+ import { KeyboardHandler } from "../input/KeyboardHandler.js";
10
+ import { MouseHandler } from "../input/MouseHandler.js";
11
+ import { TouchHandler } from "../input/TouchHandler.js";
12
+ import { Vec2 } from "../math/Vec2.js";
13
+ import { Vec3 } from "../math/Vec3.js";
14
+
15
+ const LB_M = 0b0001;
16
+ const RB_M = 0b0010;
17
+ const MB_M = 0b0100;
18
+
19
+ /**
20
+ * Renderer events handler.
21
+ * @class
22
+ * @param {Renderer} renderer - Renderer object, events that works for.
23
+ */
24
+ class RendererEvents extends Events {
25
+ constructor(renderer) {
26
+ super(EVENT_NAMES);
27
+
28
+ /**
29
+ * Assigned renderer.
30
+ * @public
31
+ * @type {Renderer}
32
+ */
33
+ this.renderer = renderer;
34
+
35
+ /**
36
+ * Low level touch events handler.
37
+ * @private
38
+ * @type {input.TouchHandler}
39
+ */
40
+ this._touchHandler = new TouchHandler(renderer.handler.canvas);
41
+
42
+ /**
43
+ * Low level mouse events handler.
44
+ * @private
45
+ * @type {input.MouseHandler}
46
+ */
47
+ this._mouseHandler = new MouseHandler(renderer.handler.canvas);
48
+
49
+ /**
50
+ * Low level keyboard events handler.
51
+ * @private
52
+ * @type {input.KeyboardHandler}
53
+ */
54
+ this._keyboardHandler = new KeyboardHandler();
55
+
56
+ this._active = true;
57
+
58
+ this.clickRadius = 15;
59
+
60
+ /**
61
+ * Current mouse state.
62
+ * @public
63
+ * @enum {Object}
64
+ */
65
+ this.mouseState = {
66
+ /** Current screen mouse X position. */
67
+ clientX: 0,
68
+ /** Current screen mouse Y position. */
69
+ clientY: 0,
70
+ /** Current viewport mouse X position. */
71
+ x: 0,
72
+ /** Current viewport mouse Y position. */
73
+ y: 0,
74
+ /** Current mouse X position from 0 to 1 */
75
+ nx: 0,
76
+ /** Current mouse Y position from 0 to 1 */
77
+ ny: 0,
78
+ /** Previous mouse X position. */
79
+ prev_x: 0,
80
+ /** Previous mouse Y position. */
81
+ prev_y: 0,
82
+ /** Screen mouse position world direction. */
83
+ direction: new Vec3(),
84
+ /** Left mouse button has stopped pushing down right now.*/
85
+ leftButtonUp: false,
86
+ /** Right mouse button has stopped pushing down right now.*/
87
+ rightButtonUp: false,
88
+ /** Middle mouse button has stopped pushing down right now.*/
89
+ middleButtonUp: false,
90
+ /** Left mouse button has pushed now.*/
91
+ leftButtonDown: false,
92
+ /** Right mouse button has pushed now.*/
93
+ rightButtonDown: false,
94
+ /** Middle mouse button has pushed now.*/
95
+ middleButtonDown: false,
96
+ /** Left mouse button is pushing.*/
97
+ leftButtonHold: false,
98
+ /** Right mouse button is pushing.*/
99
+ rightButtonHold: false,
100
+ /** Middle mouse button is pushing.*/
101
+ middleButtonHold: false,
102
+ /** Left mouse button has clicked twice now.*/
103
+ leftButtonDoubleClick: false,
104
+ /** Right mouse button has clicked twice now.*/
105
+ rightButtonDoubleClick: false,
106
+ /** Middle mouse button has clicked twice now.*/
107
+ middleButtonDoubleClick: false,
108
+ /** Left mouse button has clicked now. */
109
+ leftButtonClick: false,
110
+ /** Right mouse button has clicked now. */
111
+ rightButtonClick: false,
112
+ /** Middle mouse button has clicked now. */
113
+ middleButtonClick: false,
114
+ /** Mouse is moving now. */
115
+ moving: false,
116
+ /** Mouse has just stopped now. */
117
+ justStopped: false,
118
+ /** Mose double click delay response time.*/
119
+ doubleClickDelay: 500,
120
+ /** Mose click delay response time.*/
121
+ clickDelay: 200,
122
+ /** Mouse wheel. */
123
+ wheelDelta: 0,
124
+ /** JavaScript mouse system event message. */
125
+ sys: null,
126
+ /** Current picking object. */
127
+ pickingObject: null,
128
+ /** Renderer instanve. */
129
+ renderer: renderer
130
+ };
131
+
132
+ /**
133
+ * Current touch state.
134
+ * @public
135
+ * @enum {Object}
136
+ */
137
+ this.touchState = {
138
+ /** Touching is moving now. */
139
+ moving: false,
140
+ /** Touch has ended right now.*/
141
+ touchEnd: false,
142
+ /** Touch has started right now.*/
143
+ touchStart: false,
144
+ /** Touch canceled.*/
145
+ touchCancel: false,
146
+ /** Touched twice.*/
147
+ doubleTouch: false,
148
+ /** Double touching responce delay.*/
149
+ doubleTouchDelay: 550,
150
+ /** Double touching responce radius in screen pixels.*/
151
+ doubleTouchRadius: 10,
152
+ /** Current touch X - coordinate. */
153
+ x: 0,
154
+ /** Current touch Y - coordinate. */
155
+ y: 0,
156
+ /** Current touch X - coordinate from 0 to 1 */
157
+ nx: 0,
158
+ /** Current touch Y - coordinate from 0 to 1 */
159
+ ny: 0,
160
+ /** Previous touch X coordinate. */
161
+ prev_x: 0,
162
+ /** Previous touch Y coordinate. */
163
+ prev_y: 0,
164
+ /** JavaScript touching system event message. */
165
+ sys: null,
166
+ /** Current touched(picking) object. */
167
+ pickingObject: null,
168
+ /** Renderer instanve. */
169
+ renderer: renderer
170
+ };
171
+
172
+ this._dblTchCoords = new Vec2();
173
+ this._oneTouchStart = false;
174
+ this._dblTchBegins = 0;
175
+ /**
176
+ * @type {number}
177
+ */
178
+ this._mousestopThread = null;
179
+ this._ldblClkBegins = 0;
180
+ this._rdblClkBegins = 0;
181
+ this._mdblClkBegins = 0;
182
+ this._lClkBegins = 0;
183
+ this._rClkBegins = 0;
184
+ this._mClkBegins = 0;
185
+ this._lclickX = 0;
186
+ this._lclickY = 0;
187
+ this._rclickX = 0;
188
+ this._rclickY = 0;
189
+ this._mclickX = 0;
190
+ this._mclickY = 0;
191
+ }
192
+
193
+ pointerEvent() {
194
+ let ms = this.mouseState,
195
+ ts = this.touchState;
196
+ return (
197
+ ms.moving ||
198
+ ms.justStopped ||
199
+ ms.wheelDelta ||
200
+ ts.moving ||
201
+ ts.touchStart ||
202
+ ts.touchEnd
203
+ )
204
+ }
205
+
206
+ get active() {
207
+ return this._active;
208
+ }
209
+
210
+ set active(act) {
211
+ this._active = act;
212
+ this._keyboardHandler.setActivity(act);
213
+ }
214
+
215
+ /**
216
+ * Used in render node frame.
217
+ * @public
218
+ */
219
+ handleEvents() {
220
+ if (this._active) {
221
+ this.mouseState.direction = this.renderer.activeCamera.unproject(
222
+ this.mouseState.x,
223
+ this.mouseState.y
224
+ );
225
+ this.entityPickingEvents();
226
+ this._keyboardHandler.handleEvents();
227
+ this.handleMouseEvents();
228
+ this.handleTouchEvents();
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Set render event callback.
234
+ * @public
235
+ * @param {string} name - Event name
236
+ * @param {eventCallback} callback - Callback function
237
+ * @param {number} [key] - Key code from og.input
238
+ * @param {*} sender - Callback context
239
+ * @param {number} [priority] - Event callback priority
240
+ */
241
+ on(name, p0, p1, p2, p3) {
242
+ if (name === "keypress" || name === "charkeypress" || name === "keyfree") {
243
+ this._keyboardHandler.addEvent(name, p2, p1, p0, p3);
244
+ } else {
245
+ super.on(name, p0, p1, p2);
246
+ }
247
+ }
248
+
249
+ /**
250
+ * TODO: DOESNT WORK!!!
251
+ * @param {any} name
252
+ * @param {any} callback
253
+ */
254
+ off(name, callback) {
255
+ if (name === "keypress" || name === "charkeypress" || name === "keyfree") {
256
+ this._keyboardHandler.removeEvent(name, callback);
257
+ } else {
258
+ super.off(name, callback);
259
+ }
260
+ }
261
+
262
+ /**
263
+ * Check key is pressed.
264
+ * @public
265
+ * @param {number} keyCode - Key code
266
+ * @return {boolean}
267
+ */
268
+ isKeyPressed(keyCode) {
269
+ return this._keyboardHandler.isKeyPressed(keyCode);
270
+ }
271
+
272
+ releaseKeys() {
273
+ this._keyboardHandler.releaseKeys();
274
+ }
275
+
276
+ /**
277
+ * Renderer events initialization.
278
+ * @public
279
+ */
280
+ initialize() {
281
+ this._mouseHandler.setEvent("mouseup", this, this.onMouseUp);
282
+ this._mouseHandler.setEvent("mousemove", this, this.onMouseMove);
283
+ this._mouseHandler.setEvent("mousedown", this, this.onMouseDown);
284
+ this._mouseHandler.setEvent("mousewheel", this, this.onMouseWheel);
285
+ this._mouseHandler.setEvent("mouseleave", this, this.onMouseLeave);
286
+ this._mouseHandler.setEvent("mouseenter", this, this.onMouseEnter);
287
+
288
+ this._touchHandler.setEvent("touchstart", this, this.onTouchStart);
289
+ this._touchHandler.setEvent("touchend", this, this.onTouchEnd);
290
+ this._touchHandler.setEvent("touchcancel", this, this.onTouchCancel);
291
+ this._touchHandler.setEvent("touchmove", this, this.onTouchMove);
292
+ }
293
+
294
+ /**
295
+ * @private
296
+ */
297
+ onMouseWheel(event) {
298
+ this.mouseState.wheelDelta = event.wheelDelta;
299
+ }
300
+
301
+ /**
302
+ * @protected
303
+ */
304
+ updateButtonsStates(buttons) {
305
+ var ms = this.mouseState;
306
+ if (buttons & LB_M) {
307
+ ms.leftButtonDown = true;
308
+ } else {
309
+ ms.leftButtonHold = false;
310
+ ms.leftButtonDown = false;
311
+ }
312
+
313
+ if (buttons & RB_M) {
314
+ ms.rightButtonDown = true;
315
+ } else {
316
+ ms.rightButtonHold = false;
317
+ ms.rightButtonDown = false;
318
+ }
319
+
320
+ if (buttons & MB_M) {
321
+ ms.middleButtonDown = true;
322
+ } else {
323
+ ms.middleButtonHold = false;
324
+ ms.middleButtonDown = false;
325
+ }
326
+ }
327
+
328
+ /**
329
+ * @private
330
+ */
331
+ onMouseMove(event, sys) {
332
+ var ms = this.mouseState;
333
+ this.updateButtonsStates(sys.buttons);
334
+ ms.sys = event;
335
+
336
+ let ex = event.clientX,
337
+ ey = event.clientY,
338
+ r = this.clickRadius;
339
+
340
+ if (Math.abs(this._lclickX - ex) >= r && Math.abs(this._lclickY - ey) >= r) {
341
+ this._ldblClkBegins = 0;
342
+ this._lClkBegins = 0;
343
+ }
344
+
345
+ if (Math.abs(this._rclickX - ex) >= r && Math.abs(this._rclickY - ey) >= r) {
346
+ this._rdblClkBegins = 0;
347
+ this._rClkBegins = 0;
348
+ }
349
+
350
+ if (Math.abs(this._mclickX - ex) >= r && Math.abs(this._mclickY - ey) >= r) {
351
+ this._mdblClkBegins = 0;
352
+ this._mClkBegins = 0;
353
+ }
354
+
355
+ if (ms.clientX === event.clientX && ms.clientY === event.clientY) {
356
+ return;
366
357
  }
367
-
368
- ms.clientX = event.clientX;
358
+
359
+ ms.clientX = event.clientX;
369
360
  ms.clientY = event.clientY;
370
361
 
371
362
  let h = this.renderer.handler;
372
363
 
373
- ms.x = event.clientX * h.pixelRatio;
374
- ms.y = event.clientY * h.pixelRatio;
375
-
376
- ms.nx = ms.x / h.canvas.width;
377
- ms.ny = ms.y / h.canvas.height;
378
-
379
- ms.moving = true;
380
-
381
- //dispatch stop mouse event
382
- clearTimeout(this._mousestopThread);
383
- this._mousestopThread = setTimeout(function () {
384
- ms.justStopped = true;
385
- }, 100);
386
- }
387
-
388
- onMouseLeave(event) {
389
- this.dispatch(this.mouseleave, event);
390
- }
391
-
392
- onMouseEnter(event) {
393
- this.dispatch(this.mouseenter, event);
394
- }
395
-
396
- /**
397
- * @private
398
- */
399
- onMouseDown(event) {
400
- if (event.button === input.MB_LEFT) {
401
- this._lClkBegins = window.performance.now();
402
- this._lclickX = event.clientX;
403
- this._lclickY = event.clientY;
404
- this.mouseState.sys = event;
405
- this.mouseState.leftButtonDown = true;
406
- } else if (event.button === input.MB_RIGHT) {
407
- this._rClkBegins = window.performance.now();
408
- this._rclickX = event.clientX;
409
- this._rclickY = event.clientY;
410
- this.mouseState.sys = event;
411
- this.mouseState.rightButtonDown = true;
412
- } else if (event.button === input.MB_MIDDLE) {
413
- this._mClkBegins = window.performance.now();
414
- this._mclickX = event.clientX;
415
- this._mclickY = event.clientY;
416
- this.mouseState.sys = event;
417
- this.mouseState.middleButtonDown = true;
418
- }
419
- }
420
-
421
- /**
422
- * @private
423
- */
424
- onMouseUp(event) {
425
- var ms = this.mouseState;
426
- ms.sys = event;
427
- var t = window.performance.now();
428
-
429
- if (event.button === input.MB_LEFT) {
430
- ms.leftButtonDown = false;
431
- ms.leftButtonUp = true;
432
-
433
- if (
434
- Math.abs(this._lclickX - event.clientX) < this.clickRadius &&
435
- Math.abs(this._lclickY - event.clientY) < this.clickRadius &&
436
- t - this._lClkBegins <= ms.clickDelay
437
- ) {
438
- if (this._ldblClkBegins) {
439
- let deltatime = window.performance.now() - this._ldblClkBegins;
440
- if (deltatime <= ms.doubleClickDelay) {
441
- ms.leftButtonDoubleClick = true;
442
- }
443
- this._ldblClkBegins = 0;
444
- } else {
445
- this._ldblClkBegins = window.performance.now();
446
- }
447
-
448
- ms.leftButtonClick = true;
449
- this._lClkBegins = 0;
450
- }
451
- } else if (event.button === input.MB_RIGHT) {
452
- ms.rightButtonDown = false;
453
- ms.rightButtonUp = true;
454
-
455
- if (
456
- Math.abs(this._rclickX - event.clientX) < this.clickRadius &&
457
- Math.abs(this._rclickY - event.clientY) < this.clickRadius &&
458
- t - this._rClkBegins <= ms.clickDelay
459
- ) {
460
- if (this._rdblClkBegins) {
461
- let deltatime = window.performance.now() - this._rdblClkBegins;
462
- if (deltatime <= ms.doubleClickDelay) {
463
- ms.rightButtonDoubleClick = true;
464
- }
465
- this._rdblClkBegins = 0;
466
- } else {
467
- this._rdblClkBegins = window.performance.now();
468
- }
469
-
470
- ms.rightButtonClick = true;
471
- this._rClkBegins = 0;
472
- }
473
- } else if (event.button === input.MB_MIDDLE) {
474
- ms.middleButtonDown = false;
475
- ms.middleButtonUp = true;
476
-
477
- if (
478
- Math.abs(this._mclickX - event.clientX) < this.clickRadius &&
479
- Math.abs(this._mclickY - event.clientY) < this.clickRadius &&
480
- t - this._mClkBegins <= ms.clickDelay
481
- ) {
482
- if (this._mdblClkBegins) {
483
- var deltatime = window.performance.now() - this._mdblClkBegins;
484
- if (deltatime <= ms.doubleClickDelay) {
485
- ms.middleButtonDoubleClick = true;
486
- }
487
- this._mdblClkBegins = 0;
488
- } else {
489
- this._mdblClkBegins = window.performance.now();
490
- }
491
-
492
- ms.middleButtonClick = true;
493
- this._mClkBegins = 0;
494
- }
495
- }
496
- }
497
-
498
- /**
499
- * @private
500
- */
501
- onTouchStart(event) {
502
- var ts = this.touchState;
364
+ ms.x = event.clientX * h.pixelRatio;
365
+ ms.y = event.clientY * h.pixelRatio;
366
+
367
+ ms.nx = ms.x / h.canvas.width;
368
+ ms.ny = ms.y / h.canvas.height;
369
+
370
+ ms.moving = true;
371
+
372
+ //dispatch stop mouse event
373
+ clearTimeout(this._mousestopThread);
374
+ this._mousestopThread = setTimeout(function () {
375
+ ms.justStopped = true;
376
+ }, 100);
377
+ }
378
+
379
+ onMouseLeave(event) {
380
+ this.dispatch(this.mouseleave, event);
381
+ }
382
+
383
+ onMouseEnter(event) {
384
+ this.dispatch(this.mouseenter, event);
385
+ }
386
+
387
+ /**
388
+ * @private
389
+ */
390
+ onMouseDown(event) {
391
+ if (event.button === input.MB_LEFT) {
392
+ this._lClkBegins = window.performance.now();
393
+ this._lclickX = event.clientX;
394
+ this._lclickY = event.clientY;
395
+ this.mouseState.sys = event;
396
+ this.mouseState.leftButtonDown = true;
397
+ } else if (event.button === input.MB_RIGHT) {
398
+ this._rClkBegins = window.performance.now();
399
+ this._rclickX = event.clientX;
400
+ this._rclickY = event.clientY;
401
+ this.mouseState.sys = event;
402
+ this.mouseState.rightButtonDown = true;
403
+ } else if (event.button === input.MB_MIDDLE) {
404
+ this._mClkBegins = window.performance.now();
405
+ this._mclickX = event.clientX;
406
+ this._mclickY = event.clientY;
407
+ this.mouseState.sys = event;
408
+ this.mouseState.middleButtonDown = true;
409
+ }
410
+ }
411
+
412
+ /**
413
+ * @private
414
+ */
415
+ onMouseUp(event) {
416
+ var ms = this.mouseState;
417
+ ms.sys = event;
418
+ var t = window.performance.now();
419
+
420
+ if (event.button === input.MB_LEFT) {
421
+ ms.leftButtonDown = false;
422
+ ms.leftButtonUp = true;
423
+
424
+ if (
425
+ Math.abs(this._lclickX - event.clientX) < this.clickRadius &&
426
+ Math.abs(this._lclickY - event.clientY) < this.clickRadius &&
427
+ t - this._lClkBegins <= ms.clickDelay
428
+ ) {
429
+ if (this._ldblClkBegins) {
430
+ let deltatime = window.performance.now() - this._ldblClkBegins;
431
+ if (deltatime <= ms.doubleClickDelay) {
432
+ ms.leftButtonDoubleClick = true;
433
+ }
434
+ this._ldblClkBegins = 0;
435
+ } else {
436
+ this._ldblClkBegins = window.performance.now();
437
+ }
438
+
439
+ ms.leftButtonClick = true;
440
+ this._lClkBegins = 0;
441
+ }
442
+ } else if (event.button === input.MB_RIGHT) {
443
+ ms.rightButtonDown = false;
444
+ ms.rightButtonUp = true;
445
+
446
+ if (
447
+ Math.abs(this._rclickX - event.clientX) < this.clickRadius &&
448
+ Math.abs(this._rclickY - event.clientY) < this.clickRadius &&
449
+ t - this._rClkBegins <= ms.clickDelay
450
+ ) {
451
+ if (this._rdblClkBegins) {
452
+ let deltatime = window.performance.now() - this._rdblClkBegins;
453
+ if (deltatime <= ms.doubleClickDelay) {
454
+ ms.rightButtonDoubleClick = true;
455
+ }
456
+ this._rdblClkBegins = 0;
457
+ } else {
458
+ this._rdblClkBegins = window.performance.now();
459
+ }
460
+
461
+ ms.rightButtonClick = true;
462
+ this._rClkBegins = 0;
463
+ }
464
+ } else if (event.button === input.MB_MIDDLE) {
465
+ ms.middleButtonDown = false;
466
+ ms.middleButtonUp = true;
467
+
468
+ if (
469
+ Math.abs(this._mclickX - event.clientX) < this.clickRadius &&
470
+ Math.abs(this._mclickY - event.clientY) < this.clickRadius &&
471
+ t - this._mClkBegins <= ms.clickDelay
472
+ ) {
473
+ if (this._mdblClkBegins) {
474
+ var deltatime = window.performance.now() - this._mdblClkBegins;
475
+ if (deltatime <= ms.doubleClickDelay) {
476
+ ms.middleButtonDoubleClick = true;
477
+ }
478
+ this._mdblClkBegins = 0;
479
+ } else {
480
+ this._mdblClkBegins = window.performance.now();
481
+ }
482
+
483
+ ms.middleButtonClick = true;
484
+ this._mClkBegins = 0;
485
+ }
486
+ }
487
+ }
488
+
489
+ /**
490
+ * @private
491
+ */
492
+ onTouchStart(event) {
493
+ var ts = this.touchState;
503
494
  ts.sys = event;
504
-
505
- ts.clienX = event.touches.item(0).clientX - event.offsetLeft;
495
+
496
+ ts.clienX = event.touches.item(0).clientX - event.offsetLeft;
506
497
  ts.clientY = event.touches.item(0).clientY - event.offsetTop;
507
-
498
+
508
499
  let h = this.renderer.handler;
509
500
 
510
501
  ts.x = ts.clientX * h.pixelRatio;
511
502
  ts.y = ts.clientY * h.pixelRatio;
512
-
513
- ts.nx = ts.x / h.canvas.width;
514
- ts.ny = ts.y / h.canvas.height;
515
- ts.prev_x = ts.x;
516
- ts.prev_y = ts.y;
517
- ts.touchStart = true;
518
-
519
- if (event.touches.length === 1) {
520
- this._dblTchCoords.x = ts.x;
521
- this._dblTchCoords.y = ts.y;
522
- this._oneTouchStart = true;
523
- } else {
524
- this._oneTouchStart = false;
525
- }
526
- }
527
-
528
- /**
529
- * @private
530
- */
531
- onTouchEnd(event) {
532
- var ts = this.touchState;
533
- ts.sys = event;
534
- ts.touchEnd = true;
535
-
536
- if (event.touches.length === 0) {
537
- ts.prev_x = ts.x;
538
- ts.prev_y = ts.y;
539
-
540
- if (this._oneTouchStart) {
541
- if (this._dblTchBegins) {
542
- var deltatime = window.performance.now() - this._dblTchBegins;
543
- if (deltatime <= ts.doubleTouchDelay) {
544
- ts.doubleTouch = true;
545
- }
546
- this._dblTchBegins = 0;
547
- }
548
- this._dblTchBegins = window.performance.now();
549
- this._oneTouchStart = false;
550
- }
551
- }
552
- }
553
-
554
- /**
555
- * @private
556
- */
557
- onTouchCancel(event) {
558
- var ts = this.touchState;
559
- ts.sys = event;
560
- ts.touchCancel = true;
561
- }
562
-
563
- /**
564
- * @private
565
- */
566
- onTouchMove(event) {
567
- var ts = this.touchState;
568
- ts.clientX = event.touches.item(0).clientX - event.offsetLeft;
503
+
504
+ ts.nx = ts.x / h.canvas.width;
505
+ ts.ny = ts.y / h.canvas.height;
506
+ ts.prev_x = ts.x;
507
+ ts.prev_y = ts.y;
508
+ ts.touchStart = true;
509
+
510
+ if (event.touches.length === 1) {
511
+ this._dblTchCoords.x = ts.x;
512
+ this._dblTchCoords.y = ts.y;
513
+ this._oneTouchStart = true;
514
+ } else {
515
+ this._oneTouchStart = false;
516
+ }
517
+ }
518
+
519
+ /**
520
+ * @private
521
+ */
522
+ onTouchEnd(event) {
523
+ var ts = this.touchState;
524
+ ts.sys = event;
525
+ ts.touchEnd = true;
526
+
527
+ if (event.touches.length === 0) {
528
+ ts.prev_x = ts.x;
529
+ ts.prev_y = ts.y;
530
+
531
+ if (this._oneTouchStart) {
532
+ if (this._dblTchBegins) {
533
+ var deltatime = window.performance.now() - this._dblTchBegins;
534
+ if (deltatime <= ts.doubleTouchDelay) {
535
+ ts.doubleTouch = true;
536
+ }
537
+ this._dblTchBegins = 0;
538
+ }
539
+ this._dblTchBegins = window.performance.now();
540
+ this._oneTouchStart = false;
541
+ }
542
+ }
543
+ }
544
+
545
+ /**
546
+ * @private
547
+ */
548
+ onTouchCancel(event) {
549
+ var ts = this.touchState;
550
+ ts.sys = event;
551
+ ts.touchCancel = true;
552
+ }
553
+
554
+ /**
555
+ * @private
556
+ */
557
+ onTouchMove(event) {
558
+ var ts = this.touchState;
559
+ ts.clientX = event.touches.item(0).clientX - event.offsetLeft;
569
560
  ts.clientY = event.touches.item(0).clientY - event.offsetTop;
570
-
561
+
571
562
  var h = this.renderer.handler;
572
563
 
573
564
  ts.x = ts.clientX * h.pixelRatio;
574
565
  ts.y = ts.clientY * h.pixelRatio;
575
-
576
- ts.nx = ts.x / h.canvas.width;
566
+
567
+ ts.nx = ts.x / h.canvas.width;
577
568
  ts.ny = ts.y / h.canvas.height;
578
-
579
- ts.sys = event;
580
- ts.moving = true;
581
- this._dblTchBegins = 0;
582
- this._oneTouchStart = false;
583
- }
584
-
585
- /**
586
- * @private
587
- */
588
- entityPickingEvents() {
589
- var ts = this.touchState,
590
- ms = this.mouseState;
591
-
592
- if (!(ms.leftButtonHold || ms.rightButtonHold || ms.middleButtonHold)) {
593
- var r = this.renderer;
594
-
595
- var o = r.colorObjects;
596
-
597
- var c = r._currPickingColor,
598
- p = r._prevPickingColor;
599
-
600
- ms.pickingObject = null;
601
- ts.pickingObject = null;
602
-
603
- var co = o && o[c[0] + "_" + c[1] + "_" + c[2]];
604
-
605
- ms.pickingObject = co;
606
- ts.pickingObject = co;
607
-
608
- //object changed
609
- if (c[0] != p[0] || c[1] != p[1] || c[2] != p[2]) {
610
- //current black
611
- if (!(c[0] || c[1] || c[2])) {
612
- let po = o[p[0] + "_" + p[1] + "_" + p[2]];
613
- if (po) {
614
- let pe = po.rendererEvents;
615
- ms.pickingObject = po;
616
- pe && pe.dispatch(pe.mouseleave, ms);
617
- ts.pickingObject = po;
618
- pe && pe.dispatch(pe.touchleave, ts);
619
- }
620
- } else {
621
- //current not black
622
-
623
- //previous not black
624
- if (p[0] || p[1] || p[2]) {
625
- let po = o[p[0] + "_" + p[1] + "_" + p[2]];
626
- if (po) {
627
- let pe = po.rendererEvents;
628
- ms.pickingObject = po;
629
- pe && pe.dispatch(pe.mouseleave, ms);
630
- ts.pickingObject = po;
631
- pe && pe.dispatch(pe.touchleave, ts);
632
- }
633
- }
634
-
635
- if (co) {
636
- var ce = co.rendererEvents;
637
- ms.pickingObject = co;
638
- ce && ce.dispatch(ce.mouseenter, ms);
639
- ts.pickingObject = co;
640
- ce && ce.dispatch(ce.touchenter, ts);
641
- }
642
- }
643
- }
644
- }
645
- }
646
-
647
- /**
648
- * @private
649
- */
650
- handleMouseEvents() {
651
- let ms = this.mouseState;
652
- let po = ms.pickingObject,
653
- pe = null;
654
-
655
- if (ms.leftButtonClick) {
656
- if (po) {
657
- pe = po.rendererEvents;
658
- pe && pe.dispatch(pe.lclick, ms);
659
- }
660
- this.dispatch(this.lclick, ms);
661
- ms.leftButtonClick = false;
662
- }
663
-
664
- if (ms.rightButtonClick) {
665
- if (po) {
666
- pe = po.rendererEvents;
667
- pe && pe.dispatch(pe.rclick, ms);
668
- }
669
- this.dispatch(this.rclick, ms);
670
- ms.rightButtonClick = false;
671
- }
672
-
673
- if (ms.middleButtonClick) {
674
- if (po) {
675
- pe = po.rendererEvents;
676
- pe && pe.dispatch(pe.mclick, ms);
677
- }
678
- this.dispatch(this.mclick, ms);
679
- ms.middleButtonClick = false;
680
- }
681
-
682
- if (ms.leftButtonDown) {
683
- if (ms.leftButtonHold) {
684
- if (po) {
685
- pe = po.rendererEvents;
686
- pe && pe.dispatch(pe.lhold, ms);
687
- }
688
- this.dispatch(this.lhold, ms);
689
- } else {
690
- ms.leftButtonHold = true;
691
- if (po) {
692
- pe = po.rendererEvents;
693
- pe && pe.dispatch(pe.ldown, ms);
694
- }
695
- this.dispatch(this.ldown, ms);
696
- }
697
- }
698
-
699
- if (ms.rightButtonDown) {
700
- if (ms.rightButtonHold) {
701
- if (po) {
702
- pe = po.rendererEvents;
703
- pe && pe.dispatch(pe.rhold, ms);
704
- }
705
- this.dispatch(this.rhold, ms);
706
- } else {
707
- ms.rightButtonHold = true;
708
- if (po) {
709
- pe = po.rendererEvents;
710
- pe && pe.dispatch(pe.rdown, ms);
711
- }
712
- this.dispatch(this.rdown, ms);
713
- }
714
- }
715
-
716
- if (ms.middleButtonDown) {
717
- if (ms.middleButtonHold) {
718
- if (po) {
719
- pe = po.rendererEvents;
720
- pe && pe.dispatch(pe.mhold, ms);
721
- }
722
- this.dispatch(this.mhold, ms);
723
- } else {
724
- ms.middleButtonHold = true;
725
- if (po) {
726
- pe = po.rendererEvents;
727
- pe && pe.dispatch(pe.mdown, ms);
728
- }
729
- this.dispatch(this.mdown, ms);
730
- }
731
- }
732
-
733
- if (ms.leftButtonUp) {
734
- if (po) {
735
- pe = po.rendererEvents;
736
- pe && pe.dispatch(pe.lup, ms);
737
- }
738
- this.dispatch(this.lup, ms);
739
- ms.leftButtonUp = false;
740
- ms.leftButtonHold = false;
741
- }
742
-
743
- if (ms.rightButtonUp) {
744
- if (po) {
745
- pe = po.rendererEvents;
746
- pe && pe.dispatch(pe.rup, ms);
747
- }
748
- this.dispatch(this.rup, ms);
749
- ms.rightButtonUp = false;
750
- ms.rightButtonHold = false;
751
- }
752
-
753
- if (ms.middleButtonUp) {
754
- if (po) {
755
- pe = po.rendererEvents;
756
- pe && pe.dispatch(pe.mup, ms);
757
- }
758
- this.dispatch(this.mup, ms);
759
- ms.middleButtonUp = false;
760
- ms.middleButtonHold = false;
761
- }
762
-
763
- if (ms.leftButtonDoubleClick) {
764
- if (po) {
765
- pe = po.rendererEvents;
766
- pe && pe.dispatch(pe.ldblclick, ms);
767
- }
768
- this.dispatch(this.ldblclick, ms);
769
- ms.leftButtonDoubleClick = false;
770
- }
771
-
772
- if (ms.rightButtonDoubleClick) {
773
- if (po) {
774
- pe = po.rendererEvents;
775
- pe && pe.dispatch(pe.rdblclick, ms);
776
- }
777
- this.dispatch(this.rdblclick, ms);
778
- ms.rightButtonDoubleClick = false;
779
- }
780
-
781
- if (ms.middleButtonDoubleClick) {
782
- if (po) {
783
- pe = po.rendererEvents;
784
- pe && pe.dispatch(pe.mdblclick, ms);
785
- }
786
- this.dispatch(this.mdblclick, ms);
787
- ms.middleButtonDoubleClick = false;
788
- }
789
-
790
- if (ms.wheelDelta) {
791
- if (po) {
792
- pe = po.rendererEvents;
793
- pe && pe.dispatch(pe.mousewheel, ms);
794
- }
795
- this.dispatch(this.mousewheel, ms);
796
- ms.wheelDelta = 0;
797
- }
798
-
799
- if (ms.moving) {
800
- if (po) {
801
- pe = po.rendererEvents;
802
- pe && pe.dispatch(pe.mousemove, ms);
803
- }
804
- this.dispatch(this.mousemove, ms);
805
- ms.prev_x = ms.x;
806
- ms.prev_y = ms.y;
807
- }
808
-
809
- if (ms.justStopped) {
810
- this.dispatch(this.mousestop, ms);
811
- ms.justStopped = false;
812
- }
813
- }
814
-
815
- /**
816
- * @private
817
- */
818
- handleTouchEvents() {
819
- var ts = this.touchState;
820
-
821
- var tpo = ts.pickingObject,
822
- tpe = null;
823
-
824
- if (ts.touchCancel) {
825
- this.dispatch(this.touchcancel, ts);
826
- ts.touchCancel = false;
827
- }
828
-
829
- if (ts.touchStart) {
830
- var r = this.renderer;
831
-
832
- r.pickingFramebuffer.activate();
833
- r.pickingFramebuffer.readPixels(r._currPickingColor, ts.nx, 1.0 - ts.ny, 1);
834
- r.pickingFramebuffer.deactivate();
835
-
836
- var o = r.colorObjects;
837
- var c = r._currPickingColor;
838
- var co = o[c[0] + "_" + c[1] + "_" + c[2]];
839
- tpo = ts.pickingObject = co;
840
- if (tpo) {
841
- tpe = tpo.rendererEvents;
842
- tpe && tpe.dispatch(tpe.touchstart, ts);
843
- }
844
- this.dispatch(this.touchstart, ts);
845
- ts.touchStart = false;
846
- }
847
-
848
- if (ts.doubleTouch) {
849
- if (tpo) {
850
- tpe = tpo.rendererEvents;
851
- tpe && tpe.dispatch(tpe.doubletouch, ts);
852
- }
853
- this.dispatch(this.doubletouch, ts);
854
- ts.doubleTouch = false;
855
- }
856
-
857
- if (ts.touchEnd) {
858
- if (tpo) {
859
- tpe = tpo.rendererEvents;
860
- tpe && tpe.dispatch(tpe.touchend, ts);
861
- }
862
- this.dispatch(this.touchend, ts);
863
- ts.x = 0;
864
- ts.y = 0;
865
- ts.touchEnd = false;
866
- }
867
-
868
- if (ts.moving) {
869
- if (tpo) {
870
- tpe = tpo.rendererEvents;
871
- tpe && tpe.dispatch(tpe.touchmove, ts);
872
- }
873
- this.dispatch(this.touchmove, ts);
874
- ts.prev_x = ts.x;
875
- ts.prev_y = ts.y;
876
- }
877
- }
878
- }
879
-
880
- const EVENT_NAMES = [
881
- /**
882
- * Triggered before scene frame is rendered(before render nodes).
883
- * @event og.RendererEvents#draw
884
- */
885
- "draw",
886
-
887
- /**
888
- * Triggered after scene frame is rendered(after render nodes).
889
- * @event og.RendererEvents#postdraw
890
- */
891
- "postdraw",
892
-
893
- /**
894
- * Triggered when screen is resized.
895
- * @event og.RendererEvents#resize
896
- */
897
- "resize",
898
-
899
- /**
900
- * Mouse enters the work screen
901
- * @event og.RendererEvents#mouseenter
902
- */
903
- "mouseenter",
904
-
905
- /**
906
- * Mouse leaves the work screen
907
- * @event og.RendererEvents#mouseleave
908
- */
909
- "mouseleave",
910
-
911
- /**
912
- * Mouse is moving.
913
- * @event og.RendererEvents#mousemove
914
- */
915
- "mousemove",
916
-
917
- /**
918
- * Mouse is just stopped.
919
- * @event og.RendererEvents#mousestop
920
- */
921
- "mousestop",
922
-
923
- /**
924
- * Mouse left button clicked.
925
- * @event og.RendererEvents#lclick
926
- */
927
- "lclick",
928
-
929
- /**
930
- * Mouse right button clicked.
931
- * @event og.RendererEvents#rclick
932
- */
933
- "rclick",
934
-
935
- /**
936
- * Mouse middle button clicked.
937
- * @event og.RendererEvents#mclick
938
- */
939
- "mclick",
940
-
941
- /**
942
- * Mouse left button double click.
943
- * @event og.RendererEvents#ldblclick
944
- */
945
- "ldblclick",
946
-
947
- /**
948
- * Mouse right button double click.
949
- * @event og.RendererEvents#rdblclick
950
- */
951
- "rdblclick",
952
-
953
- /**
954
- * Mouse middle button double click.
955
- * @event og.RendererEvents#mdblclick
956
- */
957
- "mdblclick",
958
-
959
- /**
960
- * Mouse left button up(stop pressing).
961
- * @event og.RendererEvents#lup
962
- */
963
- "lup",
964
-
965
- /**
966
- * Mouse right button up(stop pressing).
967
- * @event og.RendererEvents#rup
968
- */
969
- "rup",
970
-
971
- /**
972
- * Mouse middle button up(stop pressing).
973
- * @event og.RendererEvents#mup
974
- */
975
- "mup",
976
-
977
- /**
978
- * Mouse left button is just pressed down(start pressing).
979
- * @event og.RendererEvents#ldown
980
- */
981
- "ldown",
982
-
983
- /**
984
- * Mouse right button is just pressed down(start pressing).
985
- * @event og.RendererEvents#rdown
986
- */
987
- "rdown",
988
-
989
- /**
990
- * Mouse middle button is just pressed down(start pressing).
991
- * @event og.RendererEvents#mdown
992
- */
993
- "mdown",
994
-
995
- /**
996
- * Mouse left button is pressing.
997
- * @event og.RendererEvents#lhold
998
- */
999
- "lhold",
1000
-
1001
- /**
1002
- * Mouse right button is pressing.
1003
- * @event og.RendererEvents#rhold
1004
- */
1005
- "rhold",
1006
-
1007
- /**
1008
- * Mouse middle button is pressing.
1009
- * @event og.RendererEvents#mhold
1010
- */
1011
- "mhold",
1012
-
1013
- /**
1014
- * Mouse wheel is rotated.
1015
- * @event og.RendererEvents#mousewheel
1016
- */
1017
- "mousewheel",
1018
-
1019
- /**
1020
- * Triggered when touching starts.
1021
- * @event og.RendererEvents#touchstart
1022
- */
1023
- "touchstart",
1024
-
1025
- /**
1026
- * Triggered when touching ends.
1027
- * @event og.RendererEvents#touchend
1028
- */
1029
- "touchend",
1030
-
1031
- /**
1032
- * Triggered when touching cancel.
1033
- * @event og.RendererEvents#touchcancel
1034
- */
1035
- "touchcancel",
1036
-
1037
- /**
1038
- * Triggered when touch is move.
1039
- * @event og.RendererEvents#touchmove
1040
- */
1041
- "touchmove",
1042
-
1043
- /**
1044
- * Triggered when double touch.
1045
- * @event og.RendererEvents#doubletouch
1046
- */
1047
- "doubletouch",
1048
-
1049
- /**
1050
- * Triggered when touch leaves picked object.
1051
- * @event og.RendererEvents#touchleave
1052
- */
1053
- "touchleave",
1054
-
1055
- /**
1056
- * Triggered when touch enter picking object.
1057
- * @event og.RendererEvents#touchenter
1058
- */
1059
- "touchenter"
1060
- ];
1061
-
1062
- export { RendererEvents };
569
+
570
+ ts.sys = event;
571
+ ts.moving = true;
572
+ this._dblTchBegins = 0;
573
+ this._oneTouchStart = false;
574
+ }
575
+
576
+ /**
577
+ * @private
578
+ */
579
+ entityPickingEvents() {
580
+ var ts = this.touchState,
581
+ ms = this.mouseState;
582
+
583
+ if (!(ms.leftButtonHold || ms.rightButtonHold || ms.middleButtonHold)) {
584
+ var r = this.renderer;
585
+
586
+ var o = r.colorObjects;
587
+
588
+ var c = r._currPickingColor,
589
+ p = r._prevPickingColor;
590
+
591
+ ms.pickingObject = null;
592
+ ts.pickingObject = null;
593
+
594
+ var co = o && o[c[0] + "_" + c[1] + "_" + c[2]];
595
+
596
+ ms.pickingObject = co;
597
+ ts.pickingObject = co;
598
+
599
+ //object changed
600
+ if (c[0] != p[0] || c[1] != p[1] || c[2] != p[2]) {
601
+ //current black
602
+ if (!(c[0] || c[1] || c[2])) {
603
+ let po = o[p[0] + "_" + p[1] + "_" + p[2]];
604
+ if (po) {
605
+ let pe = po.rendererEvents;
606
+ ms.pickingObject = po;
607
+ pe && pe.dispatch(pe.mouseleave, ms);
608
+ ts.pickingObject = po;
609
+ pe && pe.dispatch(pe.touchleave, ts);
610
+ }
611
+ } else {
612
+ //current not black
613
+
614
+ //previous not black
615
+ if (p[0] || p[1] || p[2]) {
616
+ let po = o[p[0] + "_" + p[1] + "_" + p[2]];
617
+ if (po) {
618
+ let pe = po.rendererEvents;
619
+ ms.pickingObject = po;
620
+ pe && pe.dispatch(pe.mouseleave, ms);
621
+ ts.pickingObject = po;
622
+ pe && pe.dispatch(pe.touchleave, ts);
623
+ }
624
+ }
625
+
626
+ if (co) {
627
+ var ce = co.rendererEvents;
628
+ ms.pickingObject = co;
629
+ ce && ce.dispatch(ce.mouseenter, ms);
630
+ ts.pickingObject = co;
631
+ ce && ce.dispatch(ce.touchenter, ts);
632
+ }
633
+ }
634
+ }
635
+ }
636
+ }
637
+
638
+ /**
639
+ * @private
640
+ */
641
+ handleMouseEvents() {
642
+ let ms = this.mouseState;
643
+ let po = ms.pickingObject,
644
+ pe = null;
645
+
646
+ if (ms.leftButtonClick) {
647
+ if (po) {
648
+ pe = po.rendererEvents;
649
+ pe && pe.dispatch(pe.lclick, ms);
650
+ }
651
+ this.dispatch(this.lclick, ms);
652
+ ms.leftButtonClick = false;
653
+ }
654
+
655
+ if (ms.rightButtonClick) {
656
+ if (po) {
657
+ pe = po.rendererEvents;
658
+ pe && pe.dispatch(pe.rclick, ms);
659
+ }
660
+ this.dispatch(this.rclick, ms);
661
+ ms.rightButtonClick = false;
662
+ }
663
+
664
+ if (ms.middleButtonClick) {
665
+ if (po) {
666
+ pe = po.rendererEvents;
667
+ pe && pe.dispatch(pe.mclick, ms);
668
+ }
669
+ this.dispatch(this.mclick, ms);
670
+ ms.middleButtonClick = false;
671
+ }
672
+
673
+ if (ms.leftButtonDown) {
674
+ if (ms.leftButtonHold) {
675
+ if (po) {
676
+ pe = po.rendererEvents;
677
+ pe && pe.dispatch(pe.lhold, ms);
678
+ }
679
+ this.dispatch(this.lhold, ms);
680
+ } else {
681
+ ms.leftButtonHold = true;
682
+ if (po) {
683
+ pe = po.rendererEvents;
684
+ pe && pe.dispatch(pe.ldown, ms);
685
+ }
686
+ this.dispatch(this.ldown, ms);
687
+ }
688
+ }
689
+
690
+ if (ms.rightButtonDown) {
691
+ if (ms.rightButtonHold) {
692
+ if (po) {
693
+ pe = po.rendererEvents;
694
+ pe && pe.dispatch(pe.rhold, ms);
695
+ }
696
+ this.dispatch(this.rhold, ms);
697
+ } else {
698
+ ms.rightButtonHold = true;
699
+ if (po) {
700
+ pe = po.rendererEvents;
701
+ pe && pe.dispatch(pe.rdown, ms);
702
+ }
703
+ this.dispatch(this.rdown, ms);
704
+ }
705
+ }
706
+
707
+ if (ms.middleButtonDown) {
708
+ if (ms.middleButtonHold) {
709
+ if (po) {
710
+ pe = po.rendererEvents;
711
+ pe && pe.dispatch(pe.mhold, ms);
712
+ }
713
+ this.dispatch(this.mhold, ms);
714
+ } else {
715
+ ms.middleButtonHold = true;
716
+ if (po) {
717
+ pe = po.rendererEvents;
718
+ pe && pe.dispatch(pe.mdown, ms);
719
+ }
720
+ this.dispatch(this.mdown, ms);
721
+ }
722
+ }
723
+
724
+ if (ms.leftButtonUp) {
725
+ if (po) {
726
+ pe = po.rendererEvents;
727
+ pe && pe.dispatch(pe.lup, ms);
728
+ }
729
+ this.dispatch(this.lup, ms);
730
+ ms.leftButtonUp = false;
731
+ ms.leftButtonHold = false;
732
+ }
733
+
734
+ if (ms.rightButtonUp) {
735
+ if (po) {
736
+ pe = po.rendererEvents;
737
+ pe && pe.dispatch(pe.rup, ms);
738
+ }
739
+ this.dispatch(this.rup, ms);
740
+ ms.rightButtonUp = false;
741
+ ms.rightButtonHold = false;
742
+ }
743
+
744
+ if (ms.middleButtonUp) {
745
+ if (po) {
746
+ pe = po.rendererEvents;
747
+ pe && pe.dispatch(pe.mup, ms);
748
+ }
749
+ this.dispatch(this.mup, ms);
750
+ ms.middleButtonUp = false;
751
+ ms.middleButtonHold = false;
752
+ }
753
+
754
+ if (ms.leftButtonDoubleClick) {
755
+ if (po) {
756
+ pe = po.rendererEvents;
757
+ pe && pe.dispatch(pe.ldblclick, ms);
758
+ }
759
+ this.dispatch(this.ldblclick, ms);
760
+ ms.leftButtonDoubleClick = false;
761
+ }
762
+
763
+ if (ms.rightButtonDoubleClick) {
764
+ if (po) {
765
+ pe = po.rendererEvents;
766
+ pe && pe.dispatch(pe.rdblclick, ms);
767
+ }
768
+ this.dispatch(this.rdblclick, ms);
769
+ ms.rightButtonDoubleClick = false;
770
+ }
771
+
772
+ if (ms.middleButtonDoubleClick) {
773
+ if (po) {
774
+ pe = po.rendererEvents;
775
+ pe && pe.dispatch(pe.mdblclick, ms);
776
+ }
777
+ this.dispatch(this.mdblclick, ms);
778
+ ms.middleButtonDoubleClick = false;
779
+ }
780
+
781
+ if (ms.wheelDelta) {
782
+ if (po) {
783
+ pe = po.rendererEvents;
784
+ pe && pe.dispatch(pe.mousewheel, ms);
785
+ }
786
+ this.dispatch(this.mousewheel, ms);
787
+ }
788
+
789
+ if (ms.moving) {
790
+ if (po) {
791
+ pe = po.rendererEvents;
792
+ pe && pe.dispatch(pe.mousemove, ms);
793
+ }
794
+ this.dispatch(this.mousemove, ms);
795
+ ms.prev_x = ms.x;
796
+ ms.prev_y = ms.y;
797
+ }
798
+
799
+ if (ms.justStopped) {
800
+ this.dispatch(this.mousestop, ms);
801
+ }
802
+ }
803
+
804
+ /**
805
+ * @private
806
+ */
807
+ handleTouchEvents() {
808
+ var ts = this.touchState;
809
+
810
+ var tpo = ts.pickingObject,
811
+ tpe = null;
812
+
813
+ if (ts.touchCancel) {
814
+ this.dispatch(this.touchcancel, ts);
815
+ ts.touchCancel = false;
816
+ }
817
+
818
+ if (ts.touchStart) {
819
+ var r = this.renderer;
820
+
821
+ r.pickingFramebuffer.activate();
822
+ r.pickingFramebuffer.readPixels(r._currPickingColor, ts.nx, 1.0 - ts.ny, 1);
823
+ r.pickingFramebuffer.deactivate();
824
+
825
+ var o = r.colorObjects;
826
+ var c = r._currPickingColor;
827
+ var co = o[c[0] + "_" + c[1] + "_" + c[2]];
828
+ tpo = ts.pickingObject = co;
829
+ if (tpo) {
830
+ tpe = tpo.rendererEvents;
831
+ tpe && tpe.dispatch(tpe.touchstart, ts);
832
+ }
833
+ this.dispatch(this.touchstart, ts);
834
+ ts.touchStart = false;
835
+ }
836
+
837
+ if (ts.doubleTouch) {
838
+ if (tpo) {
839
+ tpe = tpo.rendererEvents;
840
+ tpe && tpe.dispatch(tpe.doubletouch, ts);
841
+ }
842
+ this.dispatch(this.doubletouch, ts);
843
+ ts.doubleTouch = false;
844
+ }
845
+
846
+ if (ts.touchEnd) {
847
+ if (tpo) {
848
+ tpe = tpo.rendererEvents;
849
+ tpe && tpe.dispatch(tpe.touchend, ts);
850
+ }
851
+ this.dispatch(this.touchend, ts);
852
+ ts.x = 0;
853
+ ts.y = 0;
854
+ ts.touchEnd = false;
855
+ }
856
+
857
+ if (ts.moving) {
858
+ if (tpo) {
859
+ tpe = tpo.rendererEvents;
860
+ tpe && tpe.dispatch(tpe.touchmove, ts);
861
+ }
862
+ this.dispatch(this.touchmove, ts);
863
+ ts.prev_x = ts.x;
864
+ ts.prev_y = ts.y;
865
+ }
866
+ }
867
+ }
868
+
869
+ const EVENT_NAMES = [
870
+ /**
871
+ * Triggered before scene frame is rendered(before render nodes).
872
+ * @event og.RendererEvents#draw
873
+ */
874
+ "draw",
875
+
876
+ /**
877
+ * Triggered after scene frame is rendered(after render nodes).
878
+ * @event og.RendererEvents#postdraw
879
+ */
880
+ "postdraw",
881
+
882
+ /**
883
+ * Triggered when screen is resized.
884
+ * @event og.RendererEvents#resize
885
+ */
886
+ "resize",
887
+
888
+ /**
889
+ * Mouse enters the work screen
890
+ * @event og.RendererEvents#mouseenter
891
+ */
892
+ "mouseenter",
893
+
894
+ /**
895
+ * Mouse leaves the work screen
896
+ * @event og.RendererEvents#mouseleave
897
+ */
898
+ "mouseleave",
899
+
900
+ /**
901
+ * Mouse is moving.
902
+ * @event og.RendererEvents#mousemove
903
+ */
904
+ "mousemove",
905
+
906
+ /**
907
+ * Mouse is just stopped.
908
+ * @event og.RendererEvents#mousestop
909
+ */
910
+ "mousestop",
911
+
912
+ /**
913
+ * Mouse left button clicked.
914
+ * @event og.RendererEvents#lclick
915
+ */
916
+ "lclick",
917
+
918
+ /**
919
+ * Mouse right button clicked.
920
+ * @event og.RendererEvents#rclick
921
+ */
922
+ "rclick",
923
+
924
+ /**
925
+ * Mouse middle button clicked.
926
+ * @event og.RendererEvents#mclick
927
+ */
928
+ "mclick",
929
+
930
+ /**
931
+ * Mouse left button double click.
932
+ * @event og.RendererEvents#ldblclick
933
+ */
934
+ "ldblclick",
935
+
936
+ /**
937
+ * Mouse right button double click.
938
+ * @event og.RendererEvents#rdblclick
939
+ */
940
+ "rdblclick",
941
+
942
+ /**
943
+ * Mouse middle button double click.
944
+ * @event og.RendererEvents#mdblclick
945
+ */
946
+ "mdblclick",
947
+
948
+ /**
949
+ * Mouse left button up(stop pressing).
950
+ * @event og.RendererEvents#lup
951
+ */
952
+ "lup",
953
+
954
+ /**
955
+ * Mouse right button up(stop pressing).
956
+ * @event og.RendererEvents#rup
957
+ */
958
+ "rup",
959
+
960
+ /**
961
+ * Mouse middle button up(stop pressing).
962
+ * @event og.RendererEvents#mup
963
+ */
964
+ "mup",
965
+
966
+ /**
967
+ * Mouse left button is just pressed down(start pressing).
968
+ * @event og.RendererEvents#ldown
969
+ */
970
+ "ldown",
971
+
972
+ /**
973
+ * Mouse right button is just pressed down(start pressing).
974
+ * @event og.RendererEvents#rdown
975
+ */
976
+ "rdown",
977
+
978
+ /**
979
+ * Mouse middle button is just pressed down(start pressing).
980
+ * @event og.RendererEvents#mdown
981
+ */
982
+ "mdown",
983
+
984
+ /**
985
+ * Mouse left button is pressing.
986
+ * @event og.RendererEvents#lhold
987
+ */
988
+ "lhold",
989
+
990
+ /**
991
+ * Mouse right button is pressing.
992
+ * @event og.RendererEvents#rhold
993
+ */
994
+ "rhold",
995
+
996
+ /**
997
+ * Mouse middle button is pressing.
998
+ * @event og.RendererEvents#mhold
999
+ */
1000
+ "mhold",
1001
+
1002
+ /**
1003
+ * Mouse wheel is rotated.
1004
+ * @event og.RendererEvents#mousewheel
1005
+ */
1006
+ "mousewheel",
1007
+
1008
+ /**
1009
+ * Triggered when touching starts.
1010
+ * @event og.RendererEvents#touchstart
1011
+ */
1012
+ "touchstart",
1013
+
1014
+ /**
1015
+ * Triggered when touching ends.
1016
+ * @event og.RendererEvents#touchend
1017
+ */
1018
+ "touchend",
1019
+
1020
+ /**
1021
+ * Triggered when touching cancel.
1022
+ * @event og.RendererEvents#touchcancel
1023
+ */
1024
+ "touchcancel",
1025
+
1026
+ /**
1027
+ * Triggered when touch is move.
1028
+ * @event og.RendererEvents#touchmove
1029
+ */
1030
+ "touchmove",
1031
+
1032
+ /**
1033
+ * Triggered when double touch.
1034
+ * @event og.RendererEvents#doubletouch
1035
+ */
1036
+ "doubletouch",
1037
+
1038
+ /**
1039
+ * Triggered when touch leaves picked object.
1040
+ * @event og.RendererEvents#touchleave
1041
+ */
1042
+ "touchleave",
1043
+
1044
+ /**
1045
+ * Triggered when touch enter picking object.
1046
+ * @event og.RendererEvents#touchenter
1047
+ */
1048
+ "touchenter"
1049
+ ];
1050
+
1051
+ export { RendererEvents };