pptx-react-viewer 4.26.0 → 4.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/{AiChatPanel-TIJ3MRTR.mjs → AiChatPanel-3J6XGIJ4.mjs} +3 -7
  3. package/dist/AiChatPanel-3J6XGIJ4.mjs.br +0 -0
  4. package/dist/AiChatPanel-3J6XGIJ4.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-PGZDMW4M.js → AiChatPanel-EGTSK4T5.js} +27 -31
  6. package/dist/AiChatPanel-EGTSK4T5.js.br +0 -0
  7. package/dist/AiChatPanel-EGTSK4T5.js.gz +0 -0
  8. package/dist/{Model3DScene-SJGIK2TB.mjs → Model3DScene-2V2GQ6FY.mjs} +2 -2
  9. package/dist/Model3DScene-2V2GQ6FY.mjs.br +0 -0
  10. package/dist/Model3DScene-2V2GQ6FY.mjs.gz +0 -0
  11. package/dist/{Model3DScene-LQBTZGVN.js → Model3DScene-Q3XEZSWV.js} +3 -3
  12. package/dist/Model3DScene-Q3XEZSWV.js.br +2 -0
  13. package/dist/Model3DScene-Q3XEZSWV.js.gz +0 -0
  14. package/dist/{UTIF-CNNXS5Z5.mjs → UTIF-RPFRSSC5.mjs} +3 -3
  15. package/dist/UTIF-RPFRSSC5.mjs.br +0 -0
  16. package/dist/UTIF-RPFRSSC5.mjs.gz +0 -0
  17. package/dist/{UTIF-6SHLXCNF.js → UTIF-XWCKRN6V.js} +21 -21
  18. package/dist/UTIF-XWCKRN6V.js.br +0 -0
  19. package/dist/UTIF-XWCKRN6V.js.gz +0 -0
  20. package/dist/{chunk-K564H64A.mjs → chunk-34AXBLYH.mjs} +51 -104
  21. package/dist/chunk-34AXBLYH.mjs.br +0 -0
  22. package/dist/chunk-34AXBLYH.mjs.gz +0 -0
  23. package/dist/{chunk-ZW2WNQN7.js → chunk-5RQTZ376.js} +1207 -1185
  24. package/dist/chunk-5RQTZ376.js.br +0 -0
  25. package/dist/chunk-5RQTZ376.js.gz +0 -0
  26. package/dist/{chunk-XGB3TDIC.mjs → chunk-6DZX6EAA.mjs} +1 -5
  27. package/dist/chunk-6DZX6EAA.mjs.br +0 -0
  28. package/dist/chunk-6DZX6EAA.mjs.gz +0 -0
  29. package/dist/{chunk-PW3YOZFA.js → chunk-MQCBMO6A.js} +909 -923
  30. package/dist/chunk-MQCBMO6A.js.br +0 -0
  31. package/dist/chunk-MQCBMO6A.js.gz +0 -0
  32. package/dist/{chunk-4VNS5WPM.js → chunk-QGM4M3NI.js} +0 -5
  33. package/dist/chunk-QGM4M3NI.js.br +0 -0
  34. package/dist/chunk-QGM4M3NI.js.gz +0 -0
  35. package/dist/{chunk-UHW3R465.js → chunk-TYJZJJZ6.mjs} +13071 -119039
  36. package/dist/chunk-TYJZJJZ6.mjs.br +0 -0
  37. package/dist/chunk-TYJZJJZ6.mjs.gz +0 -0
  38. package/dist/{chunk-LCWNHXHZ.mjs → chunk-WK6JBJCT.js} +13439 -117785
  39. package/dist/chunk-WK6JBJCT.js.br +0 -0
  40. package/dist/chunk-WK6JBJCT.js.gz +0 -0
  41. package/dist/{chunk-QJNZZBVF.mjs → chunk-ZK7UEEXE.mjs} +71 -92
  42. package/dist/chunk-ZK7UEEXE.mjs.br +0 -0
  43. package/dist/chunk-ZK7UEEXE.mjs.gz +0 -0
  44. package/dist/i18n.d.ts +1 -46
  45. package/dist/i18n.js +5 -5
  46. package/dist/i18n.js.br +2 -2
  47. package/dist/i18n.js.gz +0 -0
  48. package/dist/i18n.mjs +2 -2
  49. package/dist/i18n.mjs.br +0 -0
  50. package/dist/i18n.mjs.gz +0 -0
  51. package/dist/index.d.ts +11 -3703
  52. package/dist/index.js +96 -97
  53. package/dist/index.js.br +0 -0
  54. package/dist/index.js.gz +0 -0
  55. package/dist/index.mjs +6 -7
  56. package/dist/index.mjs.br +0 -0
  57. package/dist/index.mjs.gz +0 -0
  58. package/dist/internals.d.ts +5 -3847
  59. package/dist/internals.js +114 -115
  60. package/dist/internals.js.br +0 -0
  61. package/dist/internals.js.gz +0 -0
  62. package/dist/internals.mjs +4 -5
  63. package/dist/internals.mjs.br +0 -0
  64. package/dist/internals.mjs.gz +0 -0
  65. package/dist/{chunk-NJYF5KTY.mjs → three.module-A6ACXOES.mjs} +2 -0
  66. package/dist/three.module-A6ACXOES.mjs.br +0 -0
  67. package/dist/three.module-A6ACXOES.mjs.gz +0 -0
  68. package/dist/{chunk-QS3GAPPA.js → three.module-IORLGCSX.js} +2 -0
  69. package/dist/three.module-IORLGCSX.js.br +0 -0
  70. package/dist/three.module-IORLGCSX.js.gz +0 -0
  71. package/dist/viewer/index.d.ts +12 -2633
  72. package/dist/viewer/index.js +35 -37
  73. package/dist/viewer/index.js.br +0 -0
  74. package/dist/viewer/index.js.gz +0 -0
  75. package/dist/viewer/index.mjs +5 -7
  76. package/dist/viewer/index.mjs.br +0 -0
  77. package/dist/viewer/index.mjs.gz +0 -0
  78. package/dist/{y-webrtc-F2H7BRUK.js → y-webrtc-6LID3XZO.js} +5 -5
  79. package/dist/y-webrtc-6LID3XZO.js.br +0 -0
  80. package/dist/y-webrtc-6LID3XZO.js.gz +0 -0
  81. package/dist/{y-webrtc-GAHCEZSS.mjs → y-webrtc-F5IA7T5S.mjs} +1 -1
  82. package/dist/y-webrtc-F5IA7T5S.mjs.br +0 -0
  83. package/dist/y-webrtc-F5IA7T5S.mjs.gz +0 -0
  84. package/dist/{y-websocket-FBMB63F4.js → y-websocket-HOY2HFMH.js} +1 -1
  85. package/dist/y-websocket-HOY2HFMH.js.br +0 -0
  86. package/dist/y-websocket-HOY2HFMH.js.gz +0 -0
  87. package/dist/{y-websocket-MAGDFVLN.mjs → y-websocket-VGLBV2HJ.mjs} +1 -1
  88. package/dist/y-websocket-VGLBV2HJ.mjs.br +0 -0
  89. package/dist/y-websocket-VGLBV2HJ.mjs.gz +0 -0
  90. package/package.json +3 -4
  91. package/dist/AiChatPanel-PGZDMW4M.js.br +0 -0
  92. package/dist/AiChatPanel-PGZDMW4M.js.gz +0 -0
  93. package/dist/AiChatPanel-TIJ3MRTR.mjs.br +0 -0
  94. package/dist/AiChatPanel-TIJ3MRTR.mjs.gz +0 -0
  95. package/dist/GLTFLoader-O7FNKCHG.mjs +0 -2649
  96. package/dist/GLTFLoader-O7FNKCHG.mjs.br +0 -0
  97. package/dist/GLTFLoader-O7FNKCHG.mjs.gz +0 -0
  98. package/dist/GLTFLoader-UM56GMCK.js +0 -2651
  99. package/dist/GLTFLoader-UM56GMCK.js.br +0 -0
  100. package/dist/GLTFLoader-UM56GMCK.js.gz +0 -0
  101. package/dist/Model3DScene-LQBTZGVN.js.br +0 -0
  102. package/dist/Model3DScene-LQBTZGVN.js.gz +0 -0
  103. package/dist/Model3DScene-SJGIK2TB.mjs.br +0 -0
  104. package/dist/Model3DScene-SJGIK2TB.mjs.gz +0 -0
  105. package/dist/OrbitControls-EXEHIXFI.js +0 -922
  106. package/dist/OrbitControls-EXEHIXFI.js.br +0 -0
  107. package/dist/OrbitControls-EXEHIXFI.js.gz +0 -0
  108. package/dist/OrbitControls-PZQ4CBVS.mjs +0 -920
  109. package/dist/OrbitControls-PZQ4CBVS.mjs.br +0 -0
  110. package/dist/OrbitControls-PZQ4CBVS.mjs.gz +0 -0
  111. package/dist/UTIF-6SHLXCNF.js.br +0 -0
  112. package/dist/UTIF-6SHLXCNF.js.gz +0 -0
  113. package/dist/UTIF-CNNXS5Z5.mjs.br +0 -0
  114. package/dist/UTIF-CNNXS5Z5.mjs.gz +0 -0
  115. package/dist/chunk-4VNS5WPM.js.br +0 -0
  116. package/dist/chunk-4VNS5WPM.js.gz +0 -0
  117. package/dist/chunk-6HMJTCFO.js +0 -4247
  118. package/dist/chunk-6HMJTCFO.js.br +0 -0
  119. package/dist/chunk-6HMJTCFO.js.gz +0 -0
  120. package/dist/chunk-DKMPRUXL.mjs +0 -22197
  121. package/dist/chunk-DKMPRUXL.mjs.br +0 -0
  122. package/dist/chunk-DKMPRUXL.mjs.gz +0 -0
  123. package/dist/chunk-K564H64A.mjs.br +0 -0
  124. package/dist/chunk-K564H64A.mjs.gz +0 -0
  125. package/dist/chunk-LCWNHXHZ.mjs.br +0 -0
  126. package/dist/chunk-LCWNHXHZ.mjs.gz +0 -0
  127. package/dist/chunk-NJYF5KTY.mjs.br +0 -0
  128. package/dist/chunk-NJYF5KTY.mjs.gz +0 -0
  129. package/dist/chunk-NWZKMLGC.js +0 -22241
  130. package/dist/chunk-NWZKMLGC.js.br +0 -0
  131. package/dist/chunk-NWZKMLGC.js.gz +0 -0
  132. package/dist/chunk-PW3YOZFA.js.br +0 -0
  133. package/dist/chunk-PW3YOZFA.js.gz +0 -0
  134. package/dist/chunk-QJNZZBVF.mjs.br +0 -0
  135. package/dist/chunk-QJNZZBVF.mjs.gz +0 -0
  136. package/dist/chunk-QS3GAPPA.js.br +0 -0
  137. package/dist/chunk-QS3GAPPA.js.gz +0 -0
  138. package/dist/chunk-UHW3R465.js.br +0 -0
  139. package/dist/chunk-UHW3R465.js.gz +0 -0
  140. package/dist/chunk-USJXG5TE.mjs +0 -3915
  141. package/dist/chunk-USJXG5TE.mjs.br +0 -0
  142. package/dist/chunk-USJXG5TE.mjs.gz +0 -0
  143. package/dist/chunk-VEVEP7VF.js +0 -3977
  144. package/dist/chunk-VEVEP7VF.js.br +0 -0
  145. package/dist/chunk-VEVEP7VF.js.gz +0 -0
  146. package/dist/chunk-XGB3TDIC.mjs.br +0 -0
  147. package/dist/chunk-XGB3TDIC.mjs.gz +0 -0
  148. package/dist/chunk-XLPQM7OJ.mjs +0 -4243
  149. package/dist/chunk-XLPQM7OJ.mjs.br +0 -0
  150. package/dist/chunk-XLPQM7OJ.mjs.gz +0 -0
  151. package/dist/chunk-ZW2WNQN7.js.br +0 -0
  152. package/dist/chunk-ZW2WNQN7.js.gz +0 -0
  153. package/dist/smartart-layouts-5T2QZGLG.js +0 -2494
  154. package/dist/smartart-layouts-5T2QZGLG.js.br +0 -0
  155. package/dist/smartart-layouts-5T2QZGLG.js.gz +0 -0
  156. package/dist/smartart-layouts-UCAFYVFW.mjs +0 -2487
  157. package/dist/smartart-layouts-UCAFYVFW.mjs.br +0 -0
  158. package/dist/smartart-layouts-UCAFYVFW.mjs.gz +0 -0
  159. package/dist/three.module-BLHG4FHZ.js +0 -1783
  160. package/dist/three.module-BLHG4FHZ.js.br +0 -0
  161. package/dist/three.module-BLHG4FHZ.js.gz +0 -0
  162. package/dist/three.module-ZSSMKKHW.mjs +0 -2
  163. package/dist/three.module-ZSSMKKHW.mjs.br +0 -0
  164. package/dist/three.module-ZSSMKKHW.mjs.gz +0 -0
  165. package/dist/y-webrtc-F2H7BRUK.js.br +0 -0
  166. package/dist/y-webrtc-F2H7BRUK.js.gz +0 -0
  167. package/dist/y-webrtc-GAHCEZSS.mjs.br +0 -0
  168. package/dist/y-webrtc-GAHCEZSS.mjs.gz +0 -0
  169. package/dist/y-websocket-FBMB63F4.js.br +0 -0
  170. package/dist/y-websocket-FBMB63F4.js.gz +0 -0
  171. package/dist/y-websocket-MAGDFVLN.mjs.br +0 -0
  172. package/dist/y-websocket-MAGDFVLN.mjs.gz +0 -0
