@shopware-ag/dive 2.0.1-beta.1 → 2.0.1-beta.11

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 (280) hide show
  1. package/build/chunks/AssetCache-CsfCIl9J.mjs +79 -0
  2. package/build/chunks/AssetCache-DGLqbo2B.cjs +1 -0
  3. package/build/chunks/AssetExporter-DsbC2rqv.cjs +164 -0
  4. package/build/{src/modules/asset/exporter/AssetExporter.mjs → chunks/AssetExporter-brT7ogoM.mjs} +22 -21
  5. package/build/chunks/AssetLoader-DvF8gL8a.mjs +2341 -0
  6. package/build/chunks/AssetLoader-H_GSIMop.cjs +4 -0
  7. package/build/chunks/FileTypes-CHutqD19.cjs +30 -0
  8. package/build/chunks/FileTypes-IBuu9ohV.mjs +1057 -0
  9. package/build/chunks/MathUtils-CBW56ZuG.cjs +1 -0
  10. package/build/chunks/MathUtils-CFGjHuVF.mjs +159 -0
  11. package/build/chunks/OrbitController-BQ6SV1O_.mjs +1159 -0
  12. package/build/chunks/OrbitController-CpFQ3A1H.cjs +1 -0
  13. package/build/chunks/{PerspectiveCamera-sm4_81KJ.mjs → PerspectiveCamera-PMJPzAn3.mjs} +2 -2
  14. package/build/chunks/PovSchema-Co9FznEz.cjs +1 -0
  15. package/build/chunks/PovSchema-DWWvr_ED.mjs +10 -0
  16. package/build/chunks/{SelectTool-Bd8cC9nb.mjs → SelectTool-BU0vTDXg.mjs} +44 -39
  17. package/build/chunks/SelectTool-CAqDMcoM.cjs +1 -0
  18. package/build/chunks/draco_decoder-Bh9flJPu.cjs +1 -0
  19. package/build/chunks/draco_decoder-CEzwqP9o.mjs +38 -0
  20. package/build/chunks/draco_decoder-DtHHc5d0.mjs +4 -0
  21. package/build/chunks/draco_decoder-DvYjcLz_.cjs +35 -0
  22. package/build/chunks/draco_wasm_wrapper-FoEVV9af.cjs +118 -0
  23. package/build/chunks/draco_wasm_wrapper-yQy2VLhb.mjs +121 -0
  24. package/build/chunks/fflate.module-DHdJvhNh.cjs +6 -0
  25. package/build/chunks/fflate.module-xyO_T3Zm.mjs +602 -0
  26. package/build/chunks/findInterface-C6mrvf_t.cjs +1 -0
  27. package/build/chunks/findInterface-DbJ5qzbc.mjs +11 -0
  28. package/build/chunks/isFileTypeSupported-BSpswPHU.mjs +12 -0
  29. package/build/chunks/isFileTypeSupported-CrEqYiv9.cjs +1 -0
  30. package/build/chunks/network-error-BONfHWQq.mjs +14 -0
  31. package/build/chunks/network-error-CdDXil5g.cjs +1 -0
  32. package/build/chunks/package-CmvmIjT5.cjs +1 -0
  33. package/build/chunks/package-DSKqbNMb.mjs +39 -0
  34. package/build/chunks/parse-error-DfOPyLWM.mjs +14 -0
  35. package/build/chunks/parse-error-Dy_EE4rL.cjs +1 -0
  36. package/build/dive.cjs +1 -30
  37. package/build/dive.mjs +674 -1535
  38. package/build/plugins/animation/index.cjs +1 -0
  39. package/build/plugins/animation/index.d.ts +2 -0
  40. package/build/plugins/animation/index.mjs +126 -0
  41. package/build/plugins/ar/index.cjs +1 -0
  42. package/build/plugins/ar/index.d.ts +2 -0
  43. package/build/plugins/ar/index.mjs +207 -0
  44. package/build/plugins/assetcache/index.cjs +1 -0
  45. package/build/plugins/assetcache/index.d.ts +2 -0
  46. package/build/plugins/assetcache/index.mjs +5 -0
  47. package/build/plugins/assetconverter/index.d.ts +2 -0
  48. package/build/plugins/assetexporter/index.cjs +1 -0
  49. package/build/plugins/assetexporter/index.d.ts +2 -0
  50. package/build/plugins/assetexporter/index.mjs +4 -0
  51. package/build/plugins/assetloader/index.cjs +1 -0
  52. package/build/plugins/assetloader/index.d.ts +2 -0
  53. package/build/plugins/assetloader/index.mjs +6 -0
  54. package/build/plugins/mediacreator/index.cjs +1 -0
  55. package/build/plugins/mediacreator/index.d.ts +2 -0
  56. package/build/{src/modules/mediacreator/MediaCreator.mjs → plugins/mediacreator/index.mjs} +4 -4
  57. package/build/plugins/orbitcontroller/index.cjs +1 -0
  58. package/build/plugins/orbitcontroller/index.d.ts +2 -0
  59. package/build/plugins/orbitcontroller/index.mjs +5 -0
  60. package/build/plugins/orientationdisplay/index.cjs +1 -0
  61. package/build/plugins/orientationdisplay/index.d.ts +2 -0
  62. package/build/plugins/orientationdisplay/index.mjs +5 -0
  63. package/build/plugins/state/index.cjs +27 -0
  64. package/build/plugins/state/index.d.ts +2 -0
  65. package/build/plugins/state/index.mjs +4266 -0
  66. package/build/plugins/systeminfo/index.cjs +1 -0
  67. package/build/plugins/systeminfo/index.d.ts +2 -0
  68. package/build/{chunks/SystemInfo-DPAQG-S5.mjs → plugins/systeminfo/index.mjs} +48 -51
  69. package/build/plugins/toolbox/index.cjs +1 -0
  70. package/build/plugins/toolbox/index.d.ts +2 -0
  71. package/build/{src/modules/toolbox/Toolbox.mjs → plugins/toolbox/index.mjs} +29 -23
  72. package/build/src/components/boundingbox/BoundingBox.d.ts +136 -0
  73. package/build/src/components/gizmo/Gizmo.d.ts +1 -1
  74. package/build/src/components/gizmo/handles/AxisHandle.d.ts +1 -1
  75. package/build/src/components/gizmo/handles/RadialHandle.d.ts +1 -1
  76. package/build/src/components/gizmo/handles/ScaleHandle.d.ts +1 -1
  77. package/build/src/components/gizmo/rotate/RotateGizmo.d.ts +2 -2
  78. package/build/src/components/gizmo/scale/ScaleGizmo.d.ts +2 -2
  79. package/build/src/components/gizmo/translate/TranslateGizmo.d.ts +2 -2
  80. package/build/src/components/group/Group.d.ts +4 -4
  81. package/build/src/components/model/Model.d.ts +2 -2
  82. package/build/src/components/node/Node.d.ts +7 -7
  83. package/build/src/components/primitive/Primitive.d.ts +3 -3
  84. package/build/src/components/root/Root.d.ts +5 -7
  85. package/build/src/core/Dive.d.ts +5 -4
  86. package/build/src/engine/clock/Clock.d.ts +1 -0
  87. package/build/src/engine/index.d.ts +6 -0
  88. package/build/src/engine/renderer/Renderer.d.ts +47 -7
  89. package/build/src/engine/scene/xrroot/XRRoot.d.ts +2 -2
  90. package/build/src/engine/scene/xrroot/xrlightroot/XRLightRoot.d.ts +2 -2
  91. package/build/src/error/file-content/file-content-error.d.ts +4 -0
  92. package/build/src/error/index.d.ts +4 -0
  93. package/build/src/error/network/network-error.d.ts +1 -1
  94. package/build/src/error/parse/parse-error.d.ts +2 -1
  95. package/build/src/events/dispatcher/EventDispatcher.d.ts +6 -0
  96. package/build/src/events/index.d.ts +1 -0
  97. package/build/src/helpers/deepClone/deepClone.d.ts +34 -0
  98. package/build/src/helpers/index.d.ts +5 -4
  99. package/build/src/index.d.ts +5 -5
  100. package/build/src/interfaces/Draggable.d.ts +1 -1
  101. package/build/src/plugins/animation/index.d.ts +2 -0
  102. package/build/src/{modules/animation → plugins/animation/src}/animator/Animator.d.ts +2 -3
  103. package/build/src/plugins/animation/src/index.d.ts +3 -0
  104. package/build/src/plugins/animation/src/system/AnimationSystem.d.ts +23 -0
  105. package/build/src/plugins/ar/index.d.ts +4 -0
  106. package/build/src/plugins/ar/src/ARSystem.d.ts +24 -0
  107. package/build/src/plugins/ar/src/arquicklook/ARQuickLook.d.ts +15 -0
  108. package/build/src/plugins/ar/src/error/ar-errors.d.ts +24 -0
  109. package/build/src/{modules/ar → plugins/ar/src}/sceneviewer/SceneViewer.d.ts +10 -0
  110. package/build/src/{modules/ar → plugins/ar/src}/webxr/WebXR.d.ts +4 -4
  111. package/build/src/{modules/ar → plugins/ar/src}/webxr/controller/WebXRController.d.ts +5 -5
  112. package/build/src/{modules/ar → plugins/ar/src}/webxr/crosshair/WebXRCrosshair.d.ts +2 -2
  113. package/build/src/{modules/ar → plugins/ar/src}/webxr/origin/WebXROrigin.d.ts +4 -4
  114. package/build/src/{modules/ar → plugins/ar/src}/webxr/overlay/Overlay.d.ts +2 -2
  115. package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/WebXRRaycaster.d.ts +8 -8
  116. package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +4 -4
  117. package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +4 -4
  118. package/build/src/{modules/ar → plugins/ar/src}/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +3 -3
  119. package/build/src/plugins/assetcache/index.d.ts +1 -0
  120. package/build/src/plugins/assetcache/src/cache/AssetCache.d.ts +12 -0
  121. package/build/src/plugins/assetcache/src/chunk/Chunk.d.ts +16 -0
  122. package/build/src/plugins/assetcache/src/index.d.ts +2 -0
  123. package/build/src/plugins/assetconverter/index.d.ts +1 -0
  124. package/build/src/plugins/assetconverter/src/AssetConverter.d.ts +13 -0
  125. package/build/src/plugins/assetexporter/index.d.ts +1 -0
  126. package/build/src/{modules/asset/exporter → plugins/assetexporter/src}/AssetExporter.d.ts +0 -17
  127. package/build/src/plugins/assetloader/index.d.ts +3 -0
  128. package/build/src/plugins/assetloader/src/draco/DracoLoader.d.ts +10 -0
  129. package/build/src/plugins/assetloader/src/loader/AssetLoader.d.ts +14 -0
  130. package/build/src/plugins/mediacreator/index.d.ts +1 -0
  131. package/build/src/plugins/mediacreator/src/MediaCreator.d.ts +15 -0
  132. package/build/src/plugins/orbitcontroller/index.d.ts +1 -0
  133. package/build/src/plugins/orbitcontroller/src/OrbitController.d.ts +45 -0
  134. package/build/src/plugins/orientationdisplay/index.d.ts +2 -0
  135. package/build/src/plugins/orientationdisplay/src/OrientationDisplay.d.ts +18 -0
  136. package/build/src/plugins/orientationdisplay/src/axes/Axes.d.ts +6 -0
  137. package/build/src/plugins/state/index.d.ts +4 -0
  138. package/build/src/{modules/state → plugins/state/src}/State.d.ts +4 -27
  139. package/build/src/{modules/state → plugins/state/src}/actions/action.d.ts +1 -1
  140. package/build/src/{modules/state → plugins/state/src}/actions/ar/launchar.d.ts +2 -2
  141. package/build/src/{modules/state → plugins/state/src}/actions/camera/computeencompassingview.d.ts +1 -1
  142. package/build/src/{modules/state → plugins/state/src}/actions/camera/getcameratransform.d.ts +1 -1
  143. package/build/src/{modules/state → plugins/state/src}/actions/camera/lockcamera.d.ts +1 -1
  144. package/build/src/{modules/state → plugins/state/src}/actions/camera/movecamera.d.ts +3 -3
  145. package/build/src/{modules/state → plugins/state/src}/actions/camera/setcameralayer.d.ts +1 -1
  146. package/build/src/{modules/state → plugins/state/src}/actions/camera/setcameratransform.d.ts +1 -1
  147. package/build/src/{modules/state → plugins/state/src}/actions/camera/zoomcamera.d.ts +1 -1
  148. package/build/src/{modules/state → plugins/state/src}/actions/media/generatemedia.d.ts +1 -1
  149. package/build/src/plugins/state/src/actions/object/addobject.d.ts +9 -0
  150. package/build/src/plugins/state/src/actions/object/deleteobject.d.ts +13 -0
  151. package/build/src/plugins/state/src/actions/object/deselectobject.d.ts +13 -0
  152. package/build/src/{modules/state → plugins/state/src}/actions/object/dropit.d.ts +3 -3
  153. package/build/src/{modules/state → plugins/state/src}/actions/object/getallobjects.d.ts +3 -2
  154. package/build/src/plugins/state/src/actions/object/getobjects.d.ts +13 -0
  155. package/build/src/{modules/state → plugins/state/src}/actions/object/modelloaded.d.ts +1 -1
  156. package/build/src/{modules/state → plugins/state/src}/actions/object/placeonfloor.d.ts +3 -3
  157. package/build/src/plugins/state/src/actions/object/selectobject.d.ts +13 -0
  158. package/build/src/plugins/state/src/actions/object/setparent.d.ts +23 -0
  159. package/build/src/plugins/state/src/actions/object/updateobject.d.ts +13 -0
  160. package/build/src/{modules/state → plugins/state/src}/actions/renderer/startrender.d.ts +1 -1
  161. package/build/src/{modules/state → plugins/state/src}/actions/scene/exportscene.d.ts +4 -4
  162. package/build/src/plugins/state/src/actions/scene/getallscenedata.d.ts +9 -0
  163. package/build/src/{modules/state → plugins/state/src}/actions/scene/setbackground.d.ts +1 -1
  164. package/build/src/{modules/state → plugins/state/src}/actions/scene/updatescene.d.ts +1 -1
  165. package/build/src/{modules/state → plugins/state/src}/actions/toolbox/setgizmomode.d.ts +1 -1
  166. package/build/src/{modules/state → plugins/state/src}/actions/toolbox/setgizmoscalelinked.d.ts +1 -1
  167. package/build/src/plugins/state/src/actions/toolbox/setgizmovisible.d.ts +8 -0
  168. package/build/src/{modules/state → plugins/state/src}/actions/toolbox/usetool.d.ts +2 -2
  169. package/build/src/plugins/state/types/ActionTypes.d.ts +17 -0
  170. package/build/src/{types/SceneType.d.ts → plugins/state/types/StateExportFileType.d.ts} +1 -1
  171. package/build/src/plugins/state/types/StateSceneData.d.ts +19 -0
  172. package/build/src/plugins/state/types/index.d.ts +1 -0
  173. package/build/src/plugins/systeminfo/index.d.ts +2 -0
  174. package/build/src/{modules/systeminfo → plugins/systeminfo/src}/SystemInfo.d.ts +22 -32
  175. package/build/src/plugins/toolbox/index.d.ts +4 -0
  176. package/build/src/{modules/toolbox → plugins/toolbox/src}/BaseTool.d.ts +4 -6
  177. package/build/src/{modules/toolbox → plugins/toolbox/src}/Toolbox.d.ts +8 -17
  178. package/build/src/{modules/toolbox → plugins/toolbox/src}/select/SelectTool.d.ts +7 -11
  179. package/build/src/{modules/toolbox → plugins/toolbox/src}/transform/TransformTool.d.ts +6 -10
  180. package/build/src/types/components/DIVELight.d.ts +4 -0
  181. package/build/src/types/components/DIVESceneObject.d.ts +6 -0
  182. package/build/src/types/components/index.d.ts +2 -0
  183. package/build/src/types/index.d.ts +2 -5
  184. package/build/src/types/schema/BaseEntitySchema.d.ts +8 -0
  185. package/build/src/types/schema/EntitySchema.d.ts +11 -0
  186. package/build/src/types/schema/EntityTypeSchema.d.ts +1 -0
  187. package/build/src/types/schema/GeometrySchema.d.ts +7 -0
  188. package/build/src/types/schema/GeometryTypeSchema.d.ts +1 -0
  189. package/build/src/types/schema/GroupSchema.d.ts +11 -0
  190. package/build/src/types/schema/LightSchema.d.ts +28 -0
  191. package/build/src/{modules/state/types/COMMaterial.d.ts → types/schema/MaterialSchema.d.ts} +1 -1
  192. package/build/src/types/schema/ModelSchema.d.ts +14 -0
  193. package/build/src/types/schema/PovSchema.d.ts +10 -0
  194. package/build/src/types/schema/PrimitiveSchema.d.ts +14 -0
  195. package/build/src/types/schema/index.d.ts +11 -0
  196. package/package.json +59 -41
  197. package/build/chunks/FileTypes-BjZ0rrIV.cjs +0 -1
  198. package/build/chunks/FileTypes-qgYnI0Jg.mjs +0 -30
  199. package/build/chunks/ModuleRegistry-NyNtjHb2.cjs +0 -1
  200. package/build/chunks/ModuleRegistry-RSub8W0G.mjs +0 -13
  201. package/build/chunks/SelectTool-BAXTVyWs.cjs +0 -1
  202. package/build/chunks/SystemInfo-oX-NNneO.cjs +0 -1
  203. package/build/chunks/findInterface-BEdL2iUQ.cjs +0 -1
  204. package/build/chunks/findInterface-OrXgmwxj.mjs +0 -18
  205. package/build/chunks/index-C_uFFwT2.mjs +0 -5
  206. package/build/chunks/index-DAwIH9xh.cjs +0 -1
  207. package/build/chunks/package-BHjZWYD6.mjs +0 -39
  208. package/build/chunks/package-JHvTSNgQ.cjs +0 -1
  209. package/build/chunks/parse-error-2f5qpXP5.cjs +0 -6
  210. package/build/chunks/parse-error-DRBVHL9E.mjs +0 -614
  211. package/build/src/error/ar-compatibility/ar-compatibility-error.d.ts +0 -12
  212. package/build/src/modules/ModuleRegistry.d.ts +0 -19
  213. package/build/src/modules/animation/AnimationSystem.cjs +0 -1
  214. package/build/src/modules/animation/AnimationSystem.d.ts +0 -36
  215. package/build/src/modules/animation/AnimationSystem.mjs +0 -95
  216. package/build/src/modules/ar/ARSystem.cjs +0 -1
  217. package/build/src/modules/ar/ARSystem.d.ts +0 -71
  218. package/build/src/modules/ar/ARSystem.mjs +0 -163
  219. package/build/src/modules/ar/arquicklook/ARQuickLook.d.ts +0 -7
  220. package/build/src/modules/asset/converter/AssetConverter.d.ts +0 -30
  221. package/build/src/modules/asset/draco/README.md +0 -32
  222. package/build/src/modules/asset/draco/draco_decoder.js +0 -33
  223. package/build/src/modules/asset/draco/draco_decoder.wasm +0 -0
  224. package/build/src/modules/asset/draco/draco_encoder.js +0 -33
  225. package/build/src/modules/asset/draco/draco_wasm_wrapper.js +0 -116
  226. package/build/src/modules/asset/draco/gltf/draco_decoder.js +0 -33
  227. package/build/src/modules/asset/draco/gltf/draco_decoder.wasm +0 -0
  228. package/build/src/modules/asset/draco/gltf/draco_encoder.js +0 -33
  229. package/build/src/modules/asset/draco/gltf/draco_wasm_wrapper.js +0 -116
  230. package/build/src/modules/asset/exporter/AssetExporter.cjs +0 -164
  231. package/build/src/modules/asset/loader/AssetLoader.cjs +0 -3
  232. package/build/src/modules/asset/loader/AssetLoader.d.ts +0 -29
  233. package/build/src/modules/asset/loader/AssetLoader.mjs +0 -2154
  234. package/build/src/modules/axiscamera/AxisCamera.d.ts +0 -21
  235. package/build/src/modules/controller/orbit/OrbitController.d.ts +0 -30
  236. package/build/src/modules/events/EventExecutor.d.ts +0 -5
  237. package/build/src/modules/mediacreator/MediaCreator.cjs +0 -1
  238. package/build/src/modules/mediacreator/MediaCreator.d.ts +0 -44
  239. package/build/src/modules/state/State.cjs +0 -27
  240. package/build/src/modules/state/State.mjs +0 -4296
  241. package/build/src/modules/state/actions/object/addobject.d.ts +0 -8
  242. package/build/src/modules/state/actions/object/deleteobject.d.ts +0 -12
  243. package/build/src/modules/state/actions/object/deselectobject.d.ts +0 -12
  244. package/build/src/modules/state/actions/object/getobjects.d.ts +0 -12
  245. package/build/src/modules/state/actions/object/selectobject.d.ts +0 -12
  246. package/build/src/modules/state/actions/object/setparent.d.ts +0 -22
  247. package/build/src/modules/state/actions/object/updateobject.d.ts +0 -12
  248. package/build/src/modules/state/actions/scene/getallscenedata.d.ts +0 -9
  249. package/build/src/modules/state/actions/toolbox/setgizmovisible.d.ts +0 -8
  250. package/build/src/modules/state/types/ActionTypes.d.ts +0 -18
  251. package/build/src/modules/state/types/COMBaseEntity.d.ts +0 -8
  252. package/build/src/modules/state/types/COMEntity.d.ts +0 -11
  253. package/build/src/modules/state/types/COMEntityType.d.ts +0 -1
  254. package/build/src/modules/state/types/COMGeometry.d.ts +0 -7
  255. package/build/src/modules/state/types/COMGeometryType.d.ts +0 -1
  256. package/build/src/modules/state/types/COMGroup.d.ts +0 -11
  257. package/build/src/modules/state/types/COMLight.d.ts +0 -28
  258. package/build/src/modules/state/types/COMModel.d.ts +0 -14
  259. package/build/src/modules/state/types/COMPov.d.ts +0 -10
  260. package/build/src/modules/state/types/COMPrimitive.d.ts +0 -14
  261. package/build/src/modules/state/types/index.d.ts +0 -11
  262. package/build/src/modules/systeminfo/SystemInfo.cjs +0 -1
  263. package/build/src/modules/systeminfo/SystemInfo.mjs +0 -5
  264. package/build/src/modules/toolbox/Toolbox.cjs +0 -1
  265. package/build/src/types/SceneData.d.ts +0 -19
  266. package/build/src/types/SceneObjects.d.ts +0 -9
  267. package/build/src/types/UUID.d.ts +0 -1
  268. /package/build/{src/modules/asset/converter/AssetConverter.cjs → plugins/assetconverter/index.cjs} +0 -0
  269. /package/build/{src/modules/asset/converter/AssetConverter.mjs → plugins/assetconverter/index.mjs} +0 -0
  270. /package/build/src/{modules/animation → plugins/animation/src}/types/AnimatorParameters.d.ts +0 -0
  271. /package/build/src/{modules/state → plugins/state/src}/ActionRegistry.d.ts +0 -0
  272. /package/build/src/{modules/state → plugins/state/src}/actions/ar/index.d.ts +0 -0
  273. /package/build/src/{modules/state → plugins/state/src}/actions/camera/index.d.ts +0 -0
  274. /package/build/src/{modules/state → plugins/state/src}/actions/index.d.ts +0 -0
  275. /package/build/src/{modules/state → plugins/state/src}/actions/media/index.d.ts +0 -0
  276. /package/build/src/{modules/state → plugins/state/src}/actions/object/index.d.ts +0 -0
  277. /package/build/src/{modules/state → plugins/state/src}/actions/renderer/index.d.ts +0 -0
  278. /package/build/src/{modules/state → plugins/state/src}/actions/scene/index.d.ts +0 -0
  279. /package/build/src/{modules/state → plugins/state/src}/actions/toolbox/index.d.ts +0 -0
  280. /package/build/src/{types/info → plugins/systeminfo/types}/index.d.ts +0 -0
