@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.
- package/build/chunks/AssetCache-CsfCIl9J.mjs +79 -0
- package/build/chunks/AssetCache-DGLqbo2B.cjs +1 -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-DvF8gL8a.mjs +2341 -0
- package/build/chunks/AssetLoader-H_GSIMop.cjs +4 -0
- package/build/chunks/FileTypes-CHutqD19.cjs +30 -0
- package/build/chunks/FileTypes-IBuu9ohV.mjs +1057 -0
- package/build/chunks/MathUtils-CBW56ZuG.cjs +1 -0
- package/build/chunks/MathUtils-CFGjHuVF.mjs +159 -0
- package/build/chunks/OrbitController-BQ6SV1O_.mjs +1159 -0
- package/build/chunks/OrbitController-CpFQ3A1H.cjs +1 -0
- package/build/chunks/{PerspectiveCamera-sm4_81KJ.mjs → PerspectiveCamera-PMJPzAn3.mjs} +2 -2
- package/build/chunks/PovSchema-Co9FznEz.cjs +1 -0
- package/build/chunks/PovSchema-DWWvr_ED.mjs +10 -0
- package/build/chunks/{SelectTool-Bd8cC9nb.mjs → SelectTool-BU0vTDXg.mjs} +44 -39
- package/build/chunks/SelectTool-CAqDMcoM.cjs +1 -0
- 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-CmvmIjT5.cjs +1 -0
- package/build/chunks/package-DSKqbNMb.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 +674 -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/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/orientationdisplay/index.cjs +1 -0
- package/build/plugins/orientationdisplay/index.d.ts +2 -0
- package/build/plugins/orientationdisplay/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 +4266 -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} +29 -23
- package/build/src/components/boundingbox/BoundingBox.d.ts +136 -0
- 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 +5 -4
- 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/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/plugins/orbitcontroller/src/OrbitController.d.ts +45 -0
- package/build/src/plugins/orientationdisplay/index.d.ts +2 -0
- package/build/src/plugins/orientationdisplay/src/OrientationDisplay.d.ts +18 -0
- package/build/src/plugins/orientationdisplay/src/axes/Axes.d.ts +6 -0
- 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/plugins/state/src/actions/toolbox/setgizmovisible.d.ts +8 -0
- 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/SelectTool-BAXTVyWs.cjs +0 -1
- package/build/chunks/SystemInfo-oX-NNneO.cjs +0 -1
- 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/axiscamera/AxisCamera.d.ts +0 -21
- package/build/src/modules/controller/orbit/OrbitController.d.ts +0 -30
- 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/actions/toolbox/setgizmovisible.d.ts +0 -8
- 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 d=Object.defineProperty;var p=(t,e,r)=>e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var o=(t,e,r)=>p(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var i=(t=>(t.IOS="iOS",t.ANDROID="Android",t.WINDOWS="Windows",t.MACOS="MacOS",t.LINUX="Linux",t.UNKNOWN="Unknown",t))(i||{}),n=(t=>(t.NO_WEBXR_API="NO_WEBXR_API",t.NO_HTTPS="NO_HTTPS",t.IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE="IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE",t.AR_PERMISSION_DENIED="AR_PERMISSION_DENIED",t.UNKNOWN_ERROR="UNKNOWN_ERROR",t))(n||{}),c=(t=>(t.CHROMIUM="Chromium",t.SAFARI="Safari",t.WEBKIT="WebKit",t.FIREFOX="Firefox",t.EDGE_LEGACY="EdgeLegacy",t.UNKNOWN="Unknown",t))(c||{});class u{static getSystem(){if(typeof window>"u"||!window.navigator)return i.UNKNOWN;const e=window.navigator.userAgent.toLowerCase();return e.includes("iphone")||e.includes("ipad")?i.IOS:e.includes("android")?i.ANDROID:e.includes("windows")?i.WINDOWS:e.includes("macintosh")?i.MACOS:e.includes("linux")?i.LINUX:i.UNKNOWN}static async getSupportsWebXR(){if(this._supportsWebXR!==!1)return this._supportsWebXR;if(!window.isSecureContext)return this._supportsWebXR=!1,this._webXRUnsupportedReason=n.NO_HTTPS,this._supportsWebXR;if(!navigator.xr)return this._supportsWebXR=!1,this._webXRUnsupportedReason=n.NO_WEBXR_API,this._supportsWebXR;try{const e=await navigator.xr.isSessionSupported("immersive-ar");this._supportsWebXR=e,this._supportsWebXR||(this._webXRUnsupportedReason=n.IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE)}catch{this._supportsWebXR=!1,this._webXRUnsupportedReason=n.AR_PERMISSION_DENIED}return this._supportsWebXR}static getWebXRUnsupportedReason(){return this._supportsWebXR?(console.log("WebXR is supported."),null):this._webXRUnsupportedReason}static getSupportsARQuickLook(){return!!document.createElement("a").relList.supports("ar")}static getSupportsSceneViewer(){if(typeof window>"u"||!window.navigator)return!1;const e=window.navigator.userAgent.toLowerCase();if(!e.includes("android")||!e.includes("chrome"))return!1;const r=e.match(/chrome\/(\d+)/);return!(!r||parseInt(r[1])<89)}static get isMobile(){return this.getSystem()===i.ANDROID||this.getSystem()===i.IOS}static get isDesktop(){return!this.isMobile}static getSupportsAR(){return this.getSupportsARQuickLook()||this.getSupportsSceneViewer()}static getBrowser(){var s;if(typeof window>"u"||!window.navigator)return"Unknown";const e=window.navigator.userAgent.toLowerCase(),r=(s=window.navigator.vendor)==null?void 0:s.toLowerCase();return e.includes("fxios/")?"Firefox":e.includes("crios/")?"Chromium":e.includes("firefox/")?"Firefox":e.includes("safari/")&&e.includes("version/")&&!e.includes("chrome/")&&!e.includes("edg/")&&!e.includes("opr/")?"Safari":e.includes("edg/")?"Chromium":e.includes("edge/")?"EdgeLegacy":e.includes("chrome/")||r!=null&&r.includes("google inc.")?"Chromium":e.includes("applewebkit")?"WebKit":"Unknown"}static getIOSVersion(){if(this.getSystem()!==i.IOS||typeof window>"u"||!window.navigator)return null;const r=window.navigator.userAgent.match(/(?:iPhone OS|iPad OS|OS) (\d+[._\d]*)/i);if(r&&r[1]){const s=r[1].replace(/_/g,"."),a=parseInt(s.split(".")[0],10);if(!isNaN(a))return{major:a,full:s}}return null}}o(u,"_supportsWebXR",!1),o(u,"_webXRUnsupportedReason",null);exports.EBrowser=c;exports.ESystem=i;exports.EWebXRUnsupportedReason=n;exports.SystemInfo=u;
|
|
@@ -1,41 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
class
|
|
6
|
-
constructor(s, o, u, p) {
|
|
7
|
-
var S;
|
|
8
|
-
const n = o.match(
|
|
9
|
-
/(Chrome|Safari|Firefox|Edge)\/(\d+\.\d+)/
|
|
10
|
-
), c = n ? n[1] : "Unknown", l = n ? n[2] : "Unknown", f = o.match(/\((.*?)\)/), h = f ? f[1] : "Unknown", d = ((S = h.match(/OS (\d+_\d+)/)) == null ? void 0 : S[1]) || "Unknown", w = X(h);
|
|
11
|
-
let R = s;
|
|
12
|
-
(w === "iOS" || w === "iPadOS") && (c !== "Safari" ? R += ` ARQuickLook is only supported in Safari browser. Current browser: ${c} ${l}` : parseFloat(d.replace("_", ".")) < 13 && (R += ` ARQuickLook requires iOS/iPadOS 13.0 or later. Current version: ${d}`));
|
|
13
|
-
super(R);
|
|
14
|
-
i(this, "browserInfo");
|
|
15
|
-
this.name = "ARCompatibilityError", this.browserInfo = {
|
|
16
|
-
userAgent: o,
|
|
17
|
-
platform: u,
|
|
18
|
-
vendor: p,
|
|
19
|
-
browser: c,
|
|
20
|
-
version: l,
|
|
21
|
-
os: w,
|
|
22
|
-
osVersion: d
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function X(t) {
|
|
27
|
-
return t.includes("iPhone") ? "iOS" : t.includes("iPad") ? "iPadOS" : t.includes("Macintosh") ? "macOS" : "Unknown";
|
|
28
|
-
}
|
|
29
|
-
class b {
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var d = (t, e, r) => e in t ? c(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var o = (t, e, r) => d(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
var i = /* @__PURE__ */ ((t) => (t.IOS = "iOS", t.ANDROID = "Android", t.WINDOWS = "Windows", t.MACOS = "MacOS", t.LINUX = "Linux", t.UNKNOWN = "Unknown", t))(i || {}), s = /* @__PURE__ */ ((t) => (t.NO_WEBXR_API = "NO_WEBXR_API", t.NO_HTTPS = "NO_HTTPS", t.IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE = "IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE", t.AR_PERMISSION_DENIED = "AR_PERMISSION_DENIED", t.UNKNOWN_ERROR = "UNKNOWN_ERROR", t))(s || {}), p = /* @__PURE__ */ ((t) => (t.CHROMIUM = "Chromium", t.SAFARI = "Safari", t.WEBKIT = "WebKit", t.FIREFOX = "Firefox", t.EDGE_LEGACY = "EdgeLegacy", t.UNKNOWN = "Unknown", t))(p || {});
|
|
5
|
+
class a {
|
|
30
6
|
/**
|
|
31
7
|
* Gets the current system (iOS, Android, Windows, etc.)
|
|
32
8
|
* @returns DIVESystem The current system
|
|
33
9
|
*/
|
|
34
10
|
static getSystem() {
|
|
35
11
|
if (typeof window > "u" || !window.navigator)
|
|
36
|
-
return
|
|
12
|
+
return i.UNKNOWN;
|
|
37
13
|
const e = window.navigator.userAgent.toLowerCase();
|
|
38
|
-
return e.includes("iphone") || e.includes("ipad") ?
|
|
14
|
+
return e.includes("iphone") || e.includes("ipad") ? i.IOS : e.includes("android") ? i.ANDROID : e.includes("windows") ? i.WINDOWS : e.includes("macintosh") ? i.MACOS : e.includes("linux") ? i.LINUX : i.UNKNOWN;
|
|
39
15
|
}
|
|
40
16
|
/**
|
|
41
17
|
* @returns A promise that resolves to a boolean indicating whether the user's device supports WebXR.
|
|
@@ -44,14 +20,14 @@ class b {
|
|
|
44
20
|
if (this._supportsWebXR !== !1)
|
|
45
21
|
return this._supportsWebXR;
|
|
46
22
|
if (!window.isSecureContext)
|
|
47
|
-
return this._supportsWebXR = !1, this._webXRUnsupportedReason =
|
|
23
|
+
return this._supportsWebXR = !1, this._webXRUnsupportedReason = s.NO_HTTPS, this._supportsWebXR;
|
|
48
24
|
if (!navigator.xr)
|
|
49
|
-
return this._supportsWebXR = !1, this._webXRUnsupportedReason =
|
|
25
|
+
return this._supportsWebXR = !1, this._webXRUnsupportedReason = s.NO_WEBXR_API, this._supportsWebXR;
|
|
50
26
|
try {
|
|
51
27
|
const e = await navigator.xr.isSessionSupported("immersive-ar");
|
|
52
|
-
this._supportsWebXR = e, this._supportsWebXR || (this._webXRUnsupportedReason =
|
|
28
|
+
this._supportsWebXR = e, this._supportsWebXR || (this._webXRUnsupportedReason = s.IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE);
|
|
53
29
|
} catch {
|
|
54
|
-
this._supportsWebXR = !1, this._webXRUnsupportedReason =
|
|
30
|
+
this._supportsWebXR = !1, this._webXRUnsupportedReason = s.AR_PERMISSION_DENIED;
|
|
55
31
|
}
|
|
56
32
|
return this._supportsWebXR;
|
|
57
33
|
}
|
|
@@ -67,7 +43,7 @@ class b {
|
|
|
67
43
|
* 1. AR support via relList
|
|
68
44
|
*
|
|
69
45
|
* Requirements:
|
|
70
|
-
* - iOS
|
|
46
|
+
* - iOS 12.0 or later
|
|
71
47
|
* - Safari browser (ARQuickLook is only supported in Safari)
|
|
72
48
|
* - Device with AR capabilities (iPhone/iPad with LiDAR scanner or ARKit support)
|
|
73
49
|
*
|
|
@@ -78,15 +54,7 @@ class b {
|
|
|
78
54
|
* @throws ARCompatibilityError if ARQuickLook is not supported, with detailed browser information
|
|
79
55
|
*/
|
|
80
56
|
static getSupportsARQuickLook() {
|
|
81
|
-
|
|
82
|
-
return !0;
|
|
83
|
-
const s = window.navigator.userAgent, o = window.navigator.platform, u = window.navigator.vendor, p = "ARQuickLook is not supported";
|
|
84
|
-
throw new m(
|
|
85
|
-
p,
|
|
86
|
-
s,
|
|
87
|
-
o,
|
|
88
|
-
u
|
|
89
|
-
);
|
|
57
|
+
return !!document.createElement("a").relList.supports("ar");
|
|
90
58
|
}
|
|
91
59
|
/**
|
|
92
60
|
* Checks if SceneViewer is supported on the current device
|
|
@@ -110,14 +78,14 @@ class b {
|
|
|
110
78
|
const e = window.navigator.userAgent.toLowerCase();
|
|
111
79
|
if (!e.includes("android") || !e.includes("chrome"))
|
|
112
80
|
return !1;
|
|
113
|
-
const
|
|
114
|
-
return !(!
|
|
81
|
+
const r = e.match(/chrome\/(\d+)/);
|
|
82
|
+
return !(!r || parseInt(r[1]) < 89);
|
|
115
83
|
}
|
|
116
84
|
/**
|
|
117
85
|
* @returns A boolean indicating whether the user's device is a mobile device.
|
|
118
86
|
*/
|
|
119
87
|
static get isMobile() {
|
|
120
|
-
return this.getSystem() ===
|
|
88
|
+
return this.getSystem() === i.ANDROID || this.getSystem() === i.IOS;
|
|
121
89
|
}
|
|
122
90
|
/**
|
|
123
91
|
* @returns A boolean indicating whether the user's device is a desktop device.
|
|
@@ -131,9 +99,38 @@ class b {
|
|
|
131
99
|
static getSupportsAR() {
|
|
132
100
|
return this.getSupportsARQuickLook() || this.getSupportsSceneViewer();
|
|
133
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Gets the current browser engine.
|
|
104
|
+
* @returns EBrowser The current browser engine.
|
|
105
|
+
*/
|
|
106
|
+
static getBrowser() {
|
|
107
|
+
var n;
|
|
108
|
+
if (typeof window > "u" || !window.navigator)
|
|
109
|
+
return "Unknown";
|
|
110
|
+
const e = window.navigator.userAgent.toLowerCase(), r = (n = window.navigator.vendor) == null ? void 0 : n.toLowerCase();
|
|
111
|
+
return e.includes("fxios/") ? "Firefox" : e.includes("crios/") ? "Chromium" : e.includes("firefox/") ? "Firefox" : e.includes("safari/") && e.includes("version/") && !e.includes("chrome/") && // Excludes desktop Chrome, Edge Chromium
|
|
112
|
+
!e.includes("edg/") && !e.includes("opr/") ? "Safari" : e.includes("edg/") ? "Chromium" : e.includes("edge/") ? "EdgeLegacy" : e.includes("chrome/") || r != null && r.includes("google inc.") ? "Chromium" : e.includes("applewebkit") ? "WebKit" : "Unknown";
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Gets the iOS version if the current system is iOS.
|
|
116
|
+
* @returns An object with { major: number, full: string } or null if not iOS or version not parsable.
|
|
117
|
+
*/
|
|
118
|
+
static getIOSVersion() {
|
|
119
|
+
if (this.getSystem() !== i.IOS || typeof window > "u" || !window.navigator)
|
|
120
|
+
return null;
|
|
121
|
+
const r = window.navigator.userAgent.match(/(?:iPhone OS|iPad OS|OS) (\d+[._\d]*)/i);
|
|
122
|
+
if (r && r[1]) {
|
|
123
|
+
const n = r[1].replace(/_/g, "."), u = parseInt(n.split(".")[0], 10);
|
|
124
|
+
if (!isNaN(u))
|
|
125
|
+
return { major: u, full: n };
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
134
129
|
}
|
|
135
|
-
|
|
130
|
+
o(a, "_supportsWebXR", !1), o(a, "_webXRUnsupportedReason", null);
|
|
136
131
|
export {
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
p as EBrowser,
|
|
133
|
+
i as ESystem,
|
|
134
|
+
s as EWebXRUnsupportedReason,
|
|
135
|
+
a as SystemInfo
|
|
139
136
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var r=(t,e,o)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var l=(t,e,o)=>r(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../chunks/SelectTool-CAqDMcoM.cjs");class i{constructor(e,o){l(this,"_scene");l(this,"_controller");l(this,"_activeTool");l(this,"_selectTool");this._scene=e,this._controller=o,this._selectTool=null,this._activeTool=null}get selectTool(){return this._selectTool||(this._selectTool=new n.DIVESelectTool(this._scene,this._controller)),this._selectTool}dispose(){this.removeEventListeners()}getActiveTool(){return this._activeTool}useTool(e){var o;switch((o=this._activeTool)==null||o.deactivate(),e){case"select":{this.addEventListeners(),this.selectTool.activate(),this._activeTool=this.selectTool;break}case"none":{this.removeEventListeners(),this._activeTool=null;break}default:console.warn(`DIVEToolBox.useTool: Unknown tool: ${e}`)}}setGizmoMode(e){this.selectTool.setGizmoMode(e)}setGizmoVisible(e){this.selectTool.setGizmoVisible(e)}setGizmoScaleLinked(e){this.selectTool.setGizmoScaleLinked(e)}onPointerMove(e){var o;(o=this._activeTool)==null||o.onPointerMove(e)}onPointerDown(e){var o;(o=this._activeTool)==null||o.onPointerDown(e)}onPointerUp(e){var o;(o=this._activeTool)==null||o.onPointerUp(e)}onWheel(e){var o;(o=this._activeTool)==null||o.onWheel(e)}addEventListeners(){this._controller.domElement.addEventListener("pointermove",e=>this.onPointerMove(e)),this._controller.domElement.addEventListener("pointerdown",e=>this.onPointerDown(e)),this._controller.domElement.addEventListener("pointerup",e=>this.onPointerUp(e)),this._controller.domElement.addEventListener("wheel",e=>this.onWheel(e))}removeEventListeners(){this._controller.domElement.removeEventListener("pointermove",e=>this.onPointerMove(e)),this._controller.domElement.removeEventListener("pointerdown",e=>this.onPointerDown(e)),this._controller.domElement.removeEventListener("pointerup",e=>this.onPointerUp(e)),this._controller.domElement.removeEventListener("wheel",e=>this.onWheel(e))}}l(i,"DefaultTool","select");exports.DIVEBaseTool=n.DIVEBaseTool;exports.DIVESelectTool=n.DIVESelectTool;exports.DIVETransformTool=n.DIVETransformTool;exports.isSelectTool=n.isSelectTool;exports.isTransformTool=n.isTransformTool;exports.Toolbox=i;
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { D as
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var s = (t, e, o) => e in t ? i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
|
3
|
+
var n = (t, e, o) => s(t, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
+
import { D as l } from "../../chunks/SelectTool-BU0vTDXg.mjs";
|
|
5
|
+
import { a as m, c as T, i as d, b as _ } from "../../chunks/SelectTool-BU0vTDXg.mjs";
|
|
5
6
|
class r {
|
|
6
7
|
constructor(e, o) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
n(this, "_scene");
|
|
9
|
+
n(this, "_controller");
|
|
10
|
+
n(this, "_activeTool");
|
|
11
|
+
n(this, "_selectTool");
|
|
11
12
|
this._scene = e, this._controller = o, this._selectTool = null, this._activeTool = null;
|
|
12
13
|
}
|
|
13
14
|
get selectTool() {
|
|
14
|
-
return this._selectTool || (this._selectTool = new
|
|
15
|
+
return this._selectTool || (this._selectTool = new l(
|
|
15
16
|
this._scene,
|
|
16
17
|
this._controller
|
|
17
18
|
)), this._selectTool;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
dispose() {
|
|
20
21
|
this.removeEventListeners();
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
+
getActiveTool() {
|
|
23
24
|
return this._activeTool;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
useTool(e) {
|
|
26
27
|
var o;
|
|
27
|
-
switch ((o = this._activeTool) == null || o.
|
|
28
|
+
switch ((o = this._activeTool) == null || o.deactivate(), e) {
|
|
28
29
|
case "select": {
|
|
29
|
-
this.addEventListeners(), this.selectTool.
|
|
30
|
+
this.addEventListeners(), this.selectTool.activate(), this._activeTool = this.selectTool;
|
|
30
31
|
break;
|
|
31
32
|
}
|
|
32
33
|
case "none": {
|
|
@@ -34,17 +35,17 @@ class r {
|
|
|
34
35
|
break;
|
|
35
36
|
}
|
|
36
37
|
default:
|
|
37
|
-
console.warn(`DIVEToolBox.
|
|
38
|
+
console.warn(`DIVEToolBox.useTool: Unknown tool: ${e}`);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
-
this.selectTool.
|
|
41
|
+
setGizmoMode(e) {
|
|
42
|
+
this.selectTool.setGizmoMode(e);
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
this.selectTool.
|
|
44
|
+
setGizmoVisible(e) {
|
|
45
|
+
this.selectTool.setGizmoVisible(e);
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
this.selectTool.
|
|
47
|
+
setGizmoScaleLinked(e) {
|
|
48
|
+
this.selectTool.setGizmoScaleLinked(e);
|
|
48
49
|
}
|
|
49
50
|
onPointerMove(e) {
|
|
50
51
|
var o;
|
|
@@ -93,7 +94,12 @@ class r {
|
|
|
93
94
|
);
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
|
-
|
|
97
|
+
n(r, "DefaultTool", "select");
|
|
97
98
|
export {
|
|
98
|
-
|
|
99
|
+
m as DIVEBaseTool,
|
|
100
|
+
l as DIVESelectTool,
|
|
101
|
+
T as DIVETransformTool,
|
|
102
|
+
r as Toolbox,
|
|
103
|
+
d as isSelectTool,
|
|
104
|
+
_ as isTransformTool
|
|
99
105
|
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Box3, Object3D, Sphere, Vector3, ColorRepresentation } from 'three';
|
|
2
|
+
import { DIVENode } from '../node/Node.ts';
|
|
3
|
+
/**
|
|
4
|
+
* A bounding box component that provides both axis-aligned and oriented bounding boxes
|
|
5
|
+
* along with bounding spheres for 3D objects.
|
|
6
|
+
*
|
|
7
|
+
* The BoundingBox class extends DIVENode and creates visual representations of the
|
|
8
|
+
* bounding volumes of 3D objects. It supports two modes:
|
|
9
|
+
* - **Axis-aligned bounding box (AABB)**: Aligned with the world coordinate system
|
|
10
|
+
* - **Oriented bounding box (OBB)**: Aligned with the object's local coordinate system
|
|
11
|
+
*
|
|
12
|
+
* The class also automatically computes a bounding sphere that encompasses the entire object.
|
|
13
|
+
* Both the bounding box and sphere can be visualized as wireframe helpers.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // Create a bounding box for a 3D object
|
|
18
|
+
* const mesh = new Mesh(geometry, material);
|
|
19
|
+
* const boundingBox = new BoundingBox(mesh, false, 0x00ff00);
|
|
20
|
+
*
|
|
21
|
+
* // Show the bounding box wireframe
|
|
22
|
+
* boundingBox.setBoxHelperVisible(true);
|
|
23
|
+
*
|
|
24
|
+
* // Access bounding box properties
|
|
25
|
+
* console.log('Center:', boundingBox.center);
|
|
26
|
+
* console.log('Size:', boundingBox.size);
|
|
27
|
+
* console.log('Radius:', boundingBox.radius);
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // Create an axis-aligned bounding box
|
|
33
|
+
* const aabb = new BoundingBox(mesh, true, 0xff0000);
|
|
34
|
+
*
|
|
35
|
+
* // Show the bounding sphere wireframe
|
|
36
|
+
* aabb.setSphereHelperVisible(true);
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare class BoundingBox extends DIVENode {
|
|
40
|
+
/** The computed bounding box (Box3) */
|
|
41
|
+
private _box;
|
|
42
|
+
/** The computed bounding sphere (Sphere) */
|
|
43
|
+
private _sphere;
|
|
44
|
+
/** The center point of the bounding box */
|
|
45
|
+
private _center;
|
|
46
|
+
/** The radius of the bounding sphere */
|
|
47
|
+
private _radius;
|
|
48
|
+
/** Visual helper for the bounding box wireframe */
|
|
49
|
+
private _boxHelper;
|
|
50
|
+
/** Visual helper for the bounding sphere wireframe */
|
|
51
|
+
private _sphereHelper;
|
|
52
|
+
/** The dimensions (width, height, depth) of the bounding box */
|
|
53
|
+
private _size;
|
|
54
|
+
/**
|
|
55
|
+
* Gets the computed bounding box.
|
|
56
|
+
* @returns The Box3 instance representing the bounding box
|
|
57
|
+
*/
|
|
58
|
+
get box(): Box3;
|
|
59
|
+
/**
|
|
60
|
+
* Gets the computed bounding sphere.
|
|
61
|
+
* @returns The Sphere instance representing the bounding sphere
|
|
62
|
+
*/
|
|
63
|
+
get sphere(): Sphere;
|
|
64
|
+
/**
|
|
65
|
+
* Gets the center point of the bounding box.
|
|
66
|
+
* @returns A Vector3 representing the center coordinates
|
|
67
|
+
*/
|
|
68
|
+
get center(): Vector3;
|
|
69
|
+
/**
|
|
70
|
+
* Gets the radius of the bounding sphere.
|
|
71
|
+
* @returns The radius as a number
|
|
72
|
+
*/
|
|
73
|
+
get radius(): number;
|
|
74
|
+
/**
|
|
75
|
+
* Gets the dimensions of the bounding box.
|
|
76
|
+
* @returns A Vector3 representing width, height, and depth
|
|
77
|
+
*/
|
|
78
|
+
get size(): Vector3;
|
|
79
|
+
/**
|
|
80
|
+
* Creates a new BoundingBox instance for the specified 3D object.
|
|
81
|
+
*
|
|
82
|
+
* The constructor computes both a bounding box and bounding sphere for the given object.
|
|
83
|
+
* It handles complex objects with multiple meshes and nested transformations.
|
|
84
|
+
*
|
|
85
|
+
* @param object - The 3D object to compute bounding volumes for
|
|
86
|
+
* @param axisAligned - Whether to create an axis-aligned bounding box (true) or oriented bounding box (false). Defaults to false.
|
|
87
|
+
* @param wireframeColor - The color for the wireframe helpers. Can be a hex number or ColorRepresentation. Defaults to green (0x00ff00).
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* // Create an oriented bounding box (aligned with object's rotation)
|
|
92
|
+
* const obb = new BoundingBox(mesh, false, 0x00ff00);
|
|
93
|
+
*
|
|
94
|
+
* // Create an axis-aligned bounding box (aligned with world coordinates)
|
|
95
|
+
* const aabb = new BoundingBox(mesh, true, 0xff0000);
|
|
96
|
+
*
|
|
97
|
+
* // Use default green color
|
|
98
|
+
* const defaultBox = new BoundingBox(mesh);
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
constructor(object: Object3D, axisAligned?: boolean, wireframeColor?: ColorRepresentation | number);
|
|
102
|
+
/**
|
|
103
|
+
* Sets the visibility of the bounding box wireframe helper.
|
|
104
|
+
*
|
|
105
|
+
* @param visible - Whether the box helper should be visible
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* const boundingBox = new BoundingBox(mesh);
|
|
110
|
+
*
|
|
111
|
+
* // Show the bounding box wireframe
|
|
112
|
+
* boundingBox.setBoxHelperVisible(true);
|
|
113
|
+
*
|
|
114
|
+
* // Hide the bounding box wireframe
|
|
115
|
+
* boundingBox.setBoxHelperVisible(false);
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
setBoxHelperVisible(visible: boolean): void;
|
|
119
|
+
/**
|
|
120
|
+
* Sets the visibility of the bounding sphere wireframe helper.
|
|
121
|
+
*
|
|
122
|
+
* @param visible - Whether the sphere helper should be visible
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* const boundingBox = new BoundingBox(mesh);
|
|
127
|
+
*
|
|
128
|
+
* // Show the bounding sphere wireframe
|
|
129
|
+
* boundingBox.setSphereHelperVisible(true);
|
|
130
|
+
*
|
|
131
|
+
* // Hide the bounding sphere wireframe
|
|
132
|
+
* boundingBox.setSphereHelperVisible(false);
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
setSphereHelperVisible(visible: boolean): void;
|
|
136
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Euler, Object3D, Vector3 } from 'three';
|
|
2
|
-
import { OrbitController } from '../../
|
|
2
|
+
import { OrbitController } from '../../plugins/orbitcontroller/index.ts';
|
|
3
3
|
import { DIVEGizmoPlane as DIVEGizmoPlane } from './plane/GizmoPlane.ts';
|
|
4
4
|
import { DIVESelectable } from '../../interfaces/Selectable.ts';
|
|
5
5
|
export type DIVEGizmoMode = 'translate' | 'rotate' | 'scale';
|
|
@@ -2,7 +2,7 @@ import { ColorRepresentation, Object3D, Vector3 } from 'three';
|
|
|
2
2
|
import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
|
|
3
3
|
import { DIVETranslateGizmo } from '../translate/TranslateGizmo.ts';
|
|
4
4
|
import { DIVEDraggable } from '../../../interfaces/Draggable.ts';
|
|
5
|
-
import { DraggableEvent } from '../../../
|
|
5
|
+
import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
|
|
6
6
|
export declare class DIVEAxisHandle extends Object3D implements DIVEHoverable, DIVEDraggable {
|
|
7
7
|
readonly isHoverable: true;
|
|
8
8
|
readonly isDraggable: true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ColorRepresentation, Object3D, Vector3 } from 'three';
|
|
2
2
|
import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
|
|
3
|
-
import { DraggableEvent } from '../../../
|
|
3
|
+
import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
|
|
4
4
|
import { DIVERotateGizmo } from '../rotate/RotateGizmo.ts';
|
|
5
5
|
import { DIVEDraggable } from '../../../interfaces/Draggable.ts';
|
|
6
6
|
export declare class DIVERadialHandle extends Object3D implements DIVEHoverable, DIVEDraggable {
|
|
@@ -2,7 +2,7 @@ import { ColorRepresentation, Object3D, Vector3 } from 'three';
|
|
|
2
2
|
import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
|
|
3
3
|
import { DIVEScaleGizmo } from '../scale/ScaleGizmo.ts';
|
|
4
4
|
import { DIVEDraggable } from '../../../interfaces/Draggable.ts';
|
|
5
|
-
import { DraggableEvent } from '../../../
|
|
5
|
+
import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
|
|
6
6
|
export declare class DIVEScaleHandle extends Object3D implements DIVEHoverable, DIVEDraggable {
|
|
7
7
|
readonly isHoverable: true;
|
|
8
8
|
readonly isDraggable: true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Object3D } from 'three';
|
|
2
|
-
import { OrbitController } from '../../../
|
|
2
|
+
import { OrbitController } from '../../../plugins/orbitcontroller/index.ts';
|
|
3
3
|
import { DIVERadialHandle } from '../handles/RadialHandle.ts';
|
|
4
|
-
import { DraggableEvent } from '../../../
|
|
4
|
+
import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
|
|
5
5
|
export declare class DIVERotateGizmo extends Object3D {
|
|
6
6
|
children: DIVERadialHandle[];
|
|
7
7
|
private _controller;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Object3D, Vector3 } from 'three';
|
|
2
2
|
import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
|
|
3
|
-
import { OrbitController } from '../../../
|
|
3
|
+
import { OrbitController } from '../../../plugins/orbitcontroller/index.ts';
|
|
4
4
|
import { DIVEScaleHandle } from '../handles/ScaleHandle.ts';
|
|
5
|
-
import { DraggableEvent } from '../../../
|
|
5
|
+
import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
|
|
6
6
|
export declare class DIVEScaleGizmo extends Object3D implements DIVEHoverable {
|
|
7
7
|
readonly isHoverable: true;
|
|
8
8
|
children: DIVEScaleHandle[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Object3D } from 'three';
|
|
2
|
-
import { OrbitController } from '../../../
|
|
2
|
+
import { OrbitController } from '../../../plugins/orbitcontroller/index.ts';
|
|
3
3
|
import { DIVEAxisHandle } from '../handles/AxisHandle.ts';
|
|
4
|
-
import { DraggableEvent } from '../../../
|
|
4
|
+
import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
|
|
5
5
|
export declare class DIVETranslateGizmo extends Object3D {
|
|
6
6
|
private _controller;
|
|
7
7
|
set debug(value: boolean);
|
|
@@ -7,8 +7,8 @@ export declare class DIVEGroup extends DIVENode {
|
|
|
7
7
|
get members(): Object3D[];
|
|
8
8
|
private _lines;
|
|
9
9
|
constructor();
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
setPosition(position: Vector3Like): void;
|
|
11
|
+
setLinesVisibility(visible: boolean, object?: Object3D): void;
|
|
12
12
|
attach(object: DIVESceneObject): this;
|
|
13
13
|
/**
|
|
14
14
|
* Removes an object from the group.
|
|
@@ -16,7 +16,7 @@ export declare class DIVEGroup extends DIVENode {
|
|
|
16
16
|
* @returns The group instance.
|
|
17
17
|
*/
|
|
18
18
|
remove(object: DIVESceneObject): this;
|
|
19
|
-
|
|
19
|
+
updateLineTo(object: Object3D): void;
|
|
20
20
|
/**
|
|
21
21
|
* Creates a line for visualization.
|
|
22
22
|
*/
|
|
@@ -24,5 +24,5 @@ export declare class DIVEGroup extends DIVENode {
|
|
|
24
24
|
/**
|
|
25
25
|
* Updates a line to the object.
|
|
26
26
|
*/
|
|
27
|
-
private
|
|
27
|
+
private _updateLineTo;
|
|
28
28
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Object3D } from 'three';
|
|
2
|
-
import {
|
|
2
|
+
import { MaterialSchema } from '../../index.ts';
|
|
3
3
|
import { DIVENode } from '../node/Node.ts';
|
|
4
4
|
/**
|
|
5
5
|
* A basic model class.
|
|
@@ -18,7 +18,7 @@ export declare class DIVEModel extends DIVENode {
|
|
|
18
18
|
private _getAssetLoader;
|
|
19
19
|
setFromURL(url: string): Promise<void>;
|
|
20
20
|
setFromGLTF(gltf: Object3D): void;
|
|
21
|
-
setMaterial(material: Partial<
|
|
21
|
+
setMaterial(material: Partial<MaterialSchema>): void;
|
|
22
22
|
placeOnFloor(): void;
|
|
23
23
|
dropIt(): void;
|
|
24
24
|
}
|
|
@@ -2,18 +2,19 @@ import { Box3, Object3D, Vector3, Vector3Like } from 'three';
|
|
|
2
2
|
import { DIVEMovable } from '../../interfaces/Movable.ts';
|
|
3
3
|
import { DIVESelectable } from '../../interfaces/Selectable.ts';
|
|
4
4
|
import { TransformControls } from 'three/examples/jsm/controls/TransformControls.ts';
|
|
5
|
-
declare
|
|
6
|
-
|
|
5
|
+
export declare class DIVENode extends Object3D implements DIVESelectable, DIVEMovable {
|
|
6
|
+
readonly isSelectable: true;
|
|
7
|
+
readonly isMovable: true;
|
|
7
8
|
readonly isDIVENode: true;
|
|
8
9
|
gizmo: TransformControls | null;
|
|
9
10
|
protected _positionWorldBuffer: Vector3;
|
|
10
11
|
protected _boundingBox: Box3;
|
|
11
12
|
constructor();
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
setPosition(position: Vector3Like): void;
|
|
14
|
+
setRotation(rotation: Vector3Like): void;
|
|
15
|
+
setScale(scale: Vector3Like): void;
|
|
15
16
|
setVisibility(visible: boolean): void;
|
|
16
|
-
|
|
17
|
+
setToWorldOrigin(): void;
|
|
17
18
|
/**
|
|
18
19
|
* Can be called when the object is moved from a foreign object (gizmo, parent, etc.) to update the object's position.
|
|
19
20
|
*/
|
|
@@ -21,4 +22,3 @@ export declare class DIVENode extends DIVENode_base {
|
|
|
21
22
|
onSelect(): void;
|
|
22
23
|
onDeselect(): void;
|
|
23
24
|
}
|
|
24
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DIVENode } from '../node/Node.ts';
|
|
2
|
-
import {
|
|
2
|
+
import { GeometrySchema, MaterialSchema } from '../../index.ts';
|
|
3
3
|
/**
|
|
4
4
|
* A basic model class.
|
|
5
5
|
*
|
|
@@ -13,8 +13,8 @@ export declare class DIVEPrimitive extends DIVENode {
|
|
|
13
13
|
readonly isDIVEPrimitive: true;
|
|
14
14
|
private _mesh;
|
|
15
15
|
constructor();
|
|
16
|
-
|
|
17
|
-
setMaterial(material: Partial<
|
|
16
|
+
setGeometry(geometry: GeometrySchema): void;
|
|
17
|
+
setMaterial(material: Partial<MaterialSchema>): void;
|
|
18
18
|
placeOnFloor(): void;
|
|
19
19
|
dropIt(): void;
|
|
20
20
|
private assembleGeometry;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box3, Object3D } from 'three';
|
|
2
|
-
import {
|
|
2
|
+
import { EntitySchema, EntityTypeSchema, MinimalSchema, PartialSchema } from '../../index.ts';
|
|
3
3
|
import { DIVESceneObject } from '../../types/index.ts';
|
|
4
4
|
import { DIVEFloor } from '../floor/Floor.ts';
|
|
5
5
|
/**
|
|
@@ -11,17 +11,15 @@ export declare class DIVERoot extends Object3D {
|
|
|
11
11
|
readonly isDIVERoot: true;
|
|
12
12
|
get floor(): DIVEFloor;
|
|
13
13
|
private _floor;
|
|
14
|
-
private _assetLoader;
|
|
15
|
-
private _getAssetLoader;
|
|
16
14
|
constructor();
|
|
17
15
|
computeSceneBB(): Box3;
|
|
18
|
-
getSceneObject<E extends
|
|
16
|
+
getSceneObject<E extends EntityTypeSchema>(object: Partial<EntitySchema> & {
|
|
19
17
|
id: string;
|
|
20
18
|
entityType: E;
|
|
21
19
|
}): DIVESceneObject<E> | undefined;
|
|
22
|
-
addSceneObject(object:
|
|
23
|
-
updateSceneObject(object:
|
|
24
|
-
deleteSceneObject(object:
|
|
20
|
+
addSceneObject(object: EntitySchema): DIVESceneObject | undefined;
|
|
21
|
+
updateSceneObject(object: PartialSchema): void;
|
|
22
|
+
deleteSceneObject(object: MinimalSchema<EntitySchema>): void;
|
|
25
23
|
private _updateLight;
|
|
26
24
|
private _updateModel;
|
|
27
25
|
private _updatePrimitive;
|
package/build/src/core/Dive.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OrbitControllerSettings } from '../
|
|
1
|
+
import { OrbitControllerSettings } from '../plugins/orbitcontroller/index.ts';
|
|
2
2
|
import { DIVEEngine, EngineSettings } from '../engine/Engine.ts';
|
|
3
3
|
declare global {
|
|
4
4
|
interface Window {
|
|
@@ -33,7 +33,7 @@ export declare const DIVEDefaultSettings: DIVESettings;
|
|
|
33
33
|
*
|
|
34
34
|
* myWrapper.appendChild(dive.Canvas);
|
|
35
35
|
*
|
|
36
|
-
* dive.Communication.
|
|
36
|
+
* dive.Communication.subscribe('GET_ALL_SCENE_DATA', () => {
|
|
37
37
|
* // do something
|
|
38
38
|
* }));
|
|
39
39
|
*
|
|
@@ -45,13 +45,14 @@ export declare class DIVE {
|
|
|
45
45
|
static QuickView(uri: string, settings?: Partial<DIVESettings & {
|
|
46
46
|
lightIntensity?: number;
|
|
47
47
|
}>): Promise<DIVE>;
|
|
48
|
+
private _instanceId;
|
|
48
49
|
private _settings;
|
|
49
50
|
get engine(): DIVEEngine;
|
|
50
51
|
private _engine;
|
|
51
52
|
private orbitController;
|
|
52
|
-
private
|
|
53
|
+
private orientationDisplay;
|
|
53
54
|
get canvas(): HTMLCanvasElement;
|
|
54
55
|
setCanvas(canvas: HTMLCanvasElement): void;
|
|
55
56
|
constructor(settings?: Partial<DIVESettings>);
|
|
56
|
-
|
|
57
|
+
dispose(): Promise<void>;
|
|
57
58
|
}
|
|
@@ -13,6 +13,7 @@ export declare class DIVEClock {
|
|
|
13
13
|
stop(): void;
|
|
14
14
|
setRenderer(renderer: DIVERenderPipeline): void;
|
|
15
15
|
addTicker(ticker: DIVETicker): void;
|
|
16
|
+
hasTicker(ticker: DIVETicker): boolean;
|
|
16
17
|
removeTicker(ticker: DIVETicker): void;
|
|
17
18
|
dispose(): void;
|
|
18
19
|
private _tick;
|