@@ -1,922 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkQS3GAPPA_js = require('./chunk-QS3GAPPA.js');
4
- require('./chunk-4VNS5WPM.js');
5
-
6
- // ../../../../node_modules/.bun/three@0.186.1/node_modules/three/examples/jsm/controls/OrbitControls.js
7
- var _changeEvent = { type: "change" };
8
- var _startEvent = { type: "start" };
9
- var _endEvent = { type: "end" };
10
- var _ray = new chunkQS3GAPPA_js.Ray();
11
- var _plane = new chunkQS3GAPPA_js.Plane();
12
- var _TILT_LIMIT = Math.cos(70 * chunkQS3GAPPA_js.MathUtils.DEG2RAD);
13
- var _v = new chunkQS3GAPPA_js.Vector3();
14
- var _twoPI = 2 * Math.PI;
15
- var _STATE = {
16
- NONE: -1,
17
- ROTATE: 0,
18
- DOLLY: 1,
19
- PAN: 2,
20
- TOUCH_ROTATE: 3,
21
- TOUCH_PAN: 4,
22
- TOUCH_DOLLY_PAN: 5,
23
- TOUCH_DOLLY_ROTATE: 6
24
- };
25
- var _EPS = 1e-6;
26
- var OrbitControls = class extends chunkQS3GAPPA_js.Controls {
27
- /**
28
- * Constructs a new controls instance.
29
- *
30
- * @param {Object3D} object - The object that is managed by the controls.
31
- * @param {?HTMLElement} domElement - The HTML element used for event listeners.
32
- */
33
- constructor(object, domElement = null) {
34
- super(object, domElement);
35
- this.state = _STATE.NONE;
36
- this.target = new chunkQS3GAPPA_js.Vector3();
37
- this.cursor = new chunkQS3GAPPA_js.Vector3();
38
- this.minDistance = 0;
39
- this.maxDistance = Infinity;
40
- this.minZoom = 0;
41
- this.maxZoom = Infinity;
42
- this.minTargetRadius = 0;
43
- this.maxTargetRadius = Infinity;
44
- this.minPolarAngle = 0;
45
- this.maxPolarAngle = Math.PI;
46
- this.minAzimuthAngle = -Infinity;
47
- this.maxAzimuthAngle = Infinity;
48
- this.enableDamping = false;
49
- this.dampingFactor = 0.05;
50
- this.enableZoom = true;
51
- this.zoomSpeed = 1;
52
- this.enableRotate = true;
53
- this.rotateSpeed = 1;
54
- this.keyRotateSpeed = 1;
55
- this.enablePan = true;
56
- this.panSpeed = 1;
57
- this.screenSpacePanning = true;
58
- this.keyPanSpeed = 7;
59
- this.zoomToCursor = false;
60
- this.autoRotate = false;
61
- this.autoRotateSpeed = 2;
62
- this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" };
63
- this.mouseButtons = { LEFT: chunkQS3GAPPA_js.MOUSE.ROTATE, MIDDLE: chunkQS3GAPPA_js.MOUSE.DOLLY, RIGHT: chunkQS3GAPPA_js.MOUSE.PAN };
64
- this.touches = { ONE: chunkQS3GAPPA_js.TOUCH.ROTATE, TWO: chunkQS3GAPPA_js.TOUCH.DOLLY_PAN };
65
- this.target0 = this.target.clone();
66
- this.position0 = this.object.position.clone();
67
- this.zoom0 = this.object.zoom;
68
- this._cursorStyle = "auto";
69
- this._domElementKeyEvents = null;
70
- this._lastPosition = new chunkQS3GAPPA_js.Vector3();
71
- this._lastQuaternion = new chunkQS3GAPPA_js.Quaternion();
72
- this._lastTargetPosition = new chunkQS3GAPPA_js.Vector3();
73
- this._quat = new chunkQS3GAPPA_js.Quaternion().setFromUnitVectors(object.up, new chunkQS3GAPPA_js.Vector3(0, 1, 0));
74
- this._quatInverse = this._quat.clone().invert();
75
- this._spherical = new chunkQS3GAPPA_js.Spherical();
76
- this._sphericalDelta = new chunkQS3GAPPA_js.Spherical();
77
- this._scale = 1;
78
- this._panOffset = new chunkQS3GAPPA_js.Vector3();
79
- this._rotateStart = new chunkQS3GAPPA_js.Vector2();
80
- this._rotateEnd = new chunkQS3GAPPA_js.Vector2();
81
- this._rotateDelta = new chunkQS3GAPPA_js.Vector2();
82
- this._panStart = new chunkQS3GAPPA_js.Vector2();
83
- this._panEnd = new chunkQS3GAPPA_js.Vector2();
84
- this._panDelta = new chunkQS3GAPPA_js.Vector2();
85
- this._dollyStart = new chunkQS3GAPPA_js.Vector2();
86
- this._dollyEnd = new chunkQS3GAPPA_js.Vector2();
87
- this._dollyDelta = new chunkQS3GAPPA_js.Vector2();
88
- this._dollyDirection = new chunkQS3GAPPA_js.Vector3();
89
- this._mouse = new chunkQS3GAPPA_js.Vector2();
90
- this._performCursorZoom = false;
91
- this._pointers = [];
92
- this._pointerPositions = {};
93
- this._controlActive = false;
94
- this._onPointerMove = onPointerMove.bind(this);
95
- this._onPointerDown = onPointerDown.bind(this);
96
- this._onPointerUp = onPointerUp.bind(this);
97
- this._onContextMenu = onContextMenu.bind(this);
98
- this._onMouseWheel = onMouseWheel.bind(this);
99
- this._onKeyDown = onKeyDown.bind(this);
100
- this._onTouchStart = onTouchStart.bind(this);
101
- this._onTouchMove = onTouchMove.bind(this);
102
- this._onMouseDown = onMouseDown.bind(this);
103
- this._onMouseMove = onMouseMove.bind(this);
104
- this._interceptControlDown = interceptControlDown.bind(this);
105
- this._interceptControlUp = interceptControlUp.bind(this);
106
- if (this.domElement !== null) {
107
- this.connect(this.domElement);
108
- }
109
- this.update();
110
- }
111
- /**
112
- * Defines the visual representation of the cursor.
113
- *
114
- * @type {('auto'|'grab')}
115
- * @default 'auto'
116
- */
117
- set cursorStyle(type) {
118
- this._cursorStyle = type;
119
- if (type === "grab") {
120
- this.domElement.style.cursor = "grab";
121
- } else {
122
- this.domElement.style.cursor = "auto";
123
- }
124
- }
125
- get cursorStyle() {
126
- return this._cursorStyle;
127
- }
128
- connect(element) {
129
- super.connect(element);
130
- this.domElement.addEventListener("pointerdown", this._onPointerDown);
131
- this.domElement.addEventListener("pointercancel", this._onPointerUp);
132
- this.domElement.addEventListener("contextmenu", this._onContextMenu);
133
- this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: false });
134
- const document = this.domElement.getRootNode();
135
- document.addEventListener("keydown", this._interceptControlDown, { passive: true, capture: true });
136
- this.domElement.style.touchAction = "none";
137
- }
138
- disconnect() {
139
- this.state = _STATE.NONE;
140
- this.domElement.removeEventListener("pointerdown", this._onPointerDown);
141
- this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove);
142
- this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp);
143
- this.domElement.removeEventListener("pointercancel", this._onPointerUp);
144
- this.domElement.removeEventListener("wheel", this._onMouseWheel);
145
- this.domElement.removeEventListener("contextmenu", this._onContextMenu);
146
- this.stopListenToKeyEvents();
147
- const document = this.domElement.getRootNode();
148
- document.removeEventListener("keydown", this._interceptControlDown, { capture: true });
149
- document.removeEventListener("keyup", this._interceptControlUp, { capture: true });
150
- this._controlActive = false;
151
- this._pointers.length = 0;
152
- this._pointerPositions = {};
153
- this.domElement.style.touchAction = "";
154
- this.domElement.style.cursor = "auto";
155
- }
156
- dispose() {
157
- this.disconnect();
158
- }
159
- /**
160
- * Get the current vertical rotation, in radians.
161
- *
162
- * @return {number} The current vertical rotation, in radians.
163
- */
164
- getPolarAngle() {
165
- return this._spherical.phi;
166
- }
167
- /**
168
- * Get the current horizontal rotation, in radians.
169
- *
170
- * @return {number} The current horizontal rotation, in radians.
171
- */
172
- getAzimuthalAngle() {
173
- return this._spherical.theta;
174
- }
175
- /**
176
- * Returns the distance from the camera to the target.
177
- *
178
- * @return {number} The distance from the camera to the target.
179
- */
180
- getDistance() {
181
- return this.object.position.distanceTo(this.target);
182
- }
183
- /**
184
- * Adds key event listeners to the given DOM element.
185
- * `window` is a recommended argument for using this method.
186
- *
187
- * @param {HTMLElement} domElement - The DOM element
188
- */
189
- listenToKeyEvents(domElement) {
190
- domElement.addEventListener("keydown", this._onKeyDown);
191
- this._domElementKeyEvents = domElement;
192
- }
193
- /**
194
- * Removes the key event listener previously defined with `listenToKeyEvents()`.
195
- */
196
- stopListenToKeyEvents() {
197
- if (this._domElementKeyEvents !== null) {
198
- this._domElementKeyEvents.removeEventListener("keydown", this._onKeyDown);
199
- this._domElementKeyEvents = null;
200
- }
201
- }
202
- /**
203
- * Save the current state of the controls. This can later be recovered with `reset()`.
204
- */
205
- saveState() {
206
- this.target0.copy(this.target);
207
- this.position0.copy(this.object.position);
208
- this.zoom0 = this.object.zoom;
209
- }
210
- /**
211
- * Reset the controls to their state from either the last time the `saveState()`
212
- * was called, or the initial state.
213
- */
214
- reset() {
215
- this.target.copy(this.target0);
216
- this.object.position.copy(this.position0);
217
- this.object.zoom = this.zoom0;
218
- this.object.updateProjectionMatrix();
219
- this.dispatchEvent(_changeEvent);
220
- this.update();
221
- this.state = _STATE.NONE;
222
- }
223
- /**
224
- * Programmatically pan the camera.
225
- *
226
- * @param {number} deltaX - The horizontal pan amount in pixels.
227
- * @param {number} deltaY - The vertical pan amount in pixels.
228
- */
229
- pan(deltaX, deltaY) {
230
- this._pan(deltaX, deltaY);
231
- this.update();
232
- }
233
- /**
234
- * Programmatically dolly in (zoom in for perspective camera).
235
- *
236
- * @param {number} dollyScale - The dolly scale factor.
237
- */
238
- dollyIn(dollyScale) {
239
- this._dollyIn(dollyScale);
240
- this.update();
241
- }
242
- /**
243
- * Programmatically dolly out (zoom out for perspective camera).
244
- *
245
- * @param {number} dollyScale - The dolly scale factor.
246
- */
247
- dollyOut(dollyScale) {
248
- this._dollyOut(dollyScale);
249
- this.update();
250
- }
251
- /**
252
- * Programmatically rotate the camera left (around the vertical axis).
253
- *
254
- * @param {number} angle - The rotation angle in radians.
255
- */
256
- rotateLeft(angle) {
257
- this._rotateLeft(angle);
258
- this.update();
259
- }
260
- /**
261
- * Programmatically rotate the camera up (around the horizontal axis).
262
- *
263
- * @param {number} angle - The rotation angle in radians.
264
- */
265
- rotateUp(angle) {
266
- this._rotateUp(angle);
267
- this.update();
268
- }
269
- update(deltaTime = null) {
270
- const position = this.object.position;
271
- _v.copy(position).sub(this.target);
272
- _v.applyQuaternion(this._quat);
273
- this._spherical.setFromVector3(_v);
274
- if (this.autoRotate && this.state === _STATE.NONE) {
275
- this._rotateLeft(this._getAutoRotationAngle(deltaTime));
276
- }
277
- if (this.enableDamping) {
278
- this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor;
279
- this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor;
280
- } else {
281
- this._spherical.theta += this._sphericalDelta.theta;
282
- this._spherical.phi += this._sphericalDelta.phi;
283
- }
284
- let min = this.minAzimuthAngle;
285
- let max = this.maxAzimuthAngle;
286
- if (isFinite(min) && isFinite(max)) {
287
- if (min < -Math.PI) min += _twoPI;
288
- else if (min > Math.PI) min -= _twoPI;
289
- if (max < -Math.PI) max += _twoPI;
290
- else if (max > Math.PI) max -= _twoPI;
291
- if (min <= max) {
292
- this._spherical.theta = Math.max(min, Math.min(max, this._spherical.theta));
293
- } else {
294
- this._spherical.theta = this._spherical.theta > (min + max) / 2 ? Math.max(min, this._spherical.theta) : Math.min(max, this._spherical.theta);
295
- }
296
- }
297
- this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi));
298
- this._spherical.makeSafe();
299
- if (this.enableDamping === true) {
300
- this.target.addScaledVector(this._panOffset, this.dampingFactor);
301
- } else {
302
- this.target.add(this._panOffset);
303
- }
304
- this.target.sub(this.cursor);
305
- this.target.clampLength(this.minTargetRadius, this.maxTargetRadius);
306
- this.target.add(this.cursor);
307
- let zoomChanged = false;
308
- if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera) {
309
- this._spherical.radius = this._clampDistance(this._spherical.radius);
310
- } else {
311
- const prevRadius = this._spherical.radius;
312
- this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale);
313
- zoomChanged = prevRadius != this._spherical.radius;
314
- }
315
- _v.setFromSpherical(this._spherical);
316
- _v.applyQuaternion(this._quatInverse);
317
- position.copy(this.target).add(_v);
318
- this.object.lookAt(this.target);
319
- if (this.enableDamping === true) {
320
- this._sphericalDelta.theta *= 1 - this.dampingFactor;
321
- this._sphericalDelta.phi *= 1 - this.dampingFactor;
322
- this._panOffset.multiplyScalar(1 - this.dampingFactor);
323
- } else {
324
- this._sphericalDelta.set(0, 0, 0);
325
- this._panOffset.set(0, 0, 0);
326
- }
327
- if (this.zoomToCursor && this._performCursorZoom) {
328
- let newRadius = null;
329
- if (this.object.isPerspectiveCamera) {
330
- const prevRadius = _v.length();
331
- newRadius = this._clampDistance(prevRadius * this._scale);
332
- const radiusDelta = prevRadius - newRadius;
333
- this.object.position.addScaledVector(this._dollyDirection, radiusDelta);
334
- this.object.updateMatrixWorld();
335
- zoomChanged = !!radiusDelta;
336
- } else if (this.object.isOrthographicCamera) {
337
- const mouseBefore = new chunkQS3GAPPA_js.Vector3(this._mouse.x, this._mouse.y, 0);
338
- mouseBefore.unproject(this.object);
339
- const prevZoom = this.object.zoom;
340
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale));
341
- this.object.updateProjectionMatrix();
342
- zoomChanged = prevZoom !== this.object.zoom;
343
- const mouseAfter = new chunkQS3GAPPA_js.Vector3(this._mouse.x, this._mouse.y, 0);
344
- mouseAfter.unproject(this.object);
345
- this.object.position.sub(mouseAfter).add(mouseBefore);
346
- this.object.updateMatrixWorld();
347
- newRadius = _v.length();
348
- } else {
349
- console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.");
350
- this.zoomToCursor = false;
351
- }
352
- if (newRadius !== null) {
353
- if (this.screenSpacePanning) {
354
- this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(newRadius).add(this.object.position);
355
- } else {
356
- _ray.origin.copy(this.object.position);
357
- _ray.direction.set(0, 0, -1).transformDirection(this.object.matrix);
358
- if (Math.abs(this.object.up.dot(_ray.direction)) < _TILT_LIMIT) {
359
- this.object.lookAt(this.target);
360
- } else {
361
- _plane.setFromNormalAndCoplanarPoint(this.object.up, this.target);
362
- _ray.intersectPlane(_plane, this.target);
363
- }
364
- }
365
- }
366
- } else if (this.object.isOrthographicCamera) {
367
- const prevZoom = this.object.zoom;
368
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale));
369
- if (prevZoom !== this.object.zoom) {
370
- this.object.updateProjectionMatrix();
371
- zoomChanged = true;
372
- }
373
- }
374
- this._scale = 1;
375
- this._performCursorZoom = false;
376
- if (zoomChanged || this._lastPosition.distanceToSquared(this.object.position) > _EPS || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > _EPS || this._lastTargetPosition.distanceToSquared(this.target) > _EPS) {
377
- this.dispatchEvent(_changeEvent);
378
- this._lastPosition.copy(this.object.position);
379
- this._lastQuaternion.copy(this.object.quaternion);
380
- this._lastTargetPosition.copy(this.target);
381
- return true;
382
- }
383
- return false;
384
- }
385
- _getAutoRotationAngle(deltaTime) {
386
- if (deltaTime !== null) {
387
- return _twoPI / 60 * this.autoRotateSpeed * deltaTime;
388
- } else {
389
- return _twoPI / 60 / 60 * this.autoRotateSpeed;
390
- }
391
- }
392
- _getZoomScale(delta) {
393
- const normalizedDelta = Math.abs(delta * 0.01);
394
- return Math.pow(0.95, this.zoomSpeed * normalizedDelta);
395
- }
396
- _rotateLeft(angle) {
397
- this._sphericalDelta.theta -= angle;
398
- }
399
- _rotateUp(angle) {
400
- this._sphericalDelta.phi -= angle;
401
- }
402
- _panLeft(distance, objectMatrix) {
403
- _v.setFromMatrixColumn(objectMatrix, 0);
404
- _v.multiplyScalar(-distance);
405
- this._panOffset.add(_v);
406
- }
407
- _panUp(distance, objectMatrix) {
408
- if (this.screenSpacePanning === true) {
409
- _v.setFromMatrixColumn(objectMatrix, 1);
410
- } else {
411
- _v.setFromMatrixColumn(objectMatrix, 0);
412
- _v.crossVectors(this.object.up, _v);
413
- }
414
- _v.multiplyScalar(distance);
415
- this._panOffset.add(_v);
416
- }
417
- // deltaX and deltaY are in pixels; right and down are positive
418
- _pan(deltaX, deltaY) {
419
- const element = this.domElement;
420
- if (this.object.isPerspectiveCamera) {
421
- const position = this.object.position;
422
- _v.copy(position).sub(this.target);
423
- let targetDistance = _v.length();
424
- targetDistance *= Math.tan(this.object.fov / 2 * Math.PI / 180);
425
- this._panLeft(2 * deltaX * targetDistance / element.clientHeight, this.object.matrix);
426
- this._panUp(2 * deltaY * targetDistance / element.clientHeight, this.object.matrix);
427
- } else if (this.object.isOrthographicCamera) {
428
- this._panLeft(deltaX * (this.object.right - this.object.left) / this.object.zoom / element.clientWidth, this.object.matrix);
429
- this._panUp(deltaY * (this.object.top - this.object.bottom) / this.object.zoom / element.clientHeight, this.object.matrix);
430
- } else {
431
- console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.");
432
- this.enablePan = false;
433
- }
434
- }
435
- _dollyOut(dollyScale) {
436
- if (this.object.isPerspectiveCamera || this.object.isOrthographicCamera) {
437
- this._scale /= dollyScale;
438
- } else {
439
- console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.");
440
- this.enableZoom = false;
441
- }
442
- }
443
- _dollyIn(dollyScale) {
444
- if (this.object.isPerspectiveCamera || this.object.isOrthographicCamera) {
445
- this._scale *= dollyScale;
446
- } else {
447
- console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.");
448
- this.enableZoom = false;
449
- }
450
- }
451
- _updateZoomParameters(x, y) {
452
- if (!this.zoomToCursor) {
453
- return;
454
- }
455
- this._performCursorZoom = true;
456
- const rect = this.domElement.getBoundingClientRect();
457
- const dx = x - rect.left;
458
- const dy = y - rect.top;
459
- const w = rect.width;
460
- const h = rect.height;
461
- this._mouse.x = dx / w * 2 - 1;
462
- this._mouse.y = -(dy / h) * 2 + 1;
463
- this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
464
- }
465
- _clampDistance(dist) {
466
- return Math.max(this.minDistance, Math.min(this.maxDistance, dist));
467
- }
468
- //
469
- // event callbacks - update the object state
470
- //
471
- _handleMouseDownRotate(event) {
472
- this._rotateStart.set(event.clientX, event.clientY);
473
- }
474
- _handleMouseDownDolly(event) {
475
- this._updateZoomParameters(event.clientX, event.clientX);
476
- this._dollyStart.set(event.clientX, event.clientY);
477
- }
478
- _handleMouseDownPan(event) {
479
- this._panStart.set(event.clientX, event.clientY);
480
- }
481
- _handleMouseMoveRotate(event) {
482
- this._rotateEnd.set(event.clientX, event.clientY);
483
- this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
484
- const element = this.domElement;
485
- this._rotateLeft(_twoPI * this._rotateDelta.x / element.clientHeight);
486
- this._rotateUp(_twoPI * this._rotateDelta.y / element.clientHeight);
487
- this._rotateStart.copy(this._rotateEnd);
488
- this.update();
489
- }
490
- _handleMouseMoveDolly(event) {
491
- this._dollyEnd.set(event.clientX, event.clientY);
492
- this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart);
493
- if (this._dollyDelta.y > 0) {
494
- this._dollyOut(this._getZoomScale(this._dollyDelta.y));
495
- } else if (this._dollyDelta.y < 0) {
496
- this._dollyIn(this._getZoomScale(this._dollyDelta.y));
497
- }
498
- this._dollyStart.copy(this._dollyEnd);
499
- this.update();
500
- }
501
- _handleMouseMovePan(event) {
502
- this._panEnd.set(event.clientX, event.clientY);
503
- this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed);
504
- this._pan(this._panDelta.x, this._panDelta.y);
505
- this._panStart.copy(this._panEnd);
506
- this.update();
507
- }
508
- _handleMouseWheel(event) {
509
- this._updateZoomParameters(event.clientX, event.clientY);
510
- if (event.deltaY < 0) {
511
- this._dollyIn(this._getZoomScale(event.deltaY));
512
- } else if (event.deltaY > 0) {
513
- this._dollyOut(this._getZoomScale(event.deltaY));
514
- }
515
- this.update();
516
- }
517
- _handleKeyDown(event) {
518
- let needsUpdate = false;
519
- switch (event.code) {
520
- case this.keys.UP:
521
- if (event.ctrlKey || event.metaKey || event.shiftKey) {
522
- if (this.enableRotate) {
523
- this._rotateUp(_twoPI * this.keyRotateSpeed / this.domElement.clientHeight);
524
- }
525
- } else {
526
- if (this.enablePan) {
527
- this._pan(0, this.keyPanSpeed);
528
- }
529
- }
530
- needsUpdate = true;
531
- break;
532
- case this.keys.BOTTOM:
533
- if (event.ctrlKey || event.metaKey || event.shiftKey) {
534
- if (this.enableRotate) {
535
- this._rotateUp(-_twoPI * this.keyRotateSpeed / this.domElement.clientHeight);
536
- }
537
- } else {
538
- if (this.enablePan) {
539
- this._pan(0, -this.keyPanSpeed);
540
- }
541
- }
542
- needsUpdate = true;
543
- break;
544
- case this.keys.LEFT:
545
- if (event.ctrlKey || event.metaKey || event.shiftKey) {
546
- if (this.enableRotate) {
547
- this._rotateLeft(_twoPI * this.keyRotateSpeed / this.domElement.clientHeight);
548
- }
549
- } else {
550
- if (this.enablePan) {
551
- this._pan(this.keyPanSpeed, 0);
552
- }
553
- }
554
- needsUpdate = true;
555
- break;
556
- case this.keys.RIGHT:
557
- if (event.ctrlKey || event.metaKey || event.shiftKey) {
558
- if (this.enableRotate) {
559
- this._rotateLeft(-_twoPI * this.keyRotateSpeed / this.domElement.clientHeight);
560
- }
561
- } else {
562
- if (this.enablePan) {
563
- this._pan(-this.keyPanSpeed, 0);
564
- }
565
- }
566
- needsUpdate = true;
567
- break;
568
- }
569
- if (needsUpdate) {
570
- event.preventDefault();
571
- this.update();
572
- }
573
- }
574
- _handleTouchStartRotate(event) {
575
- if (this._pointers.length === 1) {
576
- this._rotateStart.set(event.pageX, event.pageY);
577
- } else {
578
- const position = this._getSecondPointerPosition(event);
579
- const x = 0.5 * (event.pageX + position.x);
580
- const y = 0.5 * (event.pageY + position.y);
581
- this._rotateStart.set(x, y);
582
- }
583
- }
584
- _handleTouchStartPan(event) {
585
- if (this._pointers.length === 1) {
586
- this._panStart.set(event.pageX, event.pageY);
587
- } else {
588
- const position = this._getSecondPointerPosition(event);
589
- const x = 0.5 * (event.pageX + position.x);
590
- const y = 0.5 * (event.pageY + position.y);
591
- this._panStart.set(x, y);
592
- }
593
- }
594
- _handleTouchStartDolly(event) {
595
- const position = this._getSecondPointerPosition(event);
596
- const dx = event.pageX - position.x;
597
- const dy = event.pageY - position.y;
598
- const distance = Math.sqrt(dx * dx + dy * dy);
599
- this._dollyStart.set(0, distance);
600
- }
601
- _handleTouchStartDollyPan(event) {
602
- if (this.enableZoom) this._handleTouchStartDolly(event);
603
- if (this.enablePan) this._handleTouchStartPan(event);
604
- }
605
- _handleTouchStartDollyRotate(event) {
606
- if (this.enableZoom) this._handleTouchStartDolly(event);
607
- if (this.enableRotate) this._handleTouchStartRotate(event);
608
- }
609
- _handleTouchMoveRotate(event) {
610
- if (this._pointers.length == 1) {
611
- this._rotateEnd.set(event.pageX, event.pageY);
612
- } else {
613
- const position = this._getSecondPointerPosition(event);
614
- const x = 0.5 * (event.pageX + position.x);
615
- const y = 0.5 * (event.pageY + position.y);
616
- this._rotateEnd.set(x, y);
617
- }
618
- this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
619
- const element = this.domElement;
620
- this._rotateLeft(_twoPI * this._rotateDelta.x / element.clientHeight);
621
- this._rotateUp(_twoPI * this._rotateDelta.y / element.clientHeight);
622
- this._rotateStart.copy(this._rotateEnd);
623
- }
624
- _handleTouchMovePan(event) {
625
- if (this._pointers.length === 1) {
626
- this._panEnd.set(event.pageX, event.pageY);
627
- } else {
628
- const position = this._getSecondPointerPosition(event);
629
- const x = 0.5 * (event.pageX + position.x);
630
- const y = 0.5 * (event.pageY + position.y);
631
- this._panEnd.set(x, y);
632
- }
633
- this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed);
634
- this._pan(this._panDelta.x, this._panDelta.y);
635
- this._panStart.copy(this._panEnd);
636
- }
637
- _handleTouchMoveDolly(event) {
638
- const position = this._getSecondPointerPosition(event);
639
- const dx = event.pageX - position.x;
640
- const dy = event.pageY - position.y;
641
- const distance = Math.sqrt(dx * dx + dy * dy);
642
- this._dollyEnd.set(0, distance);
643
- this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed));
644
- this._dollyOut(this._dollyDelta.y);
645
- this._dollyStart.copy(this._dollyEnd);
646
- const centerX = (event.pageX + position.x) * 0.5;
647
- const centerY = (event.pageY + position.y) * 0.5;
648
- this._updateZoomParameters(centerX, centerY);
649
- }
650
- _handleTouchMoveDollyPan(event) {
651
- if (this.enableZoom) this._handleTouchMoveDolly(event);
652
- if (this.enablePan) this._handleTouchMovePan(event);
653
- }
654
- _handleTouchMoveDollyRotate(event) {
655
- if (this.enableZoom) this._handleTouchMoveDolly(event);
656
- if (this.enableRotate) this._handleTouchMoveRotate(event);
657
- }
658
- // pointers
659
- _addPointer(event) {
660
- this._pointers.push(event.pointerId);
661
- }
662
- _removePointer(event) {
663
- delete this._pointerPositions[event.pointerId];
664
- for (let i = 0; i < this._pointers.length; i++) {
665
- if (this._pointers[i] == event.pointerId) {
666
- this._pointers.splice(i, 1);
667
- return;
668
- }
669
- }
670
- }
671
- _isTrackingPointer(event) {
672
- for (let i = 0; i < this._pointers.length; i++) {
673
- if (this._pointers[i] == event.pointerId) return true;
674
- }
675
- return false;
676
- }
677
- _trackPointer(event) {
678
- let position = this._pointerPositions[event.pointerId];
679
- if (position === void 0) {
680
- position = new chunkQS3GAPPA_js.Vector2();
681
- this._pointerPositions[event.pointerId] = position;
682
- }
683
- position.set(event.pageX, event.pageY);
684
- }
685
- _getSecondPointerPosition(event) {
686
- const pointerId = event.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
687
- return this._pointerPositions[pointerId];
688
- }
689
- //
690
- _customWheelEvent(event) {
691
- const mode = event.deltaMode;
692
- const newEvent = {
693
- clientX: event.clientX,
694
- clientY: event.clientY,
695
- deltaY: event.deltaY
696
- };
697
- switch (mode) {
698
- case 1:
699
- newEvent.deltaY *= 16;
700
- break;
701
- case 2:
702
- newEvent.deltaY *= 100;
703
- break;
704
- }
705
- if (event.ctrlKey && !this._controlActive) {
706
- newEvent.deltaY *= 10;
707
- }
708
- return newEvent;
709
- }
710
- };
711
- function onPointerDown(event) {
712
- if (this.enabled === false) return;
713
- if (this._pointers.length === 0) {
714
- this.domElement.setPointerCapture(event.pointerId);
715
- this.domElement.ownerDocument.addEventListener("pointermove", this._onPointerMove);
716
- this.domElement.ownerDocument.addEventListener("pointerup", this._onPointerUp);
717
- }
718
- if (this._isTrackingPointer(event)) return;
719
- this._addPointer(event);
720
- if (event.pointerType === "touch") {
721
- this._onTouchStart(event);
722
- } else {
723
- this._onMouseDown(event);
724
- }
725
- if (this._cursorStyle === "grab") {
726
- this.domElement.style.cursor = "grabbing";
727
- }
728
- }
729
- function onPointerMove(event) {
730
- if (this.enabled === false) return;
731
- if (event.pointerType === "touch") {
732
- this._onTouchMove(event);
733
- } else {
734
- this._onMouseMove(event);
735
- }
736
- }
737
- function onPointerUp(event) {
738
- this._removePointer(event);
739
- switch (this._pointers.length) {
740
- case 0:
741
- this.domElement.releasePointerCapture(event.pointerId);
742
- this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove);
743
- this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp);
744
- this.dispatchEvent(_endEvent);
745
- this.state = _STATE.NONE;
746
- if (this._cursorStyle === "grab") {
747
- this.domElement.style.cursor = "grab";
748
- }
749
- break;
750
- case 1:
751
- const pointerId = this._pointers[0];
752
- const position = this._pointerPositions[pointerId];
753
- this._onTouchStart({ pointerId, pageX: position.x, pageY: position.y });
754
- break;
755
- }
756
- }
757
- function onMouseDown(event) {
758
- let mouseAction;
759
- switch (event.button) {
760
- case 0:
761
- mouseAction = this.mouseButtons.LEFT;
762
- break;
763
- case 1:
764
- mouseAction = this.mouseButtons.MIDDLE;
765
- break;
766
- case 2:
767
- mouseAction = this.mouseButtons.RIGHT;
768
- break;
769
- default:
770
- mouseAction = -1;
771
- }
772
- switch (mouseAction) {
773
- case chunkQS3GAPPA_js.MOUSE.DOLLY:
774
- if (this.enableZoom === false) return;
775
- this._handleMouseDownDolly(event);
776
- this.state = _STATE.DOLLY;
777
- break;
778
- case chunkQS3GAPPA_js.MOUSE.ROTATE:
779
- if (event.ctrlKey || event.metaKey || event.shiftKey) {
780
- if (this.enablePan === false) return;
781
- this._handleMouseDownPan(event);
782
- this.state = _STATE.PAN;
783
- } else {
784
- if (this.enableRotate === false) return;
785
- this._handleMouseDownRotate(event);
786
- this.state = _STATE.ROTATE;
787
- }
788
- break;
789
- case chunkQS3GAPPA_js.MOUSE.PAN:
790
- if (event.ctrlKey || event.metaKey || event.shiftKey) {
791
- if (this.enableRotate === false) return;
792
- this._handleMouseDownRotate(event);
793
- this.state = _STATE.ROTATE;
794
- } else {
795
- if (this.enablePan === false) return;
796
- this._handleMouseDownPan(event);
797
- this.state = _STATE.PAN;
798
- }
799
- break;
800
- default:
801
- this.state = _STATE.NONE;
802
- }
803
- if (this.state !== _STATE.NONE) {
804
- this.dispatchEvent(_startEvent);
805
- }
806
- }
807
- function onMouseMove(event) {
808
- switch (this.state) {
809
- case _STATE.ROTATE:
810
- if (this.enableRotate === false) return;
811
- this._handleMouseMoveRotate(event);
812
- break;
813
- case _STATE.DOLLY:
814
- if (this.enableZoom === false) return;
815
- this._handleMouseMoveDolly(event);
816
- break;
817
- case _STATE.PAN:
818
- if (this.enablePan === false) return;
819
- this._handleMouseMovePan(event);
820
- break;
821
- }
822
- }
823
- function onMouseWheel(event) {
824
- if (this.enabled === false || this.enableZoom === false || this.state !== _STATE.NONE) return;
825
- event.preventDefault();
826
- this.dispatchEvent(_startEvent);
827
- this._handleMouseWheel(this._customWheelEvent(event));
828
- this.dispatchEvent(_endEvent);
829
- }
830
- function onKeyDown(event) {
831
- if (this.enabled === false) return;
832
- this._handleKeyDown(event);
833
- }
834
- function onTouchStart(event) {
835
- this._trackPointer(event);
836
- switch (this._pointers.length) {
837
- case 1:
838
- switch (this.touches.ONE) {
839
- case chunkQS3GAPPA_js.TOUCH.ROTATE:
840
- if (this.enableRotate === false) return;
841
- this._handleTouchStartRotate(event);
842
- this.state = _STATE.TOUCH_ROTATE;
843
- break;
844
- case chunkQS3GAPPA_js.TOUCH.PAN:
845
- if (this.enablePan === false) return;
846
- this._handleTouchStartPan(event);
847
- this.state = _STATE.TOUCH_PAN;
848
- break;
849
- default:
850
- this.state = _STATE.NONE;
851
- }
852
- break;
853
- case 2:
854
- switch (this.touches.TWO) {
855
- case chunkQS3GAPPA_js.TOUCH.DOLLY_PAN:
856
- if (this.enableZoom === false && this.enablePan === false) return;
857
- this._handleTouchStartDollyPan(event);
858
- this.state = _STATE.TOUCH_DOLLY_PAN;
859
- break;
860
- case chunkQS3GAPPA_js.TOUCH.DOLLY_ROTATE:
861
- if (this.enableZoom === false && this.enableRotate === false) return;
862
- this._handleTouchStartDollyRotate(event);
863
- this.state = _STATE.TOUCH_DOLLY_ROTATE;
864
- break;
865
- default:
866
- this.state = _STATE.NONE;
867
- }
868
- break;
869
- default:
870
- this.state = _STATE.NONE;
871
- }
872
- if (this.state !== _STATE.NONE) {
873
- this.dispatchEvent(_startEvent);
874
- }
875
- }
876
- function onTouchMove(event) {
877
- this._trackPointer(event);
878
- switch (this.state) {
879
- case _STATE.TOUCH_ROTATE:
880
- if (this.enableRotate === false) return;
881
- this._handleTouchMoveRotate(event);
882
- this.update();
883
- break;
884
- case _STATE.TOUCH_PAN:
885
- if (this.enablePan === false) return;
886
- this._handleTouchMovePan(event);
887
- this.update();
888
- break;
889
- case _STATE.TOUCH_DOLLY_PAN:
890
- if (this.enableZoom === false && this.enablePan === false) return;
891
- this._handleTouchMoveDollyPan(event);
892
- this.update();
893
- break;
894
- case _STATE.TOUCH_DOLLY_ROTATE:
895
- if (this.enableZoom === false && this.enableRotate === false) return;
896
- this._handleTouchMoveDollyRotate(event);
897
- this.update();
898
- break;
899
- default:
900
- this.state = _STATE.NONE;
901
- }
902
- }
903
- function onContextMenu(event) {
904
- if (this.enabled === false) return;
905
- event.preventDefault();
906
- }
907
- function interceptControlDown(event) {
908
- if (event.key === "Control") {
909
- this._controlActive = true;
910
- const document = this.domElement.getRootNode();
911
- document.addEventListener("keyup", this._interceptControlUp, { passive: true, capture: true });
912
- }
913
- }
914
- function interceptControlUp(event) {
915
- if (event.key === "Control") {
916
- this._controlActive = false;
917
- const document = this.domElement.getRootNode();
918
- document.removeEventListener("keyup", this._interceptControlUp, { passive: true, capture: true });
919
- }
920
- }
921
-
922
- exports.OrbitControls = OrbitControls;