three-stdlib 2.15.0 → 2.15.2

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 (1222) hide show
  1. package/animation/AnimationClipCreator.js +32 -52
  2. package/animation/AnimationClipCreator.mjs +57 -0
  3. package/animation/CCDIKSolver.js +66 -161
  4. package/animation/CCDIKSolver.mjs +234 -0
  5. package/animation/MMDAnimationHelper.js +150 -341
  6. package/animation/MMDAnimationHelper.mjs +514 -0
  7. package/animation/MMDPhysics.js +154 -361
  8. package/animation/MMDPhysics.mjs +769 -0
  9. package/cameras/CinematicCamera.js +67 -77
  10. package/cameras/CinematicCamera.mjs +129 -0
  11. package/controls/ArcballControls.js +544 -1449
  12. package/controls/ArcballControls.mjs +1737 -0
  13. package/controls/DeviceOrientationControls.js +52 -97
  14. package/controls/DeviceOrientationControls.mjs +74 -0
  15. package/controls/DragControls.js +85 -187
  16. package/controls/DragControls.mjs +172 -0
  17. package/controls/FirstPersonControls.js +123 -193
  18. package/controls/FirstPersonControls.mjs +220 -0
  19. package/controls/FlyControls.js +82 -152
  20. package/controls/FlyControls.mjs +239 -0
  21. package/controls/OrbitControls.js +232 -481
  22. package/controls/OrbitControls.mjs +731 -0
  23. package/controls/PointerLockControls.js +63 -99
  24. package/controls/PointerLockControls.mjs +88 -0
  25. package/controls/TrackballControls.js +211 -383
  26. package/controls/TrackballControls.mjs +481 -0
  27. package/controls/TransformControls.js +575 -782
  28. package/controls/TransformControls.mjs +1068 -0
  29. package/controls/experimental/CameraControls.js +329 -609
  30. package/controls/experimental/CameraControls.mjs +673 -0
  31. package/csm/CSM.js +47 -108
  32. package/csm/CSM.mjs +244 -0
  33. package/csm/CSMFrustum.js +14 -29
  34. package/csm/CSMFrustum.mjs +75 -0
  35. package/csm/CSMHelper.js +20 -34
  36. package/csm/CSMHelper.mjs +114 -0
  37. package/csm/CSMShader.js +7 -11
  38. package/csm/CSMShader.mjs +251 -0
  39. package/curves/CurveExtras.js +73 -115
  40. package/curves/CurveExtras.mjs +224 -0
  41. package/curves/NURBSCurve.js +15 -43
  42. package/curves/NURBSCurve.mjs +35 -0
  43. package/curves/NURBSSurface.js +11 -27
  44. package/curves/NURBSSurface.mjs +28 -0
  45. package/curves/NURBSUtils.js +54 -203
  46. package/curves/NURBSUtils.mjs +226 -0
  47. package/deprecated/Geometry.js +191 -486
  48. package/deprecated/Geometry.mjs +966 -0
  49. package/effects/AnaglyphEffect.js +95 -60
  50. package/effects/AnaglyphEffect.mjs +120 -0
  51. package/effects/AsciiEffect.js +80 -110
  52. package/effects/AsciiEffect.mjs +173 -0
  53. package/effects/OutlineEffect.js +121 -204
  54. package/effects/OutlineEffect.mjs +295 -0
  55. package/effects/ParallaxBarrierEffect.js +39 -38
  56. package/effects/ParallaxBarrierEffect.mjs +64 -0
  57. package/effects/PeppersGhostEffect.js +19 -68
  58. package/effects/PeppersGhostEffect.mjs +85 -0
  59. package/effects/StereoEffect.js +12 -16
  60. package/effects/StereoEffect.mjs +32 -0
  61. package/environments/RoomEnvironment.js +52 -47
  62. package/environments/RoomEnvironment.mjs +78 -0
  63. package/exporters/ColladaExporter.js +115 -241
  64. package/exporters/ColladaExporter.mjs +299 -0
  65. package/exporters/DRACOExporter.js +67 -121
  66. package/exporters/DRACOExporter.mjs +132 -0
  67. package/exporters/GLTFExporter.js +463 -1014
  68. package/exporters/GLTFExporter.mjs +1381 -0
  69. package/exporters/MMDExporter.js +44 -102
  70. package/exporters/MMDExporter.mjs +102 -0
  71. package/exporters/OBJExporter.js +78 -140
  72. package/exporters/OBJExporter.mjs +166 -0
  73. package/exporters/PLYExporter.js +93 -154
  74. package/exporters/PLYExporter.mjs +278 -0
  75. package/exporters/STLExporter.js +30 -81
  76. package/exporters/STLExporter.mjs +129 -0
  77. package/exporters/USDZExporter.js +84 -144
  78. package/exporters/USDZExporter.mjs +328 -0
  79. package/geometries/BoxLineGeometry.js +7 -14
  80. package/geometries/BoxLineGeometry.mjs +45 -0
  81. package/geometries/ConvexGeometry.js +15 -24
  82. package/geometries/ConvexGeometry.mjs +29 -0
  83. package/geometries/DecalGeometry.js +108 -162
  84. package/geometries/DecalGeometry.mjs +184 -0
  85. package/geometries/LightningStrike.js +101 -294
  86. package/geometries/LightningStrike.mjs +547 -0
  87. package/geometries/ParametricGeometries.js +26 -76
  88. package/geometries/ParametricGeometries.mjs +129 -0
  89. package/geometries/ParametricGeometry.js +24 -48
  90. package/geometries/ParametricGeometry.mjs +63 -0
  91. package/geometries/RoundedBoxGeometry.js +33 -64
  92. package/geometries/RoundedBoxGeometry.mjs +91 -0
  93. package/geometries/TeapotGeometry.js +1434 -174
  94. package/geometries/TeapotGeometry.mjs +1557 -0
  95. package/geometries/TextGeometry.js +9 -17
  96. package/geometries/TextGeometry.mjs +23 -0
  97. package/helpers/LightProbeHelper.js +53 -21
  98. package/helpers/LightProbeHelper.mjs +72 -0
  99. package/helpers/PositionalAudioHelper.js +23 -30
  100. package/helpers/PositionalAudioHelper.mjs +68 -0
  101. package/helpers/RectAreaLightHelper.js +17 -33
  102. package/helpers/RectAreaLightHelper.mjs +44 -0
  103. package/helpers/VertexNormalsHelper.js +20 -41
  104. package/helpers/VertexNormalsHelper.mjs +54 -0
  105. package/helpers/VertexTangentsHelper.js +18 -36
  106. package/helpers/VertexTangentsHelper.mjs +45 -0
  107. package/index.d.ts +54 -0
  108. package/index.js +968 -333
  109. package/index.mjs +968 -0
  110. package/interactive/SelectionBox.js +31 -46
  111. package/interactive/SelectionBox.mjs +137 -0
  112. package/interactive/SelectionHelper.js +16 -21
  113. package/interactive/SelectionHelper.mjs +54 -0
  114. package/libs/MeshoptDecoder.js +147 -58
  115. package/libs/MeshoptDecoder.mjs +210 -0
  116. package/libs/MotionControllers.js +66 -208
  117. package/libs/MotionControllers.mjs +261 -0
  118. package/lights/LightProbeGenerator.js +40 -96
  119. package/lights/LightProbeGenerator.mjs +145 -0
  120. package/lights/RectAreaLightUniformsLib.js +32842 -9
  121. package/lights/RectAreaLightUniformsLib.mjs +32842 -0
  122. package/lines/Line2.js +9 -12
  123. package/lines/Line2.mjs +13 -0
  124. package/lines/LineGeometry.js +7 -19
  125. package/lines/LineGeometry.mjs +44 -0
  126. package/lines/LineMaterial.js +51 -89
  127. package/lines/LineMaterial.mjs +539 -0
  128. package/lines/LineSegments2.js +56 -165
  129. package/lines/LineSegments2.mjs +202 -0
  130. package/lines/LineSegmentsGeometry.js +29 -71
  131. package/lines/LineSegmentsGeometry.mjs +124 -0
  132. package/lines/Wireframe.js +15 -29
  133. package/lines/Wireframe.mjs +31 -0
  134. package/lines/WireframeGeometry2.js +8 -9
  135. package/lines/WireframeGeometry2.mjs +13 -0
  136. package/loaders/3DMLoader.js +234 -469
  137. package/loaders/3DMLoader.mjs +802 -0
  138. package/loaders/3MFLoader.js +340 -555
  139. package/loaders/3MFLoader.mjs +837 -0
  140. package/loaders/AMFLoader.js +114 -219
  141. package/loaders/AMFLoader.mjs +284 -0
  142. package/loaders/AssimpLoader.js +328 -725
  143. package/loaders/AssimpLoader.mjs +1396 -0
  144. package/loaders/BVHLoader.js +94 -200
  145. package/loaders/BVHLoader.mjs +207 -0
  146. package/loaders/BasisTextureLoader.js +229 -357
  147. package/loaders/BasisTextureLoader.mjs +474 -0
  148. package/loaders/ColladaLoader.js +932 -1522
  149. package/loaders/ColladaLoader.mjs +2403 -0
  150. package/loaders/DDSLoader.js +42 -108
  151. package/loaders/DDSLoader.mjs +148 -0
  152. package/loaders/DRACOLoader.js +103 -210
  153. package/loaders/DRACOLoader.mjs +340 -0
  154. package/loaders/EXRLoader.js +461 -809
  155. package/loaders/EXRLoader.mjs +1351 -0
  156. package/loaders/FBXLoader.js +842 -1397
  157. package/loaders/FBXLoader.mjs +2362 -0
  158. package/loaders/FontLoader.js +33 -66
  159. package/loaders/FontLoader.mjs +111 -0
  160. package/loaders/GCodeLoader.js +63 -111
  161. package/loaders/GCodeLoader.mjs +141 -0
  162. package/loaders/GLTFLoader.js +771 -1484
  163. package/loaders/GLTFLoader.mjs +2316 -0
  164. package/loaders/HDRCubeTextureLoader.js +45 -50
  165. package/loaders/HDRCubeTextureLoader.mjs +77 -0
  166. package/loaders/KMZLoader.js +42 -55
  167. package/loaders/KMZLoader.mjs +75 -0
  168. package/loaders/KTX2Loader.js +229 -362
  169. package/loaders/KTX2Loader.mjs +427 -0
  170. package/loaders/KTXLoader.js +37 -99
  171. package/loaders/KTXLoader.mjs +87 -0
  172. package/loaders/LDrawLoader.js +313 -746
  173. package/loaders/LDrawLoader.mjs +1409 -0
  174. package/loaders/LUT3dlLoader.js +50 -62
  175. package/loaders/LUT3dlLoader.mjs +100 -0
  176. package/loaders/LUTCubeLoader.js +45 -56
  177. package/loaders/LUTCubeLoader.mjs +104 -0
  178. package/loaders/LWOLoader.js +227 -339
  179. package/loaders/LWOLoader.mjs +625 -0
  180. package/loaders/LottieLoader.js +36 -38
  181. package/loaders/LottieLoader.mjs +47 -0
  182. package/loaders/MD2Loader.js +248 -91
  183. package/loaders/MD2Loader.mjs +359 -0
  184. package/loaders/MDDLoader.js +25 -45
  185. package/loaders/MDDLoader.mjs +58 -0
  186. package/loaders/MMDLoader.js +359 -795
  187. package/loaders/MMDLoader.mjs +998 -0
  188. package/loaders/MTLLoader.js +91 -201
  189. package/loaders/MTLLoader.mjs +280 -0
  190. package/loaders/NRRDLoader.js +182 -263
  191. package/loaders/NRRDLoader.mjs +401 -0
  192. package/loaders/NodeMaterialLoader.js +121 -14
  193. package/loaders/NodeMaterialLoader.mjs +146 -0
  194. package/loaders/OBJLoader.js +161 -283
  195. package/loaders/OBJLoader.mjs +487 -0
  196. package/loaders/PCDLoader.js +145 -164
  197. package/loaders/PCDLoader.mjs +248 -0
  198. package/loaders/PDBLoader.js +45 -63
  199. package/loaders/PDBLoader.mjs +246 -0
  200. package/loaders/PLYLoader.js +106 -203
  201. package/loaders/PLYLoader.mjs +317 -0
  202. package/loaders/PRWMLoader.js +73 -110
  203. package/loaders/PRWMLoader.mjs +160 -0
  204. package/loaders/PVRLoader.js +32 -93
  205. package/loaders/PVRLoader.mjs +131 -0
  206. package/loaders/RGBELoader.js +96 -233
  207. package/loaders/RGBELoader.mjs +244 -0
  208. package/loaders/RGBMLoader.js +344 -514
  209. package/loaders/RGBMLoader.mjs +998 -0
  210. package/loaders/STLLoader.js +59 -165
  211. package/loaders/STLLoader.mjs +190 -0
  212. package/loaders/SVGLoader.js +481 -851
  213. package/loaders/SVGLoader.mjs +1709 -0
  214. package/loaders/TDSLoader.js +137 -527
  215. package/loaders/TDSLoader.mjs +480 -0
  216. package/loaders/TGALoader.js +94 -205
  217. package/loaders/TGALoader.mjs +285 -0
  218. package/loaders/TTFLoader.js +58 -79
  219. package/loaders/TTFLoader.mjs +131 -0
  220. package/loaders/TiltLoader.js +129 -167
  221. package/loaders/TiltLoader.mjs +373 -0
  222. package/loaders/VOXLoader.js +320 -84
  223. package/loaders/VOXLoader.mjs +431 -0
  224. package/loaders/VRMLLoader.js +786 -1268
  225. package/loaders/VRMLLoader.mjs +2093 -0
  226. package/loaders/VRMLoader.js +23 -31
  227. package/loaders/VRMLoader.mjs +38 -0
  228. package/loaders/VTKLoader.js +219 -407
  229. package/loaders/VTKLoader.mjs +646 -0
  230. package/loaders/XLoader.js +1083 -1259
  231. package/loaders/XLoader.mjs +1258 -0
  232. package/loaders/XYZLoader.js +28 -34
  233. package/loaders/XYZLoader.mjs +60 -0
  234. package/loaders/lwo/IFFParser.js +238 -492
  235. package/loaders/lwo/IFFParser.mjs +697 -0
  236. package/loaders/lwo/LWO2Parser.js +176 -279
  237. package/loaders/lwo/LWO2Parser.mjs +327 -0
  238. package/loaders/lwo/LWO3Parser.js +160 -247
  239. package/loaders/lwo/LWO3Parser.mjs +298 -0
  240. package/math/Capsule.js +56 -43
  241. package/math/Capsule.mjs +100 -0
  242. package/math/ColorConverter.js +18 -32
  243. package/math/ColorConverter.mjs +51 -0
  244. package/math/ConvexHull.js +515 -739
  245. package/math/ConvexHull.mjs +574 -0
  246. package/math/ImprovedNoise.js +282 -32
  247. package/math/ImprovedNoise.mjs +302 -0
  248. package/math/Lut.js +51 -35
  249. package/math/Lut.mjs +135 -0
  250. package/math/MeshSurfaceSampler.js +25 -68
  251. package/math/MeshSurfaceSampler.mjs +107 -0
  252. package/math/OBB.js +91 -152
  253. package/math/OBB.mjs +235 -0
  254. package/math/Octree.js +76 -139
  255. package/math/Octree.mjs +278 -0
  256. package/math/SimplexNoise.js +217 -238
  257. package/math/SimplexNoise.mjs +425 -0
  258. package/misc/ConvexObjectBreaker.js +79 -185
  259. package/misc/ConvexObjectBreaker.mjs +292 -0
  260. package/misc/GPUComputationRenderer.js +69 -194
  261. package/misc/GPUComputationRenderer.mjs +171 -0
  262. package/misc/Gyroscope.js +16 -22
  263. package/misc/Gyroscope.mjs +35 -0
  264. package/misc/MD2Character.js +52 -74
  265. package/misc/MD2Character.mjs +162 -0
  266. package/misc/MD2CharacterComplex.js +112 -163
  267. package/misc/MD2CharacterComplex.mjs +328 -0
  268. package/misc/MorphAnimMesh.js +20 -28
  269. package/misc/MorphAnimMesh.mjs +40 -0
  270. package/misc/MorphBlendMesh.js +45 -69
  271. package/misc/MorphBlendMesh.mjs +179 -0
  272. package/misc/ProgressiveLightmap.js +70 -187
  273. package/misc/ProgressiveLightmap.mjs +166 -0
  274. package/misc/RollerCoaster.js +106 -135
  275. package/misc/RollerCoaster.mjs +346 -0
  276. package/misc/TubePainter.js +74 -92
  277. package/misc/TubePainter.mjs +123 -0
  278. package/misc/Volume.js +108 -270
  279. package/misc/Volume.mjs +244 -0
  280. package/misc/VolumeSlice.js +34 -122
  281. package/misc/VolumeSlice.mjs +106 -0
  282. package/misc/WebGL.js +37 -34
  283. package/misc/WebGL.mjs +74 -0
  284. package/modifiers/CurveModifier.js +46 -151
  285. package/modifiers/CurveModifier.mjs +182 -0
  286. package/modifiers/EdgeSplitModifier.js +46 -90
  287. package/modifiers/EdgeSplitModifier.mjs +162 -0
  288. package/modifiers/SimplifyModifier.js +77 -202
  289. package/modifiers/SimplifyModifier.mjs +282 -0
  290. package/modifiers/TessellateModifier.js +65 -90
  291. package/modifiers/TessellateModifier.mjs +206 -0
  292. package/nodes/Nodes.js +274 -140
  293. package/nodes/Nodes.mjs +400 -0
  294. package/nodes/ShaderNode.js +296 -196
  295. package/nodes/ShaderNode.mjs +408 -0
  296. package/nodes/accessors/BufferNode.js +4 -8
  297. package/nodes/accessors/BufferNode.mjs +15 -0
  298. package/nodes/accessors/CameraNode.js +20 -25
  299. package/nodes/accessors/CameraNode.mjs +44 -0
  300. package/nodes/accessors/CubeTextureNode.js +14 -26
  301. package/nodes/accessors/CubeTextureNode.mjs +42 -0
  302. package/nodes/accessors/MaterialNode.js +43 -53
  303. package/nodes/accessors/MaterialNode.mjs +71 -0
  304. package/nodes/accessors/MaterialReferenceNode.js +3 -6
  305. package/nodes/accessors/MaterialReferenceNode.mjs +14 -0
  306. package/nodes/accessors/ModelNode.js +3 -5
  307. package/nodes/accessors/ModelNode.mjs +9 -0
  308. package/nodes/accessors/ModelViewProjectionNode.js +14 -13
  309. package/nodes/accessors/ModelViewProjectionNode.mjs +24 -0
  310. package/nodes/accessors/NormalNode.js +40 -39
  311. package/nodes/accessors/NormalNode.mjs +62 -0
  312. package/nodes/accessors/Object3DNode.js +40 -50
  313. package/nodes/accessors/Object3DNode.mjs +76 -0
  314. package/nodes/accessors/PointUVNode.js +5 -9
  315. package/nodes/accessors/PointUVNode.mjs +13 -0
  316. package/nodes/accessors/PositionNode.js +42 -41
  317. package/nodes/accessors/PositionNode.mjs +65 -0
  318. package/nodes/accessors/ReferenceNode.js +10 -17
  319. package/nodes/accessors/ReferenceNode.mjs +37 -0
  320. package/nodes/accessors/ReflectNode.js +23 -26
  321. package/nodes/accessors/ReflectNode.mjs +43 -0
  322. package/nodes/accessors/SkinningNode.js +46 -48
  323. package/nodes/accessors/SkinningNode.mjs +58 -0
  324. package/nodes/accessors/TextureNode.js +14 -29
  325. package/nodes/accessors/TextureNode.mjs +54 -0
  326. package/nodes/accessors/UVNode.js +5 -11
  327. package/nodes/accessors/UVNode.mjs +23 -0
  328. package/nodes/core/ArrayUniformNode.js +3 -7
  329. package/nodes/core/ArrayUniformNode.mjs +14 -0
  330. package/nodes/core/AttributeNode.js +5 -12
  331. package/nodes/core/AttributeNode.mjs +30 -0
  332. package/nodes/core/BypassNode.js +5 -12
  333. package/nodes/core/BypassNode.mjs +22 -0
  334. package/nodes/core/CodeNode.js +4 -12
  335. package/nodes/core/CodeNode.mjs +28 -0
  336. package/nodes/core/ConstNode.js +3 -7
  337. package/nodes/core/ConstNode.mjs +14 -0
  338. package/nodes/core/ContextNode.js +3 -8
  339. package/nodes/core/ContextNode.mjs +22 -0
  340. package/nodes/core/ExpressionNode.js +5 -9
  341. package/nodes/core/ExpressionNode.mjs +19 -0
  342. package/nodes/core/FunctionCallNode.js +6 -15
  343. package/nodes/core/FunctionCallNode.mjs +37 -0
  344. package/nodes/core/FunctionNode.js +10 -25
  345. package/nodes/core/FunctionNode.mjs +56 -0
  346. package/nodes/core/InputNode.js +12 -23
  347. package/nodes/core/InputNode.mjs +38 -0
  348. package/nodes/core/Node.js +35 -75
  349. package/nodes/core/Node.mjs +139 -0
  350. package/nodes/core/NodeAttribute.js +2 -4
  351. package/nodes/core/NodeAttribute.mjs +10 -0
  352. package/nodes/core/NodeBuilder.js +110 -224
  353. package/nodes/core/NodeBuilder.mjs +395 -0
  354. package/nodes/core/NodeCode.js +4 -7
  355. package/nodes/core/NodeCode.mjs +11 -0
  356. package/nodes/core/NodeFrame.js +9 -12
  357. package/nodes/core/NodeFrame.mjs +35 -0
  358. package/nodes/core/NodeFunctionInput.js +3 -5
  359. package/nodes/core/NodeFunctionInput.mjs +13 -0
  360. package/nodes/core/NodeKeywords.js +5 -16
  361. package/nodes/core/NodeKeywords.mjs +44 -0
  362. package/nodes/core/NodeUniform.js +3 -7
  363. package/nodes/core/NodeUniform.mjs +18 -0
  364. package/nodes/core/NodeUtils.js +39 -43
  365. package/nodes/core/NodeUtils.mjs +57 -0
  366. package/nodes/core/NodeVar.js +2 -4
  367. package/nodes/core/NodeVar.mjs +10 -0
  368. package/nodes/core/NodeVary.js +2 -4
  369. package/nodes/core/NodeVary.mjs +10 -0
  370. package/nodes/core/PropertyNode.js +4 -10
  371. package/nodes/core/PropertyNode.mjs +21 -0
  372. package/nodes/core/TempNode.js +5 -11
  373. package/nodes/core/TempNode.mjs +25 -0
  374. package/nodes/core/UniformNode.js +4 -10
  375. package/nodes/core/UniformNode.mjs +23 -0
  376. package/nodes/core/VarNode.js +3 -11
  377. package/nodes/core/VarNode.mjs +31 -0
  378. package/nodes/core/VaryNode.js +6 -15
  379. package/nodes/core/VaryNode.mjs +30 -0
  380. package/nodes/core/constants.js +20 -7
  381. package/nodes/core/constants.mjs +24 -0
  382. package/nodes/display/ColorSpaceNode.js +34 -38
  383. package/nodes/display/ColorSpaceNode.mjs +63 -0
  384. package/nodes/display/NormalMapNode.js +35 -53
  385. package/nodes/display/NormalMapNode.mjs +54 -0
  386. package/nodes/fog/FogNode.js +5 -9
  387. package/nodes/fog/FogNode.mjs +15 -0
  388. package/nodes/fog/FogRangeNode.js +5 -9
  389. package/nodes/fog/FogRangeNode.mjs +17 -0
  390. package/nodes/functions/BSDFs.js +61 -118
  391. package/nodes/functions/BSDFs.mjs +64 -0
  392. package/nodes/lights/LightContextNode.js +14 -23
  393. package/nodes/lights/LightContextNode.mjs +35 -0
  394. package/nodes/lights/LightNode.js +27 -31
  395. package/nodes/lights/LightNode.mjs +58 -0
  396. package/nodes/lights/LightsNode.js +9 -28
  397. package/nodes/lights/LightsNode.mjs +59 -0
  398. package/nodes/loaders/NodeLoader.js +27 -42
  399. package/nodes/loaders/NodeLoader.mjs +66 -0
  400. package/nodes/loaders/NodeMaterialLoader.js +4 -10
  401. package/nodes/loaders/NodeMaterialLoader.mjs +24 -0
  402. package/nodes/loaders/NodeObjectLoader.js +9 -19
  403. package/nodes/loaders/NodeObjectLoader.mjs +40 -0
  404. package/nodes/materials/LineBasicNodeMaterial.js +5 -10
  405. package/nodes/materials/LineBasicNodeMaterial.mjs +27 -0
  406. package/nodes/materials/Materials.js +14 -17
  407. package/nodes/materials/Materials.mjs +28 -0
  408. package/nodes/materials/MeshBasicNodeMaterial.js +5 -10
  409. package/nodes/materials/MeshBasicNodeMaterial.mjs +28 -0
  410. package/nodes/materials/MeshStandardNodeMaterial.js +5 -8
  411. package/nodes/materials/MeshStandardNodeMaterial.mjs +41 -0
  412. package/nodes/materials/NodeMaterial.js +20 -36
  413. package/nodes/materials/NodeMaterial.mjs +64 -0
  414. package/nodes/materials/PointsNodeMaterial.js +5 -10
  415. package/nodes/materials/PointsNodeMaterial.mjs +30 -0
  416. package/nodes/math/CondNode.js +11 -23
  417. package/nodes/math/CondNode.mjs +38 -0
  418. package/nodes/math/MathNode.js +98 -142
  419. package/nodes/math/MathNode.mjs +163 -0
  420. package/nodes/math/OperatorNode.js +24 -46
  421. package/nodes/math/OperatorNode.mjs +103 -0
  422. package/nodes/procedural/CheckerNode.js +13 -19
  423. package/nodes/procedural/CheckerNode.mjs +21 -0
  424. package/nodes/utils/ArrayElementNode.js +4 -8
  425. package/nodes/utils/ArrayElementNode.mjs +19 -0
  426. package/nodes/utils/ConvertNode.js +3 -8
  427. package/nodes/utils/ConvertNode.mjs +25 -0
  428. package/nodes/utils/JoinNode.js +7 -11
  429. package/nodes/utils/JoinNode.mjs +26 -0
  430. package/nodes/utils/MatcapUVNode.js +8 -11
  431. package/nodes/utils/MatcapUVNode.mjs +16 -0
  432. package/nodes/utils/OscNode.js +27 -33
  433. package/nodes/utils/OscNode.mjs +50 -0
  434. package/nodes/utils/SplitNode.js +6 -20
  435. package/nodes/utils/SplitNode.mjs +45 -0
  436. package/nodes/utils/SpriteSheetUVNode.js +23 -23
  437. package/nodes/utils/SpriteSheetUVNode.mjs +40 -0
  438. package/nodes/utils/TimerNode.js +20 -24
  439. package/nodes/utils/TimerNode.mjs +44 -0
  440. package/objects/GroundProjectedEnv.js +22 -37
  441. package/objects/GroundProjectedEnv.mjs +130 -0
  442. package/objects/Lensflare.js +86 -156
  443. package/objects/Lensflare.mjs +262 -0
  444. package/objects/LightningStorm.js +38 -102
  445. package/objects/LightningStorm.mjs +110 -0
  446. package/objects/MarchingCubes.js +150 -303
  447. package/objects/MarchingCubes.mjs +457 -0
  448. package/objects/Reflector.js +50 -72
  449. package/objects/Reflector.mjs +166 -0
  450. package/objects/ReflectorForSSRPass.js +80 -131
  451. package/objects/ReflectorForSSRPass.mjs +247 -0
  452. package/objects/ReflectorRTT.js +6 -7
  453. package/objects/ReflectorRTT.mjs +10 -0
  454. package/objects/Refractor.js +64 -106
  455. package/objects/Refractor.mjs +178 -0
  456. package/objects/ShadowMesh.js +8 -17
  457. package/objects/ShadowMesh.mjs +41 -0
  458. package/objects/Sky.js +119 -80
  459. package/objects/Sky.mjs +124 -0
  460. package/objects/Water.js +83 -127
  461. package/objects/Water.mjs +235 -0
  462. package/objects/Water2.js +72 -108
  463. package/objects/Water2.mjs +252 -0
  464. package/offscreen/jank.js +10 -14
  465. package/offscreen/jank.mjs +27 -0
  466. package/offscreen/offscreen.js +4 -5
  467. package/offscreen/offscreen.mjs +5 -0
  468. package/offscreen/scene.js +45 -48
  469. package/offscreen/scene.mjs +52 -0
  470. package/package.json +3 -3
  471. package/physics/AmmoPhysics.js +30 -71
  472. package/physics/AmmoPhysics.mjs +165 -0
  473. package/postprocessing/AdaptiveToneMappingPass.js +97 -123
  474. package/postprocessing/AdaptiveToneMappingPass.mjs +221 -0
  475. package/postprocessing/AfterimagePass.js +28 -49
  476. package/postprocessing/AfterimagePass.mjs +55 -0
  477. package/postprocessing/BloomPass.js +43 -69
  478. package/postprocessing/BloomPass.mjs +90 -0
  479. package/postprocessing/BokehPass.js +39 -69
  480. package/postprocessing/BokehPass.mjs +76 -0
  481. package/postprocessing/ClearPass.js +10 -25
  482. package/postprocessing/ClearPass.mjs +27 -0
  483. package/postprocessing/CubeTexturePass.js +28 -27
  484. package/postprocessing/CubeTexturePass.mjs +49 -0
  485. package/postprocessing/DotScreenPass.js +24 -32
  486. package/postprocessing/DotScreenPass.mjs +40 -0
  487. package/postprocessing/EffectComposer.js +39 -86
  488. package/postprocessing/EffectComposer.mjs +139 -0
  489. package/postprocessing/FilmPass.js +25 -30
  490. package/postprocessing/FilmPass.mjs +42 -0
  491. package/postprocessing/GlitchPass.js +38 -61
  492. package/postprocessing/GlitchPass.mjs +75 -0
  493. package/postprocessing/HalftonePass.js +19 -39
  494. package/postprocessing/HalftonePass.mjs +44 -0
  495. package/postprocessing/LUTPass.js +13 -38
  496. package/postprocessing/LUTPass.mjs +136 -0
  497. package/postprocessing/MaskPass.js +19 -38
  498. package/postprocessing/MaskPass.mjs +60 -0
  499. package/postprocessing/OutlinePass.js +135 -277
  500. package/postprocessing/OutlinePass.mjs +438 -0
  501. package/postprocessing/Pass.js +20 -44
  502. package/postprocessing/Pass.mjs +37 -0
  503. package/postprocessing/RenderPass.js +13 -36
  504. package/postprocessing/RenderPass.mjs +48 -0
  505. package/postprocessing/RenderPixelatedPass.js +44 -58
  506. package/postprocessing/RenderPixelatedPass.mjs +199 -0
  507. package/postprocessing/SAOPass.js +154 -189
  508. package/postprocessing/SAOPass.mjs +282 -0
  509. package/postprocessing/SMAAPass.js +64 -84
  510. package/postprocessing/SMAAPass.mjs +112 -0
  511. package/postprocessing/SSAARenderPass.js +121 -69
  512. package/postprocessing/SSAARenderPass.mjs +170 -0
  513. package/postprocessing/SSAOPass.js +123 -172
  514. package/postprocessing/SSAOPass.mjs +265 -0
  515. package/postprocessing/SSRPass.js +211 -280
  516. package/postprocessing/SSRPass.mjs +432 -0
  517. package/postprocessing/SavePass.js +20 -25
  518. package/postprocessing/SavePass.mjs +37 -0
  519. package/postprocessing/ShaderPass.js +14 -30
  520. package/postprocessing/ShaderPass.mjs +39 -0
  521. package/postprocessing/TAARenderPass.js +42 -61
  522. package/postprocessing/TAARenderPass.mjs +88 -0
  523. package/postprocessing/TexturePass.js +21 -22
  524. package/postprocessing/TexturePass.mjs +39 -0
  525. package/postprocessing/UnrealBloomPass.js +105 -213
  526. package/postprocessing/UnrealBloomPass.mjs +220 -0
  527. package/renderers/CSS2DRenderer.js +44 -56
  528. package/renderers/CSS2DRenderer.mjs +112 -0
  529. package/renderers/CSS3DRenderer.js +53 -86
  530. package/renderers/CSS3DRenderer.mjs +133 -0
  531. package/renderers/Projector.js +107 -274
  532. package/renderers/Projector.mjs +511 -0
  533. package/renderers/SVGRenderer.js +72 -182
  534. package/renderers/SVGRenderer.mjs +306 -0
  535. package/renderers/nodes/accessors/CameraNode.js +29 -40
  536. package/renderers/nodes/accessors/CameraNode.mjs +63 -0
  537. package/renderers/nodes/accessors/ModelNode.js +28 -37
  538. package/renderers/nodes/accessors/ModelNode.mjs +61 -0
  539. package/renderers/nodes/accessors/ModelViewProjectionNode.js +10 -23
  540. package/renderers/nodes/accessors/ModelViewProjectionNode.mjs +21 -0
  541. package/renderers/nodes/accessors/NormalNode.js +35 -45
  542. package/renderers/nodes/accessors/NormalNode.mjs +61 -0
  543. package/renderers/nodes/accessors/PositionNode.js +18 -19
  544. package/renderers/nodes/accessors/PositionNode.mjs +30 -0
  545. package/renderers/nodes/accessors/UVNode.js +5 -10
  546. package/renderers/nodes/accessors/UVNode.mjs +13 -0
  547. package/renderers/nodes/core/AttributeNode.js +5 -14
  548. package/renderers/nodes/core/AttributeNode.mjs +35 -0
  549. package/renderers/nodes/core/InputNode.js +4 -14
  550. package/renderers/nodes/core/InputNode.mjs +31 -0
  551. package/renderers/nodes/core/Node.js +7 -17
  552. package/renderers/nodes/core/Node.mjs +34 -0
  553. package/renderers/nodes/core/NodeAttribute.js +3 -6
  554. package/renderers/nodes/core/NodeAttribute.mjs +10 -0
  555. package/renderers/nodes/core/NodeBuilder.js +87 -154
  556. package/renderers/nodes/core/NodeBuilder.mjs +243 -0
  557. package/renderers/nodes/core/NodeFrame.js +9 -12
  558. package/renderers/nodes/core/NodeFrame.mjs +35 -0
  559. package/renderers/nodes/core/NodeSlot.js +2 -3
  560. package/renderers/nodes/core/NodeSlot.mjs +10 -0
  561. package/renderers/nodes/core/NodeUniform.js +4 -9
  562. package/renderers/nodes/core/NodeUniform.mjs +18 -0
  563. package/renderers/nodes/core/NodeVary.js +4 -7
  564. package/renderers/nodes/core/NodeVary.mjs +11 -0
  565. package/renderers/nodes/core/VaryNode.js +6 -12
  566. package/renderers/nodes/core/VaryNode.mjs +22 -0
  567. package/renderers/nodes/core/constants.js +16 -13
  568. package/renderers/nodes/core/constants.mjs +22 -0
  569. package/renderers/nodes/inputs/ColorNode.js +5 -11
  570. package/renderers/nodes/inputs/ColorNode.mjs +11 -0
  571. package/renderers/nodes/inputs/FloatNode.js +5 -11
  572. package/renderers/nodes/inputs/FloatNode.mjs +11 -0
  573. package/renderers/nodes/inputs/Matrix3Node.js +7 -13
  574. package/renderers/nodes/inputs/Matrix3Node.mjs +12 -0
  575. package/renderers/nodes/inputs/Matrix4Node.js +7 -13
  576. package/renderers/nodes/inputs/Matrix4Node.mjs +12 -0
  577. package/renderers/nodes/inputs/TextureNode.js +7 -15
  578. package/renderers/nodes/inputs/TextureNode.mjs +20 -0
  579. package/renderers/nodes/inputs/Vector2Node.js +5 -11
  580. package/renderers/nodes/inputs/Vector2Node.mjs +11 -0
  581. package/renderers/nodes/inputs/Vector3Node.js +7 -13
  582. package/renderers/nodes/inputs/Vector3Node.mjs +12 -0
  583. package/renderers/nodes/inputs/Vector4Node.js +7 -13
  584. package/renderers/nodes/inputs/Vector4Node.mjs +12 -0
  585. package/renderers/nodes/math/MathNode.js +20 -30
  586. package/renderers/nodes/math/MathNode.mjs +55 -0
  587. package/renderers/nodes/math/OperatorNode.js +4 -20
  588. package/renderers/nodes/math/OperatorNode.mjs +42 -0
  589. package/renderers/nodes/utils/SwitchNode.js +4 -9
  590. package/renderers/nodes/utils/SwitchNode.mjs +20 -0
  591. package/renderers/nodes/utils/TimerNode.js +5 -10
  592. package/renderers/nodes/utils/TimerNode.mjs +14 -0
  593. package/renderers/webgpu/WebGPU.js +14 -16
  594. package/renderers/webgpu/WebGPU.mjs +24 -0
  595. package/renderers/webgpu/WebGPUAttributes.js +16 -23
  596. package/renderers/webgpu/WebGPUAttributes.mjs +69 -0
  597. package/renderers/webgpu/WebGPUBackground.js +13 -30
  598. package/renderers/webgpu/WebGPUBackground.mjs +61 -0
  599. package/renderers/webgpu/WebGPUBinding.js +4 -7
  600. package/renderers/webgpu/WebGPUBinding.mjs +14 -0
  601. package/renderers/webgpu/WebGPUBindings.js +21 -57
  602. package/renderers/webgpu/WebGPUBindings.mjs +155 -0
  603. package/renderers/webgpu/WebGPUComputePipelines.js +14 -25
  604. package/renderers/webgpu/WebGPUComputePipelines.mjs +44 -0
  605. package/renderers/webgpu/WebGPUGeometries.js +5 -15
  606. package/renderers/webgpu/WebGPUGeometries.mjs +41 -0
  607. package/renderers/webgpu/WebGPUInfo.js +3 -8
  608. package/renderers/webgpu/WebGPUInfo.mjs +46 -0
  609. package/renderers/webgpu/WebGPUObjects.js +5 -10
  610. package/renderers/webgpu/WebGPUObjects.mjs +25 -0
  611. package/renderers/webgpu/WebGPUProperties.js +5 -11
  612. package/renderers/webgpu/WebGPUProperties.mjs +22 -0
  613. package/renderers/webgpu/WebGPURenderLists.js +20 -36
  614. package/renderers/webgpu/WebGPURenderLists.mjs +119 -0
  615. package/renderers/webgpu/WebGPURenderPipelines.js +260 -387
  616. package/renderers/webgpu/WebGPURenderPipelines.mjs +545 -0
  617. package/renderers/webgpu/WebGPURenderer.js +124 -262
  618. package/renderers/webgpu/WebGPURenderer.mjs +574 -0
  619. package/renderers/webgpu/WebGPUSampledTexture.js +18 -31
  620. package/renderers/webgpu/WebGPUSampledTexture.mjs +40 -0
  621. package/renderers/webgpu/WebGPUSampler.js +7 -12
  622. package/renderers/webgpu/WebGPUSampler.mjs +15 -0
  623. package/renderers/webgpu/WebGPUStorageBuffer.js +7 -12
  624. package/renderers/webgpu/WebGPUStorageBuffer.mjs +15 -0
  625. package/renderers/webgpu/WebGPUTextureRenderer.js +5 -11
  626. package/renderers/webgpu/WebGPUTextureRenderer.mjs +23 -0
  627. package/renderers/webgpu/WebGPUTextureUtils.js +29 -40
  628. package/renderers/webgpu/WebGPUTextureUtils.mjs +98 -0
  629. package/renderers/webgpu/WebGPUTextures.js +186 -333
  630. package/renderers/webgpu/WebGPUTextures.mjs +484 -0
  631. package/renderers/webgpu/WebGPUUniform.js +25 -51
  632. package/renderers/webgpu/WebGPUUniform.mjs +81 -0
  633. package/renderers/webgpu/WebGPUUniformsGroup.js +32 -72
  634. package/renderers/webgpu/WebGPUUniformsGroup.mjs +176 -0
  635. package/renderers/webgpu/constants.js +190 -181
  636. package/renderers/webgpu/constants.mjs +230 -0
  637. package/renderers/webgpu/nodes/ShaderLib.js +2 -2
  638. package/renderers/webgpu/nodes/ShaderLib.mjs +42 -0
  639. package/renderers/webgpu/nodes/WebGPUNodeBuilder.js +53 -124
  640. package/renderers/webgpu/nodes/WebGPUNodeBuilder.mjs +165 -0
  641. package/renderers/webgpu/nodes/WebGPUNodeUniform.js +17 -31
  642. package/renderers/webgpu/nodes/WebGPUNodeUniform.mjs +73 -0
  643. package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +8 -9
  644. package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.mjs +15 -0
  645. package/renderers/webgpu/nodes/WebGPUNodes.js +7 -45
  646. package/renderers/webgpu/nodes/WebGPUNodes.mjs +40 -0
  647. package/shaders/ACESFilmicToneMappingShader.js +44 -24
  648. package/shaders/ACESFilmicToneMappingShader.mjs +48 -0
  649. package/shaders/AfterimageShader.js +28 -18
  650. package/shaders/AfterimageShader.mjs +32 -0
  651. package/shaders/BasicShader.js +9 -7
  652. package/shaders/BasicShader.mjs +12 -0
  653. package/shaders/BleachBypassShader.js +31 -15
  654. package/shaders/BleachBypassShader.mjs +35 -0
  655. package/shaders/BlendShader.js +26 -19
  656. package/shaders/BlendShader.mjs +30 -0
  657. package/shaders/BokehShader.js +98 -36
  658. package/shaders/BokehShader.mjs +106 -0
  659. package/shaders/BokehShader2.js +261 -90
  660. package/shaders/BokehShader2.mjs +269 -0
  661. package/shaders/BrightnessContrastShader.js +28 -19
  662. package/shaders/BrightnessContrastShader.mjs +32 -0
  663. package/shaders/ColorCorrectionShader.js +26 -22
  664. package/shaders/ColorCorrectionShader.mjs +30 -0
  665. package/shaders/ColorifyShader.js +24 -16
  666. package/shaders/ColorifyShader.mjs +28 -0
  667. package/shaders/ConvolutionShader.js +40 -36
  668. package/shaders/ConvolutionShader.mjs +55 -0
  669. package/shaders/CopyShader.js +21 -13
  670. package/shaders/CopyShader.mjs +25 -0
  671. package/shaders/DOFMipMapShader.js +28 -21
  672. package/shaders/DOFMipMapShader.mjs +32 -0
  673. package/shaders/DepthLimitedBlurShader.js +85 -40
  674. package/shaders/DepthLimitedBlurShader.mjs +114 -0
  675. package/shaders/DigitalGlitch.js +74 -46
  676. package/shaders/DigitalGlitch.mjs +78 -0
  677. package/shaders/DotScreenShader.js +35 -27
  678. package/shaders/DotScreenShader.mjs +39 -0
  679. package/shaders/FXAAShader.js +1094 -19
  680. package/shaders/FXAAShader.mjs +1098 -0
  681. package/shaders/FilmShader.js +38 -52
  682. package/shaders/FilmShader.mjs +42 -0
  683. package/shaders/FocusShader.js +51 -24
  684. package/shaders/FocusShader.mjs +55 -0
  685. package/shaders/FreiChenShader.js +57 -24
  686. package/shaders/FreiChenShader.mjs +61 -0
  687. package/shaders/FresnelShader.js +43 -22
  688. package/shaders/FresnelShader.mjs +47 -0
  689. package/shaders/GammaCorrectionShader.js +19 -11
  690. package/shaders/GammaCorrectionShader.mjs +23 -0
  691. package/shaders/GodRaysShader.js +103 -94
  692. package/shaders/GodRaysShader.mjs +146 -0
  693. package/shaders/HalftoneShader.js +208 -65
  694. package/shaders/HalftoneShader.mjs +212 -0
  695. package/shaders/HorizontalBlurShader.js +7 -23
  696. package/shaders/HorizontalBlurShader.mjs +43 -0
  697. package/shaders/HorizontalTiltShiftShader.js +33 -21
  698. package/shaders/HorizontalTiltShiftShader.mjs +37 -0
  699. package/shaders/HueSaturationShader.js +37 -21
  700. package/shaders/HueSaturationShader.mjs +41 -0
  701. package/shaders/KaleidoShader.js +30 -22
  702. package/shaders/KaleidoShader.mjs +34 -0
  703. package/shaders/LuminosityHighPassShader.js +33 -27
  704. package/shaders/LuminosityHighPassShader.mjs +37 -0
  705. package/shaders/LuminosityShader.js +21 -11
  706. package/shaders/LuminosityShader.mjs +25 -0
  707. package/shaders/MirrorShader.js +31 -16
  708. package/shaders/MirrorShader.mjs +35 -0
  709. package/shaders/NormalMapShader.js +27 -23
  710. package/shaders/NormalMapShader.mjs +31 -0
  711. package/shaders/ParallaxShader.js +107 -48
  712. package/shaders/ParallaxShader.mjs +113 -0
  713. package/shaders/PixelShader.js +24 -16
  714. package/shaders/PixelShader.mjs +28 -0
  715. package/shaders/RGBShiftShader.js +26 -22
  716. package/shaders/RGBShiftShader.mjs +30 -0
  717. package/shaders/SAOShader.js +132 -48
  718. package/shaders/SAOShader.mjs +144 -0
  719. package/shaders/SMAAShader.js +256 -135
  720. package/shaders/SMAAShader.mjs +272 -0
  721. package/shaders/SSAOShader.js +153 -81
  722. package/shaders/SSAOShader.mjs +172 -0
  723. package/shaders/SSRShader.js +32 -87
  724. package/shaders/SSRShader.mjs +324 -0
  725. package/shaders/SepiaShader.js +25 -15
  726. package/shaders/SepiaShader.mjs +29 -0
  727. package/shaders/SobelOperatorShader.js +40 -29
  728. package/shaders/SobelOperatorShader.mjs +44 -0
  729. package/shaders/SubsurfaceScatteringShader.js +53 -39
  730. package/shaders/SubsurfaceScatteringShader.mjs +59 -0
  731. package/shaders/TechnicolorShader.js +20 -13
  732. package/shaders/TechnicolorShader.mjs +24 -0
  733. package/shaders/ToneMapShader.js +44 -28
  734. package/shaders/ToneMapShader.mjs +48 -0
  735. package/shaders/ToonShader.js +172 -96
  736. package/shaders/ToonShader.mjs +188 -0
  737. package/shaders/TriangleBlurShader.js +32 -23
  738. package/shaders/TriangleBlurShader.mjs +36 -0
  739. package/shaders/UnpackDepthRGBAShader.js +22 -14
  740. package/shaders/UnpackDepthRGBAShader.mjs +26 -0
  741. package/shaders/VerticalBlurShader.js +7 -23
  742. package/shaders/VerticalBlurShader.mjs +44 -0
  743. package/shaders/VerticalTiltShiftShader.js +33 -21
  744. package/shaders/VerticalTiltShiftShader.mjs +37 -0
  745. package/shaders/VignetteShader.js +24 -28
  746. package/shaders/VignetteShader.mjs +28 -0
  747. package/shaders/VolumeShader.js +174 -77
  748. package/shaders/VolumeShader.mjs +178 -0
  749. package/shaders/WaterRefractionShader.js +38 -6
  750. package/shaders/WaterRefractionShader.mjs +57 -0
  751. package/shaders/types.js +1 -1
  752. package/{custom.d.js → shaders/types.mjs} +0 -0
  753. package/textures/FlakesTexture.js +8 -10
  754. package/textures/FlakesTexture.mjs +30 -0
  755. package/types/helpers.js +3 -2
  756. package/types/helpers.mjs +4 -0
  757. package/utils/BufferGeometryUtils.js +251 -325
  758. package/utils/BufferGeometryUtils.mjs +570 -0
  759. package/utils/GeometryCompressionUtils.js +241 -239
  760. package/utils/GeometryCompressionUtils.mjs +547 -0
  761. package/utils/GeometryUtils.js +41 -94
  762. package/utils/GeometryUtils.mjs +108 -0
  763. package/utils/RoughnessMipmapper.js +38 -82
  764. package/utils/RoughnessMipmapper.mjs +213 -0
  765. package/utils/SceneUtils.js +15 -20
  766. package/utils/SceneUtils.mjs +36 -0
  767. package/utils/ShadowMapViewer.js +49 -95
  768. package/utils/ShadowMapViewer.mjs +114 -0
  769. package/utils/SkeletonUtils.js +74 -165
  770. package/utils/SkeletonUtils.mjs +292 -0
  771. package/utils/UVsDebug.js +32 -62
  772. package/utils/UVsDebug.mjs +85 -0
  773. package/utils/WorkerPool.js +13 -33
  774. package/utils/WorkerPool.mjs +62 -0
  775. package/webxr/ARButton.js +72 -98
  776. package/webxr/ARButton.mjs +119 -0
  777. package/webxr/OculusHandModel.js +18 -37
  778. package/webxr/OculusHandModel.mjs +71 -0
  779. package/webxr/OculusHandPointerModel.js +58 -80
  780. package/webxr/OculusHandPointerModel.mjs +207 -0
  781. package/webxr/Text2D.js +37 -19
  782. package/webxr/Text2D.mjs +31 -0
  783. package/webxr/VRButton.js +59 -90
  784. package/webxr/VRButton.mjs +105 -0
  785. package/webxr/XRControllerModelFactory.js +58 -116
  786. package/webxr/XRControllerModelFactory.mjs +146 -0
  787. package/webxr/XREstimatedLight.js +39 -66
  788. package/webxr/XREstimatedLight.mjs +126 -0
  789. package/webxr/XRHandMeshModel.js +40 -29
  790. package/webxr/XRHandMeshModel.mjs +73 -0
  791. package/webxr/XRHandModelFactory.js +28 -31
  792. package/webxr/XRHandModelFactory.mjs +61 -0
  793. package/webxr/XRHandPrimitiveModel.js +41 -27
  794. package/webxr/XRHandPrimitiveModel.mjs +68 -0
  795. package/BufferGeometryUtils-1a7a235c.js +0 -655
  796. package/BufferGeometryUtils-971dfde3.js +0 -1
  797. package/Nodes-4f766d71.js +0 -471
  798. package/Nodes-9aa16d74.js +0 -1
  799. package/animation/AnimationClipCreator.cjs.js +0 -1
  800. package/animation/CCDIKSolver.cjs.js +0 -1
  801. package/animation/MMDAnimationHelper.cjs.js +0 -1
  802. package/animation/MMDPhysics.cjs.js +0 -1
  803. package/cameras/CinematicCamera.cjs.js +0 -1
  804. package/controls/ArcballControls.cjs.js +0 -1
  805. package/controls/DeviceOrientationControls.cjs.js +0 -1
  806. package/controls/DragControls.cjs.js +0 -1
  807. package/controls/FirstPersonControls.cjs.js +0 -1
  808. package/controls/FlyControls.cjs.js +0 -1
  809. package/controls/OrbitControls.cjs.js +0 -1
  810. package/controls/PointerLockControls.cjs.js +0 -1
  811. package/controls/TrackballControls.cjs.js +0 -1
  812. package/controls/TransformControls.cjs.js +0 -1
  813. package/controls/experimental/CameraControls.cjs.js +0 -1
  814. package/csm/CSM.cjs.js +0 -1
  815. package/csm/CSMFrustum.cjs.js +0 -1
  816. package/csm/CSMHelper.cjs.js +0 -1
  817. package/csm/CSMShader.cjs.js +0 -1
  818. package/curves/CurveExtras.cjs.js +0 -1
  819. package/curves/NURBSCurve.cjs.js +0 -1
  820. package/curves/NURBSSurface.cjs.js +0 -1
  821. package/curves/NURBSUtils.cjs.js +0 -1
  822. package/custom.d.cjs.js +0 -1
  823. package/deprecated/Geometry.cjs.js +0 -1
  824. package/effects/AnaglyphEffect.cjs.js +0 -1
  825. package/effects/AsciiEffect.cjs.js +0 -1
  826. package/effects/OutlineEffect.cjs.js +0 -1
  827. package/effects/ParallaxBarrierEffect.cjs.js +0 -1
  828. package/effects/PeppersGhostEffect.cjs.js +0 -1
  829. package/effects/StereoEffect.cjs.js +0 -1
  830. package/environments/RoomEnvironment.cjs.js +0 -1
  831. package/exporters/ColladaExporter.cjs.js +0 -1
  832. package/exporters/DRACOExporter.cjs.js +0 -1
  833. package/exporters/GLTFExporter.cjs.js +0 -1
  834. package/exporters/MMDExporter.cjs.js +0 -1
  835. package/exporters/OBJExporter.cjs.js +0 -1
  836. package/exporters/PLYExporter.cjs.js +0 -1
  837. package/exporters/STLExporter.cjs.js +0 -1
  838. package/exporters/USDZExporter.cjs.js +0 -1
  839. package/geometries/BoxLineGeometry.cjs.js +0 -1
  840. package/geometries/ConvexGeometry.cjs.js +0 -1
  841. package/geometries/DecalGeometry.cjs.js +0 -1
  842. package/geometries/LightningStrike.cjs.js +0 -1
  843. package/geometries/ParametricGeometries.cjs.js +0 -1
  844. package/geometries/ParametricGeometry.cjs.js +0 -1
  845. package/geometries/RoundedBoxGeometry.cjs.js +0 -1
  846. package/geometries/TeapotGeometry.cjs.js +0 -1
  847. package/geometries/TextGeometry.cjs.js +0 -1
  848. package/helpers/LightProbeHelper.cjs.js +0 -1
  849. package/helpers/PositionalAudioHelper.cjs.js +0 -1
  850. package/helpers/RectAreaLightHelper.cjs.js +0 -1
  851. package/helpers/VertexNormalsHelper.cjs.js +0 -1
  852. package/helpers/VertexTangentsHelper.cjs.js +0 -1
  853. package/index.cjs.js +0 -1
  854. package/interactive/InteractiveGroup.cjs.js +0 -1
  855. package/interactive/InteractiveGroup.d.ts +0 -5
  856. package/interactive/InteractiveGroup.js +0 -87
  857. package/interactive/SelectionBox.cjs.js +0 -1
  858. package/interactive/SelectionHelper.cjs.js +0 -1
  859. package/libs/MeshoptDecoder.cjs.js +0 -1
  860. package/libs/MotionControllers.cjs.js +0 -1
  861. package/lights/LightProbeGenerator.cjs.js +0 -1
  862. package/lights/RectAreaLightUniformsLib.cjs.js +0 -1
  863. package/lines/Line2.cjs.js +0 -1
  864. package/lines/LineGeometry.cjs.js +0 -1
  865. package/lines/LineMaterial.cjs.js +0 -1
  866. package/lines/LineSegments2.cjs.js +0 -1
  867. package/lines/LineSegmentsGeometry.cjs.js +0 -1
  868. package/lines/Wireframe.cjs.js +0 -1
  869. package/lines/WireframeGeometry2.cjs.js +0 -1
  870. package/loaders/3DMLoader.cjs.js +0 -1
  871. package/loaders/3MFLoader.cjs.js +0 -1
  872. package/loaders/AMFLoader.cjs.js +0 -1
  873. package/loaders/AssimpLoader.cjs.js +0 -1
  874. package/loaders/BVHLoader.cjs.js +0 -1
  875. package/loaders/BasisTextureLoader.cjs.js +0 -1
  876. package/loaders/ColladaLoader.cjs.js +0 -1
  877. package/loaders/DDSLoader.cjs.js +0 -1
  878. package/loaders/DRACOLoader.cjs.js +0 -1
  879. package/loaders/EXRLoader.cjs.js +0 -1
  880. package/loaders/FBXLoader.cjs.js +0 -1
  881. package/loaders/FontLoader.cjs.js +0 -1
  882. package/loaders/GCodeLoader.cjs.js +0 -1
  883. package/loaders/GLTFLoader.cjs.js +0 -1
  884. package/loaders/HDRCubeTextureLoader.cjs.js +0 -1
  885. package/loaders/KMZLoader.cjs.js +0 -1
  886. package/loaders/KTX2Loader.cjs.js +0 -1
  887. package/loaders/KTXLoader.cjs.js +0 -1
  888. package/loaders/LDrawLoader.cjs.js +0 -1
  889. package/loaders/LUT3dlLoader.cjs.js +0 -1
  890. package/loaders/LUTCubeLoader.cjs.js +0 -1
  891. package/loaders/LWOLoader.cjs.js +0 -1
  892. package/loaders/LottieLoader.cjs.js +0 -1
  893. package/loaders/MD2Loader.cjs.js +0 -1
  894. package/loaders/MDDLoader.cjs.js +0 -1
  895. package/loaders/MMDLoader.cjs.js +0 -1
  896. package/loaders/MTLLoader.cjs.js +0 -1
  897. package/loaders/NRRDLoader.cjs.js +0 -1
  898. package/loaders/NodeMaterialLoader.cjs.js +0 -1
  899. package/loaders/OBJLoader.cjs.js +0 -1
  900. package/loaders/PCDLoader.cjs.js +0 -1
  901. package/loaders/PDBLoader.cjs.js +0 -1
  902. package/loaders/PLYLoader.cjs.js +0 -1
  903. package/loaders/PRWMLoader.cjs.js +0 -1
  904. package/loaders/PVRLoader.cjs.js +0 -1
  905. package/loaders/RGBELoader.cjs.js +0 -1
  906. package/loaders/RGBMLoader.cjs.js +0 -1
  907. package/loaders/STLLoader.cjs.js +0 -1
  908. package/loaders/SVGLoader.cjs.js +0 -1
  909. package/loaders/TDSLoader.cjs.js +0 -1
  910. package/loaders/TGALoader.cjs.js +0 -1
  911. package/loaders/TTFLoader.cjs.js +0 -1
  912. package/loaders/TiltLoader.cjs.js +0 -1
  913. package/loaders/VOXLoader.cjs.js +0 -1
  914. package/loaders/VRMLLoader.cjs.js +0 -1
  915. package/loaders/VRMLoader.cjs.js +0 -1
  916. package/loaders/VTKLoader.cjs.js +0 -1
  917. package/loaders/XLoader.cjs.js +0 -1
  918. package/loaders/XYZLoader.cjs.js +0 -1
  919. package/loaders/lwo/IFFParser.cjs.js +0 -1
  920. package/loaders/lwo/LWO2Parser.cjs.js +0 -1
  921. package/loaders/lwo/LWO3Parser.cjs.js +0 -1
  922. package/math/Capsule.cjs.js +0 -1
  923. package/math/ColorConverter.cjs.js +0 -1
  924. package/math/ConvexHull.cjs.js +0 -1
  925. package/math/ImprovedNoise.cjs.js +0 -1
  926. package/math/Lut.cjs.js +0 -1
  927. package/math/MeshSurfaceSampler.cjs.js +0 -1
  928. package/math/OBB.cjs.js +0 -1
  929. package/math/Octree.cjs.js +0 -1
  930. package/math/SimplexNoise.cjs.js +0 -1
  931. package/misc/ConvexObjectBreaker.cjs.js +0 -1
  932. package/misc/GPUComputationRenderer.cjs.js +0 -1
  933. package/misc/Gyroscope.cjs.js +0 -1
  934. package/misc/MD2Character.cjs.js +0 -1
  935. package/misc/MD2CharacterComplex.cjs.js +0 -1
  936. package/misc/MorphAnimMesh.cjs.js +0 -1
  937. package/misc/MorphBlendMesh.cjs.js +0 -1
  938. package/misc/ProgressiveLightmap.cjs.js +0 -1
  939. package/misc/RollerCoaster.cjs.js +0 -1
  940. package/misc/TubePainter.cjs.js +0 -1
  941. package/misc/Volume.cjs.js +0 -1
  942. package/misc/VolumeSlice.cjs.js +0 -1
  943. package/misc/WebGL.cjs.js +0 -1
  944. package/modifiers/CurveModifier.cjs.js +0 -1
  945. package/modifiers/EdgeSplitModifier.cjs.js +0 -1
  946. package/modifiers/SimplifyModifier.cjs.js +0 -1
  947. package/modifiers/TessellateModifier.cjs.js +0 -1
  948. package/nodes/Nodes.cjs.js +0 -1
  949. package/nodes/ShaderNode.cjs.js +0 -1
  950. package/nodes/accessors/BufferNode.cjs.js +0 -1
  951. package/nodes/accessors/CameraNode.cjs.js +0 -1
  952. package/nodes/accessors/CubeTextureNode.cjs.js +0 -1
  953. package/nodes/accessors/MaterialNode.cjs.js +0 -1
  954. package/nodes/accessors/MaterialReferenceNode.cjs.js +0 -1
  955. package/nodes/accessors/ModelNode.cjs.js +0 -1
  956. package/nodes/accessors/ModelViewProjectionNode.cjs.js +0 -1
  957. package/nodes/accessors/NormalNode.cjs.js +0 -1
  958. package/nodes/accessors/Object3DNode.cjs.js +0 -1
  959. package/nodes/accessors/PointUVNode.cjs.js +0 -1
  960. package/nodes/accessors/PositionNode.cjs.js +0 -1
  961. package/nodes/accessors/ReferenceNode.cjs.js +0 -1
  962. package/nodes/accessors/ReflectNode.cjs.js +0 -1
  963. package/nodes/accessors/SkinningNode.cjs.js +0 -1
  964. package/nodes/accessors/TextureNode.cjs.js +0 -1
  965. package/nodes/accessors/UVNode.cjs.js +0 -1
  966. package/nodes/core/ArrayUniformNode.cjs.js +0 -1
  967. package/nodes/core/AttributeNode.cjs.js +0 -1
  968. package/nodes/core/BypassNode.cjs.js +0 -1
  969. package/nodes/core/CodeNode.cjs.js +0 -1
  970. package/nodes/core/ConstNode.cjs.js +0 -1
  971. package/nodes/core/ContextNode.cjs.js +0 -1
  972. package/nodes/core/ExpressionNode.cjs.js +0 -1
  973. package/nodes/core/FunctionCallNode.cjs.js +0 -1
  974. package/nodes/core/FunctionNode.cjs.js +0 -1
  975. package/nodes/core/InputNode.cjs.js +0 -1
  976. package/nodes/core/Node.cjs.js +0 -1
  977. package/nodes/core/NodeAttribute.cjs.js +0 -1
  978. package/nodes/core/NodeBuilder.cjs.js +0 -1
  979. package/nodes/core/NodeCode.cjs.js +0 -1
  980. package/nodes/core/NodeFrame.cjs.js +0 -1
  981. package/nodes/core/NodeFunction.cjs.js +0 -1
  982. package/nodes/core/NodeFunction.js +0 -17
  983. package/nodes/core/NodeFunctionInput.cjs.js +0 -1
  984. package/nodes/core/NodeKeywords.cjs.js +0 -1
  985. package/nodes/core/NodeParser.cjs.js +0 -1
  986. package/nodes/core/NodeParser.js +0 -8
  987. package/nodes/core/NodeUniform.cjs.js +0 -1
  988. package/nodes/core/NodeUtils.cjs.js +0 -1
  989. package/nodes/core/NodeVar.cjs.js +0 -1
  990. package/nodes/core/NodeVary.cjs.js +0 -1
  991. package/nodes/core/PropertyNode.cjs.js +0 -1
  992. package/nodes/core/TempNode.cjs.js +0 -1
  993. package/nodes/core/UniformNode.cjs.js +0 -1
  994. package/nodes/core/VarNode.cjs.js +0 -1
  995. package/nodes/core/VaryNode.cjs.js +0 -1
  996. package/nodes/core/constants.cjs.js +0 -1
  997. package/nodes/display/ColorSpaceNode.cjs.js +0 -1
  998. package/nodes/display/NormalMapNode.cjs.js +0 -1
  999. package/nodes/fog/FogNode.cjs.js +0 -1
  1000. package/nodes/fog/FogRangeNode.cjs.js +0 -1
  1001. package/nodes/functions/BSDFs.cjs.js +0 -1
  1002. package/nodes/functions/PhysicalMaterialFunctions.cjs.js +0 -1
  1003. package/nodes/functions/PhysicalMaterialFunctions.js +0 -57
  1004. package/nodes/lights/LightContextNode.cjs.js +0 -1
  1005. package/nodes/lights/LightNode.cjs.js +0 -1
  1006. package/nodes/lights/LightsNode.cjs.js +0 -1
  1007. package/nodes/loaders/NodeLoader.cjs.js +0 -1
  1008. package/nodes/loaders/NodeMaterialLoader.cjs.js +0 -1
  1009. package/nodes/loaders/NodeObjectLoader.cjs.js +0 -1
  1010. package/nodes/materials/LineBasicNodeMaterial.cjs.js +0 -1
  1011. package/nodes/materials/Materials.cjs.js +0 -1
  1012. package/nodes/materials/MeshBasicNodeMaterial.cjs.js +0 -1
  1013. package/nodes/materials/MeshStandardNodeMaterial.cjs.js +0 -1
  1014. package/nodes/materials/NodeMaterial.cjs.js +0 -1
  1015. package/nodes/materials/PointsNodeMaterial.cjs.js +0 -1
  1016. package/nodes/math/CondNode.cjs.js +0 -1
  1017. package/nodes/math/MathNode.cjs.js +0 -1
  1018. package/nodes/math/OperatorNode.cjs.js +0 -1
  1019. package/nodes/parsers/GLSLNodeFunction.cjs.js +0 -1
  1020. package/nodes/parsers/GLSLNodeFunction.js +0 -101
  1021. package/nodes/parsers/GLSLNodeParser.cjs.js +0 -1
  1022. package/nodes/parsers/GLSLNodeParser.js +0 -13
  1023. package/nodes/parsers/WGSLNodeFunction.cjs.js +0 -1
  1024. package/nodes/parsers/WGSLNodeFunction.js +0 -71
  1025. package/nodes/parsers/WGSLNodeParser.cjs.js +0 -1
  1026. package/nodes/parsers/WGSLNodeParser.js +0 -13
  1027. package/nodes/procedural/CheckerNode.cjs.js +0 -1
  1028. package/nodes/utils/ArrayElementNode.cjs.js +0 -1
  1029. package/nodes/utils/ConvertNode.cjs.js +0 -1
  1030. package/nodes/utils/JoinNode.cjs.js +0 -1
  1031. package/nodes/utils/MatcapUVNode.cjs.js +0 -1
  1032. package/nodes/utils/OscNode.cjs.js +0 -1
  1033. package/nodes/utils/SplitNode.cjs.js +0 -1
  1034. package/nodes/utils/SpriteSheetUVNode.cjs.js +0 -1
  1035. package/nodes/utils/TimerNode.cjs.js +0 -1
  1036. package/objects/GroundProjectedEnv.cjs.js +0 -1
  1037. package/objects/Lensflare.cjs.js +0 -1
  1038. package/objects/LightningStorm.cjs.js +0 -1
  1039. package/objects/MarchingCubes.cjs.js +0 -1
  1040. package/objects/Reflector.cjs.js +0 -1
  1041. package/objects/ReflectorForSSRPass.cjs.js +0 -1
  1042. package/objects/ReflectorRTT.cjs.js +0 -1
  1043. package/objects/Refractor.cjs.js +0 -1
  1044. package/objects/ShadowMesh.cjs.js +0 -1
  1045. package/objects/Sky.cjs.js +0 -1
  1046. package/objects/Water.cjs.js +0 -1
  1047. package/objects/Water2.cjs.js +0 -1
  1048. package/offscreen/jank.cjs.js +0 -1
  1049. package/offscreen/offscreen.cjs.js +0 -1
  1050. package/offscreen/scene.cjs.js +0 -1
  1051. package/physics/AmmoPhysics.cjs.js +0 -1
  1052. package/postprocessing/AdaptiveToneMappingPass.cjs.js +0 -1
  1053. package/postprocessing/AfterimagePass.cjs.js +0 -1
  1054. package/postprocessing/BloomPass.cjs.js +0 -1
  1055. package/postprocessing/BokehPass.cjs.js +0 -1
  1056. package/postprocessing/ClearPass.cjs.js +0 -1
  1057. package/postprocessing/CubeTexturePass.cjs.js +0 -1
  1058. package/postprocessing/DotScreenPass.cjs.js +0 -1
  1059. package/postprocessing/EffectComposer.cjs.js +0 -1
  1060. package/postprocessing/FilmPass.cjs.js +0 -1
  1061. package/postprocessing/GlitchPass.cjs.js +0 -1
  1062. package/postprocessing/HalftonePass.cjs.js +0 -1
  1063. package/postprocessing/LUTPass.cjs.js +0 -1
  1064. package/postprocessing/MaskPass.cjs.js +0 -1
  1065. package/postprocessing/OutlinePass.cjs.js +0 -1
  1066. package/postprocessing/Pass.cjs.js +0 -1
  1067. package/postprocessing/RenderPass.cjs.js +0 -1
  1068. package/postprocessing/RenderPixelatedPass.cjs.js +0 -1
  1069. package/postprocessing/SAOPass.cjs.js +0 -1
  1070. package/postprocessing/SMAAPass.cjs.js +0 -1
  1071. package/postprocessing/SSAARenderPass.cjs.js +0 -1
  1072. package/postprocessing/SSAOPass.cjs.js +0 -1
  1073. package/postprocessing/SSRPass.cjs.js +0 -1
  1074. package/postprocessing/SavePass.cjs.js +0 -1
  1075. package/postprocessing/ShaderPass.cjs.js +0 -1
  1076. package/postprocessing/TAARenderPass.cjs.js +0 -1
  1077. package/postprocessing/TexturePass.cjs.js +0 -1
  1078. package/postprocessing/UnrealBloomPass.cjs.js +0 -1
  1079. package/renderers/CSS2DRenderer.cjs.js +0 -1
  1080. package/renderers/CSS3DRenderer.cjs.js +0 -1
  1081. package/renderers/Projector.cjs.js +0 -1
  1082. package/renderers/SVGRenderer.cjs.js +0 -1
  1083. package/renderers/nodes/accessors/CameraNode.cjs.js +0 -1
  1084. package/renderers/nodes/accessors/ModelNode.cjs.js +0 -1
  1085. package/renderers/nodes/accessors/ModelViewProjectionNode.cjs.js +0 -1
  1086. package/renderers/nodes/accessors/NormalNode.cjs.js +0 -1
  1087. package/renderers/nodes/accessors/PositionNode.cjs.js +0 -1
  1088. package/renderers/nodes/accessors/UVNode.cjs.js +0 -1
  1089. package/renderers/nodes/core/AttributeNode.cjs.js +0 -1
  1090. package/renderers/nodes/core/InputNode.cjs.js +0 -1
  1091. package/renderers/nodes/core/Node.cjs.js +0 -1
  1092. package/renderers/nodes/core/NodeAttribute.cjs.js +0 -1
  1093. package/renderers/nodes/core/NodeBuilder.cjs.js +0 -1
  1094. package/renderers/nodes/core/NodeFrame.cjs.js +0 -1
  1095. package/renderers/nodes/core/NodeSlot.cjs.js +0 -1
  1096. package/renderers/nodes/core/NodeUniform.cjs.js +0 -1
  1097. package/renderers/nodes/core/NodeVary.cjs.js +0 -1
  1098. package/renderers/nodes/core/VaryNode.cjs.js +0 -1
  1099. package/renderers/nodes/core/constants.cjs.js +0 -1
  1100. package/renderers/nodes/inputs/ColorNode.cjs.js +0 -1
  1101. package/renderers/nodes/inputs/FloatNode.cjs.js +0 -1
  1102. package/renderers/nodes/inputs/Matrix3Node.cjs.js +0 -1
  1103. package/renderers/nodes/inputs/Matrix4Node.cjs.js +0 -1
  1104. package/renderers/nodes/inputs/TextureNode.cjs.js +0 -1
  1105. package/renderers/nodes/inputs/Vector2Node.cjs.js +0 -1
  1106. package/renderers/nodes/inputs/Vector3Node.cjs.js +0 -1
  1107. package/renderers/nodes/inputs/Vector4Node.cjs.js +0 -1
  1108. package/renderers/nodes/math/MathNode.cjs.js +0 -1
  1109. package/renderers/nodes/math/OperatorNode.cjs.js +0 -1
  1110. package/renderers/nodes/utils/SwitchNode.cjs.js +0 -1
  1111. package/renderers/nodes/utils/TimerNode.cjs.js +0 -1
  1112. package/renderers/webgpu/WebGPU.cjs.js +0 -1
  1113. package/renderers/webgpu/WebGPUAttributes.cjs.js +0 -1
  1114. package/renderers/webgpu/WebGPUBackground.cjs.js +0 -1
  1115. package/renderers/webgpu/WebGPUBinding.cjs.js +0 -1
  1116. package/renderers/webgpu/WebGPUBindings.cjs.js +0 -1
  1117. package/renderers/webgpu/WebGPUComputePipelines.cjs.js +0 -1
  1118. package/renderers/webgpu/WebGPUGeometries.cjs.js +0 -1
  1119. package/renderers/webgpu/WebGPUInfo.cjs.js +0 -1
  1120. package/renderers/webgpu/WebGPUObjects.cjs.js +0 -1
  1121. package/renderers/webgpu/WebGPUProperties.cjs.js +0 -1
  1122. package/renderers/webgpu/WebGPURenderLists.cjs.js +0 -1
  1123. package/renderers/webgpu/WebGPURenderPipelines.cjs.js +0 -1
  1124. package/renderers/webgpu/WebGPURenderer.cjs.js +0 -1
  1125. package/renderers/webgpu/WebGPUSampledTexture.cjs.js +0 -1
  1126. package/renderers/webgpu/WebGPUSampler.cjs.js +0 -1
  1127. package/renderers/webgpu/WebGPUStorageBuffer.cjs.js +0 -1
  1128. package/renderers/webgpu/WebGPUTextureRenderer.cjs.js +0 -1
  1129. package/renderers/webgpu/WebGPUTextureUtils.cjs.js +0 -1
  1130. package/renderers/webgpu/WebGPUTextures.cjs.js +0 -1
  1131. package/renderers/webgpu/WebGPUUniform.cjs.js +0 -1
  1132. package/renderers/webgpu/WebGPUUniformsGroup.cjs.js +0 -1
  1133. package/renderers/webgpu/constants.cjs.js +0 -1
  1134. package/renderers/webgpu/nodes/ShaderLib.cjs.js +0 -1
  1135. package/renderers/webgpu/nodes/WebGPUNodeBuilder.cjs.js +0 -1
  1136. package/renderers/webgpu/nodes/WebGPUNodeUniform.cjs.js +0 -1
  1137. package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.cjs.js +0 -1
  1138. package/renderers/webgpu/nodes/WebGPUNodes.cjs.js +0 -1
  1139. package/shaders/ACESFilmicToneMappingShader.cjs.js +0 -1
  1140. package/shaders/AfterimageShader.cjs.js +0 -1
  1141. package/shaders/BasicShader.cjs.js +0 -1
  1142. package/shaders/BleachBypassShader.cjs.js +0 -1
  1143. package/shaders/BlendShader.cjs.js +0 -1
  1144. package/shaders/BokehShader.cjs.js +0 -1
  1145. package/shaders/BokehShader2.cjs.js +0 -1
  1146. package/shaders/BrightnessContrastShader.cjs.js +0 -1
  1147. package/shaders/ColorCorrectionShader.cjs.js +0 -1
  1148. package/shaders/ColorifyShader.cjs.js +0 -1
  1149. package/shaders/ConvolutionShader.cjs.js +0 -1
  1150. package/shaders/CopyShader.cjs.js +0 -1
  1151. package/shaders/DOFMipMapShader.cjs.js +0 -1
  1152. package/shaders/DepthLimitedBlurShader.cjs.js +0 -1
  1153. package/shaders/DigitalGlitch.cjs.js +0 -1
  1154. package/shaders/DotScreenShader.cjs.js +0 -1
  1155. package/shaders/FXAAShader.cjs.js +0 -1
  1156. package/shaders/FilmShader.cjs.js +0 -1
  1157. package/shaders/FocusShader.cjs.js +0 -1
  1158. package/shaders/FreiChenShader.cjs.js +0 -1
  1159. package/shaders/FresnelShader.cjs.js +0 -1
  1160. package/shaders/GammaCorrectionShader.cjs.js +0 -1
  1161. package/shaders/GodRaysShader.cjs.js +0 -1
  1162. package/shaders/HalftoneShader.cjs.js +0 -1
  1163. package/shaders/HorizontalBlurShader.cjs.js +0 -1
  1164. package/shaders/HorizontalTiltShiftShader.cjs.js +0 -1
  1165. package/shaders/HueSaturationShader.cjs.js +0 -1
  1166. package/shaders/KaleidoShader.cjs.js +0 -1
  1167. package/shaders/LuminosityHighPassShader.cjs.js +0 -1
  1168. package/shaders/LuminosityShader.cjs.js +0 -1
  1169. package/shaders/MirrorShader.cjs.js +0 -1
  1170. package/shaders/NormalMapShader.cjs.js +0 -1
  1171. package/shaders/ParallaxShader.cjs.js +0 -1
  1172. package/shaders/PixelShader.cjs.js +0 -1
  1173. package/shaders/RGBShiftShader.cjs.js +0 -1
  1174. package/shaders/SAOShader.cjs.js +0 -1
  1175. package/shaders/SMAAShader.cjs.js +0 -1
  1176. package/shaders/SSAOShader.cjs.js +0 -1
  1177. package/shaders/SSRShader.cjs.js +0 -1
  1178. package/shaders/SepiaShader.cjs.js +0 -1
  1179. package/shaders/SobelOperatorShader.cjs.js +0 -1
  1180. package/shaders/SubsurfaceScatteringShader.cjs.js +0 -1
  1181. package/shaders/TechnicolorShader.cjs.js +0 -1
  1182. package/shaders/ToneMapShader.cjs.js +0 -1
  1183. package/shaders/ToonShader.cjs.js +0 -1
  1184. package/shaders/TriangleBlurShader.cjs.js +0 -1
  1185. package/shaders/UnpackDepthRGBAShader.cjs.js +0 -1
  1186. package/shaders/VerticalBlurShader.cjs.js +0 -1
  1187. package/shaders/VerticalTiltShiftShader.cjs.js +0 -1
  1188. package/shaders/VignetteShader.cjs.js +0 -1
  1189. package/shaders/VolumeShader.cjs.js +0 -1
  1190. package/shaders/WaterRefractionShader.cjs.js +0 -1
  1191. package/shaders/index.cjs.js +0 -1
  1192. package/shaders/index.d.ts +0 -54
  1193. package/shaders/index.js +0 -53
  1194. package/shaders/types.cjs.js +0 -1
  1195. package/textures/FlakesTexture.cjs.js +0 -1
  1196. package/types/helpers.cjs.js +0 -1
  1197. package/types/shared.cjs.js +0 -1
  1198. package/types/shared.js +0 -1
  1199. package/types/utils.cjs.js +0 -1
  1200. package/types/utils.js +0 -1
  1201. package/utils/BufferGeometryUtils.cjs.js +0 -1
  1202. package/utils/GeometryCompressionUtils.cjs.js +0 -1
  1203. package/utils/GeometryUtils.cjs.js +0 -1
  1204. package/utils/LDrawUtils.cjs.js +0 -1
  1205. package/utils/LDrawUtils.d.ts +0 -5
  1206. package/utils/LDrawUtils.js +0 -144
  1207. package/utils/RoughnessMipmapper.cjs.js +0 -1
  1208. package/utils/SceneUtils.cjs.js +0 -1
  1209. package/utils/ShadowMapViewer.cjs.js +0 -1
  1210. package/utils/SkeletonUtils.cjs.js +0 -1
  1211. package/utils/UVsDebug.cjs.js +0 -1
  1212. package/utils/WorkerPool.cjs.js +0 -1
  1213. package/webxr/ARButton.cjs.js +0 -1
  1214. package/webxr/OculusHandModel.cjs.js +0 -1
  1215. package/webxr/OculusHandPointerModel.cjs.js +0 -1
  1216. package/webxr/Text2D.cjs.js +0 -1
  1217. package/webxr/VRButton.cjs.js +0 -1
  1218. package/webxr/XRControllerModelFactory.cjs.js +0 -1
  1219. package/webxr/XREstimatedLight.cjs.js +0 -1
  1220. package/webxr/XRHandMeshModel.cjs.js +0 -1
  1221. package/webxr/XRHandModelFactory.cjs.js +0 -1
  1222. package/webxr/XRHandPrimitiveModel.cjs.js +0 -1
