@shopware-ag/dive 2.0.1-beta.1 → 2.0.1-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/chunks/AssetCache-C-7MpNrK.cjs +1 -0
- package/build/chunks/AssetCache-CZV5A70i.mjs +79 -0
- package/build/chunks/AssetExporter-DsbC2rqv.cjs +164 -0
- package/build/{src/modules/asset/exporter/AssetExporter.mjs → chunks/AssetExporter-brT7ogoM.mjs} +22 -21
- package/build/chunks/AssetLoader-BZlqXTbf.cjs +4 -0
- package/build/chunks/AssetLoader-Dnh5tbUZ.mjs +2341 -0
- package/build/chunks/FileTypes-DMybIHHj.mjs +1109 -0
- package/build/chunks/FileTypes-PEcAgRZ8.cjs +30 -0
- package/build/chunks/MathUtils-CBW56ZuG.cjs +1 -0
- package/build/chunks/MathUtils-CFGjHuVF.mjs +159 -0
- package/build/chunks/OrbitController-D-WNei2f.mjs +940 -0
- package/build/chunks/OrbitController-rMX8EHvJ.cjs +1 -0
- package/build/chunks/PerspectiveCamera-CONx93im.cjs +1 -0
- package/build/chunks/PerspectiveCamera-DUiWJJIj.mjs +38 -0
- package/build/chunks/PovSchema-Co9FznEz.cjs +1 -0
- package/build/chunks/PovSchema-DWWvr_ED.mjs +10 -0
- package/build/chunks/SelectTool-BVxDEcnM.cjs +1 -0
- package/build/chunks/{SelectTool-Bd8cC9nb.mjs → SelectTool-D5QfT5rr.mjs} +45 -40
- package/build/chunks/draco_decoder-Bh9flJPu.cjs +1 -0
- package/build/chunks/draco_decoder-CEzwqP9o.mjs +38 -0
- package/build/chunks/draco_decoder-DtHHc5d0.mjs +4 -0
- package/build/chunks/draco_decoder-DvYjcLz_.cjs +35 -0
- package/build/chunks/draco_wasm_wrapper-FoEVV9af.cjs +118 -0
- package/build/chunks/draco_wasm_wrapper-yQy2VLhb.mjs +121 -0
- package/build/chunks/fflate.module-DHdJvhNh.cjs +6 -0
- package/build/chunks/fflate.module-xyO_T3Zm.mjs +602 -0
- package/build/chunks/findInterface-C6mrvf_t.cjs +1 -0
- package/build/chunks/findInterface-DbJ5qzbc.mjs +11 -0
- package/build/chunks/isFileTypeSupported-BSpswPHU.mjs +12 -0
- package/build/chunks/isFileTypeSupported-CrEqYiv9.cjs +1 -0
- package/build/chunks/network-error-BONfHWQq.mjs +14 -0
- package/build/chunks/network-error-CdDXil5g.cjs +1 -0
- package/build/chunks/package-Bf92jAR_.cjs +1 -0
- package/build/chunks/package-ZPbjnXun.mjs +39 -0
- package/build/chunks/parse-error-DfOPyLWM.mjs +14 -0
- package/build/chunks/parse-error-Dy_EE4rL.cjs +1 -0
- package/build/dive.cjs +1 -30
- package/build/dive.mjs +672 -1535
- package/build/plugins/animation/index.cjs +1 -0
- package/build/plugins/animation/index.d.ts +2 -0
- package/build/plugins/animation/index.mjs +126 -0
- package/build/plugins/ar/index.cjs +1 -0
- package/build/plugins/ar/index.d.ts +2 -0
- package/build/plugins/ar/index.mjs +207 -0
- package/build/plugins/assetcache/index.cjs +1 -0
- package/build/plugins/assetcache/index.d.ts +2 -0
- package/build/plugins/assetcache/index.mjs +5 -0
- package/build/plugins/assetconverter/index.d.ts +2 -0
- package/build/plugins/assetexporter/index.cjs +1 -0
- package/build/plugins/assetexporter/index.d.ts +2 -0
- package/build/plugins/assetexporter/index.mjs +4 -0
- package/build/plugins/assetloader/index.cjs +1 -0
- package/build/plugins/assetloader/index.d.ts +2 -0
- package/build/plugins/assetloader/index.mjs +6 -0
- package/build/plugins/axiscamera/index.cjs +1 -0
- package/build/plugins/axiscamera/index.d.ts +2 -0
- package/build/plugins/axiscamera/index.mjs +4 -0
- package/build/plugins/mediacreator/index.cjs +1 -0
- package/build/plugins/mediacreator/index.d.ts +2 -0
- package/build/{src/modules/mediacreator/MediaCreator.mjs → plugins/mediacreator/index.mjs} +4 -4
- package/build/plugins/orbitcontroller/index.cjs +1 -0
- package/build/plugins/orbitcontroller/index.d.ts +2 -0
- package/build/plugins/orbitcontroller/index.mjs +5 -0
- package/build/plugins/state/index.cjs +27 -0
- package/build/plugins/state/index.d.ts +2 -0
- package/build/plugins/state/index.mjs +4265 -0
- package/build/plugins/systeminfo/index.cjs +1 -0
- package/build/plugins/systeminfo/index.d.ts +2 -0
- package/build/{chunks/SystemInfo-DPAQG-S5.mjs → plugins/systeminfo/index.mjs} +48 -51
- package/build/plugins/toolbox/index.cjs +1 -0
- package/build/plugins/toolbox/index.d.ts +2 -0
- package/build/{src/modules/toolbox/Toolbox.mjs → plugins/toolbox/index.mjs} +23 -17
- package/build/src/components/gizmo/Gizmo.d.ts +1 -1
- package/build/src/components/gizmo/handles/AxisHandle.d.ts +1 -1
- package/build/src/components/gizmo/handles/RadialHandle.d.ts +1 -1
- package/build/src/components/gizmo/handles/ScaleHandle.d.ts +1 -1
- package/build/src/components/gizmo/rotate/RotateGizmo.d.ts +2 -2
- package/build/src/components/gizmo/scale/ScaleGizmo.d.ts +2 -2
- package/build/src/components/gizmo/translate/TranslateGizmo.d.ts +2 -2
- package/build/src/components/group/Group.d.ts +4 -4
- package/build/src/components/model/Model.d.ts +2 -2
- package/build/src/components/node/Node.d.ts +7 -7
- package/build/src/components/primitive/Primitive.d.ts +3 -3
- package/build/src/components/root/Root.d.ts +5 -7
- package/build/src/core/Dive.d.ts +4 -3
- package/build/src/engine/clock/Clock.d.ts +1 -0
- package/build/src/engine/index.d.ts +6 -0
- package/build/src/engine/renderer/Renderer.d.ts +47 -7
- package/build/src/engine/scene/xrroot/XRRoot.d.ts +2 -2
- package/build/src/engine/scene/xrroot/xrlightroot/XRLightRoot.d.ts +2 -2
- package/build/src/error/file-content/file-content-error.d.ts +4 -0
- package/build/src/error/index.d.ts +4 -0
- package/build/src/error/network/network-error.d.ts +1 -1
- package/build/src/error/parse/parse-error.d.ts +2 -1
- package/build/src/events/dispatcher/EventDispatcher.d.ts +6 -0
- package/build/src/events/index.d.ts +1 -0
- package/build/src/helpers/deepClone/deepClone.d.ts +34 -0
- package/build/src/helpers/index.d.ts +5 -4
- package/build/src/index.d.ts +5 -5
- package/build/src/interfaces/Draggable.d.ts +1 -1
- package/build/src/plugins/animation/index.d.ts +2 -0
- package/build/src/{modules/animation → plugins/animation/src}/animator/Animator.d.ts +2 -3
- package/build/src/plugins/animation/src/index.d.ts +3 -0
- package/build/src/plugins/animation/src/system/AnimationSystem.d.ts +23 -0
- package/build/src/plugins/ar/index.d.ts +4 -0
- package/build/src/plugins/ar/src/ARSystem.d.ts +24 -0
- package/build/src/plugins/ar/src/arquicklook/ARQuickLook.d.ts +15 -0
- package/build/src/plugins/ar/src/error/ar-errors.d.ts +24 -0
- package/build/src/{modules/ar → plugins/ar/src}/sceneviewer/SceneViewer.d.ts +10 -0
- package/build/src/{modules/ar → plugins/ar/src}/webxr/WebXR.d.ts +4 -4
- package/build/src/{modules/ar → plugins/ar/src}/webxr/controller/WebXRController.d.ts +5 -5
- package/build/src/{modules/ar → plugins/ar/src}/webxr/crosshair/WebXRCrosshair.d.ts +2 -2
- package/build/src/{modules/ar → plugins/ar/src}/webxr/origin/WebXROrigin.d.ts +4 -4
- package/build/src/{modules/ar → plugins/ar/src}/webxr/overlay/Overlay.d.ts +2 -2
- package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/WebXRRaycaster.d.ts +8 -8
- package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +4 -4
- package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +4 -4
- package/build/src/{modules/ar → plugins/ar/src}/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +3 -3
- package/build/src/plugins/assetcache/index.d.ts +1 -0
- package/build/src/plugins/assetcache/src/cache/AssetCache.d.ts +12 -0
- package/build/src/plugins/assetcache/src/chunk/Chunk.d.ts +16 -0
- package/build/src/plugins/assetcache/src/index.d.ts +2 -0
- package/build/src/plugins/assetconverter/index.d.ts +1 -0
- package/build/src/plugins/assetconverter/src/AssetConverter.d.ts +13 -0
- package/build/src/plugins/assetexporter/index.d.ts +1 -0
- package/build/src/{modules/asset/exporter → plugins/assetexporter/src}/AssetExporter.d.ts +0 -17
- package/build/src/plugins/assetloader/index.d.ts +3 -0
- package/build/src/plugins/assetloader/src/draco/DracoLoader.d.ts +10 -0
- package/build/src/plugins/assetloader/src/loader/AssetLoader.d.ts +14 -0
- package/build/src/plugins/axiscamera/index.d.ts +1 -0
- package/build/src/{modules/axiscamera → plugins/axiscamera/src}/AxisCamera.d.ts +3 -6
- package/build/src/plugins/mediacreator/index.d.ts +1 -0
- package/build/src/plugins/mediacreator/src/MediaCreator.d.ts +15 -0
- package/build/src/plugins/orbitcontroller/index.d.ts +1 -0
- package/build/src/{modules/controller/orbit → plugins/orbitcontroller/src}/OrbitController.d.ts +3 -3
- package/build/src/plugins/state/index.d.ts +4 -0
- package/build/src/{modules/state → plugins/state/src}/State.d.ts +4 -27
- package/build/src/{modules/state → plugins/state/src}/actions/action.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/ar/launchar.d.ts +2 -2
- package/build/src/{modules/state → plugins/state/src}/actions/camera/computeencompassingview.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/camera/getcameratransform.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/camera/lockcamera.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/camera/movecamera.d.ts +3 -3
- package/build/src/{modules/state → plugins/state/src}/actions/camera/setcameralayer.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/camera/setcameratransform.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/camera/zoomcamera.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/media/generatemedia.d.ts +1 -1
- package/build/src/plugins/state/src/actions/object/addobject.d.ts +9 -0
- package/build/src/plugins/state/src/actions/object/deleteobject.d.ts +13 -0
- package/build/src/plugins/state/src/actions/object/deselectobject.d.ts +13 -0
- package/build/src/{modules/state → plugins/state/src}/actions/object/dropit.d.ts +3 -3
- package/build/src/{modules/state → plugins/state/src}/actions/object/getallobjects.d.ts +3 -2
- package/build/src/plugins/state/src/actions/object/getobjects.d.ts +13 -0
- package/build/src/{modules/state → plugins/state/src}/actions/object/modelloaded.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/object/placeonfloor.d.ts +3 -3
- package/build/src/plugins/state/src/actions/object/selectobject.d.ts +13 -0
- package/build/src/plugins/state/src/actions/object/setparent.d.ts +23 -0
- package/build/src/plugins/state/src/actions/object/updateobject.d.ts +13 -0
- package/build/src/{modules/state → plugins/state/src}/actions/renderer/startrender.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/scene/exportscene.d.ts +4 -4
- package/build/src/plugins/state/src/actions/scene/getallscenedata.d.ts +9 -0
- package/build/src/{modules/state → plugins/state/src}/actions/scene/setbackground.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/scene/updatescene.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/toolbox/setgizmomode.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/toolbox/setgizmoscalelinked.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/toolbox/setgizmovisible.d.ts +1 -1
- package/build/src/{modules/state → plugins/state/src}/actions/toolbox/usetool.d.ts +2 -2
- package/build/src/plugins/state/types/ActionTypes.d.ts +17 -0
- package/build/src/{types/SceneType.d.ts → plugins/state/types/StateExportFileType.d.ts} +1 -1
- package/build/src/plugins/state/types/StateSceneData.d.ts +19 -0
- package/build/src/plugins/state/types/index.d.ts +1 -0
- package/build/src/plugins/systeminfo/index.d.ts +2 -0
- package/build/src/{modules/systeminfo → plugins/systeminfo/src}/SystemInfo.d.ts +22 -32
- package/build/src/plugins/toolbox/index.d.ts +4 -0
- package/build/src/{modules/toolbox → plugins/toolbox/src}/BaseTool.d.ts +4 -6
- package/build/src/{modules/toolbox → plugins/toolbox/src}/Toolbox.d.ts +8 -17
- package/build/src/{modules/toolbox → plugins/toolbox/src}/select/SelectTool.d.ts +7 -11
- package/build/src/{modules/toolbox → plugins/toolbox/src}/transform/TransformTool.d.ts +6 -10
- package/build/src/types/components/DIVELight.d.ts +4 -0
- package/build/src/types/components/DIVESceneObject.d.ts +6 -0
- package/build/src/types/components/index.d.ts +2 -0
- package/build/src/types/index.d.ts +2 -5
- package/build/src/types/schema/BaseEntitySchema.d.ts +8 -0
- package/build/src/types/schema/EntitySchema.d.ts +11 -0
- package/build/src/types/schema/EntityTypeSchema.d.ts +1 -0
- package/build/src/types/schema/GeometrySchema.d.ts +7 -0
- package/build/src/types/schema/GeometryTypeSchema.d.ts +1 -0
- package/build/src/types/schema/GroupSchema.d.ts +11 -0
- package/build/src/types/schema/LightSchema.d.ts +28 -0
- package/build/src/{modules/state/types/COMMaterial.d.ts → types/schema/MaterialSchema.d.ts} +1 -1
- package/build/src/types/schema/ModelSchema.d.ts +14 -0
- package/build/src/types/schema/PovSchema.d.ts +10 -0
- package/build/src/types/schema/PrimitiveSchema.d.ts +14 -0
- package/build/src/types/schema/index.d.ts +11 -0
- package/package.json +59 -41
- package/build/chunks/FileTypes-BjZ0rrIV.cjs +0 -1
- package/build/chunks/FileTypes-qgYnI0Jg.mjs +0 -30
- package/build/chunks/ModuleRegistry-NyNtjHb2.cjs +0 -1
- package/build/chunks/ModuleRegistry-RSub8W0G.mjs +0 -13
- package/build/chunks/PerspectiveCamera-BByyG5R4.cjs +0 -1
- package/build/chunks/PerspectiveCamera-sm4_81KJ.mjs +0 -34
- package/build/chunks/SelectTool-BAXTVyWs.cjs +0 -1
- package/build/chunks/SystemInfo-oX-NNneO.cjs +0 -1
- package/build/chunks/VisibilityLayerMask-BI7jPKdx.cjs +0 -1
- package/build/chunks/VisibilityLayerMask-CXgt1fJc.mjs +0 -8
- package/build/chunks/findInterface-BEdL2iUQ.cjs +0 -1
- package/build/chunks/findInterface-OrXgmwxj.mjs +0 -18
- package/build/chunks/index-C_uFFwT2.mjs +0 -5
- package/build/chunks/index-DAwIH9xh.cjs +0 -1
- package/build/chunks/package-BHjZWYD6.mjs +0 -39
- package/build/chunks/package-JHvTSNgQ.cjs +0 -1
- package/build/chunks/parse-error-2f5qpXP5.cjs +0 -6
- package/build/chunks/parse-error-DRBVHL9E.mjs +0 -614
- package/build/src/error/ar-compatibility/ar-compatibility-error.d.ts +0 -12
- package/build/src/modules/ModuleRegistry.d.ts +0 -19
- package/build/src/modules/animation/AnimationSystem.cjs +0 -1
- package/build/src/modules/animation/AnimationSystem.d.ts +0 -36
- package/build/src/modules/animation/AnimationSystem.mjs +0 -95
- package/build/src/modules/ar/ARSystem.cjs +0 -1
- package/build/src/modules/ar/ARSystem.d.ts +0 -71
- package/build/src/modules/ar/ARSystem.mjs +0 -163
- package/build/src/modules/ar/arquicklook/ARQuickLook.d.ts +0 -7
- package/build/src/modules/asset/converter/AssetConverter.d.ts +0 -30
- package/build/src/modules/asset/draco/README.md +0 -32
- package/build/src/modules/asset/draco/draco_decoder.js +0 -33
- package/build/src/modules/asset/draco/draco_decoder.wasm +0 -0
- package/build/src/modules/asset/draco/draco_encoder.js +0 -33
- package/build/src/modules/asset/draco/draco_wasm_wrapper.js +0 -116
- package/build/src/modules/asset/draco/gltf/draco_decoder.js +0 -33
- package/build/src/modules/asset/draco/gltf/draco_decoder.wasm +0 -0
- package/build/src/modules/asset/draco/gltf/draco_encoder.js +0 -33
- package/build/src/modules/asset/draco/gltf/draco_wasm_wrapper.js +0 -116
- package/build/src/modules/asset/exporter/AssetExporter.cjs +0 -164
- package/build/src/modules/asset/loader/AssetLoader.cjs +0 -3
- package/build/src/modules/asset/loader/AssetLoader.d.ts +0 -29
- package/build/src/modules/asset/loader/AssetLoader.mjs +0 -2154
- package/build/src/modules/events/EventExecutor.d.ts +0 -5
- package/build/src/modules/mediacreator/MediaCreator.cjs +0 -1
- package/build/src/modules/mediacreator/MediaCreator.d.ts +0 -44
- package/build/src/modules/state/State.cjs +0 -27
- package/build/src/modules/state/State.mjs +0 -4296
- package/build/src/modules/state/actions/object/addobject.d.ts +0 -8
- package/build/src/modules/state/actions/object/deleteobject.d.ts +0 -12
- package/build/src/modules/state/actions/object/deselectobject.d.ts +0 -12
- package/build/src/modules/state/actions/object/getobjects.d.ts +0 -12
- package/build/src/modules/state/actions/object/selectobject.d.ts +0 -12
- package/build/src/modules/state/actions/object/setparent.d.ts +0 -22
- package/build/src/modules/state/actions/object/updateobject.d.ts +0 -12
- package/build/src/modules/state/actions/scene/getallscenedata.d.ts +0 -9
- package/build/src/modules/state/types/ActionTypes.d.ts +0 -18
- package/build/src/modules/state/types/COMBaseEntity.d.ts +0 -8
- package/build/src/modules/state/types/COMEntity.d.ts +0 -11
- package/build/src/modules/state/types/COMEntityType.d.ts +0 -1
- package/build/src/modules/state/types/COMGeometry.d.ts +0 -7
- package/build/src/modules/state/types/COMGeometryType.d.ts +0 -1
- package/build/src/modules/state/types/COMGroup.d.ts +0 -11
- package/build/src/modules/state/types/COMLight.d.ts +0 -28
- package/build/src/modules/state/types/COMModel.d.ts +0 -14
- package/build/src/modules/state/types/COMPov.d.ts +0 -10
- package/build/src/modules/state/types/COMPrimitive.d.ts +0 -14
- package/build/src/modules/state/types/index.d.ts +0 -11
- package/build/src/modules/systeminfo/SystemInfo.cjs +0 -1
- package/build/src/modules/systeminfo/SystemInfo.mjs +0 -5
- package/build/src/modules/toolbox/Toolbox.cjs +0 -1
- package/build/src/types/SceneData.d.ts +0 -19
- package/build/src/types/SceneObjects.d.ts +0 -9
- package/build/src/types/UUID.d.ts +0 -1
- /package/build/{src/modules/asset/converter/AssetConverter.cjs → plugins/assetconverter/index.cjs} +0 -0
- /package/build/{src/modules/asset/converter/AssetConverter.mjs → plugins/assetconverter/index.mjs} +0 -0
- /package/build/src/{modules/animation → plugins/animation/src}/types/AnimatorParameters.d.ts +0 -0
- /package/build/src/{modules/state → plugins/state/src}/ActionRegistry.d.ts +0 -0
- /package/build/src/{modules/state → plugins/state/src}/actions/ar/index.d.ts +0 -0
- /package/build/src/{modules/state → plugins/state/src}/actions/camera/index.d.ts +0 -0
- /package/build/src/{modules/state → plugins/state/src}/actions/index.d.ts +0 -0
- /package/build/src/{modules/state → plugins/state/src}/actions/media/index.d.ts +0 -0
- /package/build/src/{modules/state → plugins/state/src}/actions/object/index.d.ts +0 -0
- /package/build/src/{modules/state → plugins/state/src}/actions/renderer/index.d.ts +0 -0
- /package/build/src/{modules/state → plugins/state/src}/actions/scene/index.d.ts +0 -0
- /package/build/src/{modules/state → plugins/state/src}/actions/toolbox/index.d.ts +0 -0
- /package/build/src/{types/info → plugins/systeminfo/types}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var Bt=Object.defineProperty;var Gt=(j,t,s)=>t in j?Bt(j,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):j[t]=s;var W=(j,t,s)=>Gt(j,typeof t!="symbol"?t+"":t,s);const d=require("three"),Z=require("./MathUtils-CBW56ZuG.cjs"),Ct={type:"change"},st={type:"start"},Pt={type:"end"},B=new d.Ray,St=new d.Plane,Jt=Math.cos(70*d.MathUtils.DEG2RAD);class $t extends d.EventDispatcher{constructor(t,s){super(),this.object=t,this.domElement=s,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new d.Vector3,this.cursor=new d.Vector3,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=.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:d.MOUSE.ROTATE,MIDDLE:d.MOUSE.DOLLY,RIGHT:d.MOUSE.PAN},this.touches={ONE:d.TOUCH.ROTATE,TWO:d.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(i){i.addEventListener("keydown",it),this._domElementKeyEvents=i},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",it),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(Ct),e.update(),o=n.NONE},this.update=function(){const i=new d.Vector3,r=new d.Quaternion().setFromUnitVectors(t.up,new d.Vector3(0,1,0)),_=r.clone().invert(),z=new d.Vector3,M=new d.Quaternion,k=new d.Vector3,E=2*Math.PI;return function(Wt=null){const Et=e.object.position;i.copy(Et).sub(e.target),i.applyQuaternion(r),a.setFromVector3(i),e.autoRotate&&o===n.NONE&&Y(At(Wt)),e.enableDamping?(a.theta+=y.theta*e.dampingFactor,a.phi+=y.phi*e.dampingFactor):(a.theta+=y.theta,a.phi+=y.phi);let S=e.minAzimuthAngle,D=e.maxAzimuthAngle;isFinite(S)&&isFinite(D)&&(S<-Math.PI?S+=E:S>Math.PI&&(S-=E),D<-Math.PI?D+=E:D>Math.PI&&(D-=E),S<=D?a.theta=Math.max(S,Math.min(D,a.theta)):a.theta=a.theta>(S+D)/2?Math.max(S,a.theta):Math.min(D,a.theta)),a.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,a.phi)),a.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(l,e.dampingFactor):e.target.add(l),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor);let F=!1;if(e.zoomToCursor&&L||e.object.isOrthographicCamera)a.radius=tt(a.radius);else{const A=a.radius;a.radius=tt(a.radius*c),F=A!=a.radius}if(i.setFromSpherical(a),i.applyQuaternion(_),Et.copy(e.target).add(i),e.object.lookAt(e.target),e.enableDamping===!0?(y.theta*=1-e.dampingFactor,y.phi*=1-e.dampingFactor,l.multiplyScalar(1-e.dampingFactor)):(y.set(0,0,0),l.set(0,0,0)),e.zoomToCursor&&L){let A=null;if(e.object.isPerspectiveCamera){const V=i.length();A=tt(V*c);const Q=V-A;e.object.position.addScaledVector(O,Q),e.object.updateMatrixWorld(),F=!!Q}else if(e.object.isOrthographicCamera){const V=new d.Vector3(f.x,f.y,0);V.unproject(e.object);const Q=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/c)),e.object.updateProjectionMatrix(),F=Q!==e.object.zoom;const Tt=new d.Vector3(f.x,f.y,0);Tt.unproject(e.object),e.object.position.sub(Tt).add(V),e.object.updateMatrixWorld(),A=i.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;A!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(A).add(e.object.position):(B.origin.copy(e.object.position),B.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(B.direction))<Jt?t.lookAt(e.target):(St.setFromNormalAndCoplanarPoint(e.object.up,e.target),B.intersectPlane(St,e.target))))}else if(e.object.isOrthographicCamera){const A=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/c)),A!==e.object.zoom&&(e.object.updateProjectionMatrix(),F=!0)}return c=1,L=!1,F||z.distanceToSquared(e.object.position)>p||8*(1-M.dot(e.object.quaternion))>p||k.distanceToSquared(e.target)>p?(e.dispatchEvent(Ct),z.copy(e.object.position),M.copy(e.object.quaternion),k.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",bt),e.domElement.removeEventListener("pointerdown",_t),e.domElement.removeEventListener("pointercancel",U),e.domElement.removeEventListener("wheel",zt),e.domElement.removeEventListener("pointermove",et),e.domElement.removeEventListener("pointerup",U),e.domElement.getRootNode().removeEventListener("keydown",ft,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",it),e._domElementKeyEvents=null)};const e=this,n={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let o=n.NONE;const p=1e-6,a=new d.Spherical,y=new d.Spherical;let c=1;const l=new d.Vector3,u=new d.Vector2,m=new d.Vector2,h=new d.Vector2,x=new d.Vector2,w=new d.Vector2,b=new d.Vector2,T=new d.Vector2,P=new d.Vector2,C=new d.Vector2,O=new d.Vector3,f=new d.Vector2;let L=!1;const g=[],I={};let J=!1;function At(i){return i!==null?2*Math.PI/60*e.autoRotateSpeed*i:2*Math.PI/60/60*e.autoRotateSpeed}function K(i){const r=Math.abs(i*.01);return Math.pow(.95,e.zoomSpeed*r)}function Y(i){y.theta-=i}function q(i){y.phi-=i}const at=function(){const i=new d.Vector3;return function(_,z){i.setFromMatrixColumn(z,0),i.multiplyScalar(-_),l.add(i)}}(),rt=function(){const i=new d.Vector3;return function(_,z){e.screenSpacePanning===!0?i.setFromMatrixColumn(z,1):(i.setFromMatrixColumn(z,0),i.crossVectors(e.object.up,i)),i.multiplyScalar(_),l.add(i)}}(),R=function(){const i=new d.Vector3;return function(_,z){const M=e.domElement;if(e.object.isPerspectiveCamera){const k=e.object.position;i.copy(k).sub(e.target);let E=i.length();E*=Math.tan(e.object.fov/2*Math.PI/180),at(2*_*E/M.clientHeight,e.object.matrix),rt(2*z*E/M.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(at(_*(e.object.right-e.object.left)/e.object.zoom/M.clientWidth,e.object.matrix),rt(z*(e.object.top-e.object.bottom)/e.object.zoom/M.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function $(i){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?c/=i:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function ht(i){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?c*=i:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function v(i,r){if(!e.zoomToCursor)return;L=!0;const _=e.domElement.getBoundingClientRect(),z=i-_.left,M=r-_.top,k=_.width,E=_.height;f.x=z/k*2-1,f.y=-(M/E)*2+1,O.set(f.x,f.y,1).unproject(e.object).sub(e.object.position).normalize()}function tt(i){return Math.max(e.minDistance,Math.min(e.maxDistance,i))}function ct(i){u.set(i.clientX,i.clientY)}function kt(i){v(i.clientX,i.clientX),T.set(i.clientX,i.clientY)}function lt(i){x.set(i.clientX,i.clientY)}function jt(i){m.set(i.clientX,i.clientY),h.subVectors(m,u).multiplyScalar(e.rotateSpeed);const r=e.domElement;Y(2*Math.PI*h.x/r.clientHeight),q(2*Math.PI*h.y/r.clientHeight),u.copy(m),e.update()}function Ot(i){P.set(i.clientX,i.clientY),C.subVectors(P,T),C.y>0?$(K(C.y)):C.y<0&&ht(K(C.y)),T.copy(P),e.update()}function Lt(i){w.set(i.clientX,i.clientY),b.subVectors(w,x).multiplyScalar(e.panSpeed),R(b.x,b.y),x.copy(w),e.update()}function Rt(i){v(i.clientX,i.clientY),i.deltaY<0?ht(K(i.deltaY)):i.deltaY>0&&$(K(i.deltaY)),e.update()}function Nt(i){let r=!1;switch(i.code){case e.keys.UP:i.ctrlKey||i.metaKey||i.shiftKey?q(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):R(0,e.keyPanSpeed),r=!0;break;case e.keys.BOTTOM:i.ctrlKey||i.metaKey||i.shiftKey?q(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):R(0,-e.keyPanSpeed),r=!0;break;case e.keys.LEFT:i.ctrlKey||i.metaKey||i.shiftKey?Y(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):R(e.keyPanSpeed,0),r=!0;break;case e.keys.RIGHT:i.ctrlKey||i.metaKey||i.shiftKey?Y(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):R(-e.keyPanSpeed,0),r=!0;break}r&&(i.preventDefault(),e.update())}function ut(i){if(g.length===1)u.set(i.pageX,i.pageY);else{const r=N(i),_=.5*(i.pageX+r.x),z=.5*(i.pageY+r.y);u.set(_,z)}}function mt(i){if(g.length===1)x.set(i.pageX,i.pageY);else{const r=N(i),_=.5*(i.pageX+r.x),z=.5*(i.pageY+r.y);x.set(_,z)}}function yt(i){const r=N(i),_=i.pageX-r.x,z=i.pageY-r.y,M=Math.sqrt(_*_+z*z);T.set(0,M)}function It(i){e.enableZoom&&yt(i),e.enablePan&&mt(i)}function Yt(i){e.enableZoom&&yt(i),e.enableRotate&&ut(i)}function pt(i){if(g.length==1)m.set(i.pageX,i.pageY);else{const _=N(i),z=.5*(i.pageX+_.x),M=.5*(i.pageY+_.y);m.set(z,M)}h.subVectors(m,u).multiplyScalar(e.rotateSpeed);const r=e.domElement;Y(2*Math.PI*h.x/r.clientHeight),q(2*Math.PI*h.y/r.clientHeight),u.copy(m)}function dt(i){if(g.length===1)w.set(i.pageX,i.pageY);else{const r=N(i),_=.5*(i.pageX+r.x),z=.5*(i.pageY+r.y);w.set(_,z)}b.subVectors(w,x).multiplyScalar(e.panSpeed),R(b.x,b.y),x.copy(w)}function xt(i){const r=N(i),_=i.pageX-r.x,z=i.pageY-r.y,M=Math.sqrt(_*_+z*z);P.set(0,M),C.set(0,Math.pow(P.y/T.y,e.zoomSpeed)),$(C.y),T.copy(P);const k=(i.pageX+r.x)*.5,E=(i.pageY+r.y)*.5;v(k,E)}function Ut(i){e.enableZoom&&xt(i),e.enablePan&&dt(i)}function Ft(i){e.enableZoom&&xt(i),e.enableRotate&&pt(i)}function _t(i){e.enabled!==!1&&(g.length===0&&(e.domElement.setPointerCapture(i.pointerId),e.domElement.addEventListener("pointermove",et),e.domElement.addEventListener("pointerup",U)),!Qt(i)&&(Kt(i),i.pointerType==="touch"?Mt(i):Vt(i)))}function et(i){e.enabled!==!1&&(i.pointerType==="touch"?Xt(i):Zt(i))}function U(i){switch(qt(i),g.length){case 0:e.domElement.releasePointerCapture(i.pointerId),e.domElement.removeEventListener("pointermove",et),e.domElement.removeEventListener("pointerup",U),e.dispatchEvent(Pt),o=n.NONE;break;case 1:const r=g[0],_=I[r];Mt({pointerId:r,pageX:_.x,pageY:_.y});break}}function Vt(i){let r;switch(i.button){case 0:r=e.mouseButtons.LEFT;break;case 1:r=e.mouseButtons.MIDDLE;break;case 2:r=e.mouseButtons.RIGHT;break;default:r=-1}switch(r){case d.MOUSE.DOLLY:if(e.enableZoom===!1)return;kt(i),o=n.DOLLY;break;case d.MOUSE.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(e.enablePan===!1)return;lt(i),o=n.PAN}else{if(e.enableRotate===!1)return;ct(i),o=n.ROTATE}break;case d.MOUSE.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(e.enableRotate===!1)return;ct(i),o=n.ROTATE}else{if(e.enablePan===!1)return;lt(i),o=n.PAN}break;default:o=n.NONE}o!==n.NONE&&e.dispatchEvent(st)}function Zt(i){switch(o){case n.ROTATE:if(e.enableRotate===!1)return;jt(i);break;case n.DOLLY:if(e.enableZoom===!1)return;Ot(i);break;case n.PAN:if(e.enablePan===!1)return;Lt(i);break}}function zt(i){e.enabled===!1||e.enableZoom===!1||o!==n.NONE||(i.preventDefault(),e.dispatchEvent(st),Rt(Ht(i)),e.dispatchEvent(Pt))}function Ht(i){const r=i.deltaMode,_={clientX:i.clientX,clientY:i.clientY,deltaY:i.deltaY};switch(r){case 1:_.deltaY*=16;break;case 2:_.deltaY*=100;break}return i.ctrlKey&&!J&&(_.deltaY*=10),_}function ft(i){i.key==="Control"&&(J=!0,e.domElement.getRootNode().addEventListener("keyup",gt,{passive:!0,capture:!0}))}function gt(i){i.key==="Control"&&(J=!1,e.domElement.getRootNode().removeEventListener("keyup",gt,{passive:!0,capture:!0}))}function it(i){e.enabled===!1||e.enablePan===!1||Nt(i)}function Mt(i){switch(wt(i),g.length){case 1:switch(e.touches.ONE){case d.TOUCH.ROTATE:if(e.enableRotate===!1)return;ut(i),o=n.TOUCH_ROTATE;break;case d.TOUCH.PAN:if(e.enablePan===!1)return;mt(i),o=n.TOUCH_PAN;break;default:o=n.NONE}break;case 2:switch(e.touches.TWO){case d.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;It(i),o=n.TOUCH_DOLLY_PAN;break;case d.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Yt(i),o=n.TOUCH_DOLLY_ROTATE;break;default:o=n.NONE}break;default:o=n.NONE}o!==n.NONE&&e.dispatchEvent(st)}function Xt(i){switch(wt(i),o){case n.TOUCH_ROTATE:if(e.enableRotate===!1)return;pt(i),e.update();break;case n.TOUCH_PAN:if(e.enablePan===!1)return;dt(i),e.update();break;case n.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;Ut(i),e.update();break;case n.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Ft(i),e.update();break;default:o=n.NONE}}function bt(i){e.enabled!==!1&&i.preventDefault()}function Kt(i){g.push(i.pointerId)}function qt(i){delete I[i.pointerId];for(let r=0;r<g.length;r++)if(g[r]==i.pointerId){g.splice(r,1);return}}function Qt(i){for(let r=0;r<g.length;r++)if(g[r]==i.pointerId)return!0;return!1}function wt(i){let r=I[i.pointerId];r===void 0&&(r=new d.Vector2,I[i.pointerId]=r),r.set(i.pageX,i.pageY)}function N(i){const r=i.pointerId===g[0]?g[1]:g[0];return I[r]}e.domElement.addEventListener("contextmenu",bt),e.domElement.addEventListener("pointerdown",_t),e.domElement.addEventListener("pointercancel",U),e.domElement.addEventListener("wheel",zt,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",ft,{passive:!0,capture:!0}),this.update()}}class vt{constructor(t=0,s=0,e=0,n=1){this.isQuaternion=!0,this._x=t,this._y=s,this._z=e,this._w=n}static slerpFlat(t,s,e,n,o,p,a){let y=e[n+0],c=e[n+1],l=e[n+2],u=e[n+3];const m=o[p+0],h=o[p+1],x=o[p+2],w=o[p+3];if(a===0){t[s+0]=y,t[s+1]=c,t[s+2]=l,t[s+3]=u;return}if(a===1){t[s+0]=m,t[s+1]=h,t[s+2]=x,t[s+3]=w;return}if(u!==w||y!==m||c!==h||l!==x){let b=1-a;const T=y*m+c*h+l*x+u*w,P=T>=0?1:-1,C=1-T*T;if(C>Number.EPSILON){const f=Math.sqrt(C),L=Math.atan2(f,T*P);b=Math.sin(b*L)/f,a=Math.sin(a*L)/f}const O=a*P;if(y=y*b+m*O,c=c*b+h*O,l=l*b+x*O,u=u*b+w*O,b===1-a){const f=1/Math.sqrt(y*y+c*c+l*l+u*u);y*=f,c*=f,l*=f,u*=f}}t[s]=y,t[s+1]=c,t[s+2]=l,t[s+3]=u}static multiplyQuaternionsFlat(t,s,e,n,o,p){const a=e[n],y=e[n+1],c=e[n+2],l=e[n+3],u=o[p],m=o[p+1],h=o[p+2],x=o[p+3];return t[s]=a*x+l*u+y*h-c*m,t[s+1]=y*x+l*m+c*u-a*h,t[s+2]=c*x+l*h+a*m-y*u,t[s+3]=l*x-a*u-y*m-c*h,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,s,e,n){return this._x=t,this._y=s,this._z=e,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,s=!0){const e=t._x,n=t._y,o=t._z,p=t._order,a=Math.cos,y=Math.sin,c=a(e/2),l=a(n/2),u=a(o/2),m=y(e/2),h=y(n/2),x=y(o/2);switch(p){case"XYZ":this._x=m*l*u+c*h*x,this._y=c*h*u-m*l*x,this._z=c*l*x+m*h*u,this._w=c*l*u-m*h*x;break;case"YXZ":this._x=m*l*u+c*h*x,this._y=c*h*u-m*l*x,this._z=c*l*x-m*h*u,this._w=c*l*u+m*h*x;break;case"ZXY":this._x=m*l*u-c*h*x,this._y=c*h*u+m*l*x,this._z=c*l*x+m*h*u,this._w=c*l*u-m*h*x;break;case"ZYX":this._x=m*l*u-c*h*x,this._y=c*h*u+m*l*x,this._z=c*l*x-m*h*u,this._w=c*l*u+m*h*x;break;case"YZX":this._x=m*l*u+c*h*x,this._y=c*h*u+m*l*x,this._z=c*l*x-m*h*u,this._w=c*l*u-m*h*x;break;case"XZY":this._x=m*l*u-c*h*x,this._y=c*h*u-m*l*x,this._z=c*l*x+m*h*u,this._w=c*l*u+m*h*x;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+p)}return s===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,s){const e=s/2,n=Math.sin(e);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(e),this._onChangeCallback(),this}setFromRotationMatrix(t){const s=t.elements,e=s[0],n=s[4],o=s[8],p=s[1],a=s[5],y=s[9],c=s[2],l=s[6],u=s[10],m=e+a+u;if(m>0){const h=.5/Math.sqrt(m+1);this._w=.25/h,this._x=(l-y)*h,this._y=(o-c)*h,this._z=(p-n)*h}else if(e>a&&e>u){const h=2*Math.sqrt(1+e-a-u);this._w=(l-y)/h,this._x=.25*h,this._y=(n+p)/h,this._z=(o+c)/h}else if(a>u){const h=2*Math.sqrt(1+a-e-u);this._w=(o-c)/h,this._x=(n+p)/h,this._y=.25*h,this._z=(y+l)/h}else{const h=2*Math.sqrt(1+u-e-a);this._w=(p-n)/h,this._x=(o+c)/h,this._y=(y+l)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(t,s){let e=t.dot(s)+1;return e<Number.EPSILON?(e=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=e):(this._x=0,this._y=-t.z,this._z=t.y,this._w=e)):(this._x=t.y*s.z-t.z*s.y,this._y=t.z*s.x-t.x*s.z,this._z=t.x*s.y-t.y*s.x,this._w=e),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Z.clamp(this.dot(t),-1,1)))}rotateTowards(t,s){const e=this.angleTo(t);if(e===0)return this;const n=Math.min(1,s/e);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,s){const e=t._x,n=t._y,o=t._z,p=t._w,a=s._x,y=s._y,c=s._z,l=s._w;return this._x=e*l+p*a+n*c-o*y,this._y=n*l+p*y+o*a-e*c,this._z=o*l+p*c+e*y-n*a,this._w=p*l-e*a-n*y-o*c,this._onChangeCallback(),this}slerp(t,s){if(s===0)return this;if(s===1)return this.copy(t);const e=this._x,n=this._y,o=this._z,p=this._w;let a=p*t._w+e*t._x+n*t._y+o*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=p,this._x=e,this._y=n,this._z=o,this;const y=1-a*a;if(y<=Number.EPSILON){const h=1-s;return this._w=h*p+s*this._w,this._x=h*e+s*this._x,this._y=h*n+s*this._y,this._z=h*o+s*this._z,this.normalize(),this}const c=Math.sqrt(y),l=Math.atan2(c,a),u=Math.sin((1-s)*l)/c,m=Math.sin(s*l)/c;return this._w=p*u+this._w*m,this._x=e*u+this._x*m,this._y=n*u+this._y*m,this._z=o*u+this._z*m,this._onChangeCallback(),this}slerpQuaternions(t,s,e){return this.copy(t).slerp(s,e)}random(){const t=2*Math.PI*Math.random(),s=2*Math.PI*Math.random(),e=Math.random(),n=Math.sqrt(1-e),o=Math.sqrt(e);return this.set(n*Math.sin(t),n*Math.cos(t),o*Math.sin(s),o*Math.cos(s))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,s=0){return this._x=t[s],this._y=t[s+1],this._z=t[s+2],this._w=t[s+3],this._onChangeCallback(),this}toArray(t=[],s=0){return t[s]=this._x,t[s+1]=this._y,t[s+2]=this._z,t[s+3]=this._w,t}fromBufferAttribute(t,s){return this._x=t.getX(s),this._y=t.getY(s),this._z=t.getZ(s),this._w=t.getW(s),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class X{constructor(t=0,s=0,e=0){X.prototype.isVector3=!0,this.x=t,this.y=s,this.z=e}set(t,s,e){return e===void 0&&(e=this.z),this.x=t,this.y=s,this.z=e,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,s){switch(t){case 0:this.x=s;break;case 1:this.y=s;break;case 2:this.z=s;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this.z=t.z+s.z,this}addScaledVector(t,s){return this.x+=t.x*s,this.y+=t.y*s,this.z+=t.z*s,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,s){return this.x=t.x-s.x,this.y=t.y-s.y,this.z=t.z-s.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,s){return this.x=t.x*s.x,this.y=t.y*s.y,this.z=t.z*s.z,this}applyEuler(t){return this.applyQuaternion(Dt.setFromEuler(t))}applyAxisAngle(t,s){return this.applyQuaternion(Dt.setFromAxisAngle(t,s))}applyMatrix3(t){const s=this.x,e=this.y,n=this.z,o=t.elements;return this.x=o[0]*s+o[3]*e+o[6]*n,this.y=o[1]*s+o[4]*e+o[7]*n,this.z=o[2]*s+o[5]*e+o[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const s=this.x,e=this.y,n=this.z,o=t.elements,p=1/(o[3]*s+o[7]*e+o[11]*n+o[15]);return this.x=(o[0]*s+o[4]*e+o[8]*n+o[12])*p,this.y=(o[1]*s+o[5]*e+o[9]*n+o[13])*p,this.z=(o[2]*s+o[6]*e+o[10]*n+o[14])*p,this}applyQuaternion(t){const s=this.x,e=this.y,n=this.z,o=t.x,p=t.y,a=t.z,y=t.w,c=2*(p*n-a*e),l=2*(a*s-o*n),u=2*(o*e-p*s);return this.x=s+y*c+p*u-a*l,this.y=e+y*l+a*c-o*u,this.z=n+y*u+o*l-p*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const s=this.x,e=this.y,n=this.z,o=t.elements;return this.x=o[0]*s+o[4]*e+o[8]*n,this.y=o[1]*s+o[5]*e+o[9]*n,this.z=o[2]*s+o[6]*e+o[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,s){return this.x=Math.max(t.x,Math.min(s.x,this.x)),this.y=Math.max(t.y,Math.min(s.y,this.y)),this.z=Math.max(t.z,Math.min(s.z,this.z)),this}clampScalar(t,s){return this.x=Math.max(t,Math.min(s,this.x)),this.y=Math.max(t,Math.min(s,this.y)),this.z=Math.max(t,Math.min(s,this.z)),this}clampLength(t,s){const e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(s,e)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,s){return this.x+=(t.x-this.x)*s,this.y+=(t.y-this.y)*s,this.z+=(t.z-this.z)*s,this}lerpVectors(t,s,e){return this.x=t.x+(s.x-t.x)*e,this.y=t.y+(s.y-t.y)*e,this.z=t.z+(s.z-t.z)*e,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,s){const e=t.x,n=t.y,o=t.z,p=s.x,a=s.y,y=s.z;return this.x=n*y-o*a,this.y=o*p-e*y,this.z=e*a-n*p,this}projectOnVector(t){const s=t.lengthSq();if(s===0)return this.set(0,0,0);const e=t.dot(this)/s;return this.copy(t).multiplyScalar(e)}projectOnPlane(t){return nt.copy(this).projectOnVector(t),this.sub(nt)}reflect(t){return this.sub(nt.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const s=Math.sqrt(this.lengthSq()*t.lengthSq());if(s===0)return Math.PI/2;const e=this.dot(t)/s;return Math.acos(Z.clamp(e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const s=this.x-t.x,e=this.y-t.y,n=this.z-t.z;return s*s+e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,s,e){const n=Math.sin(s)*t;return this.x=n*Math.sin(e),this.y=Math.cos(s)*t,this.z=n*Math.cos(e),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,s,e){return this.x=t*Math.sin(s),this.y=e,this.z=t*Math.cos(s),this}setFromMatrixPosition(t){const s=t.elements;return this.x=s[12],this.y=s[13],this.z=s[14],this}setFromMatrixScale(t){const s=this.setFromMatrixColumn(t,0).length(),e=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=s,this.y=e,this.z=n,this}setFromMatrixColumn(t,s){return this.fromArray(t.elements,s*4)}setFromMatrix3Column(t,s){return this.fromArray(t.elements,s*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,s=0){return this.x=t[s],this.y=t[s+1],this.z=t[s+2],this}toArray(t=[],s=0){return t[s]=this.x,t[s+1]=this.y,t[s+2]=this.z,t}fromBufferAttribute(t,s){return this.x=t.getX(s),this.y=t.getY(s),this.z=t.getZ(s),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,s=Math.random()*2-1,e=Math.sqrt(1-s*s);return this.x=e*Math.cos(t),this.y=s,this.z=e*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const nt=new X,Dt=new vt,G={enableDamping:!0,dampingFactor:.05},H=class H extends $t{constructor(s,e,n=G){super(s,e);W(this,"uuid",Z.MathUtils.generateUUID());W(this,"object");this.domElement=e,this.domElement=e,this.object=s,this.enableDamping=n.enableDamping??G.enableDamping,this.dampingFactor=n.dampingFactor??G.dampingFactor,this.object.position.set(0,2,2),this.target.copy({x:0,y:.5,z:0}),this.update()}tick(){this.enabled&&this.update()}computeEncompassingView(s){const e=s.getCenter(new X),n=s.getSize(new X),o=Math.max(n.x,n.y,n.z)*1.25;return{position:this.object.position.clone().normalize().clone().multiplyScalar(o),target:e.clone()}}zoomIn(s){const e=s||H.DEFAULT_ZOOM_FACTOR,{minDistance:n,maxDistance:o}=this;this.minDistance=this.maxDistance=Z.MathUtils.clamp(this.getDistance()-e,n+e,o-e),this.update(),this.minDistance=n,this.maxDistance=o}zoomOut(s){const e=s||H.DEFAULT_ZOOM_FACTOR,{minDistance:n,maxDistance:o}=this;this.minDistance=this.maxDistance=Z.MathUtils.clamp(this.getDistance()+e,n+e,o-e),this.update(),this.minDistance=n,this.maxDistance=o}};W(H,"DEFAULT_ZOOM_FACTOR",1);let ot=H;exports.OrbitController=ot;exports.OrbitControllerDefaultSettings=G;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var n=(t,A,e)=>A in t?c(t,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[A]=e;var s=(t,A,e)=>n(t,typeof A!="symbol"?A+"":A,e);const M=require("three"),L=1,I=2,R=4,S=8,_=16,a={fov:70,near:.1,far:1e3},E=class E extends M.PerspectiveCamera{constructor(e=a){super(e.fov||a.fov,1,e.near||a.near,e.far||a.far);s(this,"onSetCameraLayer",()=>{});this.layers.mask=E.EDITOR_VIEW_LAYER_MASK}onResize(e,o){this.aspect=e/o,this.updateProjectionMatrix()}setCameraLayer(e){this.layers.mask=e==="LIVE"?E.LIVE_VIEW_LAYER_MASK:E.EDITOR_VIEW_LAYER_MASK,this.onSetCameraLayer(this.layers.mask)}};s(E,"EDITOR_VIEW_LAYER_MASK",L|R|S|_),s(E,"LIVE_VIEW_LAYER_MASK",_);let r=E;exports.COORDINATE_LAYER_MASK=I;exports.DEFAULT_LAYER_MASK=L;exports.DIVEPerspectiveCamera=r;exports.DIVEPerspectiveCameraDefaultSettings=a;exports.HELPER_LAYER_MASK=S;exports.PRODUCT_LAYER_MASK=_;exports.UI_LAYER_MASK=R;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var L = Object.defineProperty;
|
|
2
|
+
var R = (E, s, a) => s in E ? L(E, s, { enumerable: !0, configurable: !0, writable: !0, value: a }) : E[s] = a;
|
|
3
|
+
var A = (E, s, a) => R(E, typeof s != "symbol" ? s + "" : s, a);
|
|
4
|
+
import { PerspectiveCamera as n } from "three";
|
|
5
|
+
const S = 1, K = 2, c = 4, I = 8, r = 16, e = {
|
|
6
|
+
fov: 70,
|
|
7
|
+
near: 0.1,
|
|
8
|
+
far: 1e3
|
|
9
|
+
}, t = class t extends n {
|
|
10
|
+
constructor(a = e) {
|
|
11
|
+
super(
|
|
12
|
+
a.fov || e.fov,
|
|
13
|
+
1,
|
|
14
|
+
a.near || e.near,
|
|
15
|
+
a.far || e.far
|
|
16
|
+
);
|
|
17
|
+
A(this, "onSetCameraLayer", () => {
|
|
18
|
+
});
|
|
19
|
+
this.layers.mask = t.EDITOR_VIEW_LAYER_MASK;
|
|
20
|
+
}
|
|
21
|
+
onResize(a, o) {
|
|
22
|
+
this.aspect = a / o, this.updateProjectionMatrix();
|
|
23
|
+
}
|
|
24
|
+
setCameraLayer(a) {
|
|
25
|
+
this.layers.mask = a === "LIVE" ? t.LIVE_VIEW_LAYER_MASK : t.EDITOR_VIEW_LAYER_MASK, this.onSetCameraLayer(this.layers.mask);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
A(t, "EDITOR_VIEW_LAYER_MASK", S | c | I | r), A(t, "LIVE_VIEW_LAYER_MASK", r);
|
|
29
|
+
let _ = t;
|
|
30
|
+
export {
|
|
31
|
+
K as C,
|
|
32
|
+
_ as D,
|
|
33
|
+
I as H,
|
|
34
|
+
r as P,
|
|
35
|
+
c as U,
|
|
36
|
+
e as a,
|
|
37
|
+
S as b
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function t(e){return e.entityType==="model"}function i(e){return e.entityType==="pov"}exports.isModelSchema=t;exports.isPovSchema=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var wt=Object.defineProperty;var gt=(r,n,e)=>n in r?wt(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var h=(r,n,e)=>gt(r,typeof n!="symbol"?n+"":n,e);const Q=require("./FileTypes-PEcAgRZ8.cjs"),t=require("three"),j=require("./findInterface-C6mrvf_t.cjs"),$=require("./PerspectiveCamera-CONx93im.cjs"),D=new t.Raycaster,p=new t.Vector3,P=new t.Vector3,c=new t.Quaternion,tt={X:new t.Vector3(1,0,0),Y:new t.Vector3(0,1,0),Z:new t.Vector3(0,0,1)},U={type:"change"},et={type:"mouseDown"},it={type:"mouseUp",mode:null},nt={type:"objectChange"};class bt extends t.Object3D{constructor(n,e){super(),e===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),e=document),this.isTransformControls=!0,this.visible=!1,this.domElement=e,this.domElement.style.touchAction="none";const o=new xt;this._gizmo=o,this.add(o);const s=new Dt;this._plane=s,this.add(s);const a=this;function i(m,y){let A=y;Object.defineProperty(a,m,{get:function(){return A!==void 0?A:y},set:function(x){A!==x&&(A=x,s[m]=x,o[m]=x,a.dispatchEvent({type:m+"-changed",value:x}),a.dispatchEvent(U))}}),a[m]=y,s[m]=y,o[m]=y}i("camera",n),i("object",void 0),i("enabled",!0),i("axis",null),i("mode","translate"),i("translationSnap",null),i("rotationSnap",null),i("scaleSnap",null),i("space","world"),i("size",1),i("dragging",!1),i("showX",!0),i("showY",!0),i("showZ",!0);const d=new t.Vector3,f=new t.Vector3,E=new t.Quaternion,T=new t.Quaternion,z=new t.Vector3,C=new t.Quaternion,K=new t.Vector3,H=new t.Vector3,M=new t.Vector3,S=0,g=new t.Vector3;i("worldPosition",d),i("worldPositionStart",f),i("worldQuaternion",E),i("worldQuaternionStart",T),i("cameraPosition",z),i("cameraQuaternion",C),i("pointStart",K),i("pointEnd",H),i("rotationAxis",M),i("rotationAngle",S),i("eye",g),this._offset=new t.Vector3,this._startNorm=new t.Vector3,this._endNorm=new t.Vector3,this._cameraScale=new t.Vector3,this._parentPosition=new t.Vector3,this._parentQuaternion=new t.Quaternion,this._parentQuaternionInv=new t.Quaternion,this._parentScale=new t.Vector3,this._worldScaleStart=new t.Vector3,this._worldQuaternionInv=new t.Quaternion,this._worldScale=new t.Vector3,this._positionStart=new t.Vector3,this._quaternionStart=new t.Quaternion,this._scaleStart=new t.Vector3,this._getPointer=Mt.bind(this),this._onPointerDown=vt.bind(this),this._onPointerHover=St.bind(this),this._onPointerMove=Pt.bind(this),this._onPointerUp=Et.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(n){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(n)}pointerHover(n){if(this.object===void 0||this.dragging===!0)return;n!==null&&D.setFromCamera(n,this.camera);const e=N(this._gizmo.picker[this.mode],D);e?this.axis=e.object.name:this.axis=null}pointerDown(n){if(!(this.object===void 0||this.dragging===!0||n!=null&&n.button!==0)&&this.axis!==null){n!==null&&D.setFromCamera(n,this.camera);const e=N(this._plane,D,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,et.mode=this.mode,this.dispatchEvent(et)}}pointerMove(n){const e=this.axis,o=this.mode,s=this.object;let a=this.space;if(o==="scale"?a="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(a="world"),s===void 0||e===null||this.dragging===!1||n!==null&&n.button!==-1)return;n!==null&&D.setFromCamera(n,this.camera);const i=N(this._plane,D,!0);if(i){if(this.pointEnd.copy(i.point).sub(this.worldPositionStart),o==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),a==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),a==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(a==="local"&&(s.position.applyQuaternion(c.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),a==="world"&&(s.parent&&s.position.add(p.setFromMatrixPosition(s.parent.matrixWorld)),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(p.setFromMatrixPosition(s.parent.matrixWorld))));else if(o==="scale"){if(e.search("XYZ")!==-1){let d=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(d*=-1),P.set(d,d,d)}else p.copy(this.pointStart),P.copy(this.pointEnd),p.applyQuaternion(this._worldQuaternionInv),P.applyQuaternion(this._worldQuaternionInv),P.divide(p),e.search("X")===-1&&(P.x=1),e.search("Y")===-1&&(P.y=1),e.search("Z")===-1&&(P.z=1);s.scale.copy(this._scaleStart).multiply(P),this.scaleSnap&&(e.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(o==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const d=20/this.worldPosition.distanceTo(p.setFromMatrixPosition(this.camera.matrixWorld));let f=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(p.copy(this.rotationAxis).cross(this.eye))*d):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(tt[e]),p.copy(tt[e]),a==="local"&&p.applyQuaternion(this.worldQuaternion),p.cross(this.eye),p.length()===0?f=!0:this.rotationAngle=this._offset.dot(p.normalize())*d),(e==="E"||f)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),a==="local"&&e!=="E"&&e!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(c.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(c.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(U),this.dispatchEvent(nt)}}pointerUp(n){n!==null&&n.button!==0||(this.dragging&&this.axis!==null&&(it.mode=this.mode,this.dispatchEvent(it)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(n){n.geometry&&n.geometry.dispose(),n.material&&n.material.dispose()})}attach(n){return this.object=n,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(U),this.dispatchEvent(nt),this.pointStart.copy(this.pointEnd))}getRaycaster(){return D}getMode(){return this.mode}setMode(n){this.mode=n}setTranslationSnap(n){this.translationSnap=n}setRotationSnap(n){this.rotationSnap=n}setScaleSnap(n){this.scaleSnap=n}setSize(n){this.size=n}setSpace(n){this.space=n}}function Mt(r){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:r.button};{const n=this.domElement.getBoundingClientRect();return{x:(r.clientX-n.left)/n.width*2-1,y:-(r.clientY-n.top)/n.height*2+1,button:r.button}}}function St(r){if(this.enabled)switch(r.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(r));break}}function vt(r){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(r.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(r)),this.pointerDown(this._getPointer(r)))}function Pt(r){this.enabled&&this.pointerMove(this._getPointer(r))}function Et(r){this.enabled&&(this.domElement.releasePointerCapture(r.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(r)))}function N(r,n,e){const o=n.intersectObject(r,!0);for(let s=0;s<o.length;s++)if(o[s].object.visible||e)return o[s];return!1}const q=new t.Euler,l=new t.Vector3(0,1,0),ot=new t.Vector3(0,0,0),st=new t.Matrix4,B=new t.Quaternion,F=new t.Quaternion,b=new t.Vector3,rt=new t.Matrix4,O=new t.Vector3(1,0,0),I=new t.Vector3(0,1,0),Z=new t.Vector3(0,0,1),W=new t.Vector3,X=new t.Vector3,Y=new t.Vector3;class xt extends t.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const n=new t.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=new t.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),o=n.clone();o.opacity=.15;const s=e.clone();s.opacity=.5;const a=n.clone();a.color.setHex(16711680);const i=n.clone();i.color.setHex(65280);const d=n.clone();d.color.setHex(255);const f=n.clone();f.color.setHex(16711680),f.opacity=.5;const E=n.clone();E.color.setHex(65280),E.opacity=.5;const T=n.clone();T.color.setHex(255),T.opacity=.5;const z=n.clone();z.opacity=.25;const C=n.clone();C.color.setHex(16776960),C.opacity=.25,n.clone().color.setHex(16776960);const H=n.clone();H.color.setHex(7895160);const M=new t.CylinderGeometry(0,.04,.1,12);M.translate(0,.05,0);const S=new t.BoxGeometry(.08,.08,.08);S.translate(0,.04,0);const g=new t.BufferGeometry;g.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,0,0],3));const m=new t.CylinderGeometry(.0075,.0075,.5,3);m.translate(0,.25,0);function y(_,V){const w=new t.TorusGeometry(_,.0075,3,64,V*Math.PI*2);return w.rotateY(Math.PI/2),w.rotateX(Math.PI/2),w}function A(){const _=new t.BufferGeometry;return _.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,1,1],3)),_}const x={X:[[new t.Mesh(M,a),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(M,a),[-.5,0,0],[0,0,Math.PI/2]],[new t.Mesh(m,a),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new t.Mesh(M,i),[0,.5,0]],[new t.Mesh(M,i),[0,-.5,0],[Math.PI,0,0]],[new t.Mesh(m,i)]],Z:[[new t.Mesh(M,d),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(M,d),[0,0,-.5],[-Math.PI/2,0,0]],[new t.Mesh(m,d),null,[Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.1,0),z.clone()),[0,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),T.clone()),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),f.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),E.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},ht={X:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),o),[.3,0,0],[0,0,-Math.PI/2]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),o),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),o),[0,.3,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),o),[0,-.3,0],[0,0,Math.PI]]],Z:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),o),[0,0,.3],[Math.PI/2,0,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),o),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.2,0),o)]],XY:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),o),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),o),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),o),[.15,0,.15],[-Math.PI/2,0,0]]]},ct={START:[[new t.Mesh(new t.OctahedronGeometry(.01,2),s),null,null,null,"helper"]],END:[[new t.Mesh(new t.OctahedronGeometry(.01,2),s),null,null,null,"helper"]],DELTA:[[new t.Line(A(),s),null,null,null,"helper"]],X:[[new t.Line(g,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(g,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(g,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},dt={XYZE:[[new t.Mesh(y(.5,1),H),null,[0,Math.PI/2,0]]],X:[[new t.Mesh(y(.5,.5),a)]],Y:[[new t.Mesh(y(.5,.5),i),null,[0,0,-Math.PI/2]]],Z:[[new t.Mesh(y(.5,.5),d),null,[0,Math.PI/2,0]]],E:[[new t.Mesh(y(.75,1),C),null,[0,Math.PI/2,0]]]},pt={AXIS:[[new t.Line(g,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},mt={XYZE:[[new t.Mesh(new t.SphereGeometry(.25,10,8),o)]],X:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),o),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),o),[0,0,0],[Math.PI/2,0,0]]],Z:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),o),[0,0,0],[0,0,-Math.PI/2]]],E:[[new t.Mesh(new t.TorusGeometry(.75,.1,2,24),o)]]},ut={X:[[new t.Mesh(S,a),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(m,a),[0,0,0],[0,0,-Math.PI/2]],[new t.Mesh(S,a),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(S,i),[0,.5,0]],[new t.Mesh(m,i)],[new t.Mesh(S,i),[0,-.5,0],[0,0,Math.PI]]],Z:[[new t.Mesh(S,d),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(m,d),[0,0,0],[Math.PI/2,0,0]],[new t.Mesh(S,d),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),T),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),f),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),E),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.1,.1,.1),z.clone())]]},ft={X:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),o),[.3,0,0],[0,0,-Math.PI/2]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),o),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),o),[0,.3,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),o),[0,-.3,0],[0,0,Math.PI]]],Z:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),o),[0,0,.3],[Math.PI/2,0,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),o),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),o),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),o),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),o),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.2),o),[0,0,0]]]},_t={X:[[new t.Line(g,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(g,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(g,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function v(_){const V=new t.Object3D;for(const w in _)for(let G=_[w].length;G--;){const u=_[w][G][0].clone(),L=_[w][G][1],R=_[w][G][2],k=_[w][G][3],yt=_[w][G][4];u.name=w,u.tag=yt,L&&u.position.set(L[0],L[1],L[2]),R&&u.rotation.set(R[0],R[1],R[2]),k&&u.scale.set(k[0],k[1],k[2]),u.updateMatrix();const J=u.geometry.clone();J.applyMatrix4(u.matrix),u.geometry=J,u.renderOrder=1/0,u.position.set(0,0,0),u.rotation.set(0,0,0),u.scale.set(1,1,1),V.add(u)}return V}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=v(x)),this.add(this.gizmo.rotate=v(dt)),this.add(this.gizmo.scale=v(ut)),this.add(this.picker.translate=v(ht)),this.add(this.picker.rotate=v(mt)),this.add(this.picker.scale=v(ft)),this.add(this.helper.translate=v(ct)),this.add(this.helper.rotate=v(pt)),this.add(this.helper.scale=v(_t)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(n){const o=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:F;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let s=[];s=s.concat(this.picker[this.mode].children),s=s.concat(this.gizmo[this.mode].children),s=s.concat(this.helper[this.mode].children);for(let a=0;a<s.length;a++){const i=s[a];i.visible=!0,i.rotation.set(0,0,0),i.position.copy(this.worldPosition);let d;if(this.camera.isOrthographicCamera?d=(this.camera.top-this.camera.bottom)/this.camera.zoom:d=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),i.scale.set(1,1,1).multiplyScalar(d*this.size/4),i.tag==="helper"){i.visible=!1,i.name==="AXIS"?(i.visible=!!this.axis,this.axis==="X"&&(c.setFromEuler(q.set(0,0,0)),i.quaternion.copy(o).multiply(c),Math.abs(l.copy(O).applyQuaternion(o).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Y"&&(c.setFromEuler(q.set(0,0,Math.PI/2)),i.quaternion.copy(o).multiply(c),Math.abs(l.copy(I).applyQuaternion(o).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Z"&&(c.setFromEuler(q.set(0,Math.PI/2,0)),i.quaternion.copy(o).multiply(c),Math.abs(l.copy(Z).applyQuaternion(o).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="XYZE"&&(c.setFromEuler(q.set(0,Math.PI/2,0)),l.copy(this.rotationAxis),i.quaternion.setFromRotationMatrix(st.lookAt(ot,l,I)),i.quaternion.multiply(c),i.visible=this.dragging),this.axis==="E"&&(i.visible=!1)):i.name==="START"?(i.position.copy(this.worldPositionStart),i.visible=this.dragging):i.name==="END"?(i.position.copy(this.worldPosition),i.visible=this.dragging):i.name==="DELTA"?(i.position.copy(this.worldPositionStart),i.quaternion.copy(this.worldQuaternionStart),p.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),p.applyQuaternion(this.worldQuaternionStart.clone().invert()),i.scale.copy(p),i.visible=this.dragging):(i.quaternion.copy(o),this.dragging?i.position.copy(this.worldPositionStart):i.position.copy(this.worldPosition),this.axis&&(i.visible=this.axis.search(i.name)!==-1));continue}i.quaternion.copy(o),this.mode==="translate"||this.mode==="scale"?(i.name==="X"&&Math.abs(l.copy(O).applyQuaternion(o).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Y"&&Math.abs(l.copy(I).applyQuaternion(o).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Z"&&Math.abs(l.copy(Z).applyQuaternion(o).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XY"&&Math.abs(l.copy(Z).applyQuaternion(o).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="YZ"&&Math.abs(l.copy(O).applyQuaternion(o).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XZ"&&Math.abs(l.copy(I).applyQuaternion(o).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1)):this.mode==="rotate"&&(B.copy(o),l.copy(this.eye).applyQuaternion(c.copy(o).invert()),i.name.search("E")!==-1&&i.quaternion.setFromRotationMatrix(st.lookAt(this.eye,ot,I)),i.name==="X"&&(c.setFromAxisAngle(O,Math.atan2(-l.y,l.z)),c.multiplyQuaternions(B,c),i.quaternion.copy(c)),i.name==="Y"&&(c.setFromAxisAngle(I,Math.atan2(l.x,l.z)),c.multiplyQuaternions(B,c),i.quaternion.copy(c)),i.name==="Z"&&(c.setFromAxisAngle(Z,Math.atan2(l.y,l.x)),c.multiplyQuaternions(B,c),i.quaternion.copy(c))),i.visible=i.visible&&(i.name.indexOf("X")===-1||this.showX),i.visible=i.visible&&(i.name.indexOf("Y")===-1||this.showY),i.visible=i.visible&&(i.name.indexOf("Z")===-1||this.showZ),i.visible=i.visible&&(i.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),i.material._color=i.material._color||i.material.color.clone(),i.material._opacity=i.material._opacity||i.material.opacity,i.material.color.copy(i.material._color),i.material.opacity=i.material._opacity,this.enabled&&this.axis&&(i.name===this.axis||this.axis.split("").some(function(f){return i.name===f}))&&(i.material.color.setHex(16776960),i.material.opacity=1)}super.updateMatrixWorld(n)}}class Dt extends t.Mesh{constructor(){super(new t.PlaneGeometry(1e5,1e5,2,2),new t.MeshBasicMaterial({visible:!1,wireframe:!0,side:t.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(n){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),W.copy(O).applyQuaternion(e==="local"?this.worldQuaternion:F),X.copy(I).applyQuaternion(e==="local"?this.worldQuaternion:F),Y.copy(Z).applyQuaternion(e==="local"?this.worldQuaternion:F),l.copy(X),this.mode){case"translate":case"scale":switch(this.axis){case"X":l.copy(this.eye).cross(W),b.copy(W).cross(l);break;case"Y":l.copy(this.eye).cross(X),b.copy(X).cross(l);break;case"Z":l.copy(this.eye).cross(Y),b.copy(Y).cross(l);break;case"XY":b.copy(Y);break;case"YZ":b.copy(W);break;case"XZ":l.copy(Y),b.copy(X);break;case"XYZ":case"E":b.set(0,0,0);break}break;case"rotate":default:b.set(0,0,0)}b.length()===0?this.quaternion.copy(this.cameraQuaternion):(rt.lookAt(p.set(0,0,0),b,l),this.quaternion.setFromRotationMatrix(rt)),super.updateMatrixWorld(n)}}class at{constructor(n,e){h(this,"POINTER_DRAG_THRESHOLD",.001);h(this,"name");h(this,"_canvas");h(this,"_scene");h(this,"_controller");h(this,"_pointer");h(this,"_pointerPrimaryDown");h(this,"_pointerMiddleDown");h(this,"_pointerSecondaryDown");h(this,"_lastPointerDown");h(this,"_lastPointerUp");h(this,"_raycaster");h(this,"_intersects");h(this,"_hovered");h(this,"_dragging");h(this,"_dragStart");h(this,"_dragCurrent");h(this,"_dragEnd");h(this,"_dragDelta");h(this,"_draggable");h(this,"_dragRaycastOnObjects");this.name="BaseTool",this._canvas=e.domElement,this._scene=n,this._controller=e,this._pointer=new t.Vector2,this._pointerPrimaryDown=!1,this._pointerMiddleDown=!1,this._pointerSecondaryDown=!1,this._lastPointerDown=new t.Vector2,this._lastPointerUp=new t.Vector2,this._raycaster=new t.Raycaster,this._raycaster.layers.mask=$.PRODUCT_LAYER_MASK|$.UI_LAYER_MASK,this._intersects=[],this._hovered=null,this._dragging=!1,this._dragStart=new t.Vector3,this._dragCurrent=new t.Vector3,this._dragEnd=new t.Vector3,this._dragDelta=new t.Vector3,this._draggable=null,this._dragRaycastOnObjects=null}get _pointerAnyDown(){return this._pointerPrimaryDown||this._pointerMiddleDown||this._pointerSecondaryDown}activate(){}deactivate(){}onPointerDown(n){var e;switch(n.button){case 0:{this._pointerPrimaryDown=!0;break}case 1:{this._pointerMiddleDown=!0;break}case 2:{this._pointerSecondaryDown=!0;break}default:console.warn("DIVEBaseTool.onPointerDown: Unknown button: "+n.button)}this._lastPointerDown.copy(this._pointer),this._draggable=j.findInterface((e=this._intersects[0])==null?void 0:e.object,"isDraggable")||null}onDragStart(n){this._draggable&&(this._dragRaycastOnObjects!==null&&(this._intersects=this._raycaster.intersectObjects(this._dragRaycastOnObjects,!0)),this._intersects.length!==0&&(this._dragStart.copy(this._intersects[0].point.clone()),this._dragCurrent.copy(this._intersects[0].point.clone()),this._dragEnd.copy(this._dragStart.clone()),this._dragDelta.set(0,0,0),this._draggable&&this._draggable.onDragStart&&(this._draggable.onDragStart({dragStart:this._dragStart,dragCurrent:this._dragCurrent,dragEnd:this._dragEnd,dragDelta:this._dragDelta}),this._dragging=!0,this._controller.enabled=!1)))}onPointerMove(n){var o;this._pointer.x=n.offsetX/this._canvas.clientWidth*2-1,this._pointer.y=-(n.offsetY/this._canvas.clientHeight)*2+1,this._raycaster.setFromCamera(this._pointer,this._controller.object),this._intersects=this.raycast(this._scene.children);const e=j.findInterface((o=this._intersects[0])==null?void 0:o.object,"isHoverable");if(this._intersects[0]&&e){if(!this._hovered){e.onPointerEnter&&e.onPointerEnter(this._intersects[0]),this._hovered=e;return}if(this._hovered.uuid!==e.uuid){this._hovered.onPointerLeave&&this._hovered.onPointerLeave(),e.onPointerEnter&&e.onPointerEnter(this._intersects[0]),this._hovered=e;return}e.onPointerOver&&e.onPointerOver(this._intersects[0]),this._hovered=e}else this._hovered&&this._hovered.onPointerLeave&&this._hovered.onPointerLeave(),this._hovered=null;this._pointerAnyDown&&(this._dragging||this.onDragStart(n),this.onDrag(n))}onDrag(n){this._dragRaycastOnObjects!==null&&(this._intersects=this._raycaster.intersectObjects(this._dragRaycastOnObjects,!0));const e=this._intersects[0];e&&(this._dragCurrent.copy(e.point.clone()),this._dragEnd.copy(e.point.clone()),this._dragDelta.subVectors(this._dragCurrent.clone(),this._dragStart.clone()),this._draggable&&this._draggable.onDrag&&this._draggable.onDrag({dragStart:this._dragStart,dragCurrent:this._dragCurrent,dragEnd:this._dragEnd,dragDelta:this._dragDelta}))}onPointerUp(n){switch(this.pointerWasDragged()||this._dragging?this._draggable&&this.onDragEnd(n):this.onClick(n),n.button){case 0:this._pointerPrimaryDown=!1;break;case 1:this._pointerMiddleDown=!1;break;case 2:this._pointerSecondaryDown=!1;break}this._lastPointerUp.copy(this._pointer)}onClick(n){}onDragEnd(n){const e=this._intersects[0];e&&(this._dragEnd.copy(e.point.clone()),this._dragCurrent.copy(e.point.clone()),this._dragDelta.subVectors(this._dragCurrent.clone(),this._dragStart.clone())),this._draggable&&this._draggable.onDragEnd&&this._draggable.onDragEnd({dragStart:this._dragStart,dragCurrent:this._dragCurrent,dragEnd:this._dragEnd,dragDelta:this._dragDelta}),this._draggable=null,this._dragging=!1,this._dragStart.set(0,0,0),this._dragCurrent.set(0,0,0),this._dragEnd.set(0,0,0),this._dragDelta.set(0,0,0),this._controller.enabled=!0}onWheel(n){}raycast(n){return n!==void 0?this._raycaster.intersectObjects(n,!0).filter(e=>e.object.visible):this._raycaster.intersectObjects(this._scene.children,!0).filter(e=>e.object.visible)}pointerWasDragged(){return this._lastPointerDown.distanceTo(this._pointer)>this.POINTER_DRAG_THRESHOLD}}const It=r=>r.isTransformTool!==void 0;class lt extends at{constructor(e,o){super(e,o);h(this,"isTransformTool",!0);h(this,"_scaleLinked");h(this,"_gizmo");this.name="DIVETransformTool",this._scaleLinked=!1,this._gizmo=this.initGizmo(),this._scene.add(this._gizmo)}activate(){}setGizmoMode(e){this._gizmo.mode=e}setGizmoVisibility(e){const o=this._scene.children.includes(this._gizmo);e&&!o?(this._scene.add(this._gizmo),"isTransformControls"in this._gizmo&&this._gizmo.getRaycaster().layers.enableAll()):!e&&o&&(this._scene.remove(this._gizmo),"isTransformControls"in this._gizmo&&this._gizmo.getRaycaster().layers.disableAll())}setGizmoScaleLinked(e){this._scaleLinked=e}initGizmo(){const e=new bt(this._controller.object,this._controller.domElement);return e.mode="translate",e.traverse(o=>{if(!("isMesh"in o))return;const s=o.material;o.name==="X"&&s.color.set(Q.AxesColorRed),o.name==="Y"&&s.color.set(Q.AxesColorGreen),o.name==="Z"&&s.color.set(Q.AxesColorBlue),o.name==="XY"&&s.color.set(Q.AxesColorBlue),o.name==="YZ"&&s.color.set(Q.AxesColorRed),o.name==="XZ"&&s.color.set(Q.AxesColorGreen)}),e.addEventListener("mouseDown",()=>{this._controller.enabled=!1,j.implementsInterface(e.object,"isMovable")&&e.object.onMoveStart&&e.object.onMoveStart()}),e.addEventListener("objectChange",()=>{if(j.implementsInterface(e.object,"isMovable")&&e.object.onMove&&(e.object.onMove(),this._scaleLinked)){const o=e.object.scale,s=(o.x+o.y+o.z)/3;e.object.scale.set(s,s,s)}}),e.addEventListener("mouseUp",()=>{this._controller.enabled=!0,j.implementsInterface(e.object,"isMovable")&&e.object.onMoveEnd&&e.object.onMoveEnd()}),e}}const Tt=r=>r.isSelectTool!==void 0;class At extends lt{constructor(e,o){super(e,o);h(this,"isSelectTool",!0);this.name="SelectTool"}activate(){}select(e){this.attachGizmo(e),e.onSelect&&e.onSelect()}deselect(e){this.detachGizmo(),e.onDeselect&&e.onDeselect()}attachGizmo(e){if("isMovable"in e){const o=e;this._gizmo.attach(o),this.setGizmoVisibility(o.visible)}}detachGizmo(){this._gizmo.detach()}onClick(e){super.onClick(e);const o=this._raycaster.intersectObjects(this._scene.root.children,!0).filter(a=>a.object.visible)[0],s=j.findInterface(o==null?void 0:o.object,"isSelectable");if(!o||!s){this._gizmo.object&&this.deselect(this._gizmo.object);return}if(this._gizmo.object){if(this._gizmo.object.uuid===s.uuid)return;this.deselect(this._gizmo.object)}this.select(s)}}exports.DIVEBaseTool=at;exports.DIVESelectTool=At;exports.DIVETransformTool=lt;exports.isSelectTool=Tt;exports.isTransformTool=It;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
var jt = Object.defineProperty;
|
|
2
2
|
var Xt = (r, i, t) => i in r ? jt(r, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[i] = t;
|
|
3
3
|
var c = (r, i, t) => Xt(r, typeof i != "symbol" ? i + "" : i, t);
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { f as ot,
|
|
7
|
-
|
|
4
|
+
import { A as lt, a as ht, b as ct } from "./FileTypes-DMybIHHj.mjs";
|
|
5
|
+
import { Object3D as st, Vector3 as a, Quaternion as E, Raycaster as bt, MeshBasicMaterial as St, LineBasicMaterial as Yt, CylinderGeometry as w, BoxGeometry as f, BufferGeometry as dt, Float32BufferAttribute as pt, Mesh as o, OctahedronGeometry as B, Line as I, TorusGeometry as C, SphereGeometry as Qt, Euler as Zt, Matrix4 as vt, PlaneGeometry as Ht, DoubleSide as Ot, Vector2 as tt } from "three";
|
|
6
|
+
import { f as ot, i as et } from "./findInterface-DbJ5qzbc.mjs";
|
|
7
|
+
import { P as Ct, U as kt } from "./PerspectiveCamera-DUiWJJIj.mjs";
|
|
8
|
+
const j = new bt(), u = new a(), T = new a(), d = new E(), ut = {
|
|
8
9
|
X: new a(1, 0, 0),
|
|
9
10
|
Y: new a(0, 1, 0),
|
|
10
11
|
Z: new a(0, 0, 1)
|
|
@@ -23,8 +24,8 @@ class Lt extends st {
|
|
|
23
24
|
get: function() {
|
|
24
25
|
return Q !== void 0 ? Q : b;
|
|
25
26
|
},
|
|
26
|
-
set: function(
|
|
27
|
-
Q !==
|
|
27
|
+
set: function(A) {
|
|
28
|
+
Q !== A && (Q = A, s[m] = A, n[m] = A, l.dispatchEvent({ type: m + "-changed", value: A }), l.dispatchEvent(it));
|
|
28
29
|
}
|
|
29
30
|
}), l[m] = b, s[m] = b, n[m] = b;
|
|
30
31
|
}
|
|
@@ -61,10 +62,10 @@ class Lt extends st {
|
|
|
61
62
|
else if (n === "scale") {
|
|
62
63
|
if (t.search("XYZ") !== -1) {
|
|
63
64
|
let p = this.pointEnd.length() / this.pointStart.length();
|
|
64
|
-
this.pointEnd.dot(this.pointStart) < 0 && (p *= -1),
|
|
65
|
+
this.pointEnd.dot(this.pointStart) < 0 && (p *= -1), T.set(p, p, p);
|
|
65
66
|
} else
|
|
66
|
-
u.copy(this.pointStart),
|
|
67
|
-
s.scale.copy(this._scaleStart).multiply(
|
|
67
|
+
u.copy(this.pointStart), T.copy(this.pointEnd), u.applyQuaternion(this._worldQuaternionInv), T.applyQuaternion(this._worldQuaternionInv), T.divide(u), t.search("X") === -1 && (T.x = 1), t.search("Y") === -1 && (T.y = 1), t.search("Z") === -1 && (T.z = 1);
|
|
68
|
+
s.scale.copy(this._scaleStart).multiply(T), this.scaleSnap && (t.search("X") !== -1 && (s.scale.x = Math.round(s.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (s.scale.y = Math.round(s.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (s.scale.z = Math.round(s.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
|
|
68
69
|
} else if (n === "rotate") {
|
|
69
70
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
|
70
71
|
const p = 20 / this.worldPosition.distanceTo(u.setFromMatrixPosition(this.camera.matrixWorld));
|
|
@@ -202,8 +203,8 @@ class Ut extends st {
|
|
|
202
203
|
M.translate(0, 0.05, 0);
|
|
203
204
|
const x = new f(0.08, 0.08, 0.08);
|
|
204
205
|
x.translate(0, 0.04, 0);
|
|
205
|
-
const v = new
|
|
206
|
-
v.setAttribute("position", new
|
|
206
|
+
const v = new dt();
|
|
207
|
+
v.setAttribute("position", new pt([0, 0, 0, 1, 0, 0], 3));
|
|
207
208
|
const m = new w(75e-4, 75e-4, 0.5, 3);
|
|
208
209
|
m.translate(0, 0.25, 0);
|
|
209
210
|
function b(y, W) {
|
|
@@ -211,10 +212,10 @@ class Ut extends st {
|
|
|
211
212
|
return S.rotateY(Math.PI / 2), S.rotateX(Math.PI / 2), S;
|
|
212
213
|
}
|
|
213
214
|
function Q() {
|
|
214
|
-
const y = new
|
|
215
|
-
return y.setAttribute("position", new
|
|
215
|
+
const y = new dt();
|
|
216
|
+
return y.setAttribute("position", new pt([0, 0, 0, 1, 1, 1], 3)), y;
|
|
216
217
|
}
|
|
217
|
-
const
|
|
218
|
+
const A = {
|
|
218
219
|
X: [
|
|
219
220
|
[new o(M, l), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
220
221
|
[new o(M, l), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
@@ -350,7 +351,7 @@ class Ut extends st {
|
|
|
350
351
|
XYZ: [
|
|
351
352
|
[new o(new f(0.1, 0.1, 0.1), H.clone())]
|
|
352
353
|
]
|
|
353
|
-
},
|
|
354
|
+
}, Tt = {
|
|
354
355
|
X: [
|
|
355
356
|
[new o(new w(0.2, 0, 0.6, 4), n), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
|
356
357
|
[new o(new w(0.2, 0, 0.6, 4), n), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
|
@@ -390,14 +391,14 @@ class Ut extends st {
|
|
|
390
391
|
const W = new st();
|
|
391
392
|
for (const S in y)
|
|
392
393
|
for (let Z = y[S].length; Z--; ) {
|
|
393
|
-
const _ = y[S][Z][0].clone(), F = y[S][Z][1], U = y[S][Z][2], V = y[S][Z][3],
|
|
394
|
-
_.name = S, _.tag =
|
|
394
|
+
const _ = y[S][Z][0].clone(), F = y[S][Z][1], U = y[S][Z][2], V = y[S][Z][3], At = y[S][Z][4];
|
|
395
|
+
_.name = S, _.tag = At, F && _.position.set(F[0], F[1], F[2]), U && _.rotation.set(U[0], U[1], U[2]), V && _.scale.set(V[0], V[1], V[2]), _.updateMatrix();
|
|
395
396
|
const rt = _.geometry.clone();
|
|
396
397
|
rt.applyMatrix4(_.matrix), _.geometry = rt, _.renderOrder = 1 / 0, _.position.set(0, 0, 0), _.rotation.set(0, 0, 0), _.scale.set(1, 1, 1), W.add(_);
|
|
397
398
|
}
|
|
398
399
|
return W;
|
|
399
400
|
}
|
|
400
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = D(
|
|
401
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = D(A)), this.add(this.gizmo.rotate = D(Mt)), this.add(this.gizmo.scale = D(It)), this.add(this.picker.translate = D(Pt)), this.add(this.picker.rotate = D(Dt)), this.add(this.picker.scale = D(Tt)), this.add(this.helper.translate = D(Et)), this.add(this.helper.rotate = D(xt)), this.add(this.helper.scale = D(zt)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
401
402
|
}
|
|
402
403
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
403
404
|
updateMatrixWorld(i) {
|
|
@@ -496,9 +497,9 @@ class Bt {
|
|
|
496
497
|
get _pointerAnyDown() {
|
|
497
498
|
return this._pointerPrimaryDown || this._pointerMiddleDown || this._pointerSecondaryDown;
|
|
498
499
|
}
|
|
499
|
-
|
|
500
|
+
activate() {
|
|
500
501
|
}
|
|
501
|
-
|
|
502
|
+
deactivate() {
|
|
502
503
|
}
|
|
503
504
|
onPointerDown(i) {
|
|
504
505
|
var t;
|
|
@@ -610,6 +611,7 @@ class Bt {
|
|
|
610
611
|
return this._lastPointerDown.distanceTo(this._pointer) > this.POINTER_DRAG_THRESHOLD;
|
|
611
612
|
}
|
|
612
613
|
}
|
|
614
|
+
const ie = (r) => r.isTransformTool !== void 0;
|
|
613
615
|
class Nt extends Bt {
|
|
614
616
|
constructor(t, n) {
|
|
615
617
|
super(t, n);
|
|
@@ -618,16 +620,16 @@ class Nt extends Bt {
|
|
|
618
620
|
c(this, "_gizmo");
|
|
619
621
|
this.name = "DIVETransformTool", this._scaleLinked = !1, this._gizmo = this.initGizmo(), this._scene.add(this._gizmo);
|
|
620
622
|
}
|
|
621
|
-
|
|
623
|
+
activate() {
|
|
622
624
|
}
|
|
623
|
-
|
|
625
|
+
setGizmoMode(t) {
|
|
624
626
|
this._gizmo.mode = t;
|
|
625
627
|
}
|
|
626
|
-
|
|
628
|
+
setGizmoVisibility(t) {
|
|
627
629
|
const n = this._scene.children.includes(this._gizmo);
|
|
628
630
|
t && !n ? (this._scene.add(this._gizmo), "isTransformControls" in this._gizmo && this._gizmo.getRaycaster().layers.enableAll()) : !t && n && (this._scene.remove(this._gizmo), "isTransformControls" in this._gizmo && this._gizmo.getRaycaster().layers.disableAll());
|
|
629
631
|
}
|
|
630
|
-
|
|
632
|
+
setGizmoScaleLinked(t) {
|
|
631
633
|
this._scaleLinked = t;
|
|
632
634
|
}
|
|
633
635
|
// only used for optimizing pointer events with DIVEGizmo
|
|
@@ -652,7 +654,7 @@ class Nt extends Bt {
|
|
|
652
654
|
return t.mode = "translate", t.traverse((n) => {
|
|
653
655
|
if (!("isMesh" in n)) return;
|
|
654
656
|
const s = n.material;
|
|
655
|
-
n.name === "X" && s.color.set(
|
|
657
|
+
n.name === "X" && s.color.set(lt), n.name === "Y" && s.color.set(ht), n.name === "Z" && s.color.set(ct), n.name === "XY" && s.color.set(ct), n.name === "YZ" && s.color.set(lt), n.name === "XZ" && s.color.set(ht);
|
|
656
658
|
}), t.addEventListener("mouseDown", () => {
|
|
657
659
|
this._controller.enabled = !1, et(t.object, "isMovable") && t.object.onMoveStart && t.object.onMoveStart();
|
|
658
660
|
}), t.addEventListener("objectChange", () => {
|
|
@@ -665,28 +667,28 @@ class Nt extends Bt {
|
|
|
665
667
|
}), t;
|
|
666
668
|
}
|
|
667
669
|
}
|
|
668
|
-
const
|
|
669
|
-
class
|
|
670
|
+
const ne = (r) => r.isSelectTool !== void 0;
|
|
671
|
+
class se extends Nt {
|
|
670
672
|
constructor(t, n) {
|
|
671
673
|
super(t, n);
|
|
672
674
|
c(this, "isSelectTool", !0);
|
|
673
675
|
this.name = "SelectTool";
|
|
674
676
|
}
|
|
675
|
-
|
|
677
|
+
activate() {
|
|
676
678
|
}
|
|
677
|
-
|
|
678
|
-
this.
|
|
679
|
+
select(t) {
|
|
680
|
+
this.attachGizmo(t), t.onSelect && t.onSelect();
|
|
679
681
|
}
|
|
680
|
-
|
|
681
|
-
this.
|
|
682
|
+
deselect(t) {
|
|
683
|
+
this.detachGizmo(), t.onDeselect && t.onDeselect();
|
|
682
684
|
}
|
|
683
|
-
|
|
685
|
+
attachGizmo(t) {
|
|
684
686
|
if ("isMovable" in t) {
|
|
685
687
|
const n = t;
|
|
686
|
-
this._gizmo.attach(n), this.
|
|
688
|
+
this._gizmo.attach(n), this.setGizmoVisibility(n.visible);
|
|
687
689
|
}
|
|
688
690
|
}
|
|
689
|
-
|
|
691
|
+
detachGizmo() {
|
|
690
692
|
this._gizmo.detach();
|
|
691
693
|
}
|
|
692
694
|
onClick(t) {
|
|
@@ -696,17 +698,20 @@ class ie extends Nt {
|
|
|
696
698
|
"isSelectable"
|
|
697
699
|
);
|
|
698
700
|
if (!n || !s) {
|
|
699
|
-
this._gizmo.object && this.
|
|
701
|
+
this._gizmo.object && this.deselect(this._gizmo.object);
|
|
700
702
|
return;
|
|
701
703
|
}
|
|
702
704
|
if (this._gizmo.object) {
|
|
703
705
|
if (this._gizmo.object.uuid === s.uuid) return;
|
|
704
|
-
this.
|
|
706
|
+
this.deselect(this._gizmo.object);
|
|
705
707
|
}
|
|
706
|
-
this.
|
|
708
|
+
this.select(s);
|
|
707
709
|
}
|
|
708
710
|
}
|
|
709
711
|
export {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
+
se as D,
|
|
713
|
+
Bt as a,
|
|
714
|
+
ie as b,
|
|
715
|
+
Nt as c,
|
|
716
|
+
ne as i
|
|
712
717
|
};
|