package/build/dive.mjs CHANGED
@@ -1,1611 +1,699 @@
1
- var Dt = Object.defineProperty;
2
- var xt = (h, s, t) => s in h ? Dt(h, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[s] = t;
3
- var a = (h, s, t) => xt(h, typeof s != "symbol" ? s + "" : s, t);
4
- import { Ray as St, Plane as Tt, MathUtils as C, EventDispatcher as Lt, Vector3 as m, MOUSE as U, TOUCH as G, Spherical as Ne, Quaternion as Fe, Vector2 as E, OrthographicCamera as Pt, Vector4 as Mt, AxesHelper as It, Color as D, Matrix4 as Ct, Object3D as j, AmbientLight as vt, PointLight as Ot, SphereGeometry as Ke, MeshBasicMaterial as At, FrontSide as kt, Mesh as pe, HemisphereLight as Rt, DirectionalLight as Vt, Box3 as Ze, MeshStandardMaterial as fe, Raycaster as Xe, CylinderGeometry as Bt, BufferGeometry as qe, BufferAttribute as Ye, BoxGeometry as de, ConeGeometry as zt, LineDashedMaterial as Nt, Line as Ft, PlaneGeometry as Yt, GridHelper as Ut, Scene as Gt, WebGLRenderer as Ue } from "three";
5
- import ue from "three-spritetext";
6
- import { C as q, P, U as jt, H as Ht } from "./chunks/VisibilityLayerMask-CXgt1fJc.mjs";
7
- import { A as Wt, a as Kt, b as Zt, c as Xt, d as qt, e as Jt } from "./chunks/findInterface-OrXgmwxj.mjs";
8
- import { f as Fi, i as Yi } from "./chunks/findInterface-OrXgmwxj.mjs";
9
- import { g as w } from "./chunks/ModuleRegistry-RSub8W0G.mjs";
10
- import { D as $t, a as Qt } from "./chunks/PerspectiveCamera-sm4_81KJ.mjs";
11
- import { F as Gi, S as ji, g as Hi, i as Wi } from "./chunks/FileTypes-qgYnI0Jg.mjs";
12
- import { E as Zi, a as Xi } from "./chunks/index-C_uFFwT2.mjs";
13
- const Ge = { type: "change" }, me = { type: "start" }, je = { type: "end" }, ie = new St(), He = new Tt(), ei = Math.cos(70 * C.DEG2RAD);
14
- class ti extends Lt {
15
- constructor(s, t) {
16
- super(), this.object = s, this.domElement = t, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new m(), this.cursor = new m(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: U.ROTATE, MIDDLE: U.DOLLY, RIGHT: U.PAN }, this.touches = { ONE: G.ROTATE, TWO: G.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
17
- return l.phi;
18
- }, this.getAzimuthalAngle = function() {
19
- return l.theta;
20
- }, this.getDistance = function() {
21
- return this.object.position.distanceTo(this.target);
22
- }, this.listenToKeyEvents = function(i) {
23
- i.addEventListener("keydown", ce), this._domElementKeyEvents = i;
24
- }, this.stopListenToKeyEvents = function() {
25
- this._domElementKeyEvents.removeEventListener("keydown", ce), this._domElementKeyEvents = null;
26
- }, this.saveState = function() {
27
- e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
28
- }, this.reset = function() {
29
- e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Ge), e.update(), o = n.NONE;
30
- }, this.update = function() {
31
- const i = new m(), r = new Fe().setFromUnitVectors(s.up, new m(0, 1, 0)), d = r.clone().invert(), u = new m(), y = new Fe(), I = new m(), b = 2 * Math.PI;
32
- return function(Et = null) {
33
- const Be = e.object.position;
34
- i.copy(Be).sub(e.target), i.applyQuaternion(r), l.setFromVector3(i), e.autoRotate && o === n.NONE && W(st(Et)), e.enableDamping ? (l.theta += p.theta * e.dampingFactor, l.phi += p.phi * e.dampingFactor) : (l.theta += p.theta, l.phi += p.phi);
35
- let S = e.minAzimuthAngle, T = e.maxAzimuthAngle;
36
- isFinite(S) && isFinite(T) && (S < -Math.PI ? S += b : S > Math.PI && (S -= b), T < -Math.PI ? T += b : T > Math.PI && (T -= b), S <= T ? l.theta = Math.max(S, Math.min(T, l.theta)) : l.theta = l.theta > (S + T) / 2 ? Math.max(S, l.theta) : Math.min(T, l.theta)), l.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, l.phi)), l.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(_, e.dampingFactor) : e.target.add(_), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor);
37
- let Z = !1;
38
- if (e.zoomToCursor && $ || e.object.isOrthographicCamera)
39
- l.radius = he(l.radius);
40
- else {
41
- const L = l.radius;
42
- l.radius = he(l.radius * f), Z = L != l.radius;
43
- }
44
- if (i.setFromSpherical(l), i.applyQuaternion(d), Be.copy(e.target).add(i), e.object.lookAt(e.target), e.enableDamping === !0 ? (p.theta *= 1 - e.dampingFactor, p.phi *= 1 - e.dampingFactor, _.multiplyScalar(1 - e.dampingFactor)) : (p.set(0, 0, 0), _.set(0, 0, 0)), e.zoomToCursor && $) {
45
- let L = null;
46
- if (e.object.isPerspectiveCamera) {
47
- const X = i.length();
48
- L = he(X * f);
49
- const te = X - L;
50
- e.object.position.addScaledVector(ye, te), e.object.updateMatrixWorld(), Z = !!te;
51
- } else if (e.object.isOrthographicCamera) {
52
- const X = new m(M.x, M.y, 0);
53
- X.unproject(e.object);
54
- const te = e.object.zoom;
55
- e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), e.object.updateProjectionMatrix(), Z = te !== e.object.zoom;
56
- const ze = new m(M.x, M.y, 0);
57
- ze.unproject(e.object), e.object.position.sub(ze).add(X), e.object.updateMatrixWorld(), L = i.length();
58
- } else
59
- console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
60
- L !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(L).add(e.object.position) : (ie.origin.copy(e.object.position), ie.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(ie.direction)) < ei ? s.lookAt(e.target) : (He.setFromNormalAndCoplanarPoint(e.object.up, e.target), ie.intersectPlane(He, e.target))));
61
- } else if (e.object.isOrthographicCamera) {
62
- const L = e.object.zoom;
63
- e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), L !== e.object.zoom && (e.object.updateProjectionMatrix(), Z = !0);
64
- }
65
- return f = 1, $ = !1, Z || u.distanceToSquared(e.object.position) > c || 8 * (1 - y.dot(e.object.quaternion)) > c || I.distanceToSquared(e.target) > c ? (e.dispatchEvent(Ge), u.copy(e.object.position), y.copy(e.object.quaternion), I.copy(e.target), !0) : !1;
66
- };
67
- }(), this.dispose = function() {
68
- e.domElement.removeEventListener("contextmenu", Re), e.domElement.removeEventListener("pointerdown", Ce), e.domElement.removeEventListener("pointercancel", K), e.domElement.removeEventListener("wheel", ve), e.domElement.removeEventListener("pointermove", le), e.domElement.removeEventListener("pointerup", K), e.domElement.getRootNode().removeEventListener("keydown", Oe, { capture: !0 }), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", ce), e._domElementKeyEvents = null);
69
- };
70
- const e = this, n = {
71
- NONE: -1,
72
- ROTATE: 0,
73
- DOLLY: 1,
74
- PAN: 2,
75
- TOUCH_ROTATE: 3,
76
- TOUCH_PAN: 4,
77
- TOUCH_DOLLY_PAN: 5,
78
- TOUCH_DOLLY_ROTATE: 6
79
- };
80
- let o = n.NONE;
81
- const c = 1e-6, l = new Ne(), p = new Ne();
82
- let f = 1;
83
- const _ = new m(), v = new E(), O = new E(), V = new E(), A = new E(), k = new E(), B = new E(), z = new E(), N = new E(), R = new E(), ye = new m(), M = new E();
84
- let $ = !1;
85
- const g = [], H = {};
86
- let oe = !1;
87
- function st(i) {
88
- return i !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * i : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
89
- }
90
- function Q(i) {
91
- const r = Math.abs(i * 0.01);
92
- return Math.pow(0.95, e.zoomSpeed * r);
93
- }
94
- function W(i) {
95
- p.theta -= i;
96
- }
97
- function ee(i) {
98
- p.phi -= i;
99
- }
100
- const be = function() {
101
- const i = new m();
102
- return function(d, u) {
103
- i.setFromMatrixColumn(u, 0), i.multiplyScalar(-d), _.add(i);
104
- };
105
- }(), we = function() {
106
- const i = new m();
107
- return function(d, u) {
108
- e.screenSpacePanning === !0 ? i.setFromMatrixColumn(u, 1) : (i.setFromMatrixColumn(u, 0), i.crossVectors(e.object.up, i)), i.multiplyScalar(d), _.add(i);
109
- };
110
- }(), F = function() {
111
- const i = new m();
112
- return function(d, u) {
113
- const y = e.domElement;
114
- if (e.object.isPerspectiveCamera) {
115
- const I = e.object.position;
116
- i.copy(I).sub(e.target);
117
- let b = i.length();
118
- b *= Math.tan(e.object.fov / 2 * Math.PI / 180), be(2 * d * b / y.clientHeight, e.object.matrix), we(2 * u * b / y.clientHeight, e.object.matrix);
119
- } else e.object.isOrthographicCamera ? (be(d * (e.object.right - e.object.left) / e.object.zoom / y.clientWidth, e.object.matrix), we(u * (e.object.top - e.object.bottom) / e.object.zoom / y.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
120
- };
121
- }();
122
- function re(i) {
123
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? f /= i : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
124
- }
125
- function Ee(i) {
126
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? f *= i : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
127
- }
128
- function ae(i, r) {
129
- if (!e.zoomToCursor)
130
- return;
131
- $ = !0;
132
- const d = e.domElement.getBoundingClientRect(), u = i - d.left, y = r - d.top, I = d.width, b = d.height;
133
- M.x = u / I * 2 - 1, M.y = -(y / b) * 2 + 1, ye.set(M.x, M.y, 1).unproject(e.object).sub(e.object.position).normalize();
134
- }
135
- function he(i) {
136
- return Math.max(e.minDistance, Math.min(e.maxDistance, i));
137
- }
138
- function De(i) {
139
- v.set(i.clientX, i.clientY);
140
- }
141
- function nt(i) {
142
- ae(i.clientX, i.clientX), z.set(i.clientX, i.clientY);
143
- }
144
- function xe(i) {
145
- A.set(i.clientX, i.clientY);
146
- }
147
- function ot(i) {
148
- O.set(i.clientX, i.clientY), V.subVectors(O, v).multiplyScalar(e.rotateSpeed);
149
- const r = e.domElement;
150
- W(2 * Math.PI * V.x / r.clientHeight), ee(2 * Math.PI * V.y / r.clientHeight), v.copy(O), e.update();
151
- }
152
- function rt(i) {
153
- N.set(i.clientX, i.clientY), R.subVectors(N, z), R.y > 0 ? re(Q(R.y)) : R.y < 0 && Ee(Q(R.y)), z.copy(N), e.update();
154
- }
155
- function at(i) {
156
- k.set(i.clientX, i.clientY), B.subVectors(k, A).multiplyScalar(e.panSpeed), F(B.x, B.y), A.copy(k), e.update();
157
- }
158
- function ht(i) {
159
- ae(i.clientX, i.clientY), i.deltaY < 0 ? Ee(Q(i.deltaY)) : i.deltaY > 0 && re(Q(i.deltaY)), e.update();
160
- }
161
- function lt(i) {
162
- let r = !1;
163
- switch (i.code) {
164
- case e.keys.UP:
165
- i.ctrlKey || i.metaKey || i.shiftKey ? ee(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : F(0, e.keyPanSpeed), r = !0;
166
- break;
167
- case e.keys.BOTTOM:
168
- i.ctrlKey || i.metaKey || i.shiftKey ? ee(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : F(0, -e.keyPanSpeed), r = !0;
169
- break;
170
- case e.keys.LEFT:
171
- i.ctrlKey || i.metaKey || i.shiftKey ? W(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : F(e.keyPanSpeed, 0), r = !0;
172
- break;
173
- case e.keys.RIGHT:
174
- i.ctrlKey || i.metaKey || i.shiftKey ? W(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : F(-e.keyPanSpeed, 0), r = !0;
175
- break;
176
- }
177
- r && (i.preventDefault(), e.update());
178
- }
179
- function Se(i) {
180
- if (g.length === 1)
181
- v.set(i.pageX, i.pageY);
182
- else {
183
- const r = Y(i), d = 0.5 * (i.pageX + r.x), u = 0.5 * (i.pageY + r.y);
184
- v.set(d, u);
185
- }
186
- }
187
- function Te(i) {
188
- if (g.length === 1)
189
- A.set(i.pageX, i.pageY);
190
- else {
191
- const r = Y(i), d = 0.5 * (i.pageX + r.x), u = 0.5 * (i.pageY + r.y);
192
- A.set(d, u);
193
- }
194
- }
195
- function Le(i) {
196
- const r = Y(i), d = i.pageX - r.x, u = i.pageY - r.y, y = Math.sqrt(d * d + u * u);
197
- z.set(0, y);
198
- }
199
- function ct(i) {
200
- e.enableZoom && Le(i), e.enablePan && Te(i);
201
- }
202
- function dt(i) {
203
- e.enableZoom && Le(i), e.enableRotate && Se(i);
204
- }
205
- function Pe(i) {
206
- if (g.length == 1)
207
- O.set(i.pageX, i.pageY);
208
- else {
209
- const d = Y(i), u = 0.5 * (i.pageX + d.x), y = 0.5 * (i.pageY + d.y);
210
- O.set(u, y);
211
- }
212
- V.subVectors(O, v).multiplyScalar(e.rotateSpeed);
213
- const r = e.domElement;
214
- W(2 * Math.PI * V.x / r.clientHeight), ee(2 * Math.PI * V.y / r.clientHeight), v.copy(O);
215
- }
216
- function Me(i) {
217
- if (g.length === 1)
218
- k.set(i.pageX, i.pageY);
219
- else {
220
- const r = Y(i), d = 0.5 * (i.pageX + r.x), u = 0.5 * (i.pageY + r.y);
221
- k.set(d, u);
222
- }
223
- B.subVectors(k, A).multiplyScalar(e.panSpeed), F(B.x, B.y), A.copy(k);
224
- }
225
- function Ie(i) {
226
- const r = Y(i), d = i.pageX - r.x, u = i.pageY - r.y, y = Math.sqrt(d * d + u * u);
227
- N.set(0, y), R.set(0, Math.pow(N.y / z.y, e.zoomSpeed)), re(R.y), z.copy(N);
228
- const I = (i.pageX + r.x) * 0.5, b = (i.pageY + r.y) * 0.5;
229
- ae(I, b);
230
- }
231
- function ut(i) {
232
- e.enableZoom && Ie(i), e.enablePan && Me(i);
233
- }
234
- function mt(i) {
235
- e.enableZoom && Ie(i), e.enableRotate && Pe(i);
236
- }
237
- function Ce(i) {
238
- e.enabled !== !1 && (g.length === 0 && (e.domElement.setPointerCapture(i.pointerId), e.domElement.addEventListener("pointermove", le), e.domElement.addEventListener("pointerup", K)), !wt(i) && (yt(i), i.pointerType === "touch" ? ke(i) : pt(i)));
239
- }
240
- function le(i) {
241
- e.enabled !== !1 && (i.pointerType === "touch" ? _t(i) : ft(i));
242
- }
243
- function K(i) {
244
- switch (bt(i), g.length) {
245
- case 0:
246
- e.domElement.releasePointerCapture(i.pointerId), e.domElement.removeEventListener("pointermove", le), e.domElement.removeEventListener("pointerup", K), e.dispatchEvent(je), o = n.NONE;
247
- break;
248
- case 1:
249
- const r = g[0], d = H[r];
250
- ke({ pointerId: r, pageX: d.x, pageY: d.y });
251
- break;
252
- }
253
- }
254
- function pt(i) {
255
- let r;
256
- switch (i.button) {
257
- case 0:
258
- r = e.mouseButtons.LEFT;
259
- break;
260
- case 1:
261
- r = e.mouseButtons.MIDDLE;
262
- break;
263
- case 2:
264
- r = e.mouseButtons.RIGHT;
265
- break;
266
- default:
267
- r = -1;
268
- }
269
- switch (r) {
270
- case U.DOLLY:
271
- if (e.enableZoom === !1) return;
272
- nt(i), o = n.DOLLY;
273
- break;
274
- case U.ROTATE:
275
- if (i.ctrlKey || i.metaKey || i.shiftKey) {
276
- if (e.enablePan === !1) return;
277
- xe(i), o = n.PAN;
278
- } else {
279
- if (e.enableRotate === !1) return;
280
- De(i), o = n.ROTATE;
281
- }
282
- break;
283
- case U.PAN:
284
- if (i.ctrlKey || i.metaKey || i.shiftKey) {
285
- if (e.enableRotate === !1) return;
286
- De(i), o = n.ROTATE;
287
- } else {
288
- if (e.enablePan === !1) return;
289
- xe(i), o = n.PAN;
290
- }
291
- break;
292
- default:
293
- o = n.NONE;
294
- }
295
- o !== n.NONE && e.dispatchEvent(me);
296
- }
297
- function ft(i) {
298
- switch (o) {
299
- case n.ROTATE:
300
- if (e.enableRotate === !1) return;
301
- ot(i);
302
- break;
303
- case n.DOLLY:
304
- if (e.enableZoom === !1) return;
305
- rt(i);
306
- break;
307
- case n.PAN:
308
- if (e.enablePan === !1) return;
309
- at(i);
310
- break;
311
- }
312
- }
313
- function ve(i) {
314
- e.enabled === !1 || e.enableZoom === !1 || o !== n.NONE || (i.preventDefault(), e.dispatchEvent(me), ht(gt(i)), e.dispatchEvent(je));
315
- }
316
- function gt(i) {
317
- const r = i.deltaMode, d = {
318
- clientX: i.clientX,
319
- clientY: i.clientY,
320
- deltaY: i.deltaY
321
- };
322
- switch (r) {
323
- case 1:
324
- d.deltaY *= 16;
325
- break;
326
- case 2:
327
- d.deltaY *= 100;
328
- break;
329
- }
330
- return i.ctrlKey && !oe && (d.deltaY *= 10), d;
331
- }
332
- function Oe(i) {
333
- i.key === "Control" && (oe = !0, e.domElement.getRootNode().addEventListener("keyup", Ae, { passive: !0, capture: !0 }));
334
- }
335
- function Ae(i) {
336
- i.key === "Control" && (oe = !1, e.domElement.getRootNode().removeEventListener("keyup", Ae, { passive: !0, capture: !0 }));
337
- }
338
- function ce(i) {
339
- e.enabled === !1 || e.enablePan === !1 || lt(i);
340
- }
341
- function ke(i) {
342
- switch (Ve(i), g.length) {
343
- case 1:
344
- switch (e.touches.ONE) {
345
- case G.ROTATE:
346
- if (e.enableRotate === !1) return;
347
- Se(i), o = n.TOUCH_ROTATE;
348
- break;
349
- case G.PAN:
350
- if (e.enablePan === !1) return;
351
- Te(i), o = n.TOUCH_PAN;
352
- break;
353
- default:
354
- o = n.NONE;
355
- }
356
- break;
357
- case 2:
358
- switch (e.touches.TWO) {
359
- case G.DOLLY_PAN:
360
- if (e.enableZoom === !1 && e.enablePan === !1) return;
361
- ct(i), o = n.TOUCH_DOLLY_PAN;
362
- break;
363
- case G.DOLLY_ROTATE:
364
- if (e.enableZoom === !1 && e.enableRotate === !1) return;
365
- dt(i), o = n.TOUCH_DOLLY_ROTATE;
366
- break;
367
- default:
368
- o = n.NONE;
369
- }
370
- break;
371
- default:
372
- o = n.NONE;
373
- }
374
- o !== n.NONE && e.dispatchEvent(me);
375
- }
376
- function _t(i) {
377
- switch (Ve(i), o) {
378
- case n.TOUCH_ROTATE:
379
- if (e.enableRotate === !1) return;
380
- Pe(i), e.update();
381
- break;
382
- case n.TOUCH_PAN:
383
- if (e.enablePan === !1) return;
384
- Me(i), e.update();
385
- break;
386
- case n.TOUCH_DOLLY_PAN:
387
- if (e.enableZoom === !1 && e.enablePan === !1) return;
388
- ut(i), e.update();
389
- break;
390
- case n.TOUCH_DOLLY_ROTATE:
391
- if (e.enableZoom === !1 && e.enableRotate === !1) return;
392
- mt(i), e.update();
393
- break;
394
- default:
395
- o = n.NONE;
396
- }
397
- }
398
- function Re(i) {
399
- e.enabled !== !1 && i.preventDefault();
400
- }
401
- function yt(i) {
402
- g.push(i.pointerId);
403
- }
404
- function bt(i) {
405
- delete H[i.pointerId];
406
- for (let r = 0; r < g.length; r++)
407
- if (g[r] == i.pointerId) {
408
- g.splice(r, 1);
409
- return;
410
- }
411
- }
412
- function wt(i) {
413
- for (let r = 0; r < g.length; r++)
414
- if (g[r] == i.pointerId) return !0;
415
- return !1;
416
- }
417
- function Ve(i) {
418
- let r = H[i.pointerId];
419
- r === void 0 && (r = new E(), H[i.pointerId] = r), r.set(i.pageX, i.pageY);
420
- }
421
- function Y(i) {
422
- const r = i.pointerId === g[0] ? g[1] : g[0];
423
- return H[r];
424
- }
425
- e.domElement.addEventListener("contextmenu", Re), e.domElement.addEventListener("pointerdown", Ce), e.domElement.addEventListener("pointercancel", K), e.domElement.addEventListener("wheel", ve, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", Oe, { passive: !0, capture: !0 }), this.update();
1
+ var S = Object.defineProperty;
2
+ var A = (r, s, t) => s in r ? S(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
3
+ var i = (r, s, t) => A(r, typeof s != "symbol" ? s + "" : s, t);
4
+ import { A as P, b as I, c as H } from "./chunks/FileTypes-IBuu9ohV.mjs";
5
+ import { g as ot, f as ht, e as lt, d as ct, l as dt, r as pt, D as ut, w as ft, i as _t, j as gt, k as mt, o as Et, m as Dt, p as wt, t as yt, s as Mt, u as xt, q as Pt, v as It, n as Ht, E as bt, F as Vt, G as zt, h as vt, S as Ot, x as St } from "./chunks/FileTypes-IBuu9ohV.mjs";
6
+ import { U as d } from "./chunks/VisibilityLayerMask-CXgt1fJc.mjs";
7
+ import { C as Gt, D as Rt, H as Tt, P as Yt } from "./chunks/VisibilityLayerMask-CXgt1fJc.mjs";
8
+ import { Object3D as f, Color as b, Vector3 as c, TorusGeometry as V, MeshBasicMaterial as g, Mesh as p, MathUtils as v, Euler as G, CylinderGeometry as E, BoxGeometry as R, PlaneGeometry as w } from "three";
9
+ import { D as Ct } from "./chunks/OrbitController-BQ6SV1O_.mjs";
10
+ import { D as Nt, a as Xt } from "./chunks/PerspectiveCamera-PMJPzAn3.mjs";
11
+ import { f as Zt, i as qt } from "./chunks/findInterface-DbJ5qzbc.mjs";
12
+ import { g as Wt, i as kt } from "./chunks/isFileTypeSupported-BSpswPHU.mjs";
13
+ import { F as Kt, N as Bt } from "./chunks/network-error-BONfHWQq.mjs";
14
+ import { F as $t, P as te } from "./chunks/parse-error-DfOPyLWM.mjs";
15
+ import { i as re, a as se } from "./chunks/PovSchema-DWWvr_ED.mjs";
16
+ class y extends f {
17
+ constructor(t, e, n, o, a) {
18
+ super();
19
+ i(this, "isHoverable", !0);
20
+ i(this, "isDraggable", !0);
21
+ i(this, "parent", null);
22
+ i(this, "axis");
23
+ i(this, "_color", new b(16711935));
24
+ i(this, "_colorHover");
25
+ i(this, "_hovered");
26
+ i(this, "_highlight");
27
+ i(this, "_lineMaterial");
28
+ i(this, "_colliderMesh");
29
+ this.name = "DIVERadialHandle", this.axis = t, this._color.set(a), this._colorHover = this._color.clone().multiplyScalar(2), this._hovered = !1, this._highlight = !1;
30
+ const h = new V(e, 0.01, 13, 48, n);
31
+ this._lineMaterial = new g({
32
+ color: a,
33
+ depthTest: !1,
34
+ depthWrite: !1
35
+ });
36
+ const l = new p(h, this._lineMaterial);
37
+ l.layers.mask = d, l.renderOrder = 1 / 0, this.add(l);
38
+ const _ = new V(e, 0.1, 3, 48, n), D = new g({
39
+ color: 16711935,
40
+ transparent: !0,
41
+ opacity: 0.15,
42
+ depthTest: !1,
43
+ depthWrite: !1
44
+ });
45
+ this._colliderMesh = new p(_, D), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this.add(this._colliderMesh), this.lookAt(o);
426
46
  }
427
- }
428
- const se = {
429
- enableDamping: !0,
430
- dampingFactor: 0.05
431
- }, J = class J extends ti {
432
- constructor(t, e, n = se) {
433
- super(t, e);
434
- a(this, "uuid", C.generateUUID());
435
- a(this, "object");
436
- this.domElement = e, this.domElement = e, this.object = t, this.enableDamping = n.enableDamping ?? se.enableDamping, this.dampingFactor = n.dampingFactor ?? se.dampingFactor, this.object.position.set(0, 2, 2), this.target.copy({ x: 0, y: 0.5, z: 0 }), this.update();
437
- }
438
- tick() {
439
- this.enabled && this.update();
440
- }
441
- computeEncompassingView(t) {
442
- const e = t.getCenter(new m()), n = t.getSize(new m()), o = Math.max(n.x, n.y, n.z) * 1.25;
443
- return {
444
- position: this.object.position.clone().normalize().clone().multiplyScalar(o),
445
- target: e.clone()
446
- };
447
- }
448
- zoomIn(t) {
449
- const e = t || J.DEFAULT_ZOOM_FACTOR, { minDistance: n, maxDistance: o } = this;
450
- this.minDistance = this.maxDistance = C.clamp(
451
- this.getDistance() - e,
452
- n + e,
453
- o - e
454
- ), this.update(), this.minDistance = n, this.maxDistance = o;
455
- }
456
- zoomOut(t) {
457
- const e = t || J.DEFAULT_ZOOM_FACTOR, { minDistance: n, maxDistance: o } = this;
458
- this.minDistance = this.maxDistance = C.clamp(
459
- this.getDistance() + e,
460
- n + e,
461
- o - e
462
- ), this.update(), this.minDistance = n, this.maxDistance = o;
47
+ set debug(t) {
48
+ this._colliderMesh.visible = t;
463
49
  }
464
- };
465
- a(J, "DEFAULT_ZOOM_FACTOR", 1);
466
- let ne = J;
467
- class ii extends Pt {
468
- constructor(t, e, n) {
469
- super(-1, 1, 1, -1, 0.1, 100);
470
- a(this, "axesHelper");
471
- a(this, "_renderer");
472
- a(this, "_scene");
473
- a(this, "_camera");
474
- a(this, "_restoreViewport", new Mt());
475
- this.layers.mask = q, this.axesHelper = new It(0.5), this.axesHelper.layers.mask = q, this.axesHelper.material.depthTest = !1, this.axesHelper.position.set(0, 0, -1), this.axesHelper.setColors(
476
- new D(Wt),
477
- new D(Kt),
478
- new D(Zt)
479
- );
480
- const o = new ue("X", 0.2, Xt), c = new ue("Y", 0.2, qt), l = new ue("Z", 0.2, Jt);
481
- o.layers.mask = q, c.layers.mask = q, l.layers.mask = q, o.position.set(0.7, 0, 0), c.position.set(0, 0.7, 0), l.position.set(0, 0, 0.7), this.axesHelper.add(o), this.axesHelper.add(c), this.axesHelper.add(l), this.add(this.axesHelper), this._renderer = t, this._scene = e, this._camera = n, this._scene.add(this);
50
+ get highlight() {
51
+ return this._highlight;
482
52
  }
483
- tick() {
484
- const t = this._scene.background;
485
- this._scene.background = null, this._renderer.webglrenderer.getViewport(this._restoreViewport), this._renderer.webglrenderer.setViewport(0, 0, 150, 150), this._renderer.webglrenderer.autoClear = !1, this.SetFromCameraMatrix(this._camera.matrix), this._renderer.webglrenderer.render(this._scene, this), this._renderer.webglrenderer.setViewport(this._restoreViewport), this._renderer.webglrenderer.autoClear = !0, this._scene.background = t;
53
+ set highlight(t) {
54
+ this._highlight = t, this._lineMaterial.color = this._highlight || this._hovered ? this._colorHover : this._color;
486
55
  }
487
- Dispose() {
488
- this._scene.remove(this);
56
+ get forwardVector() {
57
+ return new c(0, 0, 1).applyQuaternion(this.quaternion).normalize();
489
58
  }
490
- SetFromCameraMatrix(t) {
491
- this.axesHelper.rotation.setFromRotationMatrix(
492
- new Ct().extractRotation(t).invert()
493
- );
59
+ get rightVector() {
60
+ return new c(1, 0, 0).applyQuaternion(this.quaternion).normalize();
494
61
  }
495
- }
496
- class si extends j {
497
- constructor() {
498
- super();
499
- a(this, "isDIVELight", !0);
500
- a(this, "isDIVEAmbientLight", !0);
501
- a(this, "_light");
502
- this.name = "DIVEAmbientLight", this._light = new vt(16777215, 1), this._light.layers.mask = P, this.add(this._light);
62
+ get upVector() {
63
+ return new c(0, 1, 0).applyQuaternion(this.quaternion).normalize();
503
64
  }
504
- setColor(t) {
505
- this._light.color = t;
65
+ reset() {
66
+ this._lineMaterial.color = this._color;
506
67
  }
507
- setIntensity(t) {
508
- this._light.intensity = t;
68
+ onPointerEnter() {
69
+ this._hovered = !0, this.parent && this.parent.onHandleHover(this, !0);
509
70
  }
510
- setEnabled(t) {
511
- this._light.visible = t;
71
+ onPointerLeave() {
72
+ this._hovered = !1, this.parent && this.parent.onHandleHover(this, !1);
512
73
  }
513
- }
514
- class ni extends j {
515
- constructor() {
516
- super();
517
- a(this, "isDIVELight", !0);
518
- a(this, "isDIVEPointLight", !0);
519
- a(this, "isMovable", !0);
520
- a(this, "isSelectable", !0);
521
- a(this, "gizmo", null);
522
- a(this, "light");
523
- a(this, "mesh");
524
- this.name = "DIVEPointLight", this.light = new Ot(16777215, 1), this.light.layers.mask = P, this.light.castShadow = !0, this.light.shadow.mapSize.width = 512, this.light.shadow.mapSize.height = 512, this.add(this.light);
525
- const t = 0.1, e = new Ke(
526
- t,
527
- t * 320,
528
- t * 320
529
- ), n = new At({
530
- color: this.light.color,
531
- transparent: !0,
532
- opacity: 0.8,
533
- side: kt
534
- });
535
- this.mesh = new pe(e, n), this.mesh.layers.mask = jt, this.add(this.mesh);
74
+ onDragStart() {
75
+ this.parent && this.parent.onHandleDragStart(this);
536
76
  }
537
- setColor(t) {
538
- this.light.color = t, this.mesh.material.color = t;
77
+ onDrag(t) {
78
+ this.parent && this.parent.onHandleDrag(this, t);
539
79
  }
540
- setIntensity(t) {
541
- this.light.intensity = t, this.mesh.material.opacity = t > 0.8 ? 0.8 : t * 0.8;
80
+ onDragEnd() {
81
+ this.parent && this.parent.onHandleDragEnd(this);
542
82
  }
543
- setEnabled(t) {
544
- this.light.visible = t;
83
+ }
84
+ function u(r, s) {
85
+ const t = (r + "e").split("e");
86
+ return +(t[0] + "e" + (+t[1] + (s || 0)));
87
+ }
88
+ function T(r, s = 0) {
89
+ const t = u(r, +s);
90
+ return u(Math.ceil(t), -s);
91
+ }
92
+ function Y(r, s = 0) {
93
+ const t = u(r, +s);
94
+ return u(Math.floor(t), -s);
95
+ }
96
+ function O(r, s = 0) {
97
+ if (r < 0) return -O(-r, s);
98
+ const t = u(r, +s);
99
+ return u(Math.round(t), -s);
100
+ }
101
+ function j(r, s, t) {
102
+ return Math.atan2(
103
+ r.clone().cross(s).dot(t),
104
+ s.clone().dot(r)
105
+ );
106
+ }
107
+ function C(r, s = 0) {
108
+ const t = u(r, +s);
109
+ return u(Math.round(t), -s).toFixed(s);
110
+ }
111
+ function L(r, s = 0) {
112
+ const t = u(r, +s);
113
+ return u(Math.trunc(t), -s);
114
+ }
115
+ function N(r) {
116
+ return (v.radToDeg(r) + 360) % 360;
117
+ }
118
+ function X(r) {
119
+ return v.degToRad(r);
120
+ }
121
+ const F = {
122
+ ceilExp: T,
123
+ floorExp: Y,
124
+ roundExp: O,
125
+ toFixedExp: C,
126
+ truncateExp: L,
127
+ signedAngleTo: j,
128
+ radToDeg: N,
129
+ degToRad: X
130
+ };
131
+ class Z extends f {
132
+ constructor(t) {
133
+ super();
134
+ i(this, "children");
135
+ i(this, "_controller");
136
+ i(this, "_startRot");
137
+ this.name = "DIVERotateGizmo", this.children = [], this._startRot = null, this._controller = t, this.add(
138
+ new y(
139
+ "x",
140
+ 1,
141
+ Math.PI / 2,
142
+ new c(1, 0, 0),
143
+ P
144
+ )
145
+ ), this.add(
146
+ new y(
147
+ "y",
148
+ 1,
149
+ -Math.PI / 2,
150
+ new c(0, 1, 0),
151
+ I
152
+ )
153
+ ), this.add(
154
+ new y(
155
+ "z",
156
+ 1,
157
+ Math.PI / 2,
158
+ new c(0, 0, 1),
159
+ H
160
+ )
161
+ );
545
162
  }
546
- onMove() {
547
- w("State").then((t) => {
548
- var e;
549
- (e = t.get(this.userData.id)) == null || e.performAction("UPDATE_OBJECT", {
550
- id: this.userData.id,
551
- position: this.position
552
- });
163
+ set debug(t) {
164
+ this.children.forEach((e) => {
165
+ e.debug = t;
553
166
  });
554
167
  }
555
- onSelect() {
556
- w("State").then((t) => {
557
- var e;
558
- (e = t.get(this.userData.id)) == null || e.performAction("SELECT_OBJECT", {
559
- id: this.userData.id
560
- });
168
+ reset() {
169
+ this.children.forEach((t) => {
170
+ t.reset();
561
171
  });
562
172
  }
563
- onDeselect() {
564
- w("State").then((t) => {
565
- var e;
566
- (e = t.get(this.userData.id)) == null || e.performAction("DESELECT_OBJECT", {
567
- id: this.userData.id
568
- });
173
+ handleHighlight(t, e, n) {
174
+ this.children.forEach((o) => {
175
+ n ? o.highlight = o.axis === t && n : o.highlight = o.axis === t && e;
569
176
  });
570
177
  }
178
+ onHandleHover(t, e) {
179
+ this._startRot || this.parent && this.parent.parent && (this.parent.parent.onHover("rotate", t.axis, e), this.handleHighlight(t.axis, e, !1));
180
+ }
181
+ onHandleDragStart(t) {
182
+ if (!this.parent || !this.parent.parent) return;
183
+ const e = this.parent.parent.object;
184
+ e && (this._startRot = e.rotation.clone(), this.handleHighlight(t.axis, !0, !0));
185
+ }
186
+ onHandleDrag(t, e) {
187
+ if (!this._startRot || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
188
+ const n = e.dragCurrent.clone().sub(this.parent.parent.position).normalize(), o = e.dragStart.clone().sub(this.parent.parent.position).normalize(), a = F.signedAngleTo(
189
+ o,
190
+ n,
191
+ t.forwardVector
192
+ ), h = new G(
193
+ this._startRot.x + t.forwardVector.x * a,
194
+ this._startRot.y + t.forwardVector.y * a,
195
+ this._startRot.z + t.forwardVector.z * a
196
+ );
197
+ this.parent.parent.onChange(void 0, h);
198
+ }
199
+ onHandleDragEnd(t) {
200
+ this._startRot = null, this.handleHighlight(t.axis, !1, !1);
201
+ }
571
202
  }
572
- class Je extends j {
573
- constructor() {
203
+ class M extends f {
204
+ constructor(t, e, n, o) {
574
205
  super();
575
- a(this, "isDIVELight", !0);
576
- a(this, "isDIVESceneLight", !0);
577
- a(this, "_hemiLight");
578
- a(this, "_dirLight");
579
- this.name = "DIVESceneLight", this._hemiLight = new Rt(16777215, 16777215, 2), this._hemiLight.layers.mask = P, this._hemiLight.position.set(0, 50, 0), this.add(this._hemiLight), this._dirLight = new Vt(16777215, 3), this._dirLight.layers.mask = P, this._dirLight.position.set(1, 1.75, 1), this._dirLight.position.multiplyScalar(30), this._dirLight.castShadow = !0, this._dirLight.shadow.mapSize.width = 2048, this._dirLight.shadow.mapSize.height = 2048;
580
- const t = 5;
581
- this._dirLight.shadow.camera.left = -5, this._dirLight.shadow.camera.right = t, this._dirLight.shadow.camera.top = t, this._dirLight.shadow.camera.bottom = -5, this._dirLight.shadow.camera.far = 3500, this.add(this._dirLight);
206
+ i(this, "isHoverable", !0);
207
+ i(this, "isDraggable", !0);
208
+ i(this, "parent", null);
209
+ i(this, "axis");
210
+ i(this, "_color", new b(16711935));
211
+ i(this, "_colorHover");
212
+ i(this, "_hovered");
213
+ i(this, "_highlight");
214
+ i(this, "_lineMaterial");
215
+ i(this, "_colliderMesh");
216
+ this.name = "DIVEAxisHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._highlight = !1, this._hovered = !1;
217
+ const a = new E(0.01, 0.01, e, 13);
218
+ this._lineMaterial = new g({
219
+ color: o,
220
+ depthTest: !1,
221
+ depthWrite: !1
222
+ });
223
+ const h = new p(a, this._lineMaterial);
224
+ h.layers.mask = d, h.renderOrder = 1 / 0, h.rotateX(Math.PI / 2), h.translateY(e / 2), this.add(h);
225
+ const l = new E(0.1, 0.1, e, 3), _ = new g({
226
+ color: 16711935,
227
+ transparent: !0,
228
+ opacity: 0.15,
229
+ depthTest: !1,
230
+ depthWrite: !1
231
+ });
232
+ this._colliderMesh = new p(l, _), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this._colliderMesh.rotateX(Math.PI / 2), this._colliderMesh.translateY(e / 2), this.add(this._colliderMesh), this.rotateX(n.y * -Math.PI / 2), this.rotateY(n.x * Math.PI / 2);
582
233
  }
583
- setColor(t) {
584
- this._hemiLight.color = t, this._dirLight.color = t;
234
+ set debug(t) {
235
+ this._colliderMesh.visible = t;
585
236
  }
586
- setIntensity(t) {
587
- this._hemiLight.intensity = t * 2, this._dirLight.intensity = t * 3;
237
+ get highlight() {
238
+ return this._highlight;
588
239
  }
589
- setEnabled(t) {
590
- this._hemiLight.visible = t, this._dirLight.visible = t;
240
+ set highlight(t) {
241
+ this._highlight = t, this._lineMaterial.color = this._highlight || this._hovered ? this._colorHover : this._color;
591
242
  }
592
- }
593
- const ge = (h) => h.parent ? ge(h.parent) : h;
594
- class oi {
595
- constructor() {
596
- a(this, "isMovable", !0);
243
+ get forwardVector() {
244
+ return new c(0, 0, 1).applyQuaternion(this.quaternion).normalize();
597
245
  }
598
- }
599
- class ri {
600
- constructor() {
601
- a(this, "isSelectable", !0);
246
+ get rightVector() {
247
+ return new c(1, 0, 0).applyQuaternion(this.quaternion).normalize();
602
248
  }
603
- }
604
- function ai(h, s) {
605
- return s.forEach((t) => {
606
- Object.getOwnPropertyNames(t.prototype).forEach((e) => {
607
- Object.defineProperty(
608
- h.prototype,
609
- e,
610
- Object.getOwnPropertyDescriptor(t.prototype, e)
611
- );
612
- });
613
- }), h;
614
- }
615
- class _e extends ai(j, [
616
- ri,
617
- oi
618
- ]) {
619
- constructor() {
620
- super();
621
- a(this, "isDIVENode", !0);
622
- a(this, "gizmo", null);
623
- a(this, "_positionWorldBuffer");
624
- a(this, "_boundingBox");
625
- this.layers.mask = P, this._positionWorldBuffer = new m(), this._boundingBox = new Ze();
626
- }
627
- SetPosition(t) {
628
- if (!this.parent) {
629
- this.position.set(t.x, t.y, t.z);
630
- return;
631
- }
632
- const e = new m(t.x, t.y, t.z);
633
- this.position.copy(this.parent.worldToLocal(e)), "isDIVEGroup" in this.parent && this.parent.UpdateLineTo(this);
634
- }
635
- SetRotation(t) {
636
- this.rotation.set(t.x, t.y, t.z);
637
- }
638
- SetScale(t) {
639
- this.scale.set(t.x, t.y, t.z);
640
- }
641
- setVisibility(t) {
642
- this.visible = t;
643
- }
644
- SetToWorldOrigin() {
645
- this.position.set(0, 0, 0), w("State").then((t) => {
646
- var e;
647
- (e = t.get(this.userData.id)) == null || e.performAction("UPDATE_OBJECT", {
648
- id: this.userData.id,
649
- position: this.getWorldPosition(this._positionWorldBuffer),
650
- rotation: this.rotation,
651
- scale: this.scale
652
- });
653
- });
249
+ get upVector() {
250
+ return new c(0, 1, 0).applyQuaternion(this.quaternion).normalize();
654
251
  }
655
- /**
656
- * Can be called when the object is moved from a foreign object (gizmo, parent, etc.) to update the object's position.
657
- */
658
- onMove() {
659
- w("State").then((t) => {
660
- var e;
661
- (e = t.get(this.userData.id)) == null || e.performAction("UPDATE_OBJECT", {
662
- id: this.userData.id,
663
- position: this.getWorldPosition(this._positionWorldBuffer),
664
- rotation: this.rotation,
665
- scale: this.scale
666
- });
667
- });
252
+ reset() {
253
+ this._lineMaterial.color = this._color;
668
254
  }
669
- onSelect() {
670
- w("State").then((t) => {
671
- var e;
672
- (e = t.get(this.userData.id)) == null || e.performAction("SELECT_OBJECT", {
673
- id: this.userData.id
674
- });
675
- });
255
+ onPointerEnter() {
256
+ this._hovered = !0, this.parent && this.parent.onHandleHover(this, !0);
676
257
  }
677
- onDeselect() {
678
- w("State").then((t) => {
679
- var e;
680
- (e = t.get(this.userData.id)) == null || e.performAction("DESELECT_OBJECT", {
681
- id: this.userData.id
682
- });
683
- });
258
+ onPointerLeave() {
259
+ this._hovered = !1, this.parent && this.parent.onHandleHover(this, !1);
684
260
  }
685
- }
686
- class $e extends _e {
687
- constructor() {
688
- super(...arguments);
689
- a(this, "isDIVEModel", !0);
690
- a(this, "_mesh", null);
691
- a(this, "_material", null);
692
- a(this, "_assetLoader", null);
693
- }
694
- async _getAssetLoader() {
695
- return this._assetLoader || (this._assetLoader = new (await w("AssetLoader"))()), this._assetLoader;
696
- }
697
- async setFromURL(t) {
698
- const n = await (await this._getAssetLoader()).load(t);
699
- this.setFromGLTF(n), w("State").then((o) => {
700
- var c;
701
- (c = o.get(this.userData.id)) == null || c.performAction("MODEL_LOADED", {
702
- id: this.userData.id
703
- });
704
- });
261
+ onDragStart() {
262
+ this.parent && this.parent.onHandleDragStart(this);
705
263
  }
706
- setFromGLTF(t) {
707
- this.clear(), this._boundingBox.makeEmpty(), t.traverse((e) => {
708
- e.castShadow = !0, e.receiveShadow = !0, e.layers.mask = this.layers.mask, this._boundingBox.expandByObject(e), !this._mesh && "isMesh" in e && (this._mesh = e, this._material ? this._mesh.material = this._material : this._material = e.material);
709
- }), this.add(t);
710
- }
711
- setMaterial(t) {
712
- this._material || (this._material = new fe()), t.vertexColors !== void 0 && (this._material.vertexColors = t.vertexColors), t.color !== void 0 && this._material.color.set(t.color), t.map !== void 0 && (this._material.map = t.map), t.normalMap !== void 0 && (this._material.normalMap = t.normalMap), t.roughness !== void 0 && (this._material.roughness = t.roughness), t.roughnessMap !== void 0 && (this._material.roughnessMap = t.roughnessMap, this._material.roughnessMap && (this._material.roughness = 1)), t.metalness !== void 0 && (this._material.metalness = t.metalness), t.metalnessMap !== void 0 && (this._material.metalnessMap = t.metalnessMap, this._material.metalnessMap && (this._material.metalness = 1)), this._mesh && (this._mesh.material = this._material);
713
- }
714
- placeOnFloor() {
715
- var o, c, l, p;
716
- const t = this.getWorldPosition(this._positionWorldBuffer), e = t.clone();
717
- (c = (o = this._mesh) == null ? void 0 : o.geometry) == null || c.computeBoundingBox();
718
- const n = (p = (l = this._mesh) == null ? void 0 : l.geometry) == null ? void 0 : p.boundingBox;
719
- !n || !this._mesh || (t.y = t.y - this._mesh.localToWorld(n.min.clone()).y, t.y !== e.y && w("State").then((f) => {
720
- var _;
721
- (_ = f.get(this.userData.id)) == null || _.performAction("UPDATE_OBJECT", {
722
- id: this.userData.id,
723
- position: t,
724
- rotation: this.rotation,
725
- scale: this.scale
726
- });
727
- }));
728
- }
729
- dropIt() {
730
- if (!this.parent) {
731
- console.warn(
732
- "DIVEModel: dropIt() called on a model that is not in the scene.",
733
- this
734
- );
735
- return;
736
- }
737
- const t = this._boundingBox.min.y * this.scale.y, e = this.localToWorld(
738
- this._boundingBox.getCenter(new m()).multiply(this.scale)
739
- );
740
- e.y = t + this.position.y;
741
- const n = new Xe(e, new m(0, -1, 0));
742
- n.layers.mask = P;
743
- const o = n.intersectObjects(
744
- ge(this).root.children,
745
- !0
746
- );
747
- if (o.length > 0) {
748
- const c = o[0].object;
749
- c.geometry.computeBoundingBox();
750
- const l = c.geometry.boundingBox, p = c.localToWorld(l.max.clone()), f = this.position.clone(), _ = this.position.clone().setY(p.y).sub(new m(0, t, 0));
751
- if (this.position.copy(_), this.position.y === f.y) return;
752
- this.onMove();
753
- }
264
+ onDrag(t) {
265
+ this.parent && this.parent.onHandleDrag(this, t);
266
+ }
267
+ onDragEnd() {
268
+ this.parent && this.parent.onHandleDragEnd(this);
754
269
  }
755
270
  }
756
- class hi extends _e {
757
- constructor() {
271
+ class q extends f {
272
+ constructor(t) {
758
273
  super();
759
- a(this, "isDIVEPrimitive", !0);
760
- a(this, "_mesh");
761
- this._mesh = new pe(), this._mesh.layers.mask = P, this._mesh.castShadow = !0, this._mesh.receiveShadow = !0, this._mesh.material = new fe(), this.add(this._mesh);
762
- }
763
- SetGeometry(t) {
764
- const e = this.assembleGeometry(t);
765
- e && (this._mesh.geometry = e, this._boundingBox.setFromObject(this._mesh));
766
- }
767
- setMaterial(t) {
768
- const e = this._mesh.material;
769
- t.vertexColors !== void 0 && (e.vertexColors = t.vertexColors), t.color !== void 0 && (e.color = new D(t.color)), t.map !== void 0 && (e.map = t.map), t.normalMap !== void 0 && (e.normalMap = t.normalMap), t.roughness !== void 0 && (e.roughness = t.roughness), t.roughnessMap !== void 0 && (e.roughnessMap = t.roughnessMap, e.roughnessMap && (e.roughness = 1)), t.metalness !== void 0 && (e.metalness = t.metalness), t.metalnessMap !== void 0 && (e.metalnessMap = t.metalnessMap, e.metalnessMap && (e.metalness = 0)), this._mesh && (this._mesh.material = e);
770
- }
771
- placeOnFloor() {
772
- var o, c, l, p;
773
- const t = this.getWorldPosition(this._positionWorldBuffer), e = t.clone();
774
- (c = (o = this._mesh) == null ? void 0 : o.geometry) == null || c.computeBoundingBox();
775
- const n = (p = (l = this._mesh) == null ? void 0 : l.geometry) == null ? void 0 : p.boundingBox;
776
- !n || !this._mesh || (t.y = t.y - this._mesh.localToWorld(n.min.clone()).y, t.y !== e.y && w("State").then((f) => {
777
- var _;
778
- (_ = f.get(this.userData.id)) == null || _.performAction("UPDATE_OBJECT", {
779
- id: this.userData.id,
780
- position: t,
781
- rotation: this.rotation,
782
- scale: this.scale
783
- });
784
- }));
785
- }
786
- dropIt() {
787
- if (!this.parent) {
788
- console.warn(
789
- "DIVEPrimitive: dropIt() called on a model that is not in the scene.",
790
- this
791
- );
792
- return;
793
- }
794
- const t = this._boundingBox.min.y * this.scale.y, e = this.localToWorld(
795
- this._boundingBox.getCenter(new m()).multiply(this.scale)
274
+ i(this, "_controller");
275
+ i(this, "children");
276
+ i(this, "_startPos");
277
+ this.name = "DIVETranslateGizmo", this.children = [], this._startPos = null, this._controller = t, this.add(
278
+ new M("x", 1, new c(1, 0, 0), P)
279
+ ), this.add(
280
+ new M("y", 1, new c(0, 1, 0), I)
281
+ ), this.add(
282
+ new M("z", 1, new c(0, 0, 1), H)
796
283
  );
797
- e.y = t + this.position.y;
798
- const n = new Xe(e, new m(0, -1, 0));
799
- n.layers.mask = P;
800
- const o = n.intersectObjects(
801
- ge(this).root.children,
802
- !0
803
- );
804
- if (o.length > 0) {
805
- const c = o[0].object;
806
- c.geometry.computeBoundingBox();
807
- const l = c.geometry.boundingBox, p = c.localToWorld(l.max.clone()), f = this.position.clone(), _ = this.position.clone().setY(p.y).sub(new m(0, t, 0));
808
- if (this.position.copy(_), this.position.y === f.y) return;
809
- this.onMove();
810
- }
811
284
  }
812
- assembleGeometry(t) {
813
- switch (this._mesh.material.flatShading = !1, t.name.toLowerCase()) {
814
- case "cylinder":
815
- return this.createCylinderGeometry(t);
816
- case "sphere":
817
- return this.createSphereGeometry(t);
818
- case "pyramid":
819
- return this._mesh.material.flatShading = !0, this.createPyramidGeometry(t);
820
- case "cube":
821
- case "box":
822
- return this.createBoxGeometry(t);
823
- case "cone":
824
- return this.createConeGeometry(t);
825
- case "wall":
826
- return this.createWallGeometry(t);
827
- case "plane":
828
- return this.createPlaneGeometry(t);
829
- default:
830
- return console.warn(
831
- "DIVEPrimitive.assembleGeometry: Invalid geometry type:",
832
- t.name.toLowerCase()
833
- ), null;
834
- }
285
+ set debug(t) {
286
+ this.children.forEach((e) => {
287
+ e.debug = t;
288
+ });
835
289
  }
836
- createCylinderGeometry(t) {
837
- const e = new Bt(
838
- t.width / 2,
839
- t.width / 2,
840
- t.height,
841
- 64
842
- );
843
- return e.translate(0, t.height / 2, 0), e;
844
- }
845
- createSphereGeometry(t) {
846
- return new Ke(t.width / 2, 256, 256);
847
- }
848
- createPyramidGeometry(t) {
849
- const e = new Float32Array([
850
- -t.width / 2,
851
- 0,
852
- -t.depth / 2,
853
- // 0
854
- t.width / 2,
855
- 0,
856
- -t.depth / 2,
857
- // 1
858
- t.width / 2,
859
- 0,
860
- t.depth / 2,
861
- // 2
862
- -t.width / 2,
863
- 0,
864
- t.depth / 2,
865
- // 3
866
- 0,
867
- t.height,
868
- 0
869
- ]), n = new Uint16Array([
870
- 0,
871
- 1,
872
- 2,
873
- 0,
874
- 2,
875
- 3,
876
- 0,
877
- 4,
878
- 1,
879
- 1,
880
- 4,
881
- 2,
882
- 2,
883
- 4,
884
- 3,
885
- 3,
886
- 4,
887
- 0
888
- ]), o = new qe();
889
- return o.setAttribute(
890
- "position",
891
- new Ye(e, 3)
892
- ), o.setIndex(new Ye(n, 1)), o.computeVertexNormals(), o.computeBoundingBox(), o.computeBoundingSphere(), o;
893
- }
894
- createBoxGeometry(t) {
895
- const e = new de(
896
- t.width,
897
- t.height,
898
- t.depth
899
- );
900
- return e.translate(0, t.height / 2, 0), e;
901
- }
902
- createConeGeometry(t) {
903
- const e = new zt(t.width / 2, t.height, 256);
904
- return e.translate(0, t.height / 2, 0), e;
905
- }
906
- createWallGeometry(t) {
907
- const e = new de(
908
- t.width,
909
- t.height,
910
- t.depth || 0.05,
911
- 16
912
- );
913
- return e.translate(0, t.height / 2, 0), e;
290
+ reset() {
291
+ this.children.forEach((t) => {
292
+ t.reset();
293
+ });
294
+ }
295
+ handleHighlight(t, e, n) {
296
+ this.children.forEach((o) => {
297
+ n ? o.highlight = o.axis === t && n : o.highlight = o.axis === t && e;
298
+ });
914
299
  }
915
- createPlaneGeometry(t) {
916
- const e = new de(
917
- t.width,
918
- t.height,
919
- t.depth
300
+ onHandleHover(t, e) {
301
+ this._startPos || this.parent && this.parent.parent && (this.parent.parent.onHover(
302
+ "translate",
303
+ t.axis,
304
+ e
305
+ ), this.handleHighlight(t.axis, e, !1));
306
+ }
307
+ onHandleDragStart(t) {
308
+ if (!this.parent || !this.parent.parent) return;
309
+ const e = this.parent.parent.object;
310
+ e && (this._startPos = e.position.clone(), this.handleHighlight(t.axis, !0, !0));
311
+ }
312
+ onHandleDrag(t, e) {
313
+ if (!this._startPos || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
314
+ const n = e.dragDelta.clone().projectOnVector(t.forwardVector);
315
+ this.parent.parent.onChange(
316
+ this._startPos.clone().add(n)
920
317
  );
921
- return e.translate(0, t.height / 2, 0), e;
318
+ }
319
+ onHandleDragEnd(t) {
320
+ this._startPos = null, this.handleHighlight(t.axis, !1, !1);
922
321
  }
923
322
  }
924
- class li extends _e {
925
- // lines to children
926
- constructor() {
323
+ class x extends f {
324
+ constructor(t, e, n, o, a = 0.05) {
927
325
  super();
928
- a(this, "isDIVEGroup", !0);
929
- a(this, "_members");
930
- a(this, "_lines");
931
- this.name = "DIVEGroup", this._members = [], this._lines = [];
932
- }
933
- // children objects
934
- get members() {
935
- return this._members;
936
- }
937
- SetPosition(t) {
938
- super.SetPosition(t), this._members.forEach((e) => {
939
- "isDIVENode" in e && e.onMove();
326
+ i(this, "isHoverable", !0);
327
+ i(this, "isDraggable", !0);
328
+ i(this, "parent", null);
329
+ i(this, "axis");
330
+ i(this, "_color", new b(16711935));
331
+ i(this, "_colorHover");
332
+ i(this, "_hovered");
333
+ i(this, "_highlight");
334
+ i(this, "_lineMaterial");
335
+ i(this, "_colliderMesh");
336
+ i(this, "_box");
337
+ i(this, "_boxSize");
338
+ this.name = "DIVEScaleHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._hovered = !1, this._highlight = !1, this._boxSize = a;
339
+ const h = new E(
340
+ 0.01,
341
+ 0.01,
342
+ e - a / 2,
343
+ 13
344
+ );
345
+ this._lineMaterial = new g({
346
+ color: o,
347
+ depthTest: !1,
348
+ depthWrite: !1
349
+ });
350
+ const l = new p(h, this._lineMaterial);
351
+ l.layers.mask = d, l.renderOrder = 1 / 0, l.rotateX(Math.PI / 2), l.translateY(e / 2 - a / 4), this.add(l), this._box = new p(
352
+ new R(a, a, a),
353
+ this._lineMaterial
354
+ ), this._box.layers.mask = d, this._box.renderOrder = 1 / 0, this._box.rotateX(Math.PI / 2), this._box.translateY(e - a / 2), this._box.rotateZ(n.x * Math.PI / 2), this._box.rotateX(n.z * Math.PI / 2), this.add(this._box);
355
+ const _ = new E(
356
+ 0.1,
357
+ 0.1,
358
+ e + a / 2,
359
+ 3
360
+ ), D = new g({
361
+ color: 16711935,
362
+ transparent: !0,
363
+ opacity: 0.15,
364
+ depthTest: !1,
365
+ depthWrite: !1
940
366
  });
367
+ this._colliderMesh = new p(_, D), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this._colliderMesh.rotateX(Math.PI / 2), this._colliderMesh.translateY(e / 2), this.add(this._colliderMesh), this.rotateX(n.y * -Math.PI / 2), this.rotateY(n.x * Math.PI / 2);
941
368
  }
942
- SetLinesVisibility(t, e) {
943
- if (!e) {
944
- this._lines.forEach((o) => {
945
- o.visible = t;
946
- });
947
- return;
948
- }
949
- const n = this._members.indexOf(e);
950
- n !== -1 && (this._lines[n].visible = t);
369
+ set debug(t) {
370
+ this._colliderMesh.visible = t;
951
371
  }
952
- attach(t) {
953
- if (this._members.includes(t))
954
- return this;
955
- const e = this.createLine();
956
- return this.add(e), this._lines.push(e), super.attach(t), this._members.push(t), this.updateLineTo(e, t), this.SetLinesVisibility(!0, t), this;
957
- }
958
- /**
959
- * Removes an object from the group.
960
- * @param object - The object to remove.
961
- * @returns The group instance.
962
- */
963
- remove(t) {
964
- const e = this._members.indexOf(t);
965
- if (e === -1)
966
- return this;
967
- const n = this._lines[e];
968
- return super.remove(n), this._lines.splice(e, 1), super.remove(t), this._members.splice(e, 1), this;
969
- }
970
- UpdateLineTo(t) {
971
- const e = this._members.indexOf(t);
972
- e !== -1 && this.updateLineTo(this._lines[e], t);
973
- }
974
- /**
975
- * Creates a line for visualization.
976
- */
977
- createLine() {
978
- const t = new qe(), e = new Nt({
979
- color: 6710886,
980
- dashSize: 0.05,
981
- gapSize: 0.025
982
- }), n = new Ft(t, e);
983
- return n.visible = !1, n;
984
- }
985
- /**
986
- * Updates a line to the object.
987
- */
988
- updateLineTo(t, e) {
989
- const n = [
990
- new m(0, 0, 0),
991
- e.position.clone()
992
- ];
993
- t.geometry.setFromPoints(n), t.computeLineDistances();
994
- }
995
- // public SetBoundingBoxVisibility(visible: boolean): void {
996
- // this._boxMesh.visible = visible;
997
- // }
998
- // /**
999
- // * Recalculates the position of the group based on it's bounding box.
1000
- // * Children's world positions are kept.
1001
- // */
1002
- // private recalculatePosition(): void {
1003
- // // store all children's world positions
1004
- // const childrensWorldPositions: Vector3[] = this.children.map((child) => child.getWorldPosition(new Vector3()));
1005
- // // calculate new center and set it as the group's position
1006
- // const bbcenter = this.updateBB();
1007
- // this.position.copy(bbcenter);
1008
- // // set childrens's positions so their world positions are kept
1009
- // this.children.forEach((child, i) => {
1010
- // if (child.uuid === this._boxMesh.uuid) return;
1011
- // child.position.copy(this.worldToLocal(childrensWorldPositions[i]));
1012
- // });
1013
- // DIVECommunication.get(this.userData.id)?.performAction('UPDATE_OBJECT', { id: this.userData.id, position: this.position });
1014
- // }
1015
- // /**
1016
- // * Updates the bounding box of the group.
1017
- // * @returns {Vector3} The new center of the bounding box.
1018
- // */
1019
- // private updateBB(): Vector3 {
1020
- // this._boundingBox.makeEmpty();
1021
- // if (this.children.length === 1) {
1022
- // // because we always have the box mesh as 1 child
1023
- // return this.position.clone();
1024
- // }
1025
- // this.children.forEach((child) => {
1026
- // if (child.uuid === this._boxMesh.uuid) return;
1027
- // this._boundingBox.expandByObject(child);
1028
- // });
1029
- // return this._boundingBox.getCenter(new Vector3());
1030
- // }
1031
- // private updateBoxMesh(): void {
1032
- // if (this.children.length === 1) {
1033
- // // because we always have the box mesh as 1 child
1034
- // this._boxMesh.visible = false;
1035
- // return;
1036
- // }
1037
- // this._boxMesh.quaternion.copy(this.quaternion.clone().invert());
1038
- // this._boxMesh.scale.set(1 / this.scale.x, 1 / this.scale.y, 1 / this.scale.z);
1039
- // this._boxMesh.geometry = new BoxGeometry(this._boundingBox.max.x - this._boundingBox.min.x, this._boundingBox.max.y - this._boundingBox.min.y, this._boundingBox.max.z - this._boundingBox.min.z);
1040
- // this._boxMesh.visible = true;
1041
- // }
1042
- }
1043
- class ci extends pe {
1044
- constructor() {
1045
- super(
1046
- new Yt(1e4, 1e4),
1047
- new fe({
1048
- color: new D(150 / 255, 150 / 255, 150 / 255)
1049
- })
1050
- );
1051
- a(this, "isDIVEFloor", !0);
1052
- this.name = "Floor", this.layers.mask = P, this.receiveShadow = !0, this.rotateX(-Math.PI / 2);
372
+ get highlight() {
373
+ return this._highlight;
1053
374
  }
1054
- setVisibility(t) {
1055
- this.visible = t;
375
+ set highlight(t) {
376
+ this._highlight = t, this._lineMaterial.color = this._highlight || this._hovered ? this._colorHover : this._color;
1056
377
  }
1057
- setColor(t) {
1058
- this.material.color = new D(t);
378
+ get forwardVector() {
379
+ return new c(0, 0, 1).applyQuaternion(this.quaternion).normalize();
1059
380
  }
1060
- }
1061
- class di extends j {
1062
- constructor() {
1063
- super();
1064
- a(this, "isDIVERoot", !0);
1065
- a(this, "_floor");
1066
- a(this, "_assetLoader", null);
1067
- this.name = "Root", this._floor = new ci(), this.add(this._floor);
1068
- }
1069
- get floor() {
1070
- return this._floor;
1071
- }
1072
- async _getAssetLoader() {
1073
- return this._assetLoader || (this._assetLoader = new (await w("AssetLoader"))()), this._assetLoader;
1074
- }
1075
- computeSceneBB() {
1076
- const t = new Ze();
1077
- return this.children.forEach((e) => {
1078
- "isDIVEFloor" in e || e.traverse((n) => {
1079
- "isObject3D" in n && t.expandByObject(n);
1080
- });
1081
- }), t;
1082
- }
1083
- getSceneObject(t) {
1084
- let e;
1085
- return this.traverse((n) => {
1086
- e || n.userData.id === t.id && (e = n);
1087
- }), e;
1088
- }
1089
- addSceneObject(t) {
1090
- let e = this.getSceneObject(t);
1091
- if (e)
1092
- return console.warn(
1093
- `DIVERoot.addSceneObject: Scene object with id ${t.id} already exists`
1094
- ), e;
1095
- switch (t.entityType) {
1096
- case "pov":
1097
- break;
1098
- case "light": {
1099
- switch (t.type) {
1100
- case "scene": {
1101
- e = new Je();
1102
- break;
1103
- }
1104
- case "ambient": {
1105
- e = new si();
1106
- break;
1107
- }
1108
- case "point": {
1109
- e = new ni();
1110
- break;
1111
- }
1112
- default:
1113
- throw new Error(
1114
- `DIVERoot.addSceneObject: Unknown light type: ${t.type}`
1115
- );
1116
- }
1117
- e.name = t.name, e.userData.id = t.id, this.add(e), this._updateLight(e, t);
1118
- break;
1119
- }
1120
- case "model": {
1121
- e = new $e(), e.name = t.name, e.userData.id = t.id, e.userData.uri = t.uri, this.add(e), this._updateModel(e, t);
1122
- break;
1123
- }
1124
- case "primitive": {
1125
- e = new hi(), e.name = t.name, e.userData.id = t.id, this.add(e), this._updatePrimitive(e, t);
1126
- break;
1127
- }
1128
- case "group": {
1129
- e = new li(), e.name = t.name, e.userData.id = t.id, this.add(e), this._updateGroup(e, t);
1130
- break;
1131
- }
1132
- default:
1133
- throw new Error(
1134
- `DIVERoot.addSceneObject: Unknown entity type: ${t.entityType}`
1135
- );
1136
- }
1137
- return e;
381
+ get rightVector() {
382
+ return new c(1, 0, 0).applyQuaternion(this.quaternion).normalize();
1138
383
  }
1139
- updateSceneObject(t) {
1140
- const e = this.getSceneObject(t);
1141
- if (!e) {
1142
- console.warn(
1143
- `DIVERoot.updateSceneObject: Scene object with id ${t.id} does not exist`
1144
- );
1145
- return;
1146
- }
1147
- switch (t.entityType) {
1148
- case "pov":
1149
- break;
1150
- case "light": {
1151
- this._updateLight(e, t);
1152
- break;
1153
- }
1154
- case "model": {
1155
- this._updateModel(e, t);
1156
- break;
1157
- }
1158
- case "primitive": {
1159
- this._updatePrimitive(e, t);
1160
- break;
1161
- }
1162
- case "group": {
1163
- this._updateGroup(e, t);
1164
- break;
1165
- }
1166
- default:
1167
- throw new Error(
1168
- `DIVERoot.updateSceneObject: Unknown entity type: ${t.entityType}`
1169
- );
1170
- }
384
+ get upVector() {
385
+ return new c(0, 1, 0).applyQuaternion(this.quaternion).normalize();
1171
386
  }
1172
- deleteSceneObject(t) {
1173
- const e = this.getSceneObject(t);
1174
- if (!e) {
1175
- console.warn(
1176
- `DIVERoot.deleteSceneObject: Object with id ${t.id} not found`
1177
- );
1178
- return;
1179
- }
1180
- switch (t.entityType) {
1181
- case "pov":
1182
- break;
1183
- case "light": {
1184
- this._deleteLight(e);
1185
- break;
1186
- }
1187
- case "model": {
1188
- this._deleteModel(e);
1189
- break;
1190
- }
1191
- case "primitive": {
1192
- this._deletePrimitive(e);
1193
- break;
1194
- }
1195
- case "group": {
1196
- this._deleteGroup(e);
1197
- break;
1198
- }
1199
- default:
1200
- throw new Error(
1201
- `DIVERoot.deleteSceneObject: Unknown entity type: ${t.entityType}`
1202
- );
1203
- }
1204
- }
1205
- _updateLight(t, e) {
1206
- e.name !== void 0 && e.name !== null && (t.name = e.name), e.position !== void 0 && e.position !== null && t.position.set(
1207
- e.position.x,
1208
- e.position.y,
1209
- e.position.z
1210
- ), e.intensity !== void 0 && e.intensity !== null && t.setIntensity(e.intensity), e.enabled !== void 0 && e.enabled !== null && t.setEnabled(e.enabled), e.color !== void 0 && e.color !== null && t.setColor(new D(e.color)), e.visible !== void 0 && e.visible !== null && (t.visible = e.visible), e.parentId !== void 0 && this._setParent({ ...e, parentId: e.parentId });
1211
- }
1212
- _updateModel(t, e) {
1213
- e.uri !== void 0 && t.setFromURL(e.uri), e.name !== void 0 && (t.name = e.name), e.position !== void 0 && t.SetPosition(e.position), e.rotation !== void 0 && t.SetRotation(e.rotation), e.scale !== void 0 && t.SetScale(e.scale), e.visible !== void 0 && t.setVisibility(e.visible), e.material !== void 0 && t.setMaterial(e.material), e.parentId !== void 0 && this._setParent({ ...e, parentId: e.parentId });
1214
- }
1215
- _updatePrimitive(t, e) {
1216
- e.name !== void 0 && (t.name = e.name), e.geometry !== void 0 && t.SetGeometry(e.geometry), e.position !== void 0 && t.SetPosition(e.position), e.rotation !== void 0 && t.SetRotation(e.rotation), e.scale !== void 0 && t.SetScale(e.scale), e.visible !== void 0 && t.setVisibility(e.visible), e.material !== void 0 && t.setMaterial(e.material), e.parentId !== void 0 && this._setParent({ ...e, parentId: e.parentId });
1217
- }
1218
- _updateGroup(t, e) {
1219
- e.name !== void 0 && (t.name = e.name), e.position !== void 0 && t.SetPosition(e.position), e.rotation !== void 0 && t.SetRotation(e.rotation), e.scale !== void 0 && t.SetScale(e.scale), e.visible !== void 0 && t.setVisibility(e.visible), e.bbVisible !== void 0 && t.SetLinesVisibility(e.bbVisible), e.parentId !== void 0 && this._setParent({ ...e, parentId: e.parentId });
1220
- }
1221
- _deleteLight(t) {
1222
- this._detachTransformControls(t), t.parent.remove(t);
1223
- }
1224
- _deleteModel(t) {
1225
- this._detachTransformControls(t), t.parent.remove(t);
1226
- }
1227
- _deletePrimitive(t) {
1228
- this._detachTransformControls(t), t.parent.remove(t);
1229
- }
1230
- _deleteGroup(t) {
1231
- this._detachTransformControls(t);
1232
- for (let e = t.members.length - 1; e >= 0; e--)
1233
- this.attach(t.members[e]);
1234
- t.parent.remove(t);
1235
- }
1236
- _setParent(t) {
1237
- const e = this.getSceneObject(t);
1238
- if (t.parentId !== null) {
1239
- const n = this.getSceneObject({
1240
- id: t.parentId,
1241
- entityType: t.entityType
1242
- });
1243
- if (!n) return;
1244
- n.attach(e);
1245
- } else
1246
- this.attach(e);
1247
- }
1248
- _detachTransformControls(t) {
1249
- this._findScene(t).children.find((e) => {
1250
- "isTransformControls" in e && e.detach();
1251
- });
387
+ reset() {
388
+ this._lineMaterial.color = this._color;
1252
389
  }
1253
- _findScene(t) {
1254
- return t.parent !== null ? this._findScene(t.parent) : t;
1255
- }
1256
- }
1257
- const ui = "#888888", mi = "#dddddd";
1258
- class pi extends j {
1259
- constructor() {
1260
- super(), this.name = "Grid";
1261
- const s = new Ut(
1262
- 100,
1263
- 100,
1264
- ui,
1265
- mi
390
+ update(t) {
391
+ this._box.scale.copy(
392
+ new c(1, 1, 1).sub(this.forwardVector).add(
393
+ // to then add ...
394
+ t.clone().multiply(this.forwardVector)
395
+ // that is scaled by the forward vector again to get the forward vector as the only direction
396
+ )
1266
397
  );
1267
- s.material.depthTest = !1, s.layers.mask = Ht, this.add(s);
1268
398
  }
1269
- setVisibility(s) {
1270
- this.visible = s;
399
+ onPointerEnter() {
400
+ this._hovered = !0, this.parent && this.parent.onHoverAxis(this, !0);
1271
401
  }
1272
- }
1273
- class fi extends Gt {
1274
- constructor() {
1275
- super();
1276
- a(this, "_root");
1277
- a(this, "_grid");
1278
- this.background = new D(16777215), this._root = new di(), this.add(this._root), this._grid = new pi(), this.add(this._grid);
402
+ onPointerLeave() {
403
+ this._hovered = !1, this.parent && this.parent.onHoverAxis(this, !1);
1279
404
  }
1280
- get root() {
1281
- return this._root;
405
+ onDragStart() {
406
+ this.parent && this.parent.onAxisDragStart(this);
1282
407
  }
1283
- get grid() {
1284
- return this._grid;
408
+ onDrag(t) {
409
+ this.parent && this.parent.onAxisDrag(this, t);
1285
410
  }
1286
- setBackground(t) {
1287
- this.background = new D(t);
1288
- }
1289
- computeSceneBB() {
1290
- return this.root.computeSceneBB();
411
+ onDragEnd() {
412
+ this.parent && this.parent.onAxisDragEnd(this);
1291
413
  }
1292
414
  }
1293
- const Qe = {
1294
- canvas: void 0,
1295
- antialias: !0,
1296
- alpha: !0,
1297
- powerPreference: "high-performance",
1298
- precision: "highp",
1299
- stencil: !1,
1300
- depth: !0,
1301
- logarithmicDepthBuffer: !1
1302
- };
1303
- class gi {
1304
- constructor(s, t, e) {
1305
- a(this, "_webglrenderer");
1306
- a(this, "_settings");
1307
- this._scene = s, this._camera = t, this._settings = {
1308
- ...Qe,
1309
- ...e ?? {}
1310
- }, this._webglrenderer = new Ue({
1311
- canvas: this._settings.canvas,
1312
- antialias: this._settings.antialias,
1313
- alpha: this._settings.alpha,
1314
- powerPreference: this._settings.powerPreference,
1315
- precision: this._settings.precision,
1316
- stencil: this._settings.stencil,
1317
- depth: this._settings.depth,
1318
- logarithmicDepthBuffer: this._settings.logarithmicDepthBuffer
415
+ class Q extends f {
416
+ constructor(t) {
417
+ super();
418
+ i(this, "isHoverable", !0);
419
+ i(this, "children");
420
+ i(this, "_controller");
421
+ i(this, "_startScale");
422
+ this.name = "DIVEScaleGizmo", this.children = [], this._startScale = null, this._controller = t, this.add(
423
+ new x("x", 1, new c(1, 0, 0), P)
424
+ ), this.add(
425
+ new x("y", 1, new c(0, 1, 0), I)
426
+ ), this.add(
427
+ new x("z", 1, new c(0, 0, 1), H)
428
+ );
429
+ }
430
+ set debug(t) {
431
+ this.children.forEach((e) => {
432
+ e.debug = t;
1319
433
  });
1320
434
  }
1321
- get webglrenderer() {
1322
- return this._webglrenderer;
435
+ reset() {
436
+ this.children.forEach((t) => {
437
+ t.reset();
438
+ });
1323
439
  }
1324
- setCanvas(s) {
1325
- this._webglrenderer.dispose(), this._settings.canvas = s, this._webglrenderer = new Ue(this._settings);
440
+ update(t) {
441
+ this.children.forEach((e) => {
442
+ e.update(t);
443
+ });
1326
444
  }
1327
- render() {
1328
- this._webglrenderer.render(this._scene, this._camera);
445
+ handleHighlight(t, e, n) {
446
+ this.children.forEach((o) => {
447
+ n ? o.highlight = o.axis === t && n : o.highlight = o.axis === t && e;
448
+ });
1329
449
  }
1330
- onResize(s, t) {
1331
- this._webglrenderer.setSize(s, t, !1);
450
+ onHoverAxis(t, e) {
451
+ this._startScale || this.parent && this.parent.parent && (this.parent.parent.onHover(
452
+ "translate",
453
+ t.axis,
454
+ e
455
+ ), this.handleHighlight(t.axis, e, !1));
456
+ }
457
+ onAxisDragStart(t) {
458
+ if (!this.parent || !this.parent.parent) return;
459
+ const e = this.parent.parent.object;
460
+ e && (this._startScale = e.scale.clone(), this.handleHighlight(t.axis, !0, !0));
461
+ }
462
+ onAxisDrag(t, e) {
463
+ if (!this._startScale || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
464
+ const n = e.dragDelta.clone().projectOnVector(t.forwardVector);
465
+ this.parent.parent.onChange(
466
+ void 0,
467
+ void 0,
468
+ this._startScale.clone().add(n)
469
+ );
1332
470
  }
1333
- dispose() {
1334
- this._webglrenderer.dispose();
471
+ onAxisDragEnd(t) {
472
+ this._startScale = null, this.handleHighlight(t.axis, !1, !1);
1335
473
  }
1336
474
  }
1337
- class _i {
475
+ class W extends f {
1338
476
  constructor() {
1339
- a(this, "_renderer", null);
1340
- a(this, "_lastTime", 0);
1341
- a(this, "_isRunning", !1);
1342
- a(this, "_tickers", []);
477
+ super();
478
+ i(this, "_meshX");
479
+ i(this, "_meshY");
480
+ i(this, "_meshZ");
481
+ this.name = "DIVEGizmoPlane";
482
+ const t = new g({
483
+ transparent: !0,
484
+ opacity: 0.15,
485
+ depthTest: !1,
486
+ depthWrite: !1,
487
+ side: 2
488
+ }), e = new w(100, 100, 2, 2), n = t.clone();
489
+ n.color.set(16711680), this._meshX = new p(e, n), this._meshX.layers.mask = d, this._meshX.rotateY(Math.PI / 2);
490
+ const o = new w(100, 100, 2, 2), a = t.clone();
491
+ a.color.set(65280), this._meshY = new p(o, a), this._meshY.layers.mask = d, this._meshY.rotateX(-Math.PI / 2);
492
+ const h = new w(100, 100, 2, 2), l = t.clone();
493
+ l.color.set(255), this._meshZ = new p(h, l), this._meshZ.layers.mask = d;
494
+ }
495
+ get XPlane() {
496
+ return this._meshX;
497
+ }
498
+ get YPlane() {
499
+ return this._meshY;
500
+ }
501
+ get ZPlane() {
502
+ return this._meshZ;
503
+ }
504
+ assemble(t, e) {
505
+ if (this.clear(), t === "translate" || t === "scale")
506
+ switch (e) {
507
+ case "x":
508
+ this.add(this._meshY), this.add(this._meshZ);
509
+ break;
510
+ case "y":
511
+ this.add(this._meshX), this.add(this._meshZ);
512
+ break;
513
+ case "z":
514
+ this.add(this._meshX), this.add(this._meshY);
515
+ break;
516
+ }
517
+ else if (t === "rotate")
518
+ switch (e) {
519
+ case "x":
520
+ this.add(this._meshX);
521
+ break;
522
+ case "y":
523
+ this.add(this._meshY);
524
+ break;
525
+ case "z":
526
+ this.add(this._meshZ);
527
+ break;
528
+ }
1343
529
  }
1344
- start() {
1345
- this._isRunning || (this._isRunning = !0, this._lastTime = performance.now(), requestAnimationFrame(this._tick.bind(this)));
530
+ }
531
+ class J extends f {
532
+ constructor(t) {
533
+ super();
534
+ i(this, "_mode");
535
+ i(this, "_gizmoNode");
536
+ i(this, "_translateGizmo");
537
+ i(this, "_rotateGizmo");
538
+ i(this, "_scaleGizmo");
539
+ i(this, "_gizmoPlane");
540
+ // attachment stuff
541
+ i(this, "_object");
542
+ this.name = "DIVEGizmo", t.addEventListener("change", () => {
543
+ const e = t.getDistance() / 2.5;
544
+ this.scale.set(e, e, e);
545
+ }), this._mode = "translate", this._gizmoNode = new f(), this.add(this._gizmoNode), this._translateGizmo = new q(t), this._rotateGizmo = new Z(t), this._scaleGizmo = new Q(t), this._gizmoPlane = new W(), this._gizmoPlane.visible = !1, this._object = null;
1346
546
  }
1347
- stop() {
1348
- this._isRunning = !1;
547
+ get mode() {
548
+ return this._mode;
1349
549
  }
1350
- setRenderer(s) {
1351
- this._renderer = s;
550
+ set mode(t) {
551
+ this._mode = t, this.assemble();
1352
552
  }
1353
- addTicker(s) {
1354
- this._tickers.find((t) => t.uuid === s.uuid) || this._tickers.push(s);
553
+ set debug(t) {
554
+ this._translateGizmo.debug = t, this._rotateGizmo.debug = t, this._scaleGizmo.debug = t;
1355
555
  }
1356
- removeTicker(s) {
1357
- const t = this._tickers.findIndex((e) => e.uuid === s.uuid);
1358
- t !== -1 && this._tickers.splice(t, 1);
556
+ get gizmoNode() {
557
+ return this._gizmoNode;
1359
558
  }
1360
- dispose() {
1361
- this.stop(), this._tickers.forEach((s) => {
1362
- var t;
1363
- return (t = s.dispose) == null ? void 0 : t.call(s);
1364
- }), this._tickers = [], this._isRunning = !1, this._lastTime = 0;
559
+ get gizmoPlane() {
560
+ return this._gizmoPlane;
1365
561
  }
1366
- _tick(s) {
1367
- var e;
1368
- if (!this._isRunning) return;
1369
- const t = (s - this._lastTime) / 1e3;
1370
- this._lastTime = s, this._tickers.forEach((n) => n.tick(t)), (e = this._renderer) == null || e.render(), requestAnimationFrame(this._tick.bind(this));
562
+ get object() {
563
+ return this._object;
1371
564
  }
1372
- }
1373
- class yi {
1374
- constructor(s, t) {
1375
- a(this, "_resizeObserver");
1376
- a(this, "_width", 0);
1377
- a(this, "_height", 0);
1378
- this._resizeObserver = new ResizeObserver((e) => {
1379
- for (const n of e) {
1380
- const { width: o, height: c } = n.contentRect;
1381
- o === this._width && c === this._height || (s.onResize(o, c), t.onResize(o, c), this._width = o, this._height = c);
1382
- }
1383
- }), this._observeCanvas(s.webglrenderer.domElement);
565
+ attach(t) {
566
+ return this._object = t, this.assemble(), this;
1384
567
  }
1385
- setCanvas(s) {
1386
- this._resizeObserver.disconnect(), this._observeCanvas(s);
568
+ detach() {
569
+ return this._object = null, this.assemble(), this;
1387
570
  }
1388
- dispose() {
1389
- this._resizeObserver.disconnect();
571
+ onHover(t, e, n) {
572
+ n && this._gizmoPlane.assemble(t, e);
1390
573
  }
1391
- _observeCanvas(s) {
1392
- if (s.parentElement)
1393
- this._resizeObserver.observe(s.parentElement);
1394
- else {
1395
- const t = setInterval(() => {
1396
- s.parentElement && (this._resizeObserver.observe(s.parentElement), clearInterval(t));
1397
- }, 16);
1398
- }
574
+ onChange(t, e, n) {
575
+ this.object !== null && (t && (this.position.copy(t), this.object.position.copy(t)), e && this.object.rotation.copy(e), n && (this.object.scale.copy(n), this._scaleGizmo.update(n)));
1399
576
  }
1400
- }
1401
- const et = {
1402
- autoStart: !0,
1403
- displayAxes: !1,
1404
- ...$t,
1405
- ...Qe
1406
- };
1407
- class bi {
1408
- constructor(s) {
1409
- a(this, "_renderer");
1410
- a(this, "_scene");
1411
- a(this, "_camera");
1412
- a(this, "_resizeManager");
1413
- a(this, "_clock");
1414
- a(this, "_settings");
1415
- this._settings = {
1416
- ...et,
1417
- ...s ?? {}
1418
- }, this._scene = new fi(), this._camera = new Qt(this._settings), this._renderer = new gi(
1419
- this._scene,
1420
- this._camera,
1421
- this._settings
1422
- ), this._resizeManager = new yi(
1423
- this._renderer,
1424
- this._camera
1425
- ), this._clock = new _i(), this._clock.setRenderer(this._renderer), this._settings.autoStart && this.start();
1426
- }
1427
- get scene() {
1428
- return this._scene;
1429
- }
1430
- get camera() {
1431
- return this._camera;
1432
- }
1433
- get renderer() {
1434
- return this._renderer;
1435
- }
1436
- setCanvas(s) {
1437
- this._renderer.setCanvas(s), this._resizeManager.setCanvas(s);
1438
- }
1439
- get clock() {
1440
- return this._clock;
1441
- }
1442
- start() {
1443
- this._clock.start();
1444
- }
1445
- stop() {
1446
- this._clock.stop();
1447
- }
1448
- dispose() {
1449
- this._clock.dispose(), this._resizeManager.dispose(), this._renderer.dispose();
577
+ assemble() {
578
+ this._gizmoNode.clear(), this._gizmoPlane.clear(), this._translateGizmo.reset(), this._rotateGizmo.reset(), this._scaleGizmo.reset(), this.object !== null && (this._mode === "translate" && this._gizmoNode.add(this._translateGizmo), this._mode === "rotate" && this._gizmoNode.add(this._rotateGizmo), this._mode === "scale" && this._gizmoNode.add(this._scaleGizmo), this.add(this._gizmoPlane));
1450
579
  }
1451
580
  }
1452
- function x(h, s) {
1453
- const t = (h + "e").split("e");
1454
- return +(t[0] + "e" + (+t[1] + (s || 0)));
1455
- }
1456
- function wi(h, s = 0) {
1457
- const t = x(h, +s);
1458
- return x(Math.ceil(t), -s);
1459
- }
1460
- function Ei(h, s = 0) {
1461
- const t = x(h, +s);
1462
- return x(Math.floor(t), -s);
1463
- }
1464
- function tt(h, s = 0) {
1465
- if (h < 0) return -tt(-h, s);
1466
- const t = x(h, +s);
1467
- return x(Math.round(t), -s);
1468
- }
1469
- function Di(h, s, t) {
1470
- return Math.atan2(
1471
- h.clone().cross(s).dot(t),
1472
- s.clone().dot(h)
1473
- );
1474
- }
1475
- function xi(h, s = 0) {
1476
- const t = x(h, +s);
1477
- return x(Math.round(t), -s).toFixed(s);
1478
- }
1479
- function Si(h, s = 0) {
1480
- const t = x(h, +s);
1481
- return x(Math.trunc(t), -s);
1482
- }
1483
- function Ti(h) {
1484
- return (C.radToDeg(h) + 360) % 360;
1485
- }
1486
- function Li(h) {
1487
- return C.degToRad(h);
581
+ class $ {
582
+ constructor() {
583
+ i(this, "isMovable", !0);
584
+ }
1488
585
  }
1489
- const Bi = {
1490
- ceilExp: wi,
1491
- floorExp: Ei,
1492
- roundExp: tt,
1493
- toFixedExp: xi,
1494
- truncateExp: Si,
1495
- signedAngleTo: Di,
1496
- radToDeg: Ti,
1497
- degToRad: Li
1498
- };
1499
- window.DIVE = {
1500
- instances: [],
1501
- get instance() {
1502
- return window.DIVE.instances[0];
586
+ class tt {
587
+ constructor() {
588
+ i(this, "isSelectable", !0);
1503
589
  }
1504
- };
1505
- const Pi = {
1506
- ...et,
1507
- ...se
1508
- };
1509
- class it {
1510
- constructor(s) {
1511
- // descriptive members
1512
- a(this, "_settings");
1513
- a(this, "_engine");
1514
- a(this, "orbitController");
1515
- a(this, "axisCamera");
1516
- this._settings = {
1517
- ...Pi,
1518
- ...s ?? {}
1519
- }, this._engine = new bi(s), this.orbitController = new ne(
1520
- this._engine.camera,
1521
- this._engine.renderer.webglrenderer.domElement,
1522
- this._settings
1523
- ), this._engine.clock.addTicker(this.orbitController), this._settings.displayAxes ? (this.axisCamera = new ii(
1524
- this._engine.renderer,
1525
- this._engine.scene,
1526
- this._engine.camera
1527
- ), this._engine.clock.addTicker(this.axisCamera)) : this.axisCamera = null, import("./chunks/package-BHjZWYD6.mjs").then((t) => {
1528
- console.log(
1529
- `DIVE ${t.default.version} initialized successfully!`
1530
- ), console.log(`
1531
- @@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
1532
- @@@@+-:::::::---------------------==------------------------------=#@@@@
1533
- @@%=::::.......::---------------------------------------------------------+@@
1534
- @@+:::...........::-----------------------------------------------------------#@@
1535
- @@=:::.........::::::-------------------------------------------------------------%@
1536
- @%:::.......:::::::-----------------------------------------------------------------#@
1537
- @*:::.....:::::-----------------------------------------------------------------------*@
1538
- @%::::::.::::---------------------------------------------------------------------------@@
1539
- @@-:::::::::-----------------------------------------------------------------------------=@
1540
- @%::::::::--------------------------------------------------------------------------------%@
1541
- @+::::::::--------------------------------=@@@@@%-----------------------------------------%@
1542
- @=:::::::--------------------------------*@@ @@+---------------------------------------#@
1543
- @+:::::::-------------------------------*@ @*--------------------------------------%@
1544
- @#::::::::-----------------------------=@@ @@=-------------------------------------%@
1545
- @@-::::::::----------------------------@@ @@------------------------------------=@
1546
- @%:::::::::--------------------------*@ @*-----------------------------------@@
1547
- @*:::::::::-------------------------@@ @@----------------------------------%@
1548
- @#::::::::::----------------------%@ @%--------------------------------%@
1549
- @#:::::::::::-------------------=@@ @@=------------------------------%@
1550
- @@-::::::::::::----------------%@ @%----------------------------=@@
1551
- @@#::::::::::::::------------*@ @*--------------------------#@@
1552
- @@+::::::::::::::::--------@@ @@------------------------+@@
1553
- @@*:::::::::::::::::----@@ @@---------------------+@@
1554
- @@@-:::::::::::::::--#@ @#-----------------=%@@
1555
- @@%-::::::::::::-%@ @%-------------=%@@
1556
- @@@@+:::::::#@@ @@*-------*@@@@
1557
- @@@@@@@ @@@@@@
1558
-
1559
- `);
590
+ }
591
+ function et(r, s) {
592
+ return s.forEach((t) => {
593
+ Object.getOwnPropertyNames(t.prototype).forEach((n) => {
594
+ if (n === "constructor")
595
+ return;
596
+ const o = Object.getOwnPropertyDescriptor(
597
+ t.prototype,
598
+ n
599
+ );
600
+ Object.defineProperty(r.prototype, n, o);
1560
601
  });
1561
- }
1562
- // static members
1563
- static async QuickView(s, t) {
1564
- const e = new it(t);
1565
- window.DIVE.instances.push(e), e.engine.scene.background = new D(16777215), e.engine.scene.grid.setVisibility(!1), e.engine.scene.root.floor.setVisibility(!1), e.engine.scene.root.floor.setColor(16777215), e.engine.camera.position.set(0, 2, 2), e.orbitController.target.set(0, 0.5, 0);
1566
- const n = new Je();
1567
- n.name = "SceneLight", n.userData.id = C.generateUUID(), n.setEnabled(!0), n.visible = !0, n.setIntensity((t == null ? void 0 : t.lightIntensity) ?? 1), n.setColor(new D(16777215)), e.engine.scene.root.add(n);
1568
- const o = new $e();
1569
- o.name = "object", o.userData.id = C.generateUUID(), o.userData.uri = s, o.visible = !0, e.engine.scene.root.add(o), await o.setFromURL(s);
1570
- const c = e.engine.scene.computeSceneBB(), l = e.orbitController.computeEncompassingView(c);
1571
- return e.engine.camera.position.copy(l.position), e.orbitController.target.copy(l.target), e;
1572
- }
1573
- get engine() {
1574
- return this._engine;
1575
- }
1576
- get canvas() {
1577
- return this._engine.renderer.webglrenderer.domElement;
1578
- }
1579
- setCanvas(s) {
1580
- this._engine.setCanvas(s), this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.orbitController = new ne(
1581
- this._engine.camera,
1582
- s,
1583
- this._settings
1584
- ), this._engine.clock.addTicker(this.orbitController);
1585
- }
1586
- async Dispose() {
1587
- return new Promise((s) => {
1588
- this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.axisCamera && (this._engine.clock.removeTicker(this.axisCamera), this.axisCamera.Dispose()), s();
602
+ const e = new t();
603
+ Object.getOwnPropertyNames(e).forEach((n) => {
604
+ const o = Object.getOwnPropertyDescriptor(
605
+ e,
606
+ n
607
+ );
608
+ Object.defineProperty(r.prototype, n, o);
1589
609
  });
1590
- }
610
+ }), r;
1591
611
  }
1592
- const We = (h, s) => {
1593
- if (Object.keys(h).length === 0 && Object.keys(s).length === 0)
612
+ function m(r, s = /* @__PURE__ */ new WeakMap()) {
613
+ if (r === null || typeof r != "object")
614
+ return r;
615
+ if (s.has(r))
616
+ return s.get(r);
617
+ if (r instanceof Date)
618
+ return new Date(r.getTime());
619
+ if (r instanceof RegExp)
620
+ return new RegExp(r.source, r.flags);
621
+ if (Array.isArray(r)) {
622
+ const a = [];
623
+ s.set(r, a);
624
+ for (let h = 0; h < r.length; h++)
625
+ a[h] = m(r[h], s);
626
+ return a;
627
+ }
628
+ if (r instanceof Map) {
629
+ const a = /* @__PURE__ */ new Map();
630
+ s.set(r, a);
631
+ for (const [
632
+ h,
633
+ l
634
+ ] of r)
635
+ a.set(m(h, s), m(l, s));
636
+ return a;
637
+ }
638
+ if (r instanceof Set) {
639
+ const a = /* @__PURE__ */ new Set();
640
+ s.set(r, a);
641
+ for (const h of r)
642
+ a.add(m(h, s));
643
+ return a;
644
+ }
645
+ const t = r;
646
+ if (typeof t.clone == "function") {
647
+ const a = t.clone();
648
+ return s.set(r, a), a;
649
+ }
650
+ const e = Object.create(Object.getPrototypeOf(r));
651
+ s.set(r, e);
652
+ const n = Object.getOwnPropertyNames(r);
653
+ for (const a of n) {
654
+ const h = Object.getOwnPropertyDescriptor(r, a);
655
+ if (h)
656
+ if (h.value !== void 0) {
657
+ const l = m(h.value, s);
658
+ Object.defineProperty(e, a, {
659
+ ...h,
660
+ value: l
661
+ });
662
+ } else
663
+ Object.defineProperty(e, a, h);
664
+ }
665
+ const o = Object.getOwnPropertySymbols(r);
666
+ for (const a of o) {
667
+ const h = Object.getOwnPropertyDescriptor(r, a);
668
+ if (h)
669
+ if (h.value !== void 0) {
670
+ const l = m(h.value, s);
671
+ Object.defineProperty(e, a, {
672
+ ...h,
673
+ value: l
674
+ });
675
+ } else
676
+ Object.defineProperty(e, a, h);
677
+ }
678
+ return e;
679
+ }
680
+ const z = (r, s) => {
681
+ if (Object.keys(r).length === 0 && Object.keys(s).length === 0)
1594
682
  return {};
1595
- if (typeof h != "object" || typeof s != "object")
683
+ if (typeof r != "object" || typeof s != "object")
1596
684
  return s;
1597
685
  let t = {};
1598
686
  return Object.keys(s).forEach((e) => {
1599
- if (!Object.keys(h).includes(e)) {
687
+ if (!Object.keys(r).includes(e)) {
1600
688
  t = { ...t, [e]: s[e] };
1601
689
  return;
1602
690
  }
1603
691
  if (Array.isArray(s[e])) {
1604
- if (!Array.isArray(h[e])) {
692
+ if (!Array.isArray(r[e])) {
1605
693
  t = { ...t, [e]: s[e] };
1606
694
  return;
1607
695
  }
1608
- const n = h[e], o = s[e];
696
+ const n = r[e], o = s[e];
1609
697
  if (n.length === 0 && o.length === 0) {
1610
698
  t = { ...t };
1611
699
  return;
@@ -1614,26 +702,26 @@ const We = (h, s) => {
1614
702
  t = { ...t, [e]: s[e] };
1615
703
  return;
1616
704
  }
1617
- const c = [];
1618
- if (o.forEach((l, p) => {
1619
- const f = We(
1620
- n[p],
1621
- o[p]
705
+ const a = [];
706
+ if (o.forEach((h, l) => {
707
+ const _ = z(
708
+ n[l],
709
+ o[l]
1622
710
  );
1623
- Object.keys(f).length && c.push(o[p]);
1624
- }), Object.keys(c).length) {
1625
- t = { ...t, [e]: c };
711
+ Object.keys(_).length && a.push(o[l]);
712
+ }), Object.keys(a).length) {
713
+ t = { ...t, [e]: a };
1626
714
  return;
1627
715
  }
1628
716
  return;
1629
717
  }
1630
718
  if (typeof s[e] == "object") {
1631
- if (typeof h[e] != "object") {
719
+ if (typeof r[e] != "object") {
1632
720
  t = { ...t, [e]: s[e] };
1633
721
  return;
1634
722
  }
1635
- const n = We(
1636
- h[e],
723
+ const n = z(
724
+ r[e],
1637
725
  s[e]
1638
726
  );
1639
727
  if (Object.keys(n).length) {
@@ -1641,23 +729,74 @@ const We = (h, s) => {
1641
729
  return;
1642
730
  }
1643
731
  }
1644
- h[e] !== s[e] && (t = { ...t, [e]: s[e] });
732
+ r[e] !== s[e] && (t = { ...t, [e]: s[e] });
1645
733
  }), t;
1646
734
  };
735
+ function rt(r) {
736
+ return r.entityType === "group";
737
+ }
738
+ function st(r) {
739
+ return r.entityType === "light";
740
+ }
741
+ function it(r) {
742
+ return r.entityType === "primitive";
743
+ }
1647
744
  export {
1648
- it as DIVE,
1649
- Pi as DIVEDefaultSettings,
1650
- Bi as DIVEMath,
1651
- Zi as ESystem,
1652
- Xi as EWebXRUnsupportedReason,
1653
- Gi as FILE_TYPES,
1654
- ji as SUPPORTED_FILE_TYPES,
1655
- ai as applyMixins,
1656
- Fi as findInterface,
1657
- ge as findSceneRecursive,
1658
- Hi as getFileTypeFromUri,
1659
- w as getModule,
1660
- We as getObjectDelta,
1661
- Yi as implementsInterface,
1662
- Wi as isFileTypeSupported
745
+ H as AxesColorBlue,
746
+ ot as AxesColorBlueLetter,
747
+ I as AxesColorGreen,
748
+ ht as AxesColorGreenLetter,
749
+ P as AxesColorRed,
750
+ lt as AxesColorRedLetter,
751
+ Gt as COORDINATE_LAYER_MASK,
752
+ Rt as DEFAULT_LAYER_MASK,
753
+ ct as DIVE,
754
+ dt as DIVEAmbientLight,
755
+ pt as DIVEClock,
756
+ ut as DIVEDefaultSettings,
757
+ ft as DIVEEngine,
758
+ _t as DIVEFloor,
759
+ J as DIVEGizmo,
760
+ gt as DIVEGrid,
761
+ mt as DIVEGroup,
762
+ F as DIVEMath,
763
+ Et as DIVEModel,
764
+ $ as DIVEMovable,
765
+ Ct as DIVENode,
766
+ Nt as DIVEPerspectiveCamera,
767
+ Xt as DIVEPerspectiveCameraDefaultSettings,
768
+ Dt as DIVEPointLight,
769
+ wt as DIVEPrimitive,
770
+ yt as DIVERenderPipeline,
771
+ Mt as DIVERenderPipelineDefaultSettings,
772
+ xt as DIVEResizeManager,
773
+ Pt as DIVERoot,
774
+ It as DIVEScene,
775
+ Ht as DIVESceneLight,
776
+ tt as DIVESelectable,
777
+ bt as EngineDefaultSettings,
778
+ Vt as FILE_TYPES,
779
+ Kt as FileContentError,
780
+ $t as FileTypeError,
781
+ zt as GRID_CENTER_LINE_COLOR,
782
+ vt as GRID_SIDE_LINE_COLOR,
783
+ Tt as HELPER_LAYER_MASK,
784
+ Bt as NetworkError,
785
+ Yt as PRODUCT_LAYER_MASK,
786
+ te as ParseError,
787
+ Ot as SUPPORTED_FILE_TYPES,
788
+ d as UI_LAYER_MASK,
789
+ et as applyMixins,
790
+ m as deepClone,
791
+ Zt as findInterface,
792
+ St as findSceneRecursive,
793
+ Wt as getFileTypeFromUri,
794
+ z as getObjectDelta,
795
+ qt as implementsInterface,
796
+ kt as isFileTypeSupported,
797
+ rt as isGroupSchema,
798
+ st as isLightSchema,
799
+ re as isModelSchema,
800
+ se as isPovSchema,
801
+ it as isPrimitiveSchema
1663
802
  };