@@ -1,7 +1,6 @@
1
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
- import { Matrix4, EventDispatcher, EllipseCurve, BufferGeometry, MathUtils, Vector3, GridHelper, LineBasicMaterial, Line, Raycaster, Vector2, Quaternion, Group, Box3, Sphere } from 'three';
3
-
4
- //trackball state
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const THREE = require("three");
5
4
  const STATE = {
6
5
  IDLE: Symbol(),
7
6
  ROTATE: Symbol(),
@@ -21,604 +20,300 @@ const INPUT = {
21
20
  TWO_FINGER: Symbol(),
22
21
  MULT_FINGER: Symbol(),
23
22
  CURSOR: Symbol()
24
- }; //cursor center coordinates
25
-
23
+ };
26
24
  const _center = {
27
25
  x: 0,
28
26
  y: 0
29
- }; //transformation matrices for gizmos and camera
30
-
31
- const _transformation = {
32
- camera: new Matrix4(),
33
- gizmos: new Matrix4()
34
- }; //events
35
-
36
- const _changeEvent = {
37
- type: 'change'
38
27
  };
39
- const _startEvent = {
40
- type: 'start'
41
- };
42
- const _endEvent = {
43
- type: 'end'
28
+ const _transformation = {
29
+ camera: new THREE.Matrix4(),
30
+ gizmos: new THREE.Matrix4()
44
31
  };
45
- /**
46
- *
47
- * @param {CamOrthographicCamera | PerspectiveCameraera} camera Virtual camera used in the scene
48
- * @param {HTMLElement=null} domElement Renderer's dom element
49
- * @param {Scene=null} scene The scene to be rendered
50
- */
51
-
52
- class ArcballControls extends EventDispatcher {
53
- constructor(_camera, _domElement = null, scene = null) {
32
+ const _changeEvent = { type: "change" };
33
+ const _startEvent = { type: "start" };
34
+ const _endEvent = { type: "end" };
35
+ class ArcballControls extends THREE.EventDispatcher {
36
+ constructor(camera, domElement = null, scene = null) {
54
37
  super();
55
-
56
- _defineProperty(this, "camera", void 0);
57
-
58
- _defineProperty(this, "domElement", void 0);
59
-
60
- _defineProperty(this, "scene", void 0);
61
-
62
- _defineProperty(this, "mouseActions", void 0);
63
-
64
- _defineProperty(this, "_mouseOp", void 0);
65
-
66
- _defineProperty(this, "_v2_1", void 0);
67
-
68
- _defineProperty(this, "_v3_1", void 0);
69
-
70
- _defineProperty(this, "_v3_2", void 0);
71
-
72
- _defineProperty(this, "_m4_1", void 0);
73
-
74
- _defineProperty(this, "_m4_2", void 0);
75
-
76
- _defineProperty(this, "_quat", void 0);
77
-
78
- _defineProperty(this, "_translationMatrix", void 0);
79
-
80
- _defineProperty(this, "_rotationMatrix", void 0);
81
-
82
- _defineProperty(this, "_scaleMatrix", void 0);
83
-
84
- _defineProperty(this, "_rotationAxis", void 0);
85
-
86
- _defineProperty(this, "_cameraMatrixState", void 0);
87
-
88
- _defineProperty(this, "_cameraProjectionState", void 0);
89
-
90
- _defineProperty(this, "_fovState", void 0);
91
-
92
- _defineProperty(this, "_upState", void 0);
93
-
94
- _defineProperty(this, "_zoomState", void 0);
95
-
96
- _defineProperty(this, "_nearPos", void 0);
97
-
98
- _defineProperty(this, "_farPos", void 0);
99
-
100
- _defineProperty(this, "_gizmoMatrixState", void 0);
101
-
102
- _defineProperty(this, "_up0", void 0);
103
-
104
- _defineProperty(this, "_zoom0", void 0);
105
-
106
- _defineProperty(this, "_fov0", void 0);
107
-
108
- _defineProperty(this, "_initialNear", void 0);
109
-
110
- _defineProperty(this, "_nearPos0", void 0);
111
-
112
- _defineProperty(this, "_initialFar", void 0);
113
-
114
- _defineProperty(this, "_farPos0", void 0);
115
-
116
- _defineProperty(this, "_cameraMatrixState0", void 0);
117
-
118
- _defineProperty(this, "_gizmoMatrixState0", void 0);
119
-
120
- _defineProperty(this, "_button", void 0);
121
-
122
- _defineProperty(this, "_touchStart", void 0);
123
-
124
- _defineProperty(this, "_touchCurrent", void 0);
125
-
126
- _defineProperty(this, "_input", void 0);
127
-
128
- _defineProperty(this, "_switchSensibility", void 0);
129
-
130
- _defineProperty(this, "_startFingerDistance", void 0);
131
-
132
- _defineProperty(this, "_currentFingerDistance", void 0);
133
-
134
- _defineProperty(this, "_startFingerRotation", void 0);
135
-
136
- _defineProperty(this, "_currentFingerRotation", void 0);
137
-
138
- _defineProperty(this, "_devPxRatio", void 0);
139
-
140
- _defineProperty(this, "_downValid", void 0);
141
-
142
- _defineProperty(this, "_nclicks", void 0);
143
-
144
- _defineProperty(this, "_downEvents", void 0);
145
-
146
- _defineProperty(this, "_clickStart", void 0);
147
-
148
- _defineProperty(this, "_maxDownTime", void 0);
149
-
150
- _defineProperty(this, "_maxInterval", void 0);
151
-
152
- _defineProperty(this, "_posThreshold", void 0);
153
-
154
- _defineProperty(this, "_movementThreshold", void 0);
155
-
156
- _defineProperty(this, "_currentCursorPosition", void 0);
157
-
158
- _defineProperty(this, "_startCursorPosition", void 0);
159
-
160
- _defineProperty(this, "_grid", void 0);
161
-
162
- _defineProperty(this, "_gridPosition", void 0);
163
-
164
- _defineProperty(this, "_gizmos", void 0);
165
-
166
- _defineProperty(this, "_curvePts", void 0);
167
-
168
- _defineProperty(this, "_timeStart", void 0);
169
-
170
- _defineProperty(this, "_animationId", void 0);
171
-
172
- _defineProperty(this, "focusAnimationTime", void 0);
173
-
174
- _defineProperty(this, "_timePrev", void 0);
175
-
176
- _defineProperty(this, "_timeCurrent", void 0);
177
-
178
- _defineProperty(this, "_anglePrev", void 0);
179
-
180
- _defineProperty(this, "_angleCurrent", void 0);
181
-
182
- _defineProperty(this, "_cursorPosPrev", void 0);
183
-
184
- _defineProperty(this, "_cursorPosCurr", void 0);
185
-
186
- _defineProperty(this, "_wPrev", void 0);
187
-
188
- _defineProperty(this, "_wCurr", void 0);
189
-
190
- _defineProperty(this, "adjustNearFar", void 0);
191
-
192
- _defineProperty(this, "scaleFactor", void 0);
193
-
194
- _defineProperty(this, "dampingFactor", void 0);
195
-
196
- _defineProperty(this, "wMax", void 0);
197
-
198
- _defineProperty(this, "enableAnimations", void 0);
199
-
200
- _defineProperty(this, "enableGrid", void 0);
201
-
202
- _defineProperty(this, "cursorZoom", void 0);
203
-
204
- _defineProperty(this, "minFov", void 0);
205
-
206
- _defineProperty(this, "maxFov", void 0);
207
-
208
- _defineProperty(this, "enabled", void 0);
209
-
210
- _defineProperty(this, "enablePan", void 0);
211
-
212
- _defineProperty(this, "enableRotate", void 0);
213
-
214
- _defineProperty(this, "enableZoom", void 0);
215
-
216
- _defineProperty(this, "minDistance", void 0);
217
-
218
- _defineProperty(this, "maxDistance", void 0);
219
-
220
- _defineProperty(this, "minZoom", void 0);
221
-
222
- _defineProperty(this, "maxZoom", void 0);
223
-
224
- _defineProperty(this, "target", void 0);
225
-
226
- _defineProperty(this, "_currentTarget", void 0);
227
-
228
- _defineProperty(this, "_tbRadius", void 0);
229
-
230
- _defineProperty(this, "_state", void 0);
231
-
232
- _defineProperty(this, "onWindowResize", () => {
38
+ this.onWindowResize = () => {
233
39
  const scale = (this._gizmos.scale.x + this._gizmos.scale.y + this._gizmos.scale.z) / 3;
234
-
235
40
  if (this.camera) {
236
41
  const tbRadius = this.calculateTbRadius(this.camera);
237
-
238
- if (tbRadius !== undefined) {
42
+ if (tbRadius !== void 0) {
239
43
  this._tbRadius = tbRadius;
240
44
  }
241
45
  }
242
-
243
- const newRadius = this._tbRadius / scale; // @ts-expect-error
244
-
245
- const curve = new EllipseCurve(0, 0, newRadius, newRadius);
46
+ const newRadius = this._tbRadius / scale;
47
+ const curve = new THREE.EllipseCurve(0, 0, newRadius, newRadius);
246
48
  const points = curve.getPoints(this._curvePts);
247
- const curveGeometry = new BufferGeometry().setFromPoints(points);
248
-
49
+ const curveGeometry = new THREE.BufferGeometry().setFromPoints(points);
249
50
  for (const gizmo in this._gizmos.children) {
250
51
  const child = this._gizmos.children[gizmo];
251
52
  child.geometry = curveGeometry;
252
53
  }
253
-
254
54
  this.dispatchEvent(_changeEvent);
255
- });
256
-
257
- _defineProperty(this, "onContextMenu", event => {
55
+ };
56
+ this.onContextMenu = (event) => {
258
57
  if (!this.enabled) {
259
58
  return;
260
59
  }
261
-
262
60
  for (let i = 0; i < this.mouseActions.length; i++) {
263
61
  if (this.mouseActions[i].mouse == 2) {
264
- //prevent only if button 2 is actually used
265
62
  event.preventDefault();
266
63
  break;
267
64
  }
268
65
  }
269
- });
270
-
271
- _defineProperty(this, "onPointerCancel", () => {
66
+ };
67
+ this.onPointerCancel = () => {
272
68
  this._touchStart.splice(0, this._touchStart.length);
273
-
274
69
  this._touchCurrent.splice(0, this._touchCurrent.length);
275
-
276
70
  this._input = INPUT.NONE;
277
- });
278
-
279
- _defineProperty(this, "onPointerDown", event => {
71
+ };
72
+ this.onPointerDown = (event) => {
280
73
  if (event.button == 0 && event.isPrimary) {
281
74
  this._downValid = true;
282
-
283
75
  this._downEvents.push(event);
284
76
  } else {
285
77
  this._downValid = false;
286
78
  }
287
-
288
- if (event.pointerType == 'touch' && this._input != INPUT.CURSOR) {
79
+ if (event.pointerType == "touch" && this._input != INPUT.CURSOR) {
289
80
  this._touchStart.push(event);
290
-
291
81
  this._touchCurrent.push(event);
292
-
293
82
  switch (this._input) {
294
83
  case INPUT.NONE:
295
- //singleStart
296
84
  this._input = INPUT.ONE_FINGER;
297
- this.onSinglePanStart(event, 'ROTATE');
298
- window.addEventListener('pointermove', this.onPointerMove);
299
- window.addEventListener('pointerup', this.onPointerUp);
85
+ this.onSinglePanStart(event, "ROTATE");
86
+ window.addEventListener("pointermove", this.onPointerMove);
87
+ window.addEventListener("pointerup", this.onPointerUp);
300
88
  break;
301
-
302
89
  case INPUT.ONE_FINGER:
303
90
  case INPUT.ONE_FINGER_SWITCHED:
304
- //doubleStart
305
91
  this._input = INPUT.TWO_FINGER;
306
92
  this.onRotateStart();
307
93
  this.onPinchStart();
308
94
  this.onDoublePanStart();
309
95
  break;
310
-
311
96
  case INPUT.TWO_FINGER:
312
- //multipleStart
313
97
  this._input = INPUT.MULT_FINGER;
314
98
  this.onTriplePanStart();
315
99
  break;
316
100
  }
317
- } else if (event.pointerType != 'touch' && this._input == INPUT.NONE) {
101
+ } else if (event.pointerType != "touch" && this._input == INPUT.NONE) {
318
102
  let modifier = null;
319
-
320
103
  if (event.ctrlKey || event.metaKey) {
321
- modifier = 'CTRL';
104
+ modifier = "CTRL";
322
105
  } else if (event.shiftKey) {
323
- modifier = 'SHIFT';
106
+ modifier = "SHIFT";
324
107
  }
325
-
326
108
  this._mouseOp = this.getOpFromAction(event.button, modifier);
327
-
328
109
  if (this._mouseOp) {
329
- window.addEventListener('pointermove', this.onPointerMove);
330
- window.addEventListener('pointerup', this.onPointerUp); //singleStart
331
-
110
+ window.addEventListener("pointermove", this.onPointerMove);
111
+ window.addEventListener("pointerup", this.onPointerUp);
332
112
  this._input = INPUT.CURSOR;
333
113
  this._button = event.button;
334
114
  this.onSinglePanStart(event, this._mouseOp);
335
115
  }
336
116
  }
337
- });
338
-
339
- _defineProperty(this, "onPointerMove", event => {
340
- if (event.pointerType == 'touch' && this._input != INPUT.CURSOR) {
117
+ };
118
+ this.onPointerMove = (event) => {
119
+ if (event.pointerType == "touch" && this._input != INPUT.CURSOR) {
341
120
  switch (this._input) {
342
121
  case INPUT.ONE_FINGER:
343
- //singleMove
344
122
  this.updateTouchEvent(event);
345
123
  this.onSinglePanMove(event, STATE.ROTATE);
346
124
  break;
347
-
348
125
  case INPUT.ONE_FINGER_SWITCHED:
349
126
  const movement = this.calculatePointersDistance(this._touchCurrent[0], event) * this._devPxRatio;
350
-
351
127
  if (movement >= this._switchSensibility) {
352
- //singleMove
353
128
  this._input = INPUT.ONE_FINGER;
354
129
  this.updateTouchEvent(event);
355
- this.onSinglePanStart(event, 'ROTATE');
130
+ this.onSinglePanStart(event, "ROTATE");
356
131
  break;
357
132
  }
358
-
359
133
  break;
360
-
361
134
  case INPUT.TWO_FINGER:
362
- //rotate/pan/pinchMove
363
135
  this.updateTouchEvent(event);
364
136
  this.onRotateMove();
365
137
  this.onPinchMove();
366
138
  this.onDoublePanMove();
367
139
  break;
368
-
369
140
  case INPUT.MULT_FINGER:
370
- //multMove
371
141
  this.updateTouchEvent(event);
372
142
  this.onTriplePanMove();
373
143
  break;
374
144
  }
375
- } else if (event.pointerType != 'touch' && this._input == INPUT.CURSOR) {
145
+ } else if (event.pointerType != "touch" && this._input == INPUT.CURSOR) {
376
146
  let modifier = null;
377
-
378
147
  if (event.ctrlKey || event.metaKey) {
379
- modifier = 'CTRL';
148
+ modifier = "CTRL";
380
149
  } else if (event.shiftKey) {
381
- modifier = 'SHIFT';
150
+ modifier = "SHIFT";
382
151
  }
383
-
384
152
  const mouseOpState = this.getOpStateFromAction(this._button, modifier);
385
-
386
153
  if (mouseOpState) {
387
154
  this.onSinglePanMove(event, mouseOpState);
388
155
  }
389
- } //checkDistance
390
-
391
-
156
+ }
392
157
  if (this._downValid) {
393
158
  const movement = this.calculatePointersDistance(this._downEvents[this._downEvents.length - 1], event) * this._devPxRatio;
394
-
395
159
  if (movement > this._movementThreshold) {
396
160
  this._downValid = false;
397
161
  }
398
162
  }
399
- });
400
-
401
- _defineProperty(this, "onPointerUp", event => {
402
- if (event.pointerType == 'touch' && this._input != INPUT.CURSOR) {
163
+ };
164
+ this.onPointerUp = (event) => {
165
+ if (event.pointerType == "touch" && this._input != INPUT.CURSOR) {
403
166
  const nTouch = this._touchCurrent.length;
404
-
405
167
  for (let i = 0; i < nTouch; i++) {
406
168
  if (this._touchCurrent[i].pointerId == event.pointerId) {
407
169
  this._touchCurrent.splice(i, 1);
408
-
409
170
  this._touchStart.splice(i, 1);
410
-
411
171
  break;
412
172
  }
413
173
  }
414
-
415
174
  switch (this._input) {
416
175
  case INPUT.ONE_FINGER:
417
176
  case INPUT.ONE_FINGER_SWITCHED:
418
- //singleEnd
419
- window.removeEventListener('pointermove', this.onPointerMove);
420
- window.removeEventListener('pointerup', this.onPointerUp);
177
+ window.removeEventListener("pointermove", this.onPointerMove);
178
+ window.removeEventListener("pointerup", this.onPointerUp);
421
179
  this._input = INPUT.NONE;
422
180
  this.onSinglePanEnd();
423
181
  break;
424
-
425
182
  case INPUT.TWO_FINGER:
426
- //doubleEnd
427
183
  this.onDoublePanEnd();
428
184
  this.onPinchEnd();
429
- this.onRotateEnd(); //switching to singleStart
430
-
185
+ this.onRotateEnd();
431
186
  this._input = INPUT.ONE_FINGER_SWITCHED;
432
187
  break;
433
-
434
188
  case INPUT.MULT_FINGER:
435
189
  if (this._touchCurrent.length == 0) {
436
- window.removeEventListener('pointermove', this.onPointerMove);
437
- window.removeEventListener('pointerup', this.onPointerUp); //multCancel
438
-
190
+ window.removeEventListener("pointermove", this.onPointerMove);
191
+ window.removeEventListener("pointerup", this.onPointerUp);
439
192
  this._input = INPUT.NONE;
440
193
  this.onTriplePanEnd();
441
194
  }
442
-
443
195
  break;
444
196
  }
445
- } else if (event.pointerType != 'touch' && this._input == INPUT.CURSOR) {
446
- window.removeEventListener('pointermove', this.onPointerMove);
447
- window.removeEventListener('pointerup', this.onPointerUp);
197
+ } else if (event.pointerType != "touch" && this._input == INPUT.CURSOR) {
198
+ window.removeEventListener("pointermove", this.onPointerMove);
199
+ window.removeEventListener("pointerup", this.onPointerUp);
448
200
  this._input = INPUT.NONE;
449
201
  this.onSinglePanEnd();
450
202
  this._button = -1;
451
203
  }
452
-
453
204
  if (event.isPrimary) {
454
205
  if (this._downValid) {
455
206
  const downTime = event.timeStamp - this._downEvents[this._downEvents.length - 1].timeStamp;
456
-
457
207
  if (downTime <= this._maxDownTime) {
458
208
  if (this._nclicks == 0) {
459
- //first valid click detected
460
209
  this._nclicks = 1;
461
210
  this._clickStart = performance.now();
462
211
  } else {
463
212
  const clickInterval = event.timeStamp - this._clickStart;
464
-
465
213
  const movement = this.calculatePointersDistance(this._downEvents[1], this._downEvents[0]) * this._devPxRatio;
466
-
467
214
  if (clickInterval <= this._maxInterval && movement <= this._posThreshold) {
468
- //second valid click detected
469
- //fire double tap and reset values
470
215
  this._nclicks = 0;
471
-
472
216
  this._downEvents.splice(0, this._downEvents.length);
473
-
474
217
  this.onDoubleTap(event);
475
218
  } else {
476
- //new 'first click'
477
219
  this._nclicks = 1;
478
-
479
220
  this._downEvents.shift();
480
-
481
221
  this._clickStart = performance.now();
482
222
  }
483
223
  }
484
224
  } else {
485
225
  this._downValid = false;
486
226
  this._nclicks = 0;
487
-
488
227
  this._downEvents.splice(0, this._downEvents.length);
489
228
  }
490
229
  } else {
491
230
  this._nclicks = 0;
492
-
493
231
  this._downEvents.splice(0, this._downEvents.length);
494
232
  }
495
233
  }
496
- });
497
-
498
- _defineProperty(this, "onWheel", event => {
499
- var _this$camera3;
500
-
234
+ };
235
+ this.onWheel = (event) => {
236
+ var _a, _b, _c, _d, _e;
501
237
  if (this.enabled && this.enableZoom && this.domElement) {
502
238
  let modifier = null;
503
-
504
239
  if (event.ctrlKey || event.metaKey) {
505
- modifier = 'CTRL';
240
+ modifier = "CTRL";
506
241
  } else if (event.shiftKey) {
507
- modifier = 'SHIFT';
242
+ modifier = "SHIFT";
508
243
  }
509
-
510
- const mouseOp = this.getOpFromAction('WHEEL', modifier);
511
-
244
+ const mouseOp = this.getOpFromAction("WHEEL", modifier);
512
245
  if (mouseOp) {
513
246
  event.preventDefault();
514
247
  this.dispatchEvent(_startEvent);
515
- const notchDeltaY = 125; //distance of one notch of mouse wheel
516
-
248
+ const notchDeltaY = 125;
517
249
  let sgn = event.deltaY / notchDeltaY;
518
250
  let size = 1;
519
-
520
251
  if (sgn > 0) {
521
252
  size = 1 / this.scaleFactor;
522
253
  } else if (sgn < 0) {
523
254
  size = this.scaleFactor;
524
255
  }
525
-
526
256
  switch (mouseOp) {
527
- case 'ZOOM':
257
+ case "ZOOM":
528
258
  this.updateTbState(STATE.SCALE, true);
529
-
530
259
  if (sgn > 0) {
531
260
  size = 1 / Math.pow(this.scaleFactor, sgn);
532
261
  } else if (sgn < 0) {
533
262
  size = Math.pow(this.scaleFactor, -sgn);
534
263
  }
535
-
536
264
  if (this.cursorZoom && this.enablePan) {
537
- var _this$camera, _this$camera2;
538
-
539
265
  let scalePoint;
540
-
541
- if (((_this$camera = this.camera) === null || _this$camera === void 0 ? void 0 : _this$camera.type) === 'OrthographicCamera') {
542
- var _this$unprojectOnTbPl;
543
-
544
- scalePoint = (_this$unprojectOnTbPl = this.unprojectOnTbPlane(this.camera, event.clientX, event.clientY, this.domElement)) === null || _this$unprojectOnTbPl === void 0 ? void 0 : _this$unprojectOnTbPl.applyQuaternion(this.camera.quaternion).multiplyScalar(1 / this.camera.zoom).add(this._gizmos.position);
266
+ if (((_a = this.camera) == null ? void 0 : _a.type) === "OrthographicCamera") {
267
+ scalePoint = (_b = this.unprojectOnTbPlane(this.camera, event.clientX, event.clientY, this.domElement)) == null ? void 0 : _b.applyQuaternion(this.camera.quaternion).multiplyScalar(1 / this.camera.zoom).add(this._gizmos.position);
545
268
  }
546
-
547
- if (((_this$camera2 = this.camera) === null || _this$camera2 === void 0 ? void 0 : _this$camera2.type) === 'PerspectiveCamera') {
548
- var _this$unprojectOnTbPl2;
549
-
550
- scalePoint = (_this$unprojectOnTbPl2 = this.unprojectOnTbPlane(this.camera, event.clientX, event.clientY, this.domElement)) === null || _this$unprojectOnTbPl2 === void 0 ? void 0 : _this$unprojectOnTbPl2.applyQuaternion(this.camera.quaternion).add(this._gizmos.position);
269
+ if (((_c = this.camera) == null ? void 0 : _c.type) === "PerspectiveCamera") {
270
+ scalePoint = (_d = this.unprojectOnTbPlane(this.camera, event.clientX, event.clientY, this.domElement)) == null ? void 0 : _d.applyQuaternion(this.camera.quaternion).add(this._gizmos.position);
551
271
  }
552
-
553
- if (scalePoint !== undefined) this.applyTransformMatrix(this.applyScale(size, scalePoint));
272
+ if (scalePoint !== void 0)
273
+ this.applyTransformMatrix(this.applyScale(size, scalePoint));
554
274
  } else {
555
275
  this.applyTransformMatrix(this.applyScale(size, this._gizmos.position));
556
276
  }
557
-
558
277
  if (this._grid) {
559
278
  this.disposeGrid();
560
279
  this.drawGrid();
561
280
  }
562
-
563
281
  this.updateTbState(STATE.IDLE, false);
564
282
  this.dispatchEvent(_changeEvent);
565
283
  this.dispatchEvent(_endEvent);
566
284
  break;
567
-
568
- case 'FOV':
569
- if (((_this$camera3 = this.camera) === null || _this$camera3 === void 0 ? void 0 : _this$camera3.type) === 'PerspectiveCamera') {
570
- this.updateTbState(STATE.FOV, true); //Vertigo effect
571
- // fov / 2
572
- // |\
573
- // | \
574
- // | \
575
- // x | \
576
- // | \
577
- // | \
578
- // | _ _ _\
579
- // y
580
- //check for iOs shift shortcut
581
-
285
+ case "FOV":
286
+ if (((_e = this.camera) == null ? void 0 : _e.type) === "PerspectiveCamera") {
287
+ this.updateTbState(STATE.FOV, true);
582
288
  if (event.deltaX != 0) {
583
289
  sgn = event.deltaX / notchDeltaY;
584
290
  size = 1;
585
-
586
291
  if (sgn > 0) {
587
292
  size = 1 / Math.pow(this.scaleFactor, sgn);
588
293
  } else if (sgn < 0) {
589
294
  size = Math.pow(this.scaleFactor, -sgn);
590
295
  }
591
296
  }
592
-
593
297
  this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
594
-
595
298
  const x = this._v3_1.distanceTo(this._gizmos.position);
596
-
597
- let xNew = x / size; //distance between camera and gizmos if scale(size, scalepoint) would be performed
598
- //check min and max distance
599
-
600
- xNew = MathUtils.clamp(xNew, this.minDistance, this.maxDistance);
601
- const y = x * Math.tan(MathUtils.DEG2RAD * this.camera.fov * 0.5); //calculate new fov
602
-
603
- let newFov = MathUtils.RAD2DEG * (Math.atan(y / xNew) * 2); //check min and max fov
604
-
299
+ let xNew = x / size;
300
+ xNew = THREE.MathUtils.clamp(xNew, this.minDistance, this.maxDistance);
301
+ const y = x * Math.tan(THREE.MathUtils.DEG2RAD * this.camera.fov * 0.5);
302
+ let newFov = THREE.MathUtils.RAD2DEG * (Math.atan(y / xNew) * 2);
605
303
  if (newFov > this.maxFov) {
606
304
  newFov = this.maxFov;
607
305
  } else if (newFov < this.minFov) {
608
306
  newFov = this.minFov;
609
307
  }
610
-
611
- const newDistance = y / Math.tan(MathUtils.DEG2RAD * (newFov / 2));
308
+ const newDistance = y / Math.tan(THREE.MathUtils.DEG2RAD * (newFov / 2));
612
309
  size = x / newDistance;
613
310
  this.setFov(newFov);
614
311
  this.applyTransformMatrix(this.applyScale(size, this._gizmos.position, false));
615
312
  }
616
-
617
313
  if (this._grid) {
618
314
  this.disposeGrid();
619
315
  this.drawGrid();
620
316
  }
621
-
622
317
  this.updateTbState(STATE.IDLE, false);
623
318
  this.dispatchEvent(_changeEvent);
624
319
  this.dispatchEvent(_endEvent);
@@ -626,19 +321,16 @@ class ArcballControls extends EventDispatcher {
626
321
  }
627
322
  }
628
323
  }
629
- });
630
-
631
- _defineProperty(this, "onSinglePanStart", (event, operation) => {
632
- var _this$camera4;
633
-
324
+ };
325
+ this.onSinglePanStart = (event, operation) => {
326
+ var _a;
634
327
  if (this.enabled && this.domElement) {
635
328
  this.dispatchEvent(_startEvent);
636
329
  this.setCenter(event.clientX, event.clientY);
637
-
638
330
  switch (operation) {
639
- case 'PAN':
640
- if (!this.enablePan) return;
641
-
331
+ case "PAN":
332
+ if (!this.enablePan)
333
+ return;
642
334
  if (this._animationId != -1) {
643
335
  cancelAnimationFrame(this._animationId);
644
336
  this._animationId = -1;
@@ -646,62 +338,48 @@ class ArcballControls extends EventDispatcher {
646
338
  this.activateGizmos(false);
647
339
  this.dispatchEvent(_changeEvent);
648
340
  }
649
-
650
341
  if (this.camera) {
651
342
  this.updateTbState(STATE.PAN, true);
652
343
  const rayDir = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement);
653
-
654
- if (rayDir !== undefined) {
344
+ if (rayDir !== void 0) {
655
345
  this._startCursorPosition.copy(rayDir);
656
346
  }
657
-
658
347
  if (this.enableGrid) {
659
348
  this.drawGrid();
660
349
  this.dispatchEvent(_changeEvent);
661
350
  }
662
351
  }
663
-
664
352
  break;
665
-
666
- case 'ROTATE':
667
- if (!this.enableRotate) return;
668
-
353
+ case "ROTATE":
354
+ if (!this.enableRotate)
355
+ return;
669
356
  if (this._animationId != -1) {
670
357
  cancelAnimationFrame(this._animationId);
671
358
  this._animationId = -1;
672
359
  this._timeStart = -1;
673
360
  }
674
-
675
361
  if (this.camera) {
676
362
  this.updateTbState(STATE.ROTATE, true);
677
363
  const rayDir = this.unprojectOnTbSurface(this.camera, _center.x, _center.y, this.domElement, this._tbRadius);
678
-
679
- if (rayDir !== undefined) {
364
+ if (rayDir !== void 0) {
680
365
  this._startCursorPosition.copy(rayDir);
681
366
  }
682
-
683
367
  this.activateGizmos(true);
684
-
685
368
  if (this.enableAnimations) {
686
369
  this._timePrev = this._timeCurrent = performance.now();
687
370
  this._angleCurrent = this._anglePrev = 0;
688
-
689
371
  this._cursorPosPrev.copy(this._startCursorPosition);
690
-
691
372
  this._cursorPosCurr.copy(this._cursorPosPrev);
692
-
693
373
  this._wCurr = 0;
694
374
  this._wPrev = this._wCurr;
695
375
  }
696
376
  }
697
-
698
377
  this.dispatchEvent(_changeEvent);
699
378
  break;
700
-
701
- case 'FOV':
702
- if (!this.enableZoom) return;
703
-
704
- if (((_this$camera4 = this.camera) === null || _this$camera4 === void 0 ? void 0 : _this$camera4.type) === 'PerspectiveCamera') {
379
+ case "FOV":
380
+ if (!this.enableZoom)
381
+ return;
382
+ if (((_a = this.camera) == null ? void 0 : _a.type) === "PerspectiveCamera") {
705
383
  if (this._animationId != -1) {
706
384
  cancelAnimationFrame(this._animationId);
707
385
  this._animationId = -1;
@@ -709,19 +387,14 @@ class ArcballControls extends EventDispatcher {
709
387
  this.activateGizmos(false);
710
388
  this.dispatchEvent(_changeEvent);
711
389
  }
712
-
713
390
  this.updateTbState(STATE.FOV, true);
714
-
715
391
  this._startCursorPosition.setY(this.getCursorNDC(_center.x, _center.y, this.domElement).y * 0.5);
716
-
717
392
  this._currentCursorPosition.copy(this._startCursorPosition);
718
393
  }
719
-
720
394
  break;
721
-
722
- case 'ZOOM':
723
- if (!this.enableZoom) return;
724
-
395
+ case "ZOOM":
396
+ if (!this.enableZoom)
397
+ return;
725
398
  if (this._animationId != -1) {
726
399
  cancelAnimationFrame(this._animationId);
727
400
  this._animationId = -1;
@@ -729,234 +402,182 @@ class ArcballControls extends EventDispatcher {
729
402
  this.activateGizmos(false);
730
403
  this.dispatchEvent(_changeEvent);
731
404
  }
732
-
733
405
  this.updateTbState(STATE.SCALE, true);
734
-
735
406
  this._startCursorPosition.setY(this.getCursorNDC(_center.x, _center.y, this.domElement).y * 0.5);
736
-
737
407
  this._currentCursorPosition.copy(this._startCursorPosition);
738
-
739
408
  break;
740
409
  }
741
410
  }
742
- });
743
-
744
- _defineProperty(this, "onSinglePanMove", (event, opState) => {
745
- var _this$camera5;
746
-
411
+ };
412
+ this.onSinglePanMove = (event, opState) => {
413
+ var _a;
747
414
  if (this.enabled && this.domElement) {
748
415
  const restart = opState != this._state;
749
416
  this.setCenter(event.clientX, event.clientY);
750
-
751
417
  switch (opState) {
752
418
  case STATE.PAN:
753
419
  if (this.enablePan && this.camera) {
754
420
  if (restart) {
755
- //switch to pan operation
756
421
  this.dispatchEvent(_endEvent);
757
422
  this.dispatchEvent(_startEvent);
758
423
  this.updateTbState(opState, true);
759
424
  const rayDir = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement);
760
-
761
- if (rayDir !== undefined) {
425
+ if (rayDir !== void 0) {
762
426
  this._startCursorPosition.copy(rayDir);
763
427
  }
764
-
765
428
  if (this.enableGrid) {
766
429
  this.drawGrid();
767
430
  }
768
-
769
431
  this.activateGizmos(false);
770
432
  } else {
771
- //continue with pan operation
772
433
  const rayDir = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement);
773
-
774
- if (rayDir !== undefined) {
434
+ if (rayDir !== void 0) {
775
435
  this._currentCursorPosition.copy(rayDir);
776
436
  }
777
-
778
437
  this.applyTransformMatrix(this.pan(this._startCursorPosition, this._currentCursorPosition));
779
438
  }
780
439
  }
781
-
782
440
  break;
783
-
784
441
  case STATE.ROTATE:
785
442
  if (this.enableRotate && this.camera) {
786
443
  if (restart) {
787
- //switch to rotate operation
788
444
  this.dispatchEvent(_endEvent);
789
445
  this.dispatchEvent(_startEvent);
790
446
  this.updateTbState(opState, true);
791
- const rayDir = this.unprojectOnTbSurface(this.camera, _center.x, _center.y, this.domElement, this._tbRadius);
792
-
793
- if (rayDir !== undefined) {
447
+ const rayDir = this.unprojectOnTbSurface(
448
+ this.camera,
449
+ _center.x,
450
+ _center.y,
451
+ this.domElement,
452
+ this._tbRadius
453
+ );
454
+ if (rayDir !== void 0) {
794
455
  this._startCursorPosition.copy(rayDir);
795
456
  }
796
-
797
457
  if (this.enableGrid) {
798
458
  this.disposeGrid();
799
459
  }
800
-
801
460
  this.activateGizmos(true);
802
461
  } else {
803
- //continue with rotate operation
804
- const rayDir = this.unprojectOnTbSurface(this.camera, _center.x, _center.y, this.domElement, this._tbRadius);
805
-
806
- if (rayDir !== undefined) {
462
+ const rayDir = this.unprojectOnTbSurface(
463
+ this.camera,
464
+ _center.x,
465
+ _center.y,
466
+ this.domElement,
467
+ this._tbRadius
468
+ );
469
+ if (rayDir !== void 0) {
807
470
  this._currentCursorPosition.copy(rayDir);
808
471
  }
809
-
810
472
  const distance = this._startCursorPosition.distanceTo(this._currentCursorPosition);
811
-
812
473
  const angle = this._startCursorPosition.angleTo(this._currentCursorPosition);
813
-
814
- const amount = Math.max(distance / this._tbRadius, angle); //effective rotation angle
815
-
816
- this.applyTransformMatrix(this.rotate(this.calculateRotationAxis(this._startCursorPosition, this._currentCursorPosition), amount));
817
-
474
+ const amount = Math.max(distance / this._tbRadius, angle);
475
+ this.applyTransformMatrix(
476
+ this.rotate(this.calculateRotationAxis(this._startCursorPosition, this._currentCursorPosition), amount)
477
+ );
818
478
  if (this.enableAnimations) {
819
479
  this._timePrev = this._timeCurrent;
820
480
  this._timeCurrent = performance.now();
821
481
  this._anglePrev = this._angleCurrent;
822
482
  this._angleCurrent = amount;
823
-
824
483
  this._cursorPosPrev.copy(this._cursorPosCurr);
825
-
826
484
  this._cursorPosCurr.copy(this._currentCursorPosition);
827
-
828
485
  this._wPrev = this._wCurr;
829
- this._wCurr = this.calculateAngularSpeed(this._anglePrev, this._angleCurrent, this._timePrev, this._timeCurrent);
486
+ this._wCurr = this.calculateAngularSpeed(
487
+ this._anglePrev,
488
+ this._angleCurrent,
489
+ this._timePrev,
490
+ this._timeCurrent
491
+ );
830
492
  }
831
493
  }
832
494
  }
833
-
834
495
  break;
835
-
836
496
  case STATE.SCALE:
837
497
  if (this.enableZoom) {
838
498
  if (restart) {
839
- //switch to zoom operation
840
499
  this.dispatchEvent(_endEvent);
841
500
  this.dispatchEvent(_startEvent);
842
501
  this.updateTbState(opState, true);
843
-
844
502
  this._startCursorPosition.setY(this.getCursorNDC(_center.x, _center.y, this.domElement).y * 0.5);
845
-
846
503
  this._currentCursorPosition.copy(this._startCursorPosition);
847
-
848
504
  if (this.enableGrid) {
849
505
  this.disposeGrid();
850
506
  }
851
-
852
507
  this.activateGizmos(false);
853
508
  } else {
854
- //continue with zoom operation
855
- const screenNotches = 8; //how many wheel notches corresponds to a full screen pan
856
-
509
+ const screenNotches = 8;
857
510
  this._currentCursorPosition.setY(this.getCursorNDC(_center.x, _center.y, this.domElement).y * 0.5);
858
-
859
511
  const movement = this._currentCursorPosition.y - this._startCursorPosition.y;
860
512
  let size = 1;
861
-
862
513
  if (movement < 0) {
863
514
  size = 1 / Math.pow(this.scaleFactor, -movement * screenNotches);
864
515
  } else if (movement > 0) {
865
516
  size = Math.pow(this.scaleFactor, movement * screenNotches);
866
517
  }
867
-
868
518
  this.applyTransformMatrix(this.applyScale(size, this._gizmos.position));
869
519
  }
870
520
  }
871
-
872
521
  break;
873
-
874
522
  case STATE.FOV:
875
- if (this.enableZoom && ((_this$camera5 = this.camera) === null || _this$camera5 === void 0 ? void 0 : _this$camera5.type) === 'PerspectiveCamera') {
523
+ if (this.enableZoom && ((_a = this.camera) == null ? void 0 : _a.type) === "PerspectiveCamera") {
876
524
  if (restart) {
877
- //switch to fov operation
878
525
  this.dispatchEvent(_endEvent);
879
526
  this.dispatchEvent(_startEvent);
880
527
  this.updateTbState(opState, true);
881
-
882
528
  this._startCursorPosition.setY(this.getCursorNDC(_center.x, _center.y, this.domElement).y * 0.5);
883
-
884
529
  this._currentCursorPosition.copy(this._startCursorPosition);
885
-
886
530
  if (this.enableGrid) {
887
531
  this.disposeGrid();
888
532
  }
889
-
890
533
  this.activateGizmos(false);
891
534
  } else {
892
- //continue with fov operation
893
- const screenNotches = 8; //how many wheel notches corresponds to a full screen pan
894
-
535
+ const screenNotches = 8;
895
536
  this._currentCursorPosition.setY(this.getCursorNDC(_center.x, _center.y, this.domElement).y * 0.5);
896
-
897
537
  const movement = this._currentCursorPosition.y - this._startCursorPosition.y;
898
538
  let size = 1;
899
-
900
539
  if (movement < 0) {
901
540
  size = 1 / Math.pow(this.scaleFactor, -movement * screenNotches);
902
541
  } else if (movement > 0) {
903
542
  size = Math.pow(this.scaleFactor, movement * screenNotches);
904
543
  }
905
-
906
544
  this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
907
-
908
545
  const x = this._v3_1.distanceTo(this._gizmos.position);
909
-
910
- let xNew = x / size; //distance between camera and gizmos if scale(size, scalepoint) would be performed
911
- //check min and max distance
912
-
913
- xNew = MathUtils.clamp(xNew, this.minDistance, this.maxDistance);
914
- const y = x * Math.tan(MathUtils.DEG2RAD * this._fovState * 0.5); //calculate new fov
915
-
916
- let newFov = MathUtils.RAD2DEG * (Math.atan(y / xNew) * 2); //check min and max fov
917
-
918
- newFov = MathUtils.clamp(newFov, this.minFov, this.maxFov);
919
- const newDistance = y / Math.tan(MathUtils.DEG2RAD * (newFov / 2));
546
+ let xNew = x / size;
547
+ xNew = THREE.MathUtils.clamp(xNew, this.minDistance, this.maxDistance);
548
+ const y = x * Math.tan(THREE.MathUtils.DEG2RAD * this._fovState * 0.5);
549
+ let newFov = THREE.MathUtils.RAD2DEG * (Math.atan(y / xNew) * 2);
550
+ newFov = THREE.MathUtils.clamp(newFov, this.minFov, this.maxFov);
551
+ const newDistance = y / Math.tan(THREE.MathUtils.DEG2RAD * (newFov / 2));
920
552
  size = x / newDistance;
921
-
922
553
  this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
923
-
924
554
  this.setFov(newFov);
925
- this.applyTransformMatrix(this.applyScale(size, this._v3_2, false)); //adjusting distance
926
-
555
+ this.applyTransformMatrix(this.applyScale(size, this._v3_2, false));
927
556
  const direction = this._gizmos.position.clone().sub(this.camera.position).normalize().multiplyScalar(newDistance / x);
928
-
929
557
  this._m4_1.makeTranslation(direction.x, direction.y, direction.z);
930
558
  }
931
559
  }
932
-
933
560
  break;
934
561
  }
935
-
936
562
  this.dispatchEvent(_changeEvent);
937
563
  }
938
- });
939
-
940
- _defineProperty(this, "onSinglePanEnd", () => {
564
+ };
565
+ this.onSinglePanEnd = () => {
941
566
  if (this._state == STATE.ROTATE) {
942
567
  if (!this.enableRotate) {
943
568
  return;
944
569
  }
945
-
946
570
  if (this.enableAnimations) {
947
- //perform rotation animation
948
571
  const deltaTime = performance.now() - this._timeCurrent;
949
-
950
572
  if (deltaTime < 120) {
951
573
  const w = Math.abs((this._wPrev + this._wCurr) / 2);
952
574
  const self = this;
953
- this._animationId = window.requestAnimationFrame(function (t) {
575
+ this._animationId = window.requestAnimationFrame(function(t) {
954
576
  self.updateTbState(STATE.ANIMATION_ROTATE, true);
955
577
  const rotationAxis = self.calculateRotationAxis(self._cursorPosPrev, self._cursorPosCurr);
956
578
  self.onRotationAnim(t, rotationAxis, Math.min(w, self.wMax));
957
579
  });
958
580
  } else {
959
- //cursor has been standing still for over 120 ms since last movement
960
581
  this.updateTbState(STATE.IDLE, false);
961
582
  this.activateGizmos(false);
962
583
  this.dispatchEvent(_changeEvent);
@@ -968,33 +589,26 @@ class ArcballControls extends EventDispatcher {
968
589
  }
969
590
  } else if (this._state == STATE.PAN || this._state == STATE.IDLE) {
970
591
  this.updateTbState(STATE.IDLE, false);
971
-
972
592
  if (this.enableGrid) {
973
593
  this.disposeGrid();
974
594
  }
975
-
976
595
  this.activateGizmos(false);
977
596
  this.dispatchEvent(_changeEvent);
978
597
  }
979
-
980
598
  this.dispatchEvent(_endEvent);
981
- });
982
-
983
- _defineProperty(this, "onDoubleTap", event => {
599
+ };
600
+ this.onDoubleTap = (event) => {
984
601
  if (this.enabled && this.enablePan && this.scene && this.camera && this.domElement) {
985
602
  this.dispatchEvent(_startEvent);
986
603
  this.setCenter(event.clientX, event.clientY);
987
604
  const hitP = this.unprojectOnObj(this.getCursorNDC(_center.x, _center.y, this.domElement), this.camera);
988
-
989
605
  if (hitP && this.enableAnimations) {
990
606
  const self = this;
991
-
992
607
  if (this._animationId != -1) {
993
608
  window.cancelAnimationFrame(this._animationId);
994
609
  }
995
-
996
610
  this._timeStart = -1;
997
- this._animationId = window.requestAnimationFrame(function (t) {
611
+ this._animationId = window.requestAnimationFrame(function(t) {
998
612
  self.updateTbState(STATE.ANIMATION_FOCUS, true);
999
613
  self.onFocusAnim(t, hitP, self._cameraMatrixState, self._gizmoMatrixState);
1000
614
  });
@@ -1005,106 +619,90 @@ class ArcballControls extends EventDispatcher {
1005
619
  this.dispatchEvent(_changeEvent);
1006
620
  }
1007
621
  }
1008
-
1009
622
  this.dispatchEvent(_endEvent);
1010
- });
1011
-
1012
- _defineProperty(this, "onDoublePanStart", () => {
623
+ };
624
+ this.onDoublePanStart = () => {
1013
625
  if (this.enabled && this.enablePan && this.camera && this.domElement) {
1014
626
  this.dispatchEvent(_startEvent);
1015
627
  this.updateTbState(STATE.PAN, true);
1016
- this.setCenter((this._touchCurrent[0].clientX + this._touchCurrent[1].clientX) / 2, (this._touchCurrent[0].clientY + this._touchCurrent[1].clientY) / 2);
628
+ this.setCenter(
629
+ (this._touchCurrent[0].clientX + this._touchCurrent[1].clientX) / 2,
630
+ (this._touchCurrent[0].clientY + this._touchCurrent[1].clientY) / 2
631
+ );
1017
632
  const rayDir = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement, true);
1018
-
1019
- if (rayDir !== undefined) {
633
+ if (rayDir !== void 0) {
1020
634
  this._startCursorPosition.copy(rayDir);
1021
635
  }
1022
-
1023
636
  this._currentCursorPosition.copy(this._startCursorPosition);
1024
-
1025
637
  this.activateGizmos(false);
1026
638
  }
1027
- });
1028
-
1029
- _defineProperty(this, "onDoublePanMove", () => {
639
+ };
640
+ this.onDoublePanMove = () => {
1030
641
  if (this.enabled && this.enablePan && this.camera && this.domElement) {
1031
- this.setCenter((this._touchCurrent[0].clientX + this._touchCurrent[1].clientX) / 2, (this._touchCurrent[0].clientY + this._touchCurrent[1].clientY) / 2);
1032
-
642
+ this.setCenter(
643
+ (this._touchCurrent[0].clientX + this._touchCurrent[1].clientX) / 2,
644
+ (this._touchCurrent[0].clientY + this._touchCurrent[1].clientY) / 2
645
+ );
1033
646
  if (this._state != STATE.PAN) {
1034
647
  this.updateTbState(STATE.PAN, true);
1035
-
1036
648
  this._startCursorPosition.copy(this._currentCursorPosition);
1037
649
  }
1038
-
1039
650
  const rayDir = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement, true);
1040
- if (rayDir !== undefined) this._currentCursorPosition.copy(rayDir);
651
+ if (rayDir !== void 0)
652
+ this._currentCursorPosition.copy(rayDir);
1041
653
  this.applyTransformMatrix(this.pan(this._startCursorPosition, this._currentCursorPosition, true));
1042
654
  this.dispatchEvent(_changeEvent);
1043
655
  }
1044
- });
1045
-
1046
- _defineProperty(this, "onDoublePanEnd", () => {
656
+ };
657
+ this.onDoublePanEnd = () => {
1047
658
  this.updateTbState(STATE.IDLE, false);
1048
659
  this.dispatchEvent(_endEvent);
1049
- });
1050
-
1051
- _defineProperty(this, "onRotateStart", () => {
660
+ };
661
+ this.onRotateStart = () => {
662
+ var _a;
1052
663
  if (this.enabled && this.enableRotate) {
1053
- var _this$camera6;
1054
-
1055
664
  this.dispatchEvent(_startEvent);
1056
- this.updateTbState(STATE.ZROTATE, true); //this._startFingerRotation = event.rotation;
1057
-
665
+ this.updateTbState(STATE.ZROTATE, true);
1058
666
  this._startFingerRotation = this.getAngle(this._touchCurrent[1], this._touchCurrent[0]) + this.getAngle(this._touchStart[1], this._touchStart[0]);
1059
667
  this._currentFingerRotation = this._startFingerRotation;
1060
- (_this$camera6 = this.camera) === null || _this$camera6 === void 0 ? void 0 : _this$camera6.getWorldDirection(this._rotationAxis); //rotation axis
1061
-
668
+ (_a = this.camera) == null ? void 0 : _a.getWorldDirection(this._rotationAxis);
1062
669
  if (!this.enablePan && !this.enableZoom) {
1063
670
  this.activateGizmos(true);
1064
671
  }
1065
672
  }
1066
- });
1067
-
1068
- _defineProperty(this, "onRotateMove", () => {
673
+ };
674
+ this.onRotateMove = () => {
675
+ var _a;
1069
676
  if (this.enabled && this.enableRotate && this.camera && this.domElement) {
1070
- this.setCenter((this._touchCurrent[0].clientX + this._touchCurrent[1].clientX) / 2, (this._touchCurrent[0].clientY + this._touchCurrent[1].clientY) / 2);
677
+ this.setCenter(
678
+ (this._touchCurrent[0].clientX + this._touchCurrent[1].clientX) / 2,
679
+ (this._touchCurrent[0].clientY + this._touchCurrent[1].clientY) / 2
680
+ );
1071
681
  let rotationPoint;
1072
-
1073
682
  if (this._state != STATE.ZROTATE) {
1074
683
  this.updateTbState(STATE.ZROTATE, true);
1075
684
  this._startFingerRotation = this._currentFingerRotation;
1076
- } //this._currentFingerRotation = event.rotation;
1077
-
1078
-
685
+ }
1079
686
  this._currentFingerRotation = this.getAngle(this._touchCurrent[1], this._touchCurrent[0]) + this.getAngle(this._touchStart[1], this._touchStart[0]);
1080
-
1081
687
  if (!this.enablePan) {
1082
- rotationPoint = new Vector3().setFromMatrixPosition(this._gizmoMatrixState);
688
+ rotationPoint = new THREE.Vector3().setFromMatrixPosition(this._gizmoMatrixState);
1083
689
  } else if (this.camera) {
1084
- var _this$unprojectOnTbPl3;
1085
-
1086
690
  this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
1087
-
1088
- rotationPoint = (_this$unprojectOnTbPl3 = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement)) === null || _this$unprojectOnTbPl3 === void 0 ? void 0 : _this$unprojectOnTbPl3.applyQuaternion(this.camera.quaternion).multiplyScalar(1 / this.camera.zoom).add(this._v3_2);
691
+ rotationPoint = (_a = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement)) == null ? void 0 : _a.applyQuaternion(this.camera.quaternion).multiplyScalar(1 / this.camera.zoom).add(this._v3_2);
1089
692
  }
1090
-
1091
- const amount = MathUtils.DEG2RAD * (this._startFingerRotation - this._currentFingerRotation);
1092
-
1093
- if (rotationPoint !== undefined) {
693
+ const amount = THREE.MathUtils.DEG2RAD * (this._startFingerRotation - this._currentFingerRotation);
694
+ if (rotationPoint !== void 0) {
1094
695
  this.applyTransformMatrix(this.zRotate(rotationPoint, amount));
1095
696
  }
1096
-
1097
697
  this.dispatchEvent(_changeEvent);
1098
698
  }
1099
- });
1100
-
1101
- _defineProperty(this, "onRotateEnd", () => {
699
+ };
700
+ this.onRotateEnd = () => {
1102
701
  this.updateTbState(STATE.IDLE, false);
1103
702
  this.activateGizmos(false);
1104
703
  this.dispatchEvent(_endEvent);
1105
- });
1106
-
1107
- _defineProperty(this, "onPinchStart", () => {
704
+ };
705
+ this.onPinchStart = () => {
1108
706
  if (this.enabled && this.enableZoom) {
1109
707
  this.dispatchEvent(_startEvent);
1110
708
  this.updateTbState(STATE.SCALE, true);
@@ -1112,583 +710,407 @@ class ArcballControls extends EventDispatcher {
1112
710
  this._currentFingerDistance = this._startFingerDistance;
1113
711
  this.activateGizmos(false);
1114
712
  }
1115
- });
1116
-
1117
- _defineProperty(this, "onPinchMove", () => {
713
+ };
714
+ this.onPinchMove = () => {
715
+ var _a, _b, _c, _d;
1118
716
  if (this.enabled && this.enableZoom && this.domElement) {
1119
- this.setCenter((this._touchCurrent[0].clientX + this._touchCurrent[1].clientX) / 2, (this._touchCurrent[0].clientY + this._touchCurrent[1].clientY) / 2);
1120
- const minDistance = 12; //minimum distance between fingers (in css pixels)
1121
-
717
+ this.setCenter(
718
+ (this._touchCurrent[0].clientX + this._touchCurrent[1].clientX) / 2,
719
+ (this._touchCurrent[0].clientY + this._touchCurrent[1].clientY) / 2
720
+ );
721
+ const minDistance = 12;
1122
722
  if (this._state != STATE.SCALE) {
1123
723
  this._startFingerDistance = this._currentFingerDistance;
1124
724
  this.updateTbState(STATE.SCALE, true);
1125
725
  }
1126
-
1127
- this._currentFingerDistance = Math.max(this.calculatePointersDistance(this._touchCurrent[0], this._touchCurrent[1]), minDistance * this._devPxRatio);
726
+ this._currentFingerDistance = Math.max(
727
+ this.calculatePointersDistance(this._touchCurrent[0], this._touchCurrent[1]),
728
+ minDistance * this._devPxRatio
729
+ );
1128
730
  const amount = this._currentFingerDistance / this._startFingerDistance;
1129
731
  let scalePoint;
1130
-
1131
732
  if (!this.enablePan) {
1132
733
  scalePoint = this._gizmos.position;
1133
734
  } else {
1134
- var _this$camera7, _this$camera8;
1135
-
1136
- if (((_this$camera7 = this.camera) === null || _this$camera7 === void 0 ? void 0 : _this$camera7.type) === 'OrthographicCamera') {
1137
- var _this$unprojectOnTbPl4;
1138
-
1139
- scalePoint = (_this$unprojectOnTbPl4 = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement)) === null || _this$unprojectOnTbPl4 === void 0 ? void 0 : _this$unprojectOnTbPl4.applyQuaternion(this.camera.quaternion).multiplyScalar(1 / this.camera.zoom).add(this._gizmos.position);
1140
- } else if (((_this$camera8 = this.camera) === null || _this$camera8 === void 0 ? void 0 : _this$camera8.type) === 'PerspectiveCamera') {
1141
- var _this$unprojectOnTbPl5;
1142
-
1143
- scalePoint = (_this$unprojectOnTbPl5 = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement)) === null || _this$unprojectOnTbPl5 === void 0 ? void 0 : _this$unprojectOnTbPl5.applyQuaternion(this.camera.quaternion).add(this._gizmos.position);
735
+ if (((_a = this.camera) == null ? void 0 : _a.type) === "OrthographicCamera") {
736
+ scalePoint = (_b = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement)) == null ? void 0 : _b.applyQuaternion(this.camera.quaternion).multiplyScalar(1 / this.camera.zoom).add(this._gizmos.position);
737
+ } else if (((_c = this.camera) == null ? void 0 : _c.type) === "PerspectiveCamera") {
738
+ scalePoint = (_d = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement)) == null ? void 0 : _d.applyQuaternion(this.camera.quaternion).add(this._gizmos.position);
1144
739
  }
1145
740
  }
1146
-
1147
- if (scalePoint !== undefined) {
741
+ if (scalePoint !== void 0) {
1148
742
  this.applyTransformMatrix(this.applyScale(amount, scalePoint));
1149
743
  }
1150
-
1151
744
  this.dispatchEvent(_changeEvent);
1152
745
  }
1153
- });
1154
-
1155
- _defineProperty(this, "onPinchEnd", () => {
746
+ };
747
+ this.onPinchEnd = () => {
1156
748
  this.updateTbState(STATE.IDLE, false);
1157
749
  this.dispatchEvent(_endEvent);
1158
- });
1159
-
1160
- _defineProperty(this, "onTriplePanStart", () => {
750
+ };
751
+ this.onTriplePanStart = () => {
1161
752
  if (this.enabled && this.enableZoom && this.domElement) {
1162
753
  this.dispatchEvent(_startEvent);
1163
- this.updateTbState(STATE.SCALE, true); //const center = event.center;
1164
-
754
+ this.updateTbState(STATE.SCALE, true);
1165
755
  let clientX = 0;
1166
756
  let clientY = 0;
1167
757
  const nFingers = this._touchCurrent.length;
1168
-
1169
758
  for (let i = 0; i < nFingers; i++) {
1170
759
  clientX += this._touchCurrent[i].clientX;
1171
760
  clientY += this._touchCurrent[i].clientY;
1172
761
  }
1173
-
1174
762
  this.setCenter(clientX / nFingers, clientY / nFingers);
1175
-
1176
763
  this._startCursorPosition.setY(this.getCursorNDC(_center.x, _center.y, this.domElement).y * 0.5);
1177
-
1178
764
  this._currentCursorPosition.copy(this._startCursorPosition);
1179
765
  }
1180
- });
1181
-
1182
- _defineProperty(this, "onTriplePanMove", () => {
766
+ };
767
+ this.onTriplePanMove = () => {
1183
768
  if (this.enabled && this.enableZoom && this.camera && this.domElement) {
1184
- // fov / 2
1185
- // |\
1186
- // | \
1187
- // | \
1188
- // x | \
1189
- // | \
1190
- // | \
1191
- // | _ _ _\
1192
- // y
1193
- //const center = event.center;
1194
769
  let clientX = 0;
1195
770
  let clientY = 0;
1196
771
  const nFingers = this._touchCurrent.length;
1197
-
1198
772
  for (let i = 0; i < nFingers; i++) {
1199
773
  clientX += this._touchCurrent[i].clientX;
1200
774
  clientY += this._touchCurrent[i].clientY;
1201
775
  }
1202
-
1203
776
  this.setCenter(clientX / nFingers, clientY / nFingers);
1204
- const screenNotches = 8; //how many wheel notches corresponds to a full screen pan
1205
-
777
+ const screenNotches = 8;
1206
778
  this._currentCursorPosition.setY(this.getCursorNDC(_center.x, _center.y, this.domElement).y * 0.5);
1207
-
1208
779
  const movement = this._currentCursorPosition.y - this._startCursorPosition.y;
1209
780
  let size = 1;
1210
-
1211
781
  if (movement < 0) {
1212
782
  size = 1 / Math.pow(this.scaleFactor, -movement * screenNotches);
1213
783
  } else if (movement > 0) {
1214
784
  size = Math.pow(this.scaleFactor, movement * screenNotches);
1215
785
  }
1216
-
1217
786
  this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
1218
-
1219
787
  const x = this._v3_1.distanceTo(this._gizmos.position);
1220
-
1221
- let xNew = x / size; //distance between camera and gizmos if scale(size, scalepoint) would be performed
1222
- //check min and max distance
1223
-
1224
- xNew = MathUtils.clamp(xNew, this.minDistance, this.maxDistance);
1225
- const y = x * Math.tan(MathUtils.DEG2RAD * this._fovState * 0.5); //calculate new fov
1226
-
1227
- let newFov = MathUtils.RAD2DEG * (Math.atan(y / xNew) * 2); //check min and max fov
1228
-
1229
- newFov = MathUtils.clamp(newFov, this.minFov, this.maxFov);
1230
- const newDistance = y / Math.tan(MathUtils.DEG2RAD * (newFov / 2));
788
+ let xNew = x / size;
789
+ xNew = THREE.MathUtils.clamp(xNew, this.minDistance, this.maxDistance);
790
+ const y = x * Math.tan(THREE.MathUtils.DEG2RAD * this._fovState * 0.5);
791
+ let newFov = THREE.MathUtils.RAD2DEG * (Math.atan(y / xNew) * 2);
792
+ newFov = THREE.MathUtils.clamp(newFov, this.minFov, this.maxFov);
793
+ const newDistance = y / Math.tan(THREE.MathUtils.DEG2RAD * (newFov / 2));
1231
794
  size = x / newDistance;
1232
-
1233
795
  this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
1234
-
1235
796
  this.setFov(newFov);
1236
- this.applyTransformMatrix(this.applyScale(size, this._v3_2, false)); //adjusting distance
1237
-
797
+ this.applyTransformMatrix(this.applyScale(size, this._v3_2, false));
1238
798
  const direction = this._gizmos.position.clone().sub(this.camera.position).normalize().multiplyScalar(newDistance / x);
1239
-
1240
799
  this._m4_1.makeTranslation(direction.x, direction.y, direction.z);
1241
-
1242
800
  this.dispatchEvent(_changeEvent);
1243
801
  }
1244
- });
1245
-
1246
- _defineProperty(this, "onTriplePanEnd", () => {
802
+ };
803
+ this.onTriplePanEnd = () => {
1247
804
  this.updateTbState(STATE.IDLE, false);
1248
- this.dispatchEvent(_endEvent); //this.dispatchEvent( _changeEvent );
1249
- });
1250
-
1251
- _defineProperty(this, "setCenter", (clientX, clientY) => {
805
+ this.dispatchEvent(_endEvent);
806
+ };
807
+ this.setCenter = (clientX, clientY) => {
1252
808
  _center.x = clientX;
1253
809
  _center.y = clientY;
1254
- });
1255
-
1256
- _defineProperty(this, "initializeMouseActions", () => {
1257
- this.setMouseAction('PAN', 0, 'CTRL');
1258
- this.setMouseAction('PAN', 2);
1259
- this.setMouseAction('ROTATE', 0);
1260
- this.setMouseAction('ZOOM', 'WHEEL');
1261
- this.setMouseAction('ZOOM', 1);
1262
- this.setMouseAction('FOV', 'WHEEL', 'SHIFT');
1263
- this.setMouseAction('FOV', 1, 'SHIFT');
1264
- });
1265
-
1266
- _defineProperty(this, "setMouseAction", (operation, mouse, key = null) => {
1267
- const operationInput = ['PAN', 'ROTATE', 'ZOOM', 'FOV'];
1268
- const mouseInput = [0, 1, 2, 'WHEEL'];
1269
- const keyInput = ['CTRL', 'SHIFT', null];
810
+ };
811
+ this.initializeMouseActions = () => {
812
+ this.setMouseAction("PAN", 0, "CTRL");
813
+ this.setMouseAction("PAN", 2);
814
+ this.setMouseAction("ROTATE", 0);
815
+ this.setMouseAction("ZOOM", "WHEEL");
816
+ this.setMouseAction("ZOOM", 1);
817
+ this.setMouseAction("FOV", "WHEEL", "SHIFT");
818
+ this.setMouseAction("FOV", 1, "SHIFT");
819
+ };
820
+ this.setMouseAction = (operation, mouse, key = null) => {
821
+ const operationInput = ["PAN", "ROTATE", "ZOOM", "FOV"];
822
+ const mouseInput = [0, 1, 2, "WHEEL"];
823
+ const keyInput = ["CTRL", "SHIFT", null];
1270
824
  let state;
1271
-
1272
825
  if (!operationInput.includes(operation) || !mouseInput.includes(mouse) || !keyInput.includes(key)) {
1273
- //invalid parameters
1274
826
  return false;
1275
827
  }
1276
-
1277
- if (mouse == 'WHEEL') {
1278
- if (operation != 'ZOOM' && operation != 'FOV') {
1279
- //cannot associate 2D operation to 1D input
828
+ if (mouse == "WHEEL") {
829
+ if (operation != "ZOOM" && operation != "FOV") {
1280
830
  return false;
1281
831
  }
1282
832
  }
1283
-
1284
833
  switch (operation) {
1285
- case 'PAN':
834
+ case "PAN":
1286
835
  state = STATE.PAN;
1287
836
  break;
1288
-
1289
- case 'ROTATE':
837
+ case "ROTATE":
1290
838
  state = STATE.ROTATE;
1291
839
  break;
1292
-
1293
- case 'ZOOM':
840
+ case "ZOOM":
1294
841
  state = STATE.SCALE;
1295
842
  break;
1296
-
1297
- case 'FOV':
843
+ case "FOV":
1298
844
  state = STATE.FOV;
1299
845
  break;
1300
846
  }
1301
-
1302
847
  const action = {
1303
- operation: operation,
1304
- mouse: mouse,
1305
- key: key,
1306
- state: state
848
+ operation,
849
+ mouse,
850
+ key,
851
+ state
1307
852
  };
1308
-
1309
853
  for (let i = 0; i < this.mouseActions.length; i++) {
1310
854
  if (this.mouseActions[i].mouse == action.mouse && this.mouseActions[i].key == action.key) {
1311
855
  this.mouseActions.splice(i, 1, action);
1312
856
  return true;
1313
857
  }
1314
858
  }
1315
-
1316
859
  this.mouseActions.push(action);
1317
860
  return true;
1318
- });
1319
-
1320
- _defineProperty(this, "getOpFromAction", (mouse, key) => {
861
+ };
862
+ this.getOpFromAction = (mouse, key) => {
1321
863
  let action;
1322
-
1323
864
  for (let i = 0; i < this.mouseActions.length; i++) {
1324
865
  action = this.mouseActions[i];
1325
-
1326
866
  if (action.mouse == mouse && action.key == key) {
1327
867
  return action.operation;
1328
868
  }
1329
869
  }
1330
-
1331
870
  if (key) {
1332
871
  for (let i = 0; i < this.mouseActions.length; i++) {
1333
872
  action = this.mouseActions[i];
1334
-
1335
873
  if (action.mouse == mouse && action.key == null) {
1336
874
  return action.operation;
1337
875
  }
1338
876
  }
1339
877
  }
1340
-
1341
878
  return null;
1342
- });
1343
-
1344
- _defineProperty(this, "getOpStateFromAction", (mouse, key) => {
879
+ };
880
+ this.getOpStateFromAction = (mouse, key) => {
1345
881
  let action;
1346
-
1347
882
  for (let i = 0; i < this.mouseActions.length; i++) {
1348
883
  action = this.mouseActions[i];
1349
-
1350
884
  if (action.mouse == mouse && action.key == key) {
1351
885
  return action.state;
1352
886
  }
1353
887
  }
1354
-
1355
888
  if (key) {
1356
889
  for (let i = 0; i < this.mouseActions.length; i++) {
1357
890
  action = this.mouseActions[i];
1358
-
1359
891
  if (action.mouse == mouse && action.key == null) {
1360
892
  return action.state;
1361
893
  }
1362
894
  }
1363
895
  }
1364
-
1365
896
  return null;
1366
- });
1367
-
1368
- _defineProperty(this, "getAngle", (p1, p2) => {
897
+ };
898
+ this.getAngle = (p1, p2) => {
1369
899
  return Math.atan2(p2.clientY - p1.clientY, p2.clientX - p1.clientX) * 180 / Math.PI;
1370
- });
1371
-
1372
- _defineProperty(this, "updateTouchEvent", event => {
900
+ };
901
+ this.updateTouchEvent = (event) => {
1373
902
  for (let i = 0; i < this._touchCurrent.length; i++) {
1374
903
  if (this._touchCurrent[i].pointerId == event.pointerId) {
1375
904
  this._touchCurrent.splice(i, 1, event);
1376
-
1377
905
  break;
1378
906
  }
1379
907
  }
1380
- });
1381
-
1382
- _defineProperty(this, "calculateAngularSpeed", (p0, p1, t0, t1) => {
908
+ };
909
+ this.calculateAngularSpeed = (p0, p1, t0, t1) => {
1383
910
  const s = p1 - p0;
1384
- const t = (t1 - t0) / 1000;
1385
-
911
+ const t = (t1 - t0) / 1e3;
1386
912
  if (t == 0) {
1387
913
  return 0;
1388
914
  }
1389
-
1390
915
  return s / t;
1391
- });
1392
-
1393
- _defineProperty(this, "calculatePointersDistance", (p0, p1) => {
916
+ };
917
+ this.calculatePointersDistance = (p0, p1) => {
1394
918
  return Math.sqrt(Math.pow(p1.clientX - p0.clientX, 2) + Math.pow(p1.clientY - p0.clientY, 2));
1395
- });
1396
-
1397
- _defineProperty(this, "calculateRotationAxis", (vec1, vec2) => {
919
+ };
920
+ this.calculateRotationAxis = (vec1, vec2) => {
1398
921
  this._rotationMatrix.extractRotation(this._cameraMatrixState);
1399
-
1400
922
  this._quat.setFromRotationMatrix(this._rotationMatrix);
1401
-
1402
923
  this._rotationAxis.crossVectors(vec1, vec2).applyQuaternion(this._quat);
1403
-
1404
924
  return this._rotationAxis.normalize().clone();
1405
- });
1406
-
1407
- _defineProperty(this, "calculateTbRadius", camera => {
925
+ };
926
+ this.calculateTbRadius = (camera2) => {
1408
927
  const factor = 0.67;
1409
- const distance = camera.position.distanceTo(this._gizmos.position);
1410
-
1411
- if (camera.type == 'PerspectiveCamera') {
1412
- const halfFovV = MathUtils.DEG2RAD * camera.fov * 0.5; //vertical fov/2 in radians
1413
-
1414
- const halfFovH = Math.atan(camera.aspect * Math.tan(halfFovV)); //horizontal fov/2 in radians
1415
-
928
+ const distance = camera2.position.distanceTo(this._gizmos.position);
929
+ if (camera2.type == "PerspectiveCamera") {
930
+ const halfFovV = THREE.MathUtils.DEG2RAD * camera2.fov * 0.5;
931
+ const halfFovH = Math.atan(camera2.aspect * Math.tan(halfFovV));
1416
932
  return Math.tan(Math.min(halfFovV, halfFovH)) * distance * factor;
1417
- } else if (camera.type == 'OrthographicCamera') {
1418
- return Math.min(camera.top, camera.right) * factor;
933
+ } else if (camera2.type == "OrthographicCamera") {
934
+ return Math.min(camera2.top, camera2.right) * factor;
1419
935
  }
1420
- });
1421
-
1422
- _defineProperty(this, "focus", (point, size, amount = 1) => {
936
+ };
937
+ this.focus = (point, size, amount = 1) => {
1423
938
  if (this.camera) {
1424
- const focusPoint = point.clone(); //move center of camera (along with gizmos) towards point of interest
1425
-
939
+ const focusPoint = point.clone();
1426
940
  focusPoint.sub(this._gizmos.position).multiplyScalar(amount);
1427
-
1428
941
  this._translationMatrix.makeTranslation(focusPoint.x, focusPoint.y, focusPoint.z);
1429
-
1430
942
  const gizmoStateTemp = this._gizmoMatrixState.clone();
1431
-
1432
943
  this._gizmoMatrixState.premultiply(this._translationMatrix);
1433
-
1434
944
  this._gizmoMatrixState.decompose(this._gizmos.position, this._gizmos.quaternion, this._gizmos.scale);
1435
-
1436
945
  const cameraStateTemp = this._cameraMatrixState.clone();
1437
-
1438
946
  this._cameraMatrixState.premultiply(this._translationMatrix);
1439
-
1440
- this._cameraMatrixState.decompose(this.camera.position, this.camera.quaternion, this.camera.scale); //apply zoom
1441
-
1442
-
947
+ this._cameraMatrixState.decompose(this.camera.position, this.camera.quaternion, this.camera.scale);
1443
948
  if (this.enableZoom) {
1444
949
  this.applyTransformMatrix(this.applyScale(size, this._gizmos.position));
1445
950
  }
1446
-
1447
951
  this._gizmoMatrixState.copy(gizmoStateTemp);
1448
-
1449
952
  this._cameraMatrixState.copy(cameraStateTemp);
1450
953
  }
1451
- });
1452
-
1453
- _defineProperty(this, "drawGrid", () => {
954
+ };
955
+ this.drawGrid = () => {
956
+ var _a, _b;
1454
957
  if (this.scene) {
1455
- var _this$camera9, _this$camera10;
1456
-
1457
- const color = 0x888888;
958
+ const color = 8947848;
1458
959
  const multiplier = 3;
1459
960
  let size, divisions, maxLength, tick;
1460
-
1461
- if (((_this$camera9 = this.camera) === null || _this$camera9 === void 0 ? void 0 : _this$camera9.type) === 'OrthographicCamera') {
961
+ if (((_a = this.camera) == null ? void 0 : _a.type) === "OrthographicCamera") {
1462
962
  const width = this.camera.right - this.camera.left;
1463
963
  const height = this.camera.bottom - this.camera.top;
1464
964
  maxLength = Math.max(width, height);
1465
965
  tick = maxLength / 20;
1466
966
  size = maxLength / this.camera.zoom * multiplier;
1467
967
  divisions = size / tick * this.camera.zoom;
1468
- } else if (((_this$camera10 = this.camera) === null || _this$camera10 === void 0 ? void 0 : _this$camera10.type) === 'PerspectiveCamera') {
968
+ } else if (((_b = this.camera) == null ? void 0 : _b.type) === "PerspectiveCamera") {
1469
969
  const distance = this.camera.position.distanceTo(this._gizmos.position);
1470
- const halfFovV = MathUtils.DEG2RAD * this.camera.fov * 0.5;
970
+ const halfFovV = THREE.MathUtils.DEG2RAD * this.camera.fov * 0.5;
1471
971
  const halfFovH = Math.atan(this.camera.aspect * Math.tan(halfFovV));
1472
972
  maxLength = Math.tan(Math.max(halfFovV, halfFovH)) * distance * 2;
1473
973
  tick = maxLength / 20;
1474
974
  size = maxLength * multiplier;
1475
975
  divisions = size / tick;
1476
976
  }
1477
-
1478
977
  if (this._grid == null && this.camera) {
1479
- this._grid = new GridHelper(size, divisions, color, color);
1480
-
978
+ this._grid = new THREE.GridHelper(size, divisions, color, color);
1481
979
  this._grid.position.copy(this._gizmos.position);
1482
-
1483
980
  this._gridPosition.copy(this._grid.position);
1484
-
1485
981
  this._grid.quaternion.copy(this.camera.quaternion);
1486
-
1487
982
  this._grid.rotateX(Math.PI * 0.5);
1488
-
1489
983
  this.scene.add(this._grid);
1490
984
  }
1491
985
  }
1492
- });
1493
-
1494
- _defineProperty(this, "connect", domElement => {
1495
- // https://github.com/mrdoob/three.js/issues/20575
1496
- if (domElement === document) {
1497
- console.error('THREE.ArcballControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.');
1498
- }
1499
-
1500
- this.domElement = domElement; // disables touch scroll
1501
- // touch-action needs to be defined for pointer events to work on mobile
1502
- // https://stackoverflow.com/a/48254578
1503
-
1504
- this.domElement.style.touchAction = 'none';
1505
- this.domElement.addEventListener('contextmenu', this.onContextMenu);
1506
- this.domElement.addEventListener('pointerdown', this.onPointerDown);
1507
- this.domElement.addEventListener('pointercancel', this.onPointerCancel);
1508
- this.domElement.addEventListener('wheel', this.onWheel);
1509
- });
1510
-
1511
- _defineProperty(this, "dispose", () => {
1512
- var _this$domElement, _this$domElement2, _this$domElement3, _this$domElement4, _this$scene;
1513
-
986
+ };
987
+ this.connect = (domElement2) => {
988
+ if (domElement2 === document) {
989
+ console.error(
990
+ 'THREE.ArcballControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'
991
+ );
992
+ }
993
+ this.domElement = domElement2;
994
+ this.domElement.style.touchAction = "none";
995
+ this.domElement.addEventListener("contextmenu", this.onContextMenu);
996
+ this.domElement.addEventListener("pointerdown", this.onPointerDown);
997
+ this.domElement.addEventListener("pointercancel", this.onPointerCancel);
998
+ this.domElement.addEventListener("wheel", this.onWheel);
999
+ };
1000
+ this.dispose = () => {
1001
+ var _a, _b, _c, _d, _e;
1514
1002
  if (this._animationId != -1) {
1515
1003
  window.cancelAnimationFrame(this._animationId);
1516
1004
  }
1517
-
1518
- (_this$domElement = this.domElement) === null || _this$domElement === void 0 ? void 0 : _this$domElement.removeEventListener('pointerdown', this.onPointerDown);
1519
- (_this$domElement2 = this.domElement) === null || _this$domElement2 === void 0 ? void 0 : _this$domElement2.removeEventListener('pointercancel', this.onPointerCancel);
1520
- (_this$domElement3 = this.domElement) === null || _this$domElement3 === void 0 ? void 0 : _this$domElement3.removeEventListener('wheel', this.onWheel);
1521
- (_this$domElement4 = this.domElement) === null || _this$domElement4 === void 0 ? void 0 : _this$domElement4.removeEventListener('contextmenu', this.onContextMenu);
1522
- window.removeEventListener('pointermove', this.onPointerMove);
1523
- window.removeEventListener('pointerup', this.onPointerUp);
1524
- window.removeEventListener('resize', this.onWindowResize);
1525
- (_this$scene = this.scene) === null || _this$scene === void 0 ? void 0 : _this$scene.remove(this._gizmos);
1005
+ (_a = this.domElement) == null ? void 0 : _a.removeEventListener("pointerdown", this.onPointerDown);
1006
+ (_b = this.domElement) == null ? void 0 : _b.removeEventListener("pointercancel", this.onPointerCancel);
1007
+ (_c = this.domElement) == null ? void 0 : _c.removeEventListener("wheel", this.onWheel);
1008
+ (_d = this.domElement) == null ? void 0 : _d.removeEventListener("contextmenu", this.onContextMenu);
1009
+ window.removeEventListener("pointermove", this.onPointerMove);
1010
+ window.removeEventListener("pointerup", this.onPointerUp);
1011
+ window.removeEventListener("resize", this.onWindowResize);
1012
+ (_e = this.scene) == null ? void 0 : _e.remove(this._gizmos);
1526
1013
  this.disposeGrid();
1527
- });
1528
-
1529
- _defineProperty(this, "disposeGrid", () => {
1014
+ };
1015
+ this.disposeGrid = () => {
1530
1016
  if (this._grid && this.scene) {
1531
1017
  this.scene.remove(this._grid);
1532
1018
  this._grid = null;
1533
1019
  }
1534
- });
1535
-
1536
- _defineProperty(this, "easeOutCubic", t => {
1020
+ };
1021
+ this.easeOutCubic = (t) => {
1537
1022
  return 1 - Math.pow(1 - t, 3);
1538
- });
1539
-
1540
- _defineProperty(this, "activateGizmos", isActive => {
1023
+ };
1024
+ this.activateGizmos = (isActive) => {
1541
1025
  for (const gizmo of this._gizmos.children) {
1542
- gizmo.material.setValues({
1543
- opacity: isActive ? 1 : 0.6
1544
- });
1026
+ ;
1027
+ gizmo.material.setValues({ opacity: isActive ? 1 : 0.6 });
1545
1028
  }
1546
- });
1547
-
1548
- _defineProperty(this, "getCursorNDC", (cursorX, cursorY, canvas) => {
1029
+ };
1030
+ this.getCursorNDC = (cursorX, cursorY, canvas) => {
1549
1031
  const canvasRect = canvas.getBoundingClientRect();
1550
-
1551
1032
  this._v2_1.setX((cursorX - canvasRect.left) / canvasRect.width * 2 - 1);
1552
-
1553
1033
  this._v2_1.setY((canvasRect.bottom - cursorY) / canvasRect.height * 2 - 1);
1554
-
1555
1034
  return this._v2_1.clone();
1556
- });
1557
-
1558
- _defineProperty(this, "getCursorPosition", (cursorX, cursorY, canvas) => {
1559
- var _this$camera11;
1560
-
1035
+ };
1036
+ this.getCursorPosition = (cursorX, cursorY, canvas) => {
1037
+ var _a;
1561
1038
  this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
1562
-
1563
- if (((_this$camera11 = this.camera) === null || _this$camera11 === void 0 ? void 0 : _this$camera11.type) === 'OrthographicCamera') {
1039
+ if (((_a = this.camera) == null ? void 0 : _a.type) === "OrthographicCamera") {
1564
1040
  this._v2_1.x *= (this.camera.right - this.camera.left) * 0.5;
1565
1041
  this._v2_1.y *= (this.camera.top - this.camera.bottom) * 0.5;
1566
1042
  }
1567
-
1568
1043
  return this._v2_1.clone();
1569
- });
1570
-
1571
- _defineProperty(this, "setCamera", camera => {
1572
- if (camera) {
1573
- camera.lookAt(this.target);
1574
- camera.updateMatrix(); //setting state
1575
-
1576
- if ((camera === null || camera === void 0 ? void 0 : camera.type) == 'PerspectiveCamera') {
1577
- this._fov0 = camera.fov;
1578
- this._fovState = camera.fov;
1579
- }
1580
-
1581
- this._cameraMatrixState0.copy(camera.matrix);
1582
-
1044
+ };
1045
+ this.setCamera = (camera2) => {
1046
+ if (camera2) {
1047
+ camera2.lookAt(this.target);
1048
+ camera2.updateMatrix();
1049
+ if ((camera2 == null ? void 0 : camera2.type) == "PerspectiveCamera") {
1050
+ this._fov0 = camera2.fov;
1051
+ this._fovState = camera2.fov;
1052
+ }
1053
+ this._cameraMatrixState0.copy(camera2.matrix);
1583
1054
  this._cameraMatrixState.copy(this._cameraMatrixState0);
1584
-
1585
- this._cameraProjectionState.copy(camera.projectionMatrix);
1586
-
1587
- this._zoom0 = camera.zoom;
1055
+ this._cameraProjectionState.copy(camera2.projectionMatrix);
1056
+ this._zoom0 = camera2.zoom;
1588
1057
  this._zoomState = this._zoom0;
1589
- this._initialNear = camera.near;
1590
- this._nearPos0 = camera.position.distanceTo(this.target) - camera.near;
1058
+ this._initialNear = camera2.near;
1059
+ this._nearPos0 = camera2.position.distanceTo(this.target) - camera2.near;
1591
1060
  this._nearPos = this._initialNear;
1592
- this._initialFar = camera.far;
1593
- this._farPos0 = camera.position.distanceTo(this.target) - camera.far;
1061
+ this._initialFar = camera2.far;
1062
+ this._farPos0 = camera2.position.distanceTo(this.target) - camera2.far;
1594
1063
  this._farPos = this._initialFar;
1595
-
1596
- this._up0.copy(camera.up);
1597
-
1598
- this._upState.copy(camera.up);
1599
-
1600
- this.camera = camera;
1601
- this.camera.updateProjectionMatrix(); //making gizmos
1602
-
1603
- const tbRadius = this.calculateTbRadius(camera);
1604
-
1605
- if (tbRadius !== undefined) {
1064
+ this._up0.copy(camera2.up);
1065
+ this._upState.copy(camera2.up);
1066
+ this.camera = camera2;
1067
+ this.camera.updateProjectionMatrix();
1068
+ const tbRadius = this.calculateTbRadius(camera2);
1069
+ if (tbRadius !== void 0) {
1606
1070
  this._tbRadius = tbRadius;
1607
1071
  }
1608
-
1609
1072
  this.makeGizmos(this.target, this._tbRadius);
1610
1073
  }
1611
- });
1612
-
1613
- _defineProperty(this, "makeGizmos", (tbCenter, tbRadius) => {
1614
- // @ts-expect-error
1615
- const curve = new EllipseCurve(0, 0, tbRadius, tbRadius);
1616
- const points = curve.getPoints(this._curvePts); //geometry
1617
-
1618
- const curveGeometry = new BufferGeometry().setFromPoints(points); //material
1619
-
1620
- const curveMaterialX = new LineBasicMaterial({
1621
- color: 0xff8080,
1622
- fog: false,
1623
- transparent: true,
1624
- opacity: 0.6
1625
- });
1626
- const curveMaterialY = new LineBasicMaterial({
1627
- color: 0x80ff80,
1628
- fog: false,
1629
- transparent: true,
1630
- opacity: 0.6
1631
- });
1632
- const curveMaterialZ = new LineBasicMaterial({
1633
- color: 0x8080ff,
1634
- fog: false,
1635
- transparent: true,
1636
- opacity: 0.6
1637
- }); //line
1638
-
1639
- const gizmoX = new Line(curveGeometry, curveMaterialX);
1640
- const gizmoY = new Line(curveGeometry, curveMaterialY);
1641
- const gizmoZ = new Line(curveGeometry, curveMaterialZ);
1074
+ };
1075
+ this.makeGizmos = (tbCenter, tbRadius) => {
1076
+ const curve = new THREE.EllipseCurve(0, 0, tbRadius, tbRadius);
1077
+ const points = curve.getPoints(this._curvePts);
1078
+ const curveGeometry = new THREE.BufferGeometry().setFromPoints(points);
1079
+ const curveMaterialX = new THREE.LineBasicMaterial({ color: 16744576, fog: false, transparent: true, opacity: 0.6 });
1080
+ const curveMaterialY = new THREE.LineBasicMaterial({ color: 8454016, fog: false, transparent: true, opacity: 0.6 });
1081
+ const curveMaterialZ = new THREE.LineBasicMaterial({ color: 8421631, fog: false, transparent: true, opacity: 0.6 });
1082
+ const gizmoX = new THREE.Line(curveGeometry, curveMaterialX);
1083
+ const gizmoY = new THREE.Line(curveGeometry, curveMaterialY);
1084
+ const gizmoZ = new THREE.Line(curveGeometry, curveMaterialZ);
1642
1085
  const rotation = Math.PI * 0.5;
1643
1086
  gizmoX.rotation.x = rotation;
1644
- gizmoY.rotation.y = rotation; //setting state
1645
-
1087
+ gizmoY.rotation.y = rotation;
1646
1088
  this._gizmoMatrixState0.identity().setPosition(tbCenter);
1647
-
1648
1089
  this._gizmoMatrixState.copy(this._gizmoMatrixState0);
1649
-
1650
1090
  if (this.camera && this.camera.zoom != 1) {
1651
- //adapt gizmos size to camera zoom
1652
1091
  const size = 1 / this.camera.zoom;
1653
-
1654
1092
  this._scaleMatrix.makeScale(size, size, size);
1655
-
1656
1093
  this._translationMatrix.makeTranslation(-tbCenter.x, -tbCenter.y, -tbCenter.z);
1657
-
1658
1094
  this._gizmoMatrixState.premultiply(this._translationMatrix).premultiply(this._scaleMatrix);
1659
-
1660
1095
  this._translationMatrix.makeTranslation(tbCenter.x, tbCenter.y, tbCenter.z);
1661
-
1662
1096
  this._gizmoMatrixState.premultiply(this._translationMatrix);
1663
1097
  }
1664
-
1665
1098
  this._gizmoMatrixState.decompose(this._gizmos.position, this._gizmos.quaternion, this._gizmos.scale);
1666
-
1667
1099
  this._gizmos.clear();
1668
-
1669
1100
  this._gizmos.add(gizmoX);
1670
-
1671
1101
  this._gizmos.add(gizmoY);
1672
-
1673
1102
  this._gizmos.add(gizmoZ);
1674
- });
1675
-
1676
- _defineProperty(this, "onFocusAnim", (time, point, cameraMatrix, gizmoMatrix) => {
1103
+ };
1104
+ this.onFocusAnim = (time, point, cameraMatrix, gizmoMatrix) => {
1677
1105
  if (this._timeStart == -1) {
1678
- //animation start
1679
1106
  this._timeStart = time;
1680
1107
  }
1681
-
1682
1108
  if (this._state == STATE.ANIMATION_FOCUS) {
1683
1109
  const deltaTime = time - this._timeStart;
1684
1110
  const animTime = deltaTime / this.focusAnimationTime;
1685
-
1686
1111
  this._gizmoMatrixState.copy(gizmoMatrix);
1687
-
1688
1112
  if (animTime >= 1) {
1689
- //animation end
1690
1113
  this._gizmoMatrixState.decompose(this._gizmos.position, this._gizmos.quaternion, this._gizmos.scale);
1691
-
1692
1114
  this.focus(point, this.scaleFactor);
1693
1115
  this._timeStart = -1;
1694
1116
  this.updateTbState(STATE.IDLE, false);
@@ -1697,43 +1119,34 @@ class ArcballControls extends EventDispatcher {
1697
1119
  } else {
1698
1120
  const amount = this.easeOutCubic(animTime);
1699
1121
  const size = 1 - amount + this.scaleFactor * amount;
1700
-
1701
1122
  this._gizmoMatrixState.decompose(this._gizmos.position, this._gizmos.quaternion, this._gizmos.scale);
1702
-
1703
1123
  this.focus(point, size, amount);
1704
1124
  this.dispatchEvent(_changeEvent);
1705
1125
  const self = this;
1706
- this._animationId = window.requestAnimationFrame(function (t) {
1126
+ this._animationId = window.requestAnimationFrame(function(t) {
1707
1127
  self.onFocusAnim(t, point, cameraMatrix, gizmoMatrix.clone());
1708
1128
  });
1709
1129
  }
1710
1130
  } else {
1711
- //interrupt animation
1712
1131
  this._animationId = -1;
1713
1132
  this._timeStart = -1;
1714
1133
  }
1715
- });
1716
-
1717
- _defineProperty(this, "onRotationAnim", (time, rotationAxis, w0) => {
1134
+ };
1135
+ this.onRotationAnim = (time, rotationAxis, w0) => {
1718
1136
  if (this._timeStart == -1) {
1719
- //animation start
1720
1137
  this._anglePrev = 0;
1721
1138
  this._angleCurrent = 0;
1722
1139
  this._timeStart = time;
1723
1140
  }
1724
-
1725
1141
  if (this._state == STATE.ANIMATION_ROTATE) {
1726
- //w = w0 + alpha * t
1727
- const deltaTime = (time - this._timeStart) / 1000;
1142
+ const deltaTime = (time - this._timeStart) / 1e3;
1728
1143
  const w = w0 + -this.dampingFactor * deltaTime;
1729
-
1730
1144
  if (w > 0) {
1731
- //tetha = 0.5 * alpha * t^2 + w0 * t + tetha0
1732
1145
  this._angleCurrent = 0.5 * -this.dampingFactor * Math.pow(deltaTime, 2) + w0 * deltaTime + 0;
1733
1146
  this.applyTransformMatrix(this.rotate(rotationAxis, this._angleCurrent));
1734
1147
  this.dispatchEvent(_changeEvent);
1735
1148
  const self = this;
1736
- this._animationId = window.requestAnimationFrame(function (t) {
1149
+ this._animationId = window.requestAnimationFrame(function(t) {
1737
1150
  self.onRotationAnim(t, rotationAxis, w0);
1738
1151
  });
1739
1152
  } else {
@@ -1744,167 +1157,123 @@ class ArcballControls extends EventDispatcher {
1744
1157
  this.dispatchEvent(_changeEvent);
1745
1158
  }
1746
1159
  } else {
1747
- //interrupt animation
1748
1160
  this._animationId = -1;
1749
1161
  this._timeStart = -1;
1750
-
1751
1162
  if (this._state != STATE.ROTATE) {
1752
1163
  this.activateGizmos(false);
1753
1164
  this.dispatchEvent(_changeEvent);
1754
1165
  }
1755
1166
  }
1756
- });
1757
-
1758
- _defineProperty(this, "pan", (p0, p1, adjust = false) => {
1167
+ };
1168
+ this.pan = (p0, p1, adjust = false) => {
1759
1169
  if (this.camera) {
1760
1170
  const movement = p0.clone().sub(p1);
1761
-
1762
- if (this.camera.type === 'OrthographicCamera') {
1763
- //adjust movement amount
1171
+ if (this.camera.type === "OrthographicCamera") {
1764
1172
  movement.multiplyScalar(1 / this.camera.zoom);
1765
1173
  }
1766
-
1767
- if (this.camera.type === 'PerspectiveCamera' && adjust) {
1768
- //adjust movement amount
1769
- this._v3_1.setFromMatrixPosition(this._cameraMatrixState0); //camera's initial position
1770
-
1771
-
1772
- this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0); //gizmo's initial position
1773
-
1774
-
1174
+ if (this.camera.type === "PerspectiveCamera" && adjust) {
1175
+ this._v3_1.setFromMatrixPosition(this._cameraMatrixState0);
1176
+ this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0);
1775
1177
  const distanceFactor = this._v3_1.distanceTo(this._v3_2) / this.camera.position.distanceTo(this._gizmos.position);
1776
1178
  movement.multiplyScalar(1 / distanceFactor);
1777
1179
  }
1778
-
1779
1180
  this._v3_1.set(movement.x, movement.y, 0).applyQuaternion(this.camera.quaternion);
1780
-
1781
1181
  this._m4_1.makeTranslation(this._v3_1.x, this._v3_1.y, this._v3_1.z);
1782
-
1783
1182
  this.setTransformationMatrices(this._m4_1, this._m4_1);
1784
1183
  }
1785
-
1786
1184
  return _transformation;
1787
- });
1788
-
1789
- _defineProperty(this, "reset", () => {
1185
+ };
1186
+ this.reset = () => {
1790
1187
  if (this.camera) {
1791
1188
  this.camera.zoom = this._zoom0;
1792
-
1793
- if (this.camera.type === 'PerspectiveCamera') {
1189
+ if (this.camera.type === "PerspectiveCamera") {
1794
1190
  this.camera.fov = this._fov0;
1795
1191
  }
1796
-
1797
1192
  this.camera.near = this._nearPos;
1798
1193
  this.camera.far = this._farPos;
1799
-
1800
1194
  this._cameraMatrixState.copy(this._cameraMatrixState0);
1801
-
1802
1195
  this._cameraMatrixState.decompose(this.camera.position, this.camera.quaternion, this.camera.scale);
1803
-
1804
1196
  this.camera.up.copy(this._up0);
1805
1197
  this.camera.updateMatrix();
1806
1198
  this.camera.updateProjectionMatrix();
1807
-
1808
1199
  this._gizmoMatrixState.copy(this._gizmoMatrixState0);
1809
-
1810
1200
  this._gizmoMatrixState0.decompose(this._gizmos.position, this._gizmos.quaternion, this._gizmos.scale);
1811
-
1812
1201
  this._gizmos.updateMatrix();
1813
-
1814
1202
  const tbRadius = this.calculateTbRadius(this.camera);
1815
-
1816
- if (tbRadius !== undefined) {
1203
+ if (tbRadius !== void 0) {
1817
1204
  this._tbRadius = tbRadius;
1818
1205
  }
1819
-
1820
1206
  this.makeGizmos(this._gizmos.position, this._tbRadius);
1821
1207
  this.camera.lookAt(this._gizmos.position);
1822
1208
  this.updateTbState(STATE.IDLE, false);
1823
1209
  this.dispatchEvent(_changeEvent);
1824
1210
  }
1825
- });
1826
-
1827
- _defineProperty(this, "rotate", (axis, angle) => {
1828
- const point = this._gizmos.position; //rotation center
1829
-
1211
+ };
1212
+ this.rotate = (axis, angle) => {
1213
+ const point = this._gizmos.position;
1830
1214
  this._translationMatrix.makeTranslation(-point.x, -point.y, -point.z);
1831
-
1832
- this._rotationMatrix.makeRotationAxis(axis, -angle); //rotate camera
1833
-
1834
-
1215
+ this._rotationMatrix.makeRotationAxis(axis, -angle);
1835
1216
  this._m4_1.makeTranslation(point.x, point.y, point.z);
1836
-
1837
1217
  this._m4_1.multiply(this._rotationMatrix);
1838
-
1839
1218
  this._m4_1.multiply(this._translationMatrix);
1840
-
1841
1219
  this.setTransformationMatrices(this._m4_1);
1842
1220
  return _transformation;
1843
- });
1844
-
1845
- _defineProperty(this, "copyState", () => {
1221
+ };
1222
+ this.copyState = () => {
1223
+ var _a;
1846
1224
  if (this.camera) {
1847
- var _this$camera12;
1848
-
1849
- const state = JSON.stringify(((_this$camera12 = this.camera) === null || _this$camera12 === void 0 ? void 0 : _this$camera12.type) === 'OrthographicCamera' ? {
1850
- arcballState: {
1851
- cameraFar: this.camera.far,
1852
- cameraMatrix: this.camera.matrix,
1853
- cameraNear: this.camera.near,
1854
- cameraUp: this.camera.up,
1855
- cameraZoom: this.camera.zoom,
1856
- gizmoMatrix: this._gizmos.matrix
1857
- }
1858
- } : {
1859
- arcballState: {
1860
- cameraFar: this.camera.far,
1861
- cameraFov: this.camera.fov,
1862
- cameraMatrix: this.camera.matrix,
1863
- cameraNear: this.camera.near,
1864
- cameraUp: this.camera.up,
1865
- cameraZoom: this.camera.zoom,
1866
- gizmoMatrix: this._gizmos.matrix
1225
+ const state = JSON.stringify(
1226
+ ((_a = this.camera) == null ? void 0 : _a.type) === "OrthographicCamera" ? {
1227
+ arcballState: {
1228
+ cameraFar: this.camera.far,
1229
+ cameraMatrix: this.camera.matrix,
1230
+ cameraNear: this.camera.near,
1231
+ cameraUp: this.camera.up,
1232
+ cameraZoom: this.camera.zoom,
1233
+ gizmoMatrix: this._gizmos.matrix
1234
+ }
1235
+ } : {
1236
+ arcballState: {
1237
+ cameraFar: this.camera.far,
1238
+ cameraFov: this.camera.fov,
1239
+ cameraMatrix: this.camera.matrix,
1240
+ cameraNear: this.camera.near,
1241
+ cameraUp: this.camera.up,
1242
+ cameraZoom: this.camera.zoom,
1243
+ gizmoMatrix: this._gizmos.matrix
1244
+ }
1867
1245
  }
1868
- });
1246
+ );
1869
1247
  navigator.clipboard.writeText(state);
1870
1248
  }
1871
- });
1872
-
1873
- _defineProperty(this, "pasteState", () => {
1249
+ };
1250
+ this.pasteState = () => {
1874
1251
  const self = this;
1875
1252
  navigator.clipboard.readText().then(function resolved(value) {
1876
1253
  self.setStateFromJSON(value);
1877
1254
  });
1878
- });
1879
-
1880
- _defineProperty(this, "saveState", () => {
1881
- if (!this.camera) return;
1882
-
1255
+ };
1256
+ this.saveState = () => {
1257
+ if (!this.camera)
1258
+ return;
1883
1259
  this._cameraMatrixState0.copy(this.camera.matrix);
1884
-
1885
1260
  this._gizmoMatrixState0.copy(this._gizmos.matrix);
1886
-
1887
1261
  this._nearPos = this.camera.near;
1888
1262
  this._farPos = this.camera.far;
1889
1263
  this._zoom0 = this.camera.zoom;
1890
-
1891
1264
  this._up0.copy(this.camera.up);
1892
-
1893
- if (this.camera.type === 'PerspectiveCamera') {
1265
+ if (this.camera.type === "PerspectiveCamera") {
1894
1266
  this._fov0 = this.camera.fov;
1895
1267
  }
1896
- });
1897
-
1898
- _defineProperty(this, "applyScale", (size, point, scaleGizmos = true) => {
1899
- if (!this.camera) return;
1268
+ };
1269
+ this.applyScale = (size, point, scaleGizmos = true) => {
1270
+ if (!this.camera)
1271
+ return;
1900
1272
  const scalePoint = point.clone();
1901
1273
  let sizeInverse = 1 / size;
1902
-
1903
- if (this.camera.type === 'OrthographicCamera') {
1904
- //camera zoom
1274
+ if (this.camera.type === "OrthographicCamera") {
1905
1275
  this.camera.zoom = this._zoomState;
1906
- this.camera.zoom *= size; //check min and max zoom
1907
-
1276
+ this.camera.zoom *= size;
1908
1277
  if (this.camera.zoom > this.maxZoom) {
1909
1278
  this.camera.zoom = this.maxZoom;
1910
1279
  sizeInverse = this._zoomState / this.maxZoom;
@@ -1912,46 +1281,26 @@ class ArcballControls extends EventDispatcher {
1912
1281
  this.camera.zoom = this.minZoom;
1913
1282
  sizeInverse = this._zoomState / this.minZoom;
1914
1283
  }
1915
-
1916
1284
  this.camera.updateProjectionMatrix();
1917
-
1918
- this._v3_1.setFromMatrixPosition(this._gizmoMatrixState); //gizmos position
1919
- //scale gizmos so they appear in the same spot having the same dimension
1920
-
1921
-
1285
+ this._v3_1.setFromMatrixPosition(this._gizmoMatrixState);
1922
1286
  this._scaleMatrix.makeScale(sizeInverse, sizeInverse, sizeInverse);
1923
-
1924
1287
  this._translationMatrix.makeTranslation(-this._v3_1.x, -this._v3_1.y, -this._v3_1.z);
1925
-
1926
1288
  this._m4_2.makeTranslation(this._v3_1.x, this._v3_1.y, this._v3_1.z).multiply(this._scaleMatrix);
1927
-
1928
- this._m4_2.multiply(this._translationMatrix); //move camera and gizmos to obtain pinch effect
1929
-
1930
-
1289
+ this._m4_2.multiply(this._translationMatrix);
1931
1290
  scalePoint.sub(this._v3_1);
1932
1291
  const amount = scalePoint.clone().multiplyScalar(sizeInverse);
1933
1292
  scalePoint.sub(amount);
1934
-
1935
1293
  this._m4_1.makeTranslation(scalePoint.x, scalePoint.y, scalePoint.z);
1936
-
1937
1294
  this._m4_2.premultiply(this._m4_1);
1938
-
1939
1295
  this.setTransformationMatrices(this._m4_1, this._m4_2);
1940
1296
  return _transformation;
1941
1297
  }
1942
-
1943
- if (this.camera.type === 'PerspectiveCamera') {
1298
+ if (this.camera.type === "PerspectiveCamera") {
1944
1299
  this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
1945
-
1946
- this._v3_2.setFromMatrixPosition(this._gizmoMatrixState); //move camera
1947
-
1948
-
1300
+ this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
1949
1301
  let distance = this._v3_1.distanceTo(scalePoint);
1950
-
1951
- let amount = distance - distance * sizeInverse; //check min and max distance
1952
-
1302
+ let amount = distance - distance * sizeInverse;
1953
1303
  const newDistance = distance - amount;
1954
-
1955
1304
  if (newDistance < this.minDistance) {
1956
1305
  sizeInverse = this.minDistance / distance;
1957
1306
  amount = distance - distance * sizeInverse;
@@ -1959,270 +1308,152 @@ class ArcballControls extends EventDispatcher {
1959
1308
  sizeInverse = this.maxDistance / distance;
1960
1309
  amount = distance - distance * sizeInverse;
1961
1310
  }
1962
-
1963
1311
  let direction = scalePoint.clone().sub(this._v3_1).normalize().multiplyScalar(amount);
1964
-
1965
1312
  this._m4_1.makeTranslation(direction.x, direction.y, direction.z);
1966
-
1967
1313
  if (scaleGizmos) {
1968
- //scale gizmos so they appear in the same spot having the same dimension
1969
1314
  const pos = this._v3_2;
1970
1315
  distance = pos.distanceTo(scalePoint);
1971
1316
  amount = distance - distance * sizeInverse;
1972
1317
  direction = scalePoint.clone().sub(this._v3_2).normalize().multiplyScalar(amount);
1973
-
1974
1318
  this._translationMatrix.makeTranslation(pos.x, pos.y, pos.z);
1975
-
1976
1319
  this._scaleMatrix.makeScale(sizeInverse, sizeInverse, sizeInverse);
1977
-
1978
1320
  this._m4_2.makeTranslation(direction.x, direction.y, direction.z).multiply(this._translationMatrix);
1979
-
1980
1321
  this._m4_2.multiply(this._scaleMatrix);
1981
-
1982
1322
  this._translationMatrix.makeTranslation(-pos.x, -pos.y, -pos.z);
1983
-
1984
1323
  this._m4_2.multiply(this._translationMatrix);
1985
-
1986
1324
  this.setTransformationMatrices(this._m4_1, this._m4_2);
1987
1325
  } else {
1988
1326
  this.setTransformationMatrices(this._m4_1);
1989
1327
  }
1990
-
1991
1328
  return _transformation;
1992
1329
  }
1993
- });
1994
-
1995
- _defineProperty(this, "setFov", value => {
1996
- var _this$camera13;
1997
-
1998
- if (((_this$camera13 = this.camera) === null || _this$camera13 === void 0 ? void 0 : _this$camera13.type) === 'PerspectiveCamera') {
1999
- this.camera.fov = MathUtils.clamp(value, this.minFov, this.maxFov);
1330
+ };
1331
+ this.setFov = (value) => {
1332
+ var _a;
1333
+ if (((_a = this.camera) == null ? void 0 : _a.type) === "PerspectiveCamera") {
1334
+ this.camera.fov = THREE.MathUtils.clamp(value, this.minFov, this.maxFov);
2000
1335
  this.camera.updateProjectionMatrix();
2001
1336
  }
2002
- });
2003
-
2004
- _defineProperty(this, "setTarget", (x, y, z) => {
1337
+ };
1338
+ this.setTarget = (x, y, z) => {
2005
1339
  if (this.camera) {
2006
1340
  this.target.set(x, y, z);
2007
-
2008
- this._gizmos.position.set(x, y, z); //for correct radius calculation
2009
-
2010
-
1341
+ this._gizmos.position.set(x, y, z);
2011
1342
  const tbRadius = this.calculateTbRadius(this.camera);
2012
-
2013
- if (tbRadius !== undefined) {
1343
+ if (tbRadius !== void 0) {
2014
1344
  this._tbRadius = tbRadius;
2015
1345
  }
2016
-
2017
1346
  this.makeGizmos(this.target, this._tbRadius);
2018
1347
  this.camera.lookAt(this.target);
2019
1348
  }
2020
- });
2021
-
2022
- _defineProperty(this, "zRotate", (point, angle) => {
1349
+ };
1350
+ this.zRotate = (point, angle) => {
2023
1351
  this._rotationMatrix.makeRotationAxis(this._rotationAxis, angle);
2024
-
2025
1352
  this._translationMatrix.makeTranslation(-point.x, -point.y, -point.z);
2026
-
2027
1353
  this._m4_1.makeTranslation(point.x, point.y, point.z);
2028
-
2029
1354
  this._m4_1.multiply(this._rotationMatrix);
2030
-
2031
1355
  this._m4_1.multiply(this._translationMatrix);
2032
-
2033
- this._v3_1.setFromMatrixPosition(this._gizmoMatrixState).sub(point); //vector from rotation center to gizmos position
2034
-
2035
-
2036
- this._v3_2.copy(this._v3_1).applyAxisAngle(this._rotationAxis, angle); //apply rotation
2037
-
2038
-
1356
+ this._v3_1.setFromMatrixPosition(this._gizmoMatrixState).sub(point);
1357
+ this._v3_2.copy(this._v3_1).applyAxisAngle(this._rotationAxis, angle);
2039
1358
  this._v3_2.sub(this._v3_1);
2040
-
2041
1359
  this._m4_2.makeTranslation(this._v3_2.x, this._v3_2.y, this._v3_2.z);
2042
-
2043
1360
  this.setTransformationMatrices(this._m4_1, this._m4_2);
2044
1361
  return _transformation;
2045
- });
2046
-
2047
- _defineProperty(this, "unprojectOnObj", (cursor, camera) => {
2048
- if (!this.scene) return null;
2049
- const raycaster = new Raycaster();
2050
- raycaster.near = camera.near;
2051
- raycaster.far = camera.far;
2052
- raycaster.setFromCamera(cursor, camera);
1362
+ };
1363
+ this.unprojectOnObj = (cursor, camera2) => {
1364
+ if (!this.scene)
1365
+ return null;
1366
+ const raycaster = new THREE.Raycaster();
1367
+ raycaster.near = camera2.near;
1368
+ raycaster.far = camera2.far;
1369
+ raycaster.setFromCamera(cursor, camera2);
2053
1370
  const intersect = raycaster.intersectObjects(this.scene.children, true);
2054
-
2055
1371
  for (let i = 0; i < intersect.length; i++) {
2056
1372
  if (intersect[i].object.uuid != this._gizmos.uuid && intersect[i].face) {
2057
1373
  return intersect[i].point.clone();
2058
1374
  }
2059
1375
  }
2060
-
2061
1376
  return null;
2062
- });
2063
-
2064
- _defineProperty(this, "unprojectOnTbSurface", (camera, cursorX, cursorY, canvas, tbRadius) => {
2065
- if (camera.type == 'OrthographicCamera') {
1377
+ };
1378
+ this.unprojectOnTbSurface = (camera2, cursorX, cursorY, canvas, tbRadius) => {
1379
+ if (camera2.type == "OrthographicCamera") {
2066
1380
  this._v2_1.copy(this.getCursorPosition(cursorX, cursorY, canvas));
2067
-
2068
1381
  this._v3_1.set(this._v2_1.x, this._v2_1.y, 0);
2069
-
2070
1382
  const x2 = Math.pow(this._v2_1.x, 2);
2071
1383
  const y2 = Math.pow(this._v2_1.y, 2);
2072
1384
  const r2 = Math.pow(this._tbRadius, 2);
2073
-
2074
1385
  if (x2 + y2 <= r2 * 0.5) {
2075
- //intersection with sphere
2076
1386
  this._v3_1.setZ(Math.sqrt(r2 - (x2 + y2)));
2077
1387
  } else {
2078
- //intersection with hyperboloid
2079
1388
  this._v3_1.setZ(r2 * 0.5 / Math.sqrt(x2 + y2));
2080
1389
  }
2081
-
2082
1390
  return this._v3_1;
2083
1391
  }
2084
-
2085
- if (camera.type == 'PerspectiveCamera') {
2086
- //unproject cursor on the near plane
1392
+ if (camera2.type == "PerspectiveCamera") {
2087
1393
  this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
2088
-
2089
1394
  this._v3_1.set(this._v2_1.x, this._v2_1.y, -1);
2090
-
2091
- this._v3_1.applyMatrix4(camera.projectionMatrixInverse);
2092
-
2093
- const rayDir = this._v3_1.clone().normalize(); //unprojected ray direction
2094
-
2095
-
2096
- const cameraGizmoDistance = camera.position.distanceTo(this._gizmos.position);
2097
- const radius2 = Math.pow(tbRadius, 2); // camera
2098
- // |\
2099
- // | \
2100
- // | \
2101
- // h | \
2102
- // | \
2103
- // | \
2104
- // _ _ | _ _ _\ _ _ near plane
2105
- // l
2106
-
1395
+ this._v3_1.applyMatrix4(camera2.projectionMatrixInverse);
1396
+ const rayDir = this._v3_1.clone().normalize();
1397
+ const cameraGizmoDistance = camera2.position.distanceTo(this._gizmos.position);
1398
+ const radius2 = Math.pow(tbRadius, 2);
2107
1399
  const h = this._v3_1.z;
2108
1400
  const l = Math.sqrt(Math.pow(this._v3_1.x, 2) + Math.pow(this._v3_1.y, 2));
2109
-
2110
1401
  if (l == 0) {
2111
- //ray aligned with camera
2112
1402
  rayDir.set(this._v3_1.x, this._v3_1.y, tbRadius);
2113
1403
  return rayDir;
2114
1404
  }
2115
-
2116
1405
  const m = h / l;
2117
1406
  const q = cameraGizmoDistance;
2118
- /*
2119
- * calculate intersection point between unprojected ray and trackball surface
2120
- *|y = m * x + q
2121
- *|x^2 + y^2 = r^2
2122
- *
2123
- * (m^2 + 1) * x^2 + (2 * m * q) * x + q^2 - r^2 = 0
2124
- */
2125
-
2126
1407
  let a = Math.pow(m, 2) + 1;
2127
1408
  let b = 2 * m * q;
2128
1409
  let c = Math.pow(q, 2) - radius2;
2129
1410
  let delta = Math.pow(b, 2) - 4 * a * c;
2130
-
2131
1411
  if (delta >= 0) {
2132
- //intersection with sphere
2133
1412
  this._v2_1.setX((-b - Math.sqrt(delta)) / (2 * a));
2134
-
2135
1413
  this._v2_1.setY(m * this._v2_1.x + q);
2136
-
2137
- const angle = MathUtils.RAD2DEG * this._v2_1.angle();
2138
-
1414
+ const angle = THREE.MathUtils.RAD2DEG * this._v2_1.angle();
2139
1415
  if (angle >= 45) {
2140
- //if angle between intersection point and X' axis is >= 45°, return that point
2141
- //otherwise, calculate intersection point with hyperboloid
2142
- const rayLength = Math.sqrt(Math.pow(this._v2_1.x, 2) + Math.pow(cameraGizmoDistance - this._v2_1.y, 2));
2143
- rayDir.multiplyScalar(rayLength);
1416
+ const rayLength2 = Math.sqrt(Math.pow(this._v2_1.x, 2) + Math.pow(cameraGizmoDistance - this._v2_1.y, 2));
1417
+ rayDir.multiplyScalar(rayLength2);
2144
1418
  rayDir.z += cameraGizmoDistance;
2145
1419
  return rayDir;
2146
1420
  }
2147
- } //intersection with hyperboloid
2148
-
2149
- /*
2150
- *|y = m * x + q
2151
- *|y = (1 / x) * (r^2 / 2)
2152
- *
2153
- * m * x^2 + q * x - r^2 / 2 = 0
2154
- */
2155
-
2156
-
1421
+ }
2157
1422
  a = m;
2158
1423
  b = q;
2159
1424
  c = -radius2 * 0.5;
2160
1425
  delta = Math.pow(b, 2) - 4 * a * c;
2161
-
2162
1426
  this._v2_1.setX((-b - Math.sqrt(delta)) / (2 * a));
2163
-
2164
1427
  this._v2_1.setY(m * this._v2_1.x + q);
2165
-
2166
1428
  const rayLength = Math.sqrt(Math.pow(this._v2_1.x, 2) + Math.pow(cameraGizmoDistance - this._v2_1.y, 2));
2167
1429
  rayDir.multiplyScalar(rayLength);
2168
1430
  rayDir.z += cameraGizmoDistance;
2169
1431
  return rayDir;
2170
1432
  }
2171
- });
2172
-
2173
- _defineProperty(this, "unprojectOnTbPlane", (camera, cursorX, cursorY, canvas, initialDistance = false) => {
2174
- if (camera.type == 'OrthographicCamera') {
1433
+ };
1434
+ this.unprojectOnTbPlane = (camera2, cursorX, cursorY, canvas, initialDistance = false) => {
1435
+ if (camera2.type == "OrthographicCamera") {
2175
1436
  this._v2_1.copy(this.getCursorPosition(cursorX, cursorY, canvas));
2176
-
2177
1437
  this._v3_1.set(this._v2_1.x, this._v2_1.y, 0);
2178
-
2179
1438
  return this._v3_1.clone();
2180
1439
  }
2181
-
2182
- if (camera.type == 'PerspectiveCamera') {
2183
- this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas)); //unproject cursor on the near plane
2184
-
2185
-
1440
+ if (camera2.type == "PerspectiveCamera") {
1441
+ this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
2186
1442
  this._v3_1.set(this._v2_1.x, this._v2_1.y, -1);
2187
-
2188
- this._v3_1.applyMatrix4(camera.projectionMatrixInverse);
2189
-
2190
- const rayDir = this._v3_1.clone().normalize(); //unprojected ray direction
2191
- // camera
2192
- // |\
2193
- // | \
2194
- // | \
2195
- // h | \
2196
- // | \
2197
- // | \
2198
- // _ _ | _ _ _\ _ _ near plane
2199
- // l
2200
-
2201
-
1443
+ this._v3_1.applyMatrix4(camera2.projectionMatrixInverse);
1444
+ const rayDir = this._v3_1.clone().normalize();
2202
1445
  const h = this._v3_1.z;
2203
1446
  const l = Math.sqrt(Math.pow(this._v3_1.x, 2) + Math.pow(this._v3_1.y, 2));
2204
1447
  let cameraGizmoDistance;
2205
-
2206
1448
  if (initialDistance) {
2207
1449
  cameraGizmoDistance = this._v3_1.setFromMatrixPosition(this._cameraMatrixState0).distanceTo(this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0));
2208
1450
  } else {
2209
- cameraGizmoDistance = camera.position.distanceTo(this._gizmos.position);
2210
- }
2211
- /*
2212
- * calculate intersection point between unprojected ray and the plane
2213
- *|y = mx + q
2214
- *|y = 0
2215
- *
2216
- * x = -q/m
2217
- */
2218
-
2219
-
1451
+ cameraGizmoDistance = camera2.position.distanceTo(this._gizmos.position);
1452
+ }
2220
1453
  if (l == 0) {
2221
- //ray aligned with camera
2222
1454
  rayDir.set(0, 0, 0);
2223
1455
  return rayDir;
2224
1456
  }
2225
-
2226
1457
  const m = h / l;
2227
1458
  const q = cameraGizmoDistance;
2228
1459
  const x = -q / m;
@@ -2231,259 +1462,179 @@ class ArcballControls extends EventDispatcher {
2231
1462
  rayDir.z = 0;
2232
1463
  return rayDir;
2233
1464
  }
2234
- });
2235
-
2236
- _defineProperty(this, "updateMatrixState", () => {
2237
- if (!this.camera) return; //update camera and gizmos state
2238
-
1465
+ };
1466
+ this.updateMatrixState = () => {
1467
+ if (!this.camera)
1468
+ return;
2239
1469
  this._cameraMatrixState.copy(this.camera.matrix);
2240
-
2241
1470
  this._gizmoMatrixState.copy(this._gizmos.matrix);
2242
-
2243
- if (this.camera.type === 'OrthographicCamera') {
1471
+ if (this.camera.type === "OrthographicCamera") {
2244
1472
  this._cameraProjectionState.copy(this.camera.projectionMatrix);
2245
-
2246
1473
  this.camera.updateProjectionMatrix();
2247
1474
  this._zoomState = this.camera.zoom;
2248
1475
  }
2249
-
2250
- if (this.camera.type === 'PerspectiveCamera') {
1476
+ if (this.camera.type === "PerspectiveCamera") {
2251
1477
  this._fovState = this.camera.fov;
2252
1478
  }
2253
- });
2254
-
2255
- _defineProperty(this, "updateTbState", (newState, updateMatrices) => {
1479
+ };
1480
+ this.updateTbState = (newState, updateMatrices) => {
2256
1481
  this._state = newState;
2257
-
2258
1482
  if (updateMatrices) {
2259
1483
  this.updateMatrixState();
2260
1484
  }
2261
- });
2262
-
2263
- _defineProperty(this, "update", () => {
2264
- const EPS = 0.000001; // Update target and gizmos state
2265
-
1485
+ };
1486
+ this.update = () => {
1487
+ const EPS = 1e-6;
2266
1488
  if (!this.target.equals(this._currentTarget) && this.camera) {
2267
- this._gizmos.position.set(this.target.x, this.target.y, this.target.z); //for correct radius calculation
2268
-
2269
-
1489
+ this._gizmos.position.set(this.target.x, this.target.y, this.target.z);
2270
1490
  const tbRadius = this.calculateTbRadius(this.camera);
2271
-
2272
- if (tbRadius !== undefined) {
1491
+ if (tbRadius !== void 0) {
2273
1492
  this._tbRadius = tbRadius;
2274
1493
  }
2275
-
2276
1494
  this.makeGizmos(this.target, this._tbRadius);
2277
-
2278
1495
  this._currentTarget.copy(this.target);
2279
1496
  }
2280
-
2281
- if (!this.camera) return; //check min/max parameters
2282
-
2283
- if (this.camera.type === 'OrthographicCamera') {
2284
- //check zoom
1497
+ if (!this.camera)
1498
+ return;
1499
+ if (this.camera.type === "OrthographicCamera") {
2285
1500
  if (this.camera.zoom > this.maxZoom || this.camera.zoom < this.minZoom) {
2286
- const newZoom = MathUtils.clamp(this.camera.zoom, this.minZoom, this.maxZoom);
1501
+ const newZoom = THREE.MathUtils.clamp(this.camera.zoom, this.minZoom, this.maxZoom);
2287
1502
  this.applyTransformMatrix(this.applyScale(newZoom / this.camera.zoom, this._gizmos.position, true));
2288
1503
  }
2289
1504
  }
2290
-
2291
- if (this.camera.type === 'PerspectiveCamera') {
2292
- //check distance
1505
+ if (this.camera.type === "PerspectiveCamera") {
2293
1506
  const distance = this.camera.position.distanceTo(this._gizmos.position);
2294
-
2295
1507
  if (distance > this.maxDistance + EPS || distance < this.minDistance - EPS) {
2296
- const newDistance = MathUtils.clamp(distance, this.minDistance, this.maxDistance);
1508
+ const newDistance = THREE.MathUtils.clamp(distance, this.minDistance, this.maxDistance);
2297
1509
  this.applyTransformMatrix(this.applyScale(newDistance / distance, this._gizmos.position));
2298
1510
  this.updateMatrixState();
2299
- } //check fov
2300
-
2301
-
1511
+ }
2302
1512
  if (this.camera.fov < this.minFov || this.camera.fov > this.maxFov) {
2303
- this.camera.fov = MathUtils.clamp(this.camera.fov, this.minFov, this.maxFov);
1513
+ this.camera.fov = THREE.MathUtils.clamp(this.camera.fov, this.minFov, this.maxFov);
2304
1514
  this.camera.updateProjectionMatrix();
2305
1515
  }
2306
-
2307
1516
  const oldRadius = this._tbRadius;
2308
1517
  const tbRadius = this.calculateTbRadius(this.camera);
2309
-
2310
- if (tbRadius !== undefined) {
1518
+ if (tbRadius !== void 0) {
2311
1519
  this._tbRadius = tbRadius;
2312
1520
  }
2313
-
2314
1521
  if (oldRadius < this._tbRadius - EPS || oldRadius > this._tbRadius + EPS) {
2315
1522
  const scale = (this._gizmos.scale.x + this._gizmos.scale.y + this._gizmos.scale.z) / 3;
2316
- const newRadius = this._tbRadius / scale; // @ts-expect-error
2317
-
2318
- const curve = new EllipseCurve(0, 0, newRadius, newRadius);
1523
+ const newRadius = this._tbRadius / scale;
1524
+ const curve = new THREE.EllipseCurve(0, 0, newRadius, newRadius);
2319
1525
  const points = curve.getPoints(this._curvePts);
2320
- const curveGeometry = new BufferGeometry().setFromPoints(points);
2321
-
1526
+ const curveGeometry = new THREE.BufferGeometry().setFromPoints(points);
2322
1527
  for (const gizmo in this._gizmos.children) {
2323
1528
  const child = this._gizmos.children[gizmo];
2324
1529
  child.geometry = curveGeometry;
2325
1530
  }
2326
1531
  }
2327
1532
  }
2328
-
2329
1533
  this.camera.lookAt(this._gizmos.position);
2330
- });
2331
-
2332
- _defineProperty(this, "setStateFromJSON", json => {
1534
+ };
1535
+ this.setStateFromJSON = (json) => {
2333
1536
  const state = JSON.parse(json);
2334
-
2335
1537
  if (state.arcballState && this.camera) {
2336
1538
  this._cameraMatrixState.fromArray(state.arcballState.cameraMatrix.elements);
2337
-
2338
1539
  this._cameraMatrixState.decompose(this.camera.position, this.camera.quaternion, this.camera.scale);
2339
-
2340
1540
  this.camera.up.copy(state.arcballState.cameraUp);
2341
1541
  this.camera.near = state.arcballState.cameraNear;
2342
1542
  this.camera.far = state.arcballState.cameraFar;
2343
1543
  this.camera.zoom = state.arcballState.cameraZoom;
2344
-
2345
- if (this.camera.type === 'PerspectiveCamera') {
1544
+ if (this.camera.type === "PerspectiveCamera") {
2346
1545
  this.camera.fov = state.arcballState.cameraFov;
2347
1546
  }
2348
-
2349
1547
  this._gizmoMatrixState.fromArray(state.arcballState.gizmoMatrix.elements);
2350
-
2351
1548
  this._gizmoMatrixState.decompose(this._gizmos.position, this._gizmos.quaternion, this._gizmos.scale);
2352
-
2353
1549
  this.camera.updateMatrix();
2354
1550
  this.camera.updateProjectionMatrix();
2355
-
2356
1551
  this._gizmos.updateMatrix();
2357
-
2358
1552
  const tbRadius = this.calculateTbRadius(this.camera);
2359
-
2360
- if (tbRadius !== undefined) {
1553
+ if (tbRadius !== void 0) {
2361
1554
  this._tbRadius = tbRadius;
2362
1555
  }
2363
-
2364
- const gizmoTmp = new Matrix4().copy(this._gizmoMatrixState0);
1556
+ const gizmoTmp = new THREE.Matrix4().copy(this._gizmoMatrixState0);
2365
1557
  this.makeGizmos(this._gizmos.position, this._tbRadius);
2366
-
2367
1558
  this._gizmoMatrixState0.copy(gizmoTmp);
2368
-
2369
1559
  this.camera.lookAt(this._gizmos.position);
2370
1560
  this.updateTbState(STATE.IDLE, false);
2371
1561
  this.dispatchEvent(_changeEvent);
2372
1562
  }
2373
- });
2374
-
1563
+ };
2375
1564
  this.camera = null;
2376
- this.domElement = _domElement;
1565
+ this.domElement = domElement;
2377
1566
  this.scene = scene;
2378
1567
  this.mouseActions = [];
2379
- this._mouseOp = null; //global vectors and matrices that are used in some operations to avoid creating new objects every time (e.g. every time cursor moves)
2380
-
2381
- this._v2_1 = new Vector2();
2382
- this._v3_1 = new Vector3();
2383
- this._v3_2 = new Vector3();
2384
- this._m4_1 = new Matrix4();
2385
- this._m4_2 = new Matrix4();
2386
- this._quat = new Quaternion(); //transformation matrices
2387
-
2388
- this._translationMatrix = new Matrix4(); //matrix for translation operation
2389
-
2390
- this._rotationMatrix = new Matrix4(); //matrix for rotation operation
2391
-
2392
- this._scaleMatrix = new Matrix4(); //matrix for scaling operation
2393
-
2394
- this._rotationAxis = new Vector3(); //axis for rotate operation
2395
- //camera state
2396
-
2397
- this._cameraMatrixState = new Matrix4();
2398
- this._cameraProjectionState = new Matrix4();
1568
+ this._mouseOp = null;
1569
+ this._v2_1 = new THREE.Vector2();
1570
+ this._v3_1 = new THREE.Vector3();
1571
+ this._v3_2 = new THREE.Vector3();
1572
+ this._m4_1 = new THREE.Matrix4();
1573
+ this._m4_2 = new THREE.Matrix4();
1574
+ this._quat = new THREE.Quaternion();
1575
+ this._translationMatrix = new THREE.Matrix4();
1576
+ this._rotationMatrix = new THREE.Matrix4();
1577
+ this._scaleMatrix = new THREE.Matrix4();
1578
+ this._rotationAxis = new THREE.Vector3();
1579
+ this._cameraMatrixState = new THREE.Matrix4();
1580
+ this._cameraProjectionState = new THREE.Matrix4();
2399
1581
  this._fovState = 1;
2400
- this._upState = new Vector3();
1582
+ this._upState = new THREE.Vector3();
2401
1583
  this._zoomState = 1;
2402
1584
  this._nearPos = 0;
2403
1585
  this._farPos = 0;
2404
- this._gizmoMatrixState = new Matrix4(); //initial values
2405
-
2406
- this._up0 = new Vector3();
1586
+ this._gizmoMatrixState = new THREE.Matrix4();
1587
+ this._up0 = new THREE.Vector3();
2407
1588
  this._zoom0 = 1;
2408
1589
  this._fov0 = 0;
2409
1590
  this._initialNear = 0;
2410
1591
  this._nearPos0 = 0;
2411
1592
  this._initialFar = 0;
2412
1593
  this._farPos0 = 0;
2413
- this._cameraMatrixState0 = new Matrix4();
2414
- this._gizmoMatrixState0 = new Matrix4(); //pointers array
2415
-
1594
+ this._cameraMatrixState0 = new THREE.Matrix4();
1595
+ this._gizmoMatrixState0 = new THREE.Matrix4();
2416
1596
  this._button = -1;
2417
1597
  this._touchStart = [];
2418
1598
  this._touchCurrent = [];
2419
- this._input = INPUT.NONE; //two fingers touch interaction
2420
-
2421
- this._switchSensibility = 32; //minimum movement to be performed to fire single pan start after the second finger has been released
2422
-
2423
- this._startFingerDistance = 0; //distance between two fingers
2424
-
1599
+ this._input = INPUT.NONE;
1600
+ this._switchSensibility = 32;
1601
+ this._startFingerDistance = 0;
2425
1602
  this._currentFingerDistance = 0;
2426
- this._startFingerRotation = 0; //amount of rotation performed with two fingers
2427
-
2428
- this._currentFingerRotation = 0; //double tap
2429
-
1603
+ this._startFingerRotation = 0;
1604
+ this._currentFingerRotation = 0;
2430
1605
  this._devPxRatio = 0;
2431
1606
  this._downValid = true;
2432
1607
  this._nclicks = 0;
2433
1608
  this._downEvents = [];
2434
- this._clickStart = 0; //first click time
2435
-
1609
+ this._clickStart = 0;
2436
1610
  this._maxDownTime = 250;
2437
1611
  this._maxInterval = 300;
2438
1612
  this._posThreshold = 24;
2439
- this._movementThreshold = 24; //cursor positions
2440
-
2441
- this._currentCursorPosition = new Vector3();
2442
- this._startCursorPosition = new Vector3(); //grid
2443
-
2444
- this._grid = null; //grid to be visualized during pan operation
2445
-
2446
- this._gridPosition = new Vector3(); //gizmos
2447
-
2448
- this._gizmos = new Group();
2449
- this._curvePts = 128; //animations
2450
-
2451
- this._timeStart = -1; //initial time
2452
-
2453
- this._animationId = -1; //focus animation
2454
-
2455
- this.focusAnimationTime = 500; //duration of focus animation in ms
2456
- //rotate animation
2457
-
2458
- this._timePrev = 0; //time at which previous rotate operation has been detected
2459
-
2460
- this._timeCurrent = 0; //time at which current rotate operation has been detected
2461
-
2462
- this._anglePrev = 0; //angle of previous rotation
2463
-
2464
- this._angleCurrent = 0; //angle of current rotation
2465
-
2466
- this._cursorPosPrev = new Vector3(); //cursor position when previous rotate operation has been detected
2467
-
2468
- this._cursorPosCurr = new Vector3(); //cursor position when current rotate operation has been detected
2469
-
2470
- this._wPrev = 0; //angular velocity of the previous rotate operation
2471
-
2472
- this._wCurr = 0; //angular velocity of the current rotate operation
2473
- //parameters
2474
-
1613
+ this._movementThreshold = 24;
1614
+ this._currentCursorPosition = new THREE.Vector3();
1615
+ this._startCursorPosition = new THREE.Vector3();
1616
+ this._grid = null;
1617
+ this._gridPosition = new THREE.Vector3();
1618
+ this._gizmos = new THREE.Group();
1619
+ this._curvePts = 128;
1620
+ this._timeStart = -1;
1621
+ this._animationId = -1;
1622
+ this.focusAnimationTime = 500;
1623
+ this._timePrev = 0;
1624
+ this._timeCurrent = 0;
1625
+ this._anglePrev = 0;
1626
+ this._angleCurrent = 0;
1627
+ this._cursorPosPrev = new THREE.Vector3();
1628
+ this._cursorPosCurr = new THREE.Vector3();
1629
+ this._wPrev = 0;
1630
+ this._wCurr = 0;
2475
1631
  this.adjustNearFar = false;
2476
- this.scaleFactor = 1.1; //zoom/distance multiplier
2477
-
1632
+ this.scaleFactor = 1.1;
2478
1633
  this.dampingFactor = 25;
2479
- this.wMax = 20; //maximum angular velocity allowed
2480
-
2481
- this.enableAnimations = true; //if animations should be performed
2482
-
2483
- this.enableGrid = false; //if grid should be showed during pan operation
2484
-
2485
- this.cursorZoom = false; //if wheel zoom should be cursor centered
2486
-
1634
+ this.wMax = 20;
1635
+ this.enableAnimations = true;
1636
+ this.enableGrid = false;
1637
+ this.cursorZoom = false;
2487
1638
  this.minFov = 5;
2488
1639
  this.maxFov = 90;
2489
1640
  this.enabled = true;
@@ -2493,63 +1644,45 @@ class ArcballControls extends EventDispatcher {
2493
1644
  this.minDistance = 0;
2494
1645
  this.maxDistance = Infinity;
2495
1646
  this.minZoom = 0;
2496
- this.maxZoom = Infinity; //trackball parameters
2497
-
2498
- this.target = new Vector3(0, 0, 0);
2499
- this._currentTarget = new Vector3(0, 0, 0);
2500
- this._tbRadius = 1; //FSA
2501
-
1647
+ this.maxZoom = Infinity;
1648
+ this.target = new THREE.Vector3(0, 0, 0);
1649
+ this._currentTarget = new THREE.Vector3(0, 0, 0);
1650
+ this._tbRadius = 1;
2502
1651
  this._state = STATE.IDLE;
2503
- this.setCamera(_camera);
2504
-
1652
+ this.setCamera(camera);
2505
1653
  if (this.scene) {
2506
1654
  this.scene.add(this._gizmos);
2507
1655
  }
2508
-
2509
1656
  this._devPxRatio = window.devicePixelRatio;
2510
1657
  this.initializeMouseActions();
2511
- if (this.domElement) this.connect(this.domElement);
2512
- window.addEventListener('resize', this.onWindowResize);
2513
- } //listeners
2514
-
2515
-
2516
- /**
2517
- * Apply a transformation matrix, to the camera and gizmos
2518
- * @param {Object} transformation Object containing matrices to apply to camera and gizmos
2519
- */
1658
+ if (this.domElement)
1659
+ this.connect(this.domElement);
1660
+ window.addEventListener("resize", this.onWindowResize);
1661
+ }
2520
1662
  applyTransformMatrix(transformation) {
2521
- if (transformation !== null && transformation !== void 0 && transformation.camera && this.camera) {
1663
+ if ((transformation == null ? void 0 : transformation.camera) && this.camera) {
2522
1664
  this._m4_1.copy(this._cameraMatrixState).premultiply(transformation.camera);
2523
-
2524
1665
  this._m4_1.decompose(this.camera.position, this.camera.quaternion, this.camera.scale);
2525
-
2526
- this.camera.updateMatrix(); //update camera up vector
2527
-
1666
+ this.camera.updateMatrix();
2528
1667
  if (this._state == STATE.ROTATE || this._state == STATE.ZROTATE || this._state == STATE.ANIMATION_ROTATE) {
2529
1668
  this.camera.up.copy(this._upState).applyQuaternion(this.camera.quaternion);
2530
1669
  }
2531
1670
  }
2532
-
2533
- if (transformation !== null && transformation !== void 0 && transformation.gizmos) {
1671
+ if (transformation == null ? void 0 : transformation.gizmos) {
2534
1672
  this._m4_1.copy(this._gizmoMatrixState).premultiply(transformation.gizmos);
2535
-
2536
1673
  this._m4_1.decompose(this._gizmos.position, this._gizmos.quaternion, this._gizmos.scale);
2537
-
2538
1674
  this._gizmos.updateMatrix();
2539
1675
  }
2540
-
2541
1676
  if ((this._state == STATE.SCALE || this._state == STATE.FOCUS || this._state == STATE.ANIMATION_FOCUS) && this.camera) {
2542
1677
  const tbRadius = this.calculateTbRadius(this.camera);
2543
-
2544
- if (tbRadius !== undefined) {
1678
+ if (tbRadius !== void 0) {
2545
1679
  this._tbRadius = tbRadius;
2546
1680
  }
2547
-
2548
1681
  if (this.adjustNearFar) {
2549
1682
  const cameraDistance = this.camera.position.distanceTo(this._gizmos.position);
2550
- const bb = new Box3();
1683
+ const bb = new THREE.Box3();
2551
1684
  bb.setFromObject(this._gizmos);
2552
- const sphere = new Sphere();
1685
+ const sphere = new THREE.Sphere();
2553
1686
  bb.getBoundingSphere(sphere);
2554
1687
  const adjustedNearPosition = Math.max(this._nearPos0, sphere.radius + sphere.center.length());
2555
1688
  const regularNearPosition = cameraDistance - this._initialNear;
@@ -2562,52 +1695,24 @@ class ArcballControls extends EventDispatcher {
2562
1695
  this.camera.updateProjectionMatrix();
2563
1696
  } else {
2564
1697
  let update = false;
2565
-
2566
1698
  if (this.camera.near != this._initialNear) {
2567
1699
  this.camera.near = this._initialNear;
2568
1700
  update = true;
2569
1701
  }
2570
-
2571
1702
  if (this.camera.far != this._initialFar) {
2572
1703
  this.camera.far = this._initialFar;
2573
1704
  update = true;
2574
1705
  }
2575
-
2576
1706
  if (update) {
2577
1707
  this.camera.updateProjectionMatrix();
2578
1708
  }
2579
1709
  }
2580
1710
  }
2581
1711
  }
2582
- /**
2583
- * Calculate the angular speed
2584
- * @param {Number} p0 Position at t0
2585
- * @param {Number} p1 Position at t1
2586
- * @param {Number} t0 Initial time in milliseconds
2587
- * @param {Number} t1 Ending time in milliseconds
2588
- */
2589
-
2590
-
2591
- /**
2592
- * Set gizmos visibility
2593
- * @param {Boolean} value Value of gizmos visibility
2594
- */
2595
1712
  setGizmosVisible(value) {
2596
1713
  this._gizmos.visible = value;
2597
1714
  this.dispatchEvent(_changeEvent);
2598
1715
  }
2599
- /**
2600
- * Creates the rotation gizmos matching trackball center and radius
2601
- * @param {Vector3} tbCenter The trackball center
2602
- * @param {number} tbRadius The trackball radius
2603
- */
2604
-
2605
-
2606
- /**
2607
- * Set values in transformation object
2608
- * @param {Matrix4} camera Transformation to be applied to the camera
2609
- * @param {Matrix4} gizmos Transformation to be applied to gizmos
2610
- */
2611
1716
  setTransformationMatrices(camera = null, gizmos = null) {
2612
1717
  if (camera) {
2613
1718
  if (_transformation.camera) {
@@ -2618,7 +1723,6 @@ class ArcballControls extends EventDispatcher {
2618
1723
  } else {
2619
1724
  _transformation.camera = null;
2620
1725
  }
2621
-
2622
1726
  if (gizmos) {
2623
1727
  if (_transformation.gizmos) {
2624
1728
  _transformation.gizmos.copy(gizmos);
@@ -2629,14 +1733,5 @@ class ArcballControls extends EventDispatcher {
2629
1733
  _transformation.gizmos = null;
2630
1734
  }
2631
1735
  }
2632
- /**
2633
- * Rotate camera around its direction axis passing by a given point by a given angle
2634
- * @param {Vector3} point The point where the rotation axis is passing trough
2635
- * @param {Number} angle Angle in radians
2636
- * @returns The computed transormation matix
2637
- */
2638
-
2639
-
2640
1736
  }
2641
-
2642
- export { ArcballControls };
1737
+ exports.ArcballControls = ArcballControls;