@shopware-ag/dive 2.0.1-beta.6 → 2.0.1-beta.7
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/{AssetExporter-ClYQ4gnb.mjs → AssetExporter-QnOue3VT.mjs} +19 -19
- package/build/chunks/{AssetExporter-CAqADFbL.cjs → AssetExporter-TzKB2FHh.cjs} +4 -4
- package/build/chunks/AssetLoader-DCBiLwef.cjs +4 -0
- package/build/chunks/{AssetLoader-BewzFwHi.mjs → AssetLoader-Dqrg0Re8.mjs} +38 -35
- package/build/chunks/FileTypes-Ca8pkRlQ.cjs +30 -0
- package/build/chunks/FileTypes-CpKiTXEY.mjs +1109 -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-BizqI7_a.cjs +1 -0
- package/build/chunks/{SelectTool-DLXheZay.mjs → SelectTool-DVFL7BtX.mjs} +10 -10
- package/build/chunks/network-error-CHvryg-4.mjs +18 -0
- package/build/chunks/network-error-D_pq8VU6.cjs +1 -0
- package/build/chunks/package-CeZyVg2G.mjs +39 -0
- package/build/chunks/package-D_hIrGNz.cjs +1 -0
- package/build/dive.cjs +1 -30
- package/build/dive.mjs +617 -1089
- 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/{chunks/ARSystem-D27w7Pck.mjs → plugins/ar/index.mjs} +38 -44
- 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/{chunks/MediaCreator-psLAAyJA.mjs → plugins/mediacreator/index.mjs} +1 -1
- package/build/{modules/controller → plugins/orbitcontroller}/index.cjs +1 -1
- 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/{modules → plugins}/systeminfo/index.mjs +24 -23
- package/build/plugins/toolbox/index.cjs +1 -0
- package/build/plugins/toolbox/index.d.ts +2 -0
- package/build/{chunks/Toolbox-DKuyL8n5.mjs → plugins/toolbox/index.mjs} +8 -2
- 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/model/Model.d.ts +2 -2
- 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 +1 -1
- package/build/src/engine/clock/Clock.d.ts +1 -0
- package/build/src/index.d.ts +2 -1
- 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/{modules/ar → plugins/ar/src}/ARSystem.d.ts +0 -27
- package/build/src/{modules/ar → plugins/ar/src}/webxr/WebXR.d.ts +2 -2
- package/build/src/{modules/ar → plugins/ar/src}/webxr/controller/WebXRController.d.ts +2 -2
- package/build/src/{modules/ar → plugins/ar/src}/webxr/origin/WebXROrigin.d.ts +1 -1
- package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/WebXRRaycaster.d.ts +3 -3
- package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +1 -1
- package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +2 -2
- package/build/src/{modules/ar → plugins/ar/src}/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +1 -1
- 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/assetexporter → plugins/assetexporter/src}/AssetExporter.d.ts +1 -18
- package/build/src/plugins/assetloader/index.d.ts +3 -0
- package/build/src/plugins/assetloader/src/loader/AssetLoader.d.ts +8 -0
- package/build/src/plugins/axiscamera/index.d.ts +1 -0
- package/build/src/{modules/axiscamera → plugins/axiscamera/src}/AxisCamera.d.ts +1 -4
- 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/{modules → plugins}/state/types/ActionTypes.d.ts +8 -9
- 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 +1 -32
- package/build/src/plugins/toolbox/index.d.ts +4 -0
- package/build/src/{modules/toolbox → plugins/toolbox/src}/BaseTool.d.ts +2 -4
- package/build/src/{modules/toolbox → plugins/toolbox/src}/Toolbox.d.ts +2 -11
- package/build/src/{modules/toolbox → plugins/toolbox/src}/select/SelectTool.d.ts +2 -3
- package/build/src/{modules/toolbox → plugins/toolbox/src}/transform/TransformTool.d.ts +2 -3
- 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 +41 -41
- package/build/chunks/ARSystem-_0cLAxyG.cjs +0 -1
- package/build/chunks/AnimationSystem-Bf-xhqRe.mjs +0 -101
- package/build/chunks/AnimationSystem-DFUYMNpj.cjs +0 -1
- package/build/chunks/AssetLoader-Bq-Ekxil.cjs +0 -4
- package/build/chunks/AxisCamera-CUb3g8WX.cjs +0 -1
- package/build/chunks/AxisCamera-lXJLIPLK.mjs +0 -39
- package/build/chunks/AxisHelperColors-BrGqktN5.cjs +0 -1
- package/build/chunks/AxisHelperColors-JLBHYQDi.mjs +0 -9
- package/build/chunks/FileTypes-DuVGjbcR.mjs +0 -36
- package/build/chunks/FileTypes-DzVpDu_p.cjs +0 -1
- package/build/chunks/MediaCreator-CEWeS42n.cjs +0 -1
- package/build/chunks/ModuleRegistry-CBfx1EVd.mjs +0 -13
- package/build/chunks/ModuleRegistry-CDIxOzgZ.cjs +0 -1
- package/build/chunks/OrbitController-B8VkQV1e.cjs +0 -1
- package/build/chunks/OrbitController-CXu1ko6E.mjs +0 -462
- package/build/chunks/PerspectiveCamera-BByyG5R4.cjs +0 -1
- package/build/chunks/PerspectiveCamera-PMJPzAn3.mjs +0 -34
- package/build/chunks/SelectTool-9eiKZXT4.cjs +0 -1
- package/build/chunks/State-BNgqNPrs.mjs +0 -4296
- package/build/chunks/State-Mvu0hG-n.cjs +0 -27
- package/build/chunks/Toolbox-qFN47t2F.cjs +0 -1
- package/build/chunks/VisibilityLayerMask-BI7jPKdx.cjs +0 -1
- package/build/chunks/VisibilityLayerMask-CXgt1fJc.mjs +0 -8
- package/build/chunks/index-C_uFFwT2.mjs +0 -5
- package/build/chunks/index-DAwIH9xh.cjs +0 -1
- package/build/chunks/package-CHgGmFCa.cjs +0 -1
- package/build/chunks/package-CIkS9WF6.mjs +0 -39
- package/build/modules/animation/index.cjs +0 -1
- package/build/modules/animation/index.d.ts +0 -2
- package/build/modules/animation/index.mjs +0 -5
- package/build/modules/ar/index.cjs +0 -1
- package/build/modules/ar/index.d.ts +0 -2
- package/build/modules/ar/index.mjs +0 -11
- package/build/modules/assetconverter/index.cjs +0 -1
- package/build/modules/assetconverter/index.d.ts +0 -2
- package/build/modules/assetconverter/index.mjs +0 -4
- package/build/modules/assetexporter/index.cjs +0 -1
- package/build/modules/assetexporter/index.d.ts +0 -2
- package/build/modules/assetexporter/index.mjs +0 -4
- package/build/modules/assetloader/index.cjs +0 -1
- package/build/modules/assetloader/index.d.ts +0 -2
- package/build/modules/assetloader/index.mjs +0 -4
- package/build/modules/axiscamera/index.cjs +0 -1
- package/build/modules/axiscamera/index.d.ts +0 -2
- package/build/modules/axiscamera/index.mjs +0 -4
- package/build/modules/controller/index.d.ts +0 -2
- package/build/modules/controller/index.mjs +0 -5
- package/build/modules/mediacreator/index.cjs +0 -1
- package/build/modules/mediacreator/index.d.ts +0 -2
- package/build/modules/mediacreator/index.mjs +0 -4
- package/build/modules/state/index.cjs +0 -1
- package/build/modules/state/index.d.ts +0 -2
- package/build/modules/state/index.mjs +0 -39
- package/build/modules/systeminfo/index.cjs +0 -1
- package/build/modules/systeminfo/index.d.ts +0 -2
- package/build/modules/toolbox/index.cjs +0 -1
- package/build/modules/toolbox/index.d.ts +0 -2
- package/build/modules/toolbox/index.mjs +0 -10
- package/build/src/modules/ModuleRegistry.d.ts +0 -19
- package/build/src/modules/animation/AnimationSystem.d.ts +0 -36
- package/build/src/modules/animation/index.d.ts +0 -2
- package/build/src/modules/ar/index.d.ts +0 -4
- package/build/src/modules/assetconverter/AssetConverter.d.ts +0 -30
- package/build/src/modules/assetconverter/index.d.ts +0 -1
- package/build/src/modules/assetexporter/index.d.ts +0 -1
- package/build/src/modules/assetloader/AssetLoader.d.ts +0 -29
- package/build/src/modules/assetloader/index.d.ts +0 -1
- package/build/src/modules/axiscamera/index.d.ts +0 -1
- package/build/src/modules/controller/index.d.ts +0 -1
- package/build/src/modules/mediacreator/MediaCreator.d.ts +0 -44
- package/build/src/modules/mediacreator/index.d.ts +0 -1
- 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/index.d.ts +0 -4
- 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/index.d.ts +0 -1
- package/build/src/modules/toolbox/index.d.ts +0 -4
- 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/{chunks/AssetConverter-BTAb23e8.cjs → plugins/assetconverter/index.cjs} +0 -0
- /package/build/{chunks/AssetConverter-D-qOTLs1.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/ar → plugins/ar/src}/arquicklook/ARQuickLook.d.ts +0 -0
- /package/build/src/{modules/ar → plugins/ar/src}/error/ar-errors.d.ts +0 -0
- /package/build/src/{modules/ar → plugins/ar/src}/sceneviewer/SceneViewer.d.ts +0 -0
- /package/build/src/{modules/ar → plugins/ar/src}/webxr/crosshair/WebXRCrosshair.d.ts +0 -0
- /package/build/src/{modules/ar → plugins/ar/src}/webxr/overlay/Overlay.d.ts +0 -0
- /package/build/src/{modules/assetloader → plugins/assetloader/src}/draco/DracoLoader.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
package/build/dive.mjs
CHANGED
|
@@ -1,1201 +1,729 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
|
-
r(this, "isDIVELight", !0);
|
|
18
|
-
r(this, "isDIVEAmbientLight", !0);
|
|
19
|
-
r(this, "_light");
|
|
20
|
-
this.name = "DIVEAmbientLight", this._light = new N(16777215, 1), this._light.layers.mask = g, this.add(this._light);
|
|
21
|
-
}
|
|
22
|
-
setColor(e) {
|
|
23
|
-
this._light.color = e;
|
|
24
|
-
}
|
|
25
|
-
setIntensity(e) {
|
|
26
|
-
this._light.intensity = e;
|
|
27
|
-
}
|
|
28
|
-
setEnabled(e) {
|
|
29
|
-
this._light.visible = e;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
class le extends p {
|
|
33
|
-
constructor() {
|
|
1
|
+
var G = Object.defineProperty;
|
|
2
|
+
var S = (r, s, t) => s in r ? G(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
|
|
3
|
+
var i = (r, s, t) => S(r, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
+
import { A as x, a as I, b as y } from "./chunks/FileTypes-CpKiTXEY.mjs";
|
|
5
|
+
import { g as nt, f as ot, e as ht, d as lt, l as ct, s as dt, c as _t, x as pt, i as ut, j as gt, k as ft, o as mt, p as Et, m as Dt, q as Mt, u as wt, t as bt, v as xt, r as It, w as yt, n as Pt, E as Ht, F as Vt, G as zt, h as vt, S as Gt, y as St } from "./chunks/FileTypes-CpKiTXEY.mjs";
|
|
6
|
+
import { U as d } from "./chunks/PerspectiveCamera-DUiWJJIj.mjs";
|
|
7
|
+
import { C as jt, b as Ot, D as Rt, a as Tt, H as Yt, P as Lt } from "./chunks/PerspectiveCamera-DUiWJJIj.mjs";
|
|
8
|
+
import { Object3D as u, Color as P, Vector3 as h, TorusGeometry as H, MeshBasicMaterial as f, Mesh as _, MathUtils as z, Euler as A, CylinderGeometry as m, BoxGeometry as j, PlaneGeometry as D } from "three";
|
|
9
|
+
import { N as Xt, g as Nt, i as Ft } from "./chunks/network-error-CHvryg-4.mjs";
|
|
10
|
+
import { f as qt, i as Qt } from "./chunks/findInterface-DbJ5qzbc.mjs";
|
|
11
|
+
import { F as Wt, P as kt } from "./chunks/parse-error-BFRJyIxM.mjs";
|
|
12
|
+
import { i as Bt, a as Jt } from "./chunks/PovSchema-DWWvr_ED.mjs";
|
|
13
|
+
class M extends u {
|
|
14
|
+
constructor(t, e, a, n, o) {
|
|
34
15
|
super();
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
this
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
color:
|
|
16
|
+
i(this, "isHoverable", !0);
|
|
17
|
+
i(this, "isDraggable", !0);
|
|
18
|
+
i(this, "parent", null);
|
|
19
|
+
i(this, "axis");
|
|
20
|
+
i(this, "_color", new P(16711935));
|
|
21
|
+
i(this, "_colorHover");
|
|
22
|
+
i(this, "_hovered");
|
|
23
|
+
i(this, "_highlight");
|
|
24
|
+
i(this, "_lineMaterial");
|
|
25
|
+
i(this, "_colliderMesh");
|
|
26
|
+
this.name = "DIVERadialHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._hovered = !1, this._highlight = !1;
|
|
27
|
+
const c = new H(e, 0.01, 13, 48, a);
|
|
28
|
+
this._lineMaterial = new f({
|
|
29
|
+
color: o,
|
|
30
|
+
depthTest: !1,
|
|
31
|
+
depthWrite: !1
|
|
32
|
+
});
|
|
33
|
+
const l = new _(c, this._lineMaterial);
|
|
34
|
+
l.layers.mask = d, l.renderOrder = 1 / 0, this.add(l);
|
|
35
|
+
const g = new H(e, 0.1, 3, 48, a), E = new f({
|
|
36
|
+
color: 16711935,
|
|
49
37
|
transparent: !0,
|
|
50
|
-
opacity: 0.
|
|
51
|
-
|
|
38
|
+
opacity: 0.15,
|
|
39
|
+
depthTest: !1,
|
|
40
|
+
depthWrite: !1
|
|
52
41
|
});
|
|
53
|
-
this.
|
|
42
|
+
this._colliderMesh = new _(g, E), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this.add(this._colliderMesh), this.lookAt(n);
|
|
54
43
|
}
|
|
55
|
-
|
|
56
|
-
this.
|
|
44
|
+
set debug(t) {
|
|
45
|
+
this._colliderMesh.visible = t;
|
|
57
46
|
}
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
get highlight() {
|
|
48
|
+
return this._highlight;
|
|
60
49
|
}
|
|
61
|
-
|
|
62
|
-
this.
|
|
50
|
+
set highlight(t) {
|
|
51
|
+
this._highlight = t, this._lineMaterial.color = this._highlight || this._hovered ? this._colorHover : this._color;
|
|
63
52
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var t;
|
|
67
|
-
(t = e.get(this.userData.id)) == null || t.performAction("UPDATE_OBJECT", {
|
|
68
|
-
id: this.userData.id,
|
|
69
|
-
position: this.position
|
|
70
|
-
});
|
|
71
|
-
});
|
|
53
|
+
get forwardVector() {
|
|
54
|
+
return new h(0, 0, 1).applyQuaternion(this.quaternion).normalize();
|
|
72
55
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
var t;
|
|
76
|
-
(t = e.get(this.userData.id)) == null || t.performAction("SELECT_OBJECT", {
|
|
77
|
-
id: this.userData.id
|
|
78
|
-
});
|
|
79
|
-
});
|
|
56
|
+
get rightVector() {
|
|
57
|
+
return new h(1, 0, 0).applyQuaternion(this.quaternion).normalize();
|
|
80
58
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var t;
|
|
84
|
-
(t = e.get(this.userData.id)) == null || t.performAction("DESELECT_OBJECT", {
|
|
85
|
-
id: this.userData.id
|
|
86
|
-
});
|
|
87
|
-
});
|
|
59
|
+
get upVector() {
|
|
60
|
+
return new h(0, 1, 0).applyQuaternion(this.quaternion).normalize();
|
|
88
61
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
constructor() {
|
|
92
|
-
super();
|
|
93
|
-
r(this, "isDIVELight", !0);
|
|
94
|
-
r(this, "isDIVESceneLight", !0);
|
|
95
|
-
r(this, "_hemiLight");
|
|
96
|
-
r(this, "_dirLight");
|
|
97
|
-
this.name = "DIVESceneLight", this._hemiLight = new $(16777215, 16777215, 2), this._hemiLight.layers.mask = g, this._hemiLight.position.set(0, 50, 0), this.add(this._hemiLight), this._dirLight = new H(16777215, 3), this._dirLight.layers.mask = g, this._dirLight.position.set(1, 1.75, 1), this._dirLight.position.multiplyScalar(30), this._dirLight.castShadow = !0, this._dirLight.shadow.mapSize.width = 2048, this._dirLight.shadow.mapSize.height = 2048;
|
|
98
|
-
const e = 5;
|
|
99
|
-
this._dirLight.shadow.camera.left = -5, this._dirLight.shadow.camera.right = e, this._dirLight.shadow.camera.top = e, this._dirLight.shadow.camera.bottom = -5, this._dirLight.shadow.camera.far = 3500, this.add(this._dirLight);
|
|
62
|
+
reset() {
|
|
63
|
+
this._lineMaterial.color = this._color;
|
|
100
64
|
}
|
|
101
|
-
|
|
102
|
-
this.
|
|
65
|
+
onPointerEnter() {
|
|
66
|
+
this._hovered = !0, this.parent && this.parent.onHandleHover(this, !0);
|
|
103
67
|
}
|
|
104
|
-
|
|
105
|
-
this.
|
|
68
|
+
onPointerLeave() {
|
|
69
|
+
this._hovered = !1, this.parent && this.parent.onHandleHover(this, !1);
|
|
106
70
|
}
|
|
107
|
-
|
|
108
|
-
this.
|
|
71
|
+
onDragStart() {
|
|
72
|
+
this.parent && this.parent.onHandleDragStart(this);
|
|
73
|
+
}
|
|
74
|
+
onDrag(t) {
|
|
75
|
+
this.parent && this.parent.onHandleDrag(this, t);
|
|
76
|
+
}
|
|
77
|
+
onDragEnd() {
|
|
78
|
+
this.parent && this.parent.onHandleDragEnd(this);
|
|
109
79
|
}
|
|
110
80
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
81
|
+
function p(r, s) {
|
|
82
|
+
const t = (r + "e").split("e");
|
|
83
|
+
return +(t[0] + "e" + (+t[1] + (s || 0)));
|
|
84
|
+
}
|
|
85
|
+
function O(r, s = 0) {
|
|
86
|
+
const t = p(r, +s);
|
|
87
|
+
return p(Math.ceil(t), -s);
|
|
88
|
+
}
|
|
89
|
+
function R(r, s = 0) {
|
|
90
|
+
const t = p(r, +s);
|
|
91
|
+
return p(Math.floor(t), -s);
|
|
92
|
+
}
|
|
93
|
+
function v(r, s = 0) {
|
|
94
|
+
if (r < 0) return -v(-r, s);
|
|
95
|
+
const t = p(r, +s);
|
|
96
|
+
return p(Math.round(t), -s);
|
|
97
|
+
}
|
|
98
|
+
function T(r, s, t) {
|
|
99
|
+
return Math.atan2(
|
|
100
|
+
r.clone().cross(s).dot(t),
|
|
101
|
+
s.clone().dot(r)
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function Y(r, s = 0) {
|
|
105
|
+
const t = p(r, +s);
|
|
106
|
+
return p(Math.round(t), -s).toFixed(s);
|
|
107
|
+
}
|
|
108
|
+
function L(r, s = 0) {
|
|
109
|
+
const t = p(r, +s);
|
|
110
|
+
return p(Math.trunc(t), -s);
|
|
111
|
+
}
|
|
112
|
+
function C(r) {
|
|
113
|
+
return (z.radToDeg(r) + 360) % 360;
|
|
114
|
+
}
|
|
115
|
+
function X(r) {
|
|
116
|
+
return z.degToRad(r);
|
|
117
|
+
}
|
|
118
|
+
const N = {
|
|
119
|
+
ceilExp: O,
|
|
120
|
+
floorExp: R,
|
|
121
|
+
roundExp: v,
|
|
122
|
+
toFixedExp: Y,
|
|
123
|
+
truncateExp: L,
|
|
124
|
+
signedAngleTo: T,
|
|
125
|
+
radToDeg: C,
|
|
126
|
+
degToRad: X
|
|
127
|
+
};
|
|
128
|
+
class F extends u {
|
|
129
|
+
constructor(t) {
|
|
114
130
|
super();
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
(t = e.get(this.userData.id)) == null || t.performAction("UPDATE_OBJECT", {
|
|
144
|
-
id: this.userData.id,
|
|
145
|
-
position: this.getWorldPosition(this._positionWorldBuffer),
|
|
146
|
-
rotation: this.rotation,
|
|
147
|
-
scale: this.scale
|
|
148
|
-
});
|
|
149
|
-
});
|
|
131
|
+
i(this, "children");
|
|
132
|
+
i(this, "_controller");
|
|
133
|
+
i(this, "_startRot");
|
|
134
|
+
this.name = "DIVERotateGizmo", this.children = [], this._startRot = null, this._controller = t, this.add(
|
|
135
|
+
new M(
|
|
136
|
+
"x",
|
|
137
|
+
1,
|
|
138
|
+
Math.PI / 2,
|
|
139
|
+
new h(1, 0, 0),
|
|
140
|
+
x
|
|
141
|
+
)
|
|
142
|
+
), this.add(
|
|
143
|
+
new M(
|
|
144
|
+
"y",
|
|
145
|
+
1,
|
|
146
|
+
-Math.PI / 2,
|
|
147
|
+
new h(0, 1, 0),
|
|
148
|
+
I
|
|
149
|
+
)
|
|
150
|
+
), this.add(
|
|
151
|
+
new M(
|
|
152
|
+
"z",
|
|
153
|
+
1,
|
|
154
|
+
Math.PI / 2,
|
|
155
|
+
new h(0, 0, 1),
|
|
156
|
+
y
|
|
157
|
+
)
|
|
158
|
+
);
|
|
150
159
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
onMove() {
|
|
155
|
-
d("State").then((e) => {
|
|
156
|
-
var t;
|
|
157
|
-
(t = e.get(this.userData.id)) == null || t.performAction("UPDATE_OBJECT", {
|
|
158
|
-
id: this.userData.id,
|
|
159
|
-
position: this.getWorldPosition(this._positionWorldBuffer),
|
|
160
|
-
rotation: this.rotation,
|
|
161
|
-
scale: this.scale
|
|
162
|
-
});
|
|
160
|
+
set debug(t) {
|
|
161
|
+
this.children.forEach((e) => {
|
|
162
|
+
e.debug = t;
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
(t = e.get(this.userData.id)) == null || t.performAction("SELECT_OBJECT", {
|
|
169
|
-
id: this.userData.id
|
|
170
|
-
});
|
|
165
|
+
reset() {
|
|
166
|
+
this.children.forEach((t) => {
|
|
167
|
+
t.reset();
|
|
171
168
|
});
|
|
172
169
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
(t = e.get(this.userData.id)) == null || t.performAction("DESELECT_OBJECT", {
|
|
177
|
-
id: this.userData.id
|
|
178
|
-
});
|
|
170
|
+
handleHighlight(t, e, a) {
|
|
171
|
+
this.children.forEach((n) => {
|
|
172
|
+
a ? n.highlight = n.axis === t && a : n.highlight = n.axis === t && e;
|
|
179
173
|
});
|
|
180
174
|
}
|
|
175
|
+
onHandleHover(t, e) {
|
|
176
|
+
this._startRot || this.parent && this.parent.parent && (this.parent.parent.onHover("rotate", t.axis, e), this.handleHighlight(t.axis, e, !1));
|
|
177
|
+
}
|
|
178
|
+
onHandleDragStart(t) {
|
|
179
|
+
if (!this.parent || !this.parent.parent) return;
|
|
180
|
+
const e = this.parent.parent.object;
|
|
181
|
+
e && (this._startRot = e.rotation.clone(), this.handleHighlight(t.axis, !0, !0));
|
|
182
|
+
}
|
|
183
|
+
onHandleDrag(t, e) {
|
|
184
|
+
if (!this._startRot || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
|
|
185
|
+
const a = e.dragCurrent.clone().sub(this.parent.parent.position).normalize(), n = e.dragStart.clone().sub(this.parent.parent.position).normalize(), o = N.signedAngleTo(
|
|
186
|
+
n,
|
|
187
|
+
a,
|
|
188
|
+
t.forwardVector
|
|
189
|
+
), c = new A(
|
|
190
|
+
this._startRot.x + t.forwardVector.x * o,
|
|
191
|
+
this._startRot.y + t.forwardVector.y * o,
|
|
192
|
+
this._startRot.z + t.forwardVector.z * o
|
|
193
|
+
);
|
|
194
|
+
this.parent.parent.onChange(void 0, c);
|
|
195
|
+
}
|
|
196
|
+
onHandleDragEnd(t) {
|
|
197
|
+
this._startRot = null, this.handleHighlight(t.axis, !1, !1);
|
|
198
|
+
}
|
|
181
199
|
}
|
|
182
|
-
class
|
|
183
|
-
constructor() {
|
|
184
|
-
super(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
this.
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
+
class w extends u {
|
|
201
|
+
constructor(t, e, a, n) {
|
|
202
|
+
super();
|
|
203
|
+
i(this, "isHoverable", !0);
|
|
204
|
+
i(this, "isDraggable", !0);
|
|
205
|
+
i(this, "parent", null);
|
|
206
|
+
i(this, "axis");
|
|
207
|
+
i(this, "_color", new P(16711935));
|
|
208
|
+
i(this, "_colorHover");
|
|
209
|
+
i(this, "_hovered");
|
|
210
|
+
i(this, "_highlight");
|
|
211
|
+
i(this, "_lineMaterial");
|
|
212
|
+
i(this, "_colliderMesh");
|
|
213
|
+
this.name = "DIVEAxisHandle", this.axis = t, this._color.set(n), this._colorHover = this._color.clone().multiplyScalar(2), this._highlight = !1, this._hovered = !1;
|
|
214
|
+
const o = new m(0.01, 0.01, e, 13);
|
|
215
|
+
this._lineMaterial = new f({
|
|
216
|
+
color: n,
|
|
217
|
+
depthTest: !1,
|
|
218
|
+
depthWrite: !1
|
|
200
219
|
});
|
|
220
|
+
const c = new _(o, this._lineMaterial);
|
|
221
|
+
c.layers.mask = d, c.renderOrder = 1 / 0, c.rotateX(Math.PI / 2), c.translateY(e / 2), this.add(c);
|
|
222
|
+
const l = new m(0.1, 0.1, e, 3), g = new f({
|
|
223
|
+
color: 16711935,
|
|
224
|
+
transparent: !0,
|
|
225
|
+
opacity: 0.15,
|
|
226
|
+
depthTest: !1,
|
|
227
|
+
depthWrite: !1
|
|
228
|
+
});
|
|
229
|
+
this._colliderMesh = new _(l, g), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this._colliderMesh.rotateX(Math.PI / 2), this._colliderMesh.translateY(e / 2), this.add(this._colliderMesh), this.rotateX(a.y * -Math.PI / 2), this.rotateY(a.x * Math.PI / 2);
|
|
201
230
|
}
|
|
202
|
-
|
|
203
|
-
this.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
const s = new P(t, new m(0, -1, 0));
|
|
238
|
-
s.layers.mask = g;
|
|
239
|
-
const o = s.intersectObjects(
|
|
240
|
-
v(this).root.children,
|
|
241
|
-
!0
|
|
242
|
-
);
|
|
243
|
-
if (o.length > 0) {
|
|
244
|
-
const a = o[0].object;
|
|
245
|
-
a.geometry.computeBoundingBox();
|
|
246
|
-
const h = a.geometry.boundingBox, l = a.localToWorld(h.max.clone()), u = this.position.clone(), _ = this.position.clone().setY(l.y).sub(new m(0, e, 0));
|
|
247
|
-
if (this.position.copy(_), this.position.y === u.y) return;
|
|
248
|
-
this.onMove();
|
|
249
|
-
}
|
|
231
|
+
set debug(t) {
|
|
232
|
+
this._colliderMesh.visible = t;
|
|
233
|
+
}
|
|
234
|
+
get highlight() {
|
|
235
|
+
return this._highlight;
|
|
236
|
+
}
|
|
237
|
+
set highlight(t) {
|
|
238
|
+
this._highlight = t, this._lineMaterial.color = this._highlight || this._hovered ? this._colorHover : this._color;
|
|
239
|
+
}
|
|
240
|
+
get forwardVector() {
|
|
241
|
+
return new h(0, 0, 1).applyQuaternion(this.quaternion).normalize();
|
|
242
|
+
}
|
|
243
|
+
get rightVector() {
|
|
244
|
+
return new h(1, 0, 0).applyQuaternion(this.quaternion).normalize();
|
|
245
|
+
}
|
|
246
|
+
get upVector() {
|
|
247
|
+
return new h(0, 1, 0).applyQuaternion(this.quaternion).normalize();
|
|
248
|
+
}
|
|
249
|
+
reset() {
|
|
250
|
+
this._lineMaterial.color = this._color;
|
|
251
|
+
}
|
|
252
|
+
onPointerEnter() {
|
|
253
|
+
this._hovered = !0, this.parent && this.parent.onHandleHover(this, !0);
|
|
254
|
+
}
|
|
255
|
+
onPointerLeave() {
|
|
256
|
+
this._hovered = !1, this.parent && this.parent.onHandleHover(this, !1);
|
|
257
|
+
}
|
|
258
|
+
onDragStart() {
|
|
259
|
+
this.parent && this.parent.onHandleDragStart(this);
|
|
260
|
+
}
|
|
261
|
+
onDrag(t) {
|
|
262
|
+
this.parent && this.parent.onHandleDrag(this, t);
|
|
263
|
+
}
|
|
264
|
+
onDragEnd() {
|
|
265
|
+
this.parent && this.parent.onHandleDragEnd(this);
|
|
250
266
|
}
|
|
251
267
|
}
|
|
252
|
-
class
|
|
253
|
-
constructor() {
|
|
268
|
+
class Z extends u {
|
|
269
|
+
constructor(t) {
|
|
254
270
|
super();
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const t = this._mesh.material;
|
|
265
|
-
e.vertexColors !== void 0 && (t.vertexColors = e.vertexColors), e.color !== void 0 && (t.color = new f(e.color)), e.map !== void 0 && (t.map = e.map), e.normalMap !== void 0 && (t.normalMap = e.normalMap), e.roughness !== void 0 && (t.roughness = e.roughness), e.roughnessMap !== void 0 && (t.roughnessMap = e.roughnessMap, t.roughnessMap && (t.roughness = 1)), e.metalness !== void 0 && (t.metalness = e.metalness), e.metalnessMap !== void 0 && (t.metalnessMap = e.metalnessMap, t.metalnessMap && (t.metalness = 0)), this._mesh && (this._mesh.material = t);
|
|
266
|
-
}
|
|
267
|
-
placeOnFloor() {
|
|
268
|
-
var o, a, h, l;
|
|
269
|
-
const e = this.getWorldPosition(this._positionWorldBuffer), t = e.clone();
|
|
270
|
-
(a = (o = this._mesh) == null ? void 0 : o.geometry) == null || a.computeBoundingBox();
|
|
271
|
-
const s = (l = (h = this._mesh) == null ? void 0 : h.geometry) == null ? void 0 : l.boundingBox;
|
|
272
|
-
!s || !this._mesh || (e.y = e.y - this._mesh.localToWorld(s.min.clone()).y, e.y !== t.y && d("State").then((u) => {
|
|
273
|
-
var _;
|
|
274
|
-
(_ = u.get(this.userData.id)) == null || _.performAction("UPDATE_OBJECT", {
|
|
275
|
-
id: this.userData.id,
|
|
276
|
-
position: e,
|
|
277
|
-
rotation: this.rotation,
|
|
278
|
-
scale: this.scale
|
|
279
|
-
});
|
|
280
|
-
}));
|
|
281
|
-
}
|
|
282
|
-
dropIt() {
|
|
283
|
-
if (!this.parent) {
|
|
284
|
-
console.warn(
|
|
285
|
-
"DIVEPrimitive: dropIt() called on a model that is not in the scene.",
|
|
286
|
-
this
|
|
287
|
-
);
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
const e = this._boundingBox.min.y * this.scale.y, t = this.localToWorld(
|
|
291
|
-
this._boundingBox.getCenter(new m()).multiply(this.scale)
|
|
271
|
+
i(this, "_controller");
|
|
272
|
+
i(this, "children");
|
|
273
|
+
i(this, "_startPos");
|
|
274
|
+
this.name = "DIVETranslateGizmo", this.children = [], this._startPos = null, this._controller = t, this.add(
|
|
275
|
+
new w("x", 1, new h(1, 0, 0), x)
|
|
276
|
+
), this.add(
|
|
277
|
+
new w("y", 1, new h(0, 1, 0), I)
|
|
278
|
+
), this.add(
|
|
279
|
+
new w("z", 1, new h(0, 0, 1), y)
|
|
292
280
|
);
|
|
293
|
-
t.y = e + this.position.y;
|
|
294
|
-
const s = new P(t, new m(0, -1, 0));
|
|
295
|
-
s.layers.mask = g;
|
|
296
|
-
const o = s.intersectObjects(
|
|
297
|
-
v(this).root.children,
|
|
298
|
-
!0
|
|
299
|
-
);
|
|
300
|
-
if (o.length > 0) {
|
|
301
|
-
const a = o[0].object;
|
|
302
|
-
a.geometry.computeBoundingBox();
|
|
303
|
-
const h = a.geometry.boundingBox, l = a.localToWorld(h.max.clone()), u = this.position.clone(), _ = this.position.clone().setY(l.y).sub(new m(0, e, 0));
|
|
304
|
-
if (this.position.copy(_), this.position.y === u.y) return;
|
|
305
|
-
this.onMove();
|
|
306
|
-
}
|
|
307
281
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
case "sphere":
|
|
313
|
-
return this.createSphereGeometry(e);
|
|
314
|
-
case "pyramid":
|
|
315
|
-
return this._mesh.material.flatShading = !0, this.createPyramidGeometry(e);
|
|
316
|
-
case "cube":
|
|
317
|
-
case "box":
|
|
318
|
-
return this.createBoxGeometry(e);
|
|
319
|
-
case "cone":
|
|
320
|
-
return this.createConeGeometry(e);
|
|
321
|
-
case "wall":
|
|
322
|
-
return this.createWallGeometry(e);
|
|
323
|
-
case "plane":
|
|
324
|
-
return this.createPlaneGeometry(e);
|
|
325
|
-
default:
|
|
326
|
-
return console.warn(
|
|
327
|
-
"DIVEPrimitive.assembleGeometry: Invalid geometry type:",
|
|
328
|
-
e.name.toLowerCase()
|
|
329
|
-
), null;
|
|
330
|
-
}
|
|
282
|
+
set debug(t) {
|
|
283
|
+
this.children.forEach((e) => {
|
|
284
|
+
e.debug = t;
|
|
285
|
+
});
|
|
331
286
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
)
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
createSphereGeometry(e) {
|
|
342
|
-
return new C(e.width / 2, 256, 256);
|
|
343
|
-
}
|
|
344
|
-
createPyramidGeometry(e) {
|
|
345
|
-
const t = new Float32Array([
|
|
346
|
-
-e.width / 2,
|
|
347
|
-
0,
|
|
348
|
-
-e.depth / 2,
|
|
349
|
-
// 0
|
|
350
|
-
e.width / 2,
|
|
351
|
-
0,
|
|
352
|
-
-e.depth / 2,
|
|
353
|
-
// 1
|
|
354
|
-
e.width / 2,
|
|
355
|
-
0,
|
|
356
|
-
e.depth / 2,
|
|
357
|
-
// 2
|
|
358
|
-
-e.width / 2,
|
|
359
|
-
0,
|
|
360
|
-
e.depth / 2,
|
|
361
|
-
// 3
|
|
362
|
-
0,
|
|
363
|
-
e.height,
|
|
364
|
-
0
|
|
365
|
-
]), s = new Uint16Array([
|
|
366
|
-
0,
|
|
367
|
-
1,
|
|
368
|
-
2,
|
|
369
|
-
0,
|
|
370
|
-
2,
|
|
371
|
-
3,
|
|
372
|
-
0,
|
|
373
|
-
4,
|
|
374
|
-
1,
|
|
375
|
-
1,
|
|
376
|
-
4,
|
|
377
|
-
2,
|
|
378
|
-
2,
|
|
379
|
-
4,
|
|
380
|
-
3,
|
|
381
|
-
3,
|
|
382
|
-
4,
|
|
383
|
-
0
|
|
384
|
-
]), o = new T();
|
|
385
|
-
return o.setAttribute(
|
|
386
|
-
"position",
|
|
387
|
-
new S(t, 3)
|
|
388
|
-
), o.setIndex(new S(s, 1)), o.computeVertexNormals(), o.computeBoundingBox(), o.computeBoundingSphere(), o;
|
|
389
|
-
}
|
|
390
|
-
createBoxGeometry(e) {
|
|
391
|
-
const t = new y(
|
|
392
|
-
e.width,
|
|
393
|
-
e.height,
|
|
394
|
-
e.depth
|
|
395
|
-
);
|
|
396
|
-
return t.translate(0, e.height / 2, 0), t;
|
|
397
|
-
}
|
|
398
|
-
createConeGeometry(e) {
|
|
399
|
-
const t = new K(e.width / 2, e.height, 256);
|
|
400
|
-
return t.translate(0, e.height / 2, 0), t;
|
|
401
|
-
}
|
|
402
|
-
createWallGeometry(e) {
|
|
403
|
-
const t = new y(
|
|
404
|
-
e.width,
|
|
405
|
-
e.height,
|
|
406
|
-
e.depth || 0.05,
|
|
407
|
-
16
|
|
408
|
-
);
|
|
409
|
-
return t.translate(0, e.height / 2, 0), t;
|
|
287
|
+
reset() {
|
|
288
|
+
this.children.forEach((t) => {
|
|
289
|
+
t.reset();
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
handleHighlight(t, e, a) {
|
|
293
|
+
this.children.forEach((n) => {
|
|
294
|
+
a ? n.highlight = n.axis === t && a : n.highlight = n.axis === t && e;
|
|
295
|
+
});
|
|
410
296
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
e
|
|
297
|
+
onHandleHover(t, e) {
|
|
298
|
+
this._startPos || this.parent && this.parent.parent && (this.parent.parent.onHover(
|
|
299
|
+
"translate",
|
|
300
|
+
t.axis,
|
|
301
|
+
e
|
|
302
|
+
), this.handleHighlight(t.axis, e, !1));
|
|
303
|
+
}
|
|
304
|
+
onHandleDragStart(t) {
|
|
305
|
+
if (!this.parent || !this.parent.parent) return;
|
|
306
|
+
const e = this.parent.parent.object;
|
|
307
|
+
e && (this._startPos = e.position.clone(), this.handleHighlight(t.axis, !0, !0));
|
|
308
|
+
}
|
|
309
|
+
onHandleDrag(t, e) {
|
|
310
|
+
if (!this._startPos || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
|
|
311
|
+
const a = e.dragDelta.clone().projectOnVector(t.forwardVector);
|
|
312
|
+
this.parent.parent.onChange(
|
|
313
|
+
this._startPos.clone().add(a)
|
|
416
314
|
);
|
|
417
|
-
|
|
315
|
+
}
|
|
316
|
+
onHandleDragEnd(t) {
|
|
317
|
+
this._startPos = null, this.handleHighlight(t.axis, !1, !1);
|
|
418
318
|
}
|
|
419
319
|
}
|
|
420
|
-
class
|
|
421
|
-
|
|
422
|
-
constructor() {
|
|
320
|
+
class b extends u {
|
|
321
|
+
constructor(t, e, a, n, o = 0.05) {
|
|
423
322
|
super();
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
this
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
323
|
+
i(this, "isHoverable", !0);
|
|
324
|
+
i(this, "isDraggable", !0);
|
|
325
|
+
i(this, "parent", null);
|
|
326
|
+
i(this, "axis");
|
|
327
|
+
i(this, "_color", new P(16711935));
|
|
328
|
+
i(this, "_colorHover");
|
|
329
|
+
i(this, "_hovered");
|
|
330
|
+
i(this, "_highlight");
|
|
331
|
+
i(this, "_lineMaterial");
|
|
332
|
+
i(this, "_colliderMesh");
|
|
333
|
+
i(this, "_box");
|
|
334
|
+
i(this, "_boxSize");
|
|
335
|
+
this.name = "DIVEScaleHandle", this.axis = t, this._color.set(n), this._colorHover = this._color.clone().multiplyScalar(2), this._hovered = !1, this._highlight = !1, this._boxSize = o;
|
|
336
|
+
const c = new m(
|
|
337
|
+
0.01,
|
|
338
|
+
0.01,
|
|
339
|
+
e - o / 2,
|
|
340
|
+
13
|
|
341
|
+
);
|
|
342
|
+
this._lineMaterial = new f({
|
|
343
|
+
color: n,
|
|
344
|
+
depthTest: !1,
|
|
345
|
+
depthWrite: !1
|
|
436
346
|
});
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
this.
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Removes an object from the group.
|
|
456
|
-
* @param object - The object to remove.
|
|
457
|
-
* @returns The group instance.
|
|
458
|
-
*/
|
|
459
|
-
remove(e) {
|
|
460
|
-
const t = this._members.indexOf(e);
|
|
461
|
-
if (t === -1)
|
|
462
|
-
return this;
|
|
463
|
-
const s = this._lines[t];
|
|
464
|
-
return super.remove(s), this._lines.splice(t, 1), super.remove(e), this._members.splice(t, 1), this;
|
|
465
|
-
}
|
|
466
|
-
updateLineTo(e) {
|
|
467
|
-
const t = this._members.indexOf(e);
|
|
468
|
-
t !== -1 && this._updateLineTo(this._lines[t], e);
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* Creates a line for visualization.
|
|
472
|
-
*/
|
|
473
|
-
createLine() {
|
|
474
|
-
const e = new T(), t = new q({
|
|
475
|
-
color: 6710886,
|
|
476
|
-
dashSize: 0.05,
|
|
477
|
-
gapSize: 0.025
|
|
478
|
-
}), s = new X(e, t);
|
|
479
|
-
return s.visible = !1, s;
|
|
480
|
-
}
|
|
481
|
-
/**
|
|
482
|
-
* Updates a line to the object.
|
|
483
|
-
*/
|
|
484
|
-
_updateLineTo(e, t) {
|
|
485
|
-
const s = [
|
|
486
|
-
new m(0, 0, 0),
|
|
487
|
-
t.position.clone()
|
|
488
|
-
];
|
|
489
|
-
e.geometry.setFromPoints(s), e.computeLineDistances();
|
|
490
|
-
}
|
|
491
|
-
// public setBoundingBoxVisibility(visible: boolean): void {
|
|
492
|
-
// this._boxMesh.visible = visible;
|
|
493
|
-
// }
|
|
494
|
-
// /**
|
|
495
|
-
// * Recalculates the position of the group based on it's bounding box.
|
|
496
|
-
// * Children's world positions are kept.
|
|
497
|
-
// */
|
|
498
|
-
// private recalculatePosition(): void {
|
|
499
|
-
// // store all children's world positions
|
|
500
|
-
// const childrensWorldPositions: Vector3[] = this.children.map((child) => child.getWorldPosition(new Vector3()));
|
|
501
|
-
// // calculate new center and set it as the group's position
|
|
502
|
-
// const bbcenter = this.updateBB();
|
|
503
|
-
// this.position.copy(bbcenter);
|
|
504
|
-
// // set childrens's positions so their world positions are kept
|
|
505
|
-
// this.children.forEach((child, i) => {
|
|
506
|
-
// if (child.uuid === this._boxMesh.uuid) return;
|
|
507
|
-
// child.position.copy(this.worldToLocal(childrensWorldPositions[i]));
|
|
508
|
-
// });
|
|
509
|
-
// DIVECommunication.get(this.userData.id)?.performAction('UPDATE_OBJECT', { id: this.userData.id, position: this.position });
|
|
510
|
-
// }
|
|
511
|
-
// /**
|
|
512
|
-
// * Updates the bounding box of the group.
|
|
513
|
-
// * @returns {Vector3} The new center of the bounding box.
|
|
514
|
-
// */
|
|
515
|
-
// private updateBB(): Vector3 {
|
|
516
|
-
// this._boundingBox.makeEmpty();
|
|
517
|
-
// if (this.children.length === 1) {
|
|
518
|
-
// // because we always have the box mesh as 1 child
|
|
519
|
-
// return this.position.clone();
|
|
520
|
-
// }
|
|
521
|
-
// this.children.forEach((child) => {
|
|
522
|
-
// if (child.uuid === this._boxMesh.uuid) return;
|
|
523
|
-
// this._boundingBox.expandByObject(child);
|
|
524
|
-
// });
|
|
525
|
-
// return this._boundingBox.getCenter(new Vector3());
|
|
526
|
-
// }
|
|
527
|
-
// private updateBoxMesh(): void {
|
|
528
|
-
// if (this.children.length === 1) {
|
|
529
|
-
// // because we always have the box mesh as 1 child
|
|
530
|
-
// this._boxMesh.visible = false;
|
|
531
|
-
// return;
|
|
532
|
-
// }
|
|
533
|
-
// this._boxMesh.quaternion.copy(this.quaternion.clone().invert());
|
|
534
|
-
// this._boxMesh.scale.set(1 / this.scale.x, 1 / this.scale.y, 1 / this.scale.z);
|
|
535
|
-
// this._boxMesh.geometry = new BoxGeometry(this._boundingBox.max.x - this._boundingBox.min.x, this._boundingBox.max.y - this._boundingBox.min.y, this._boundingBox.max.z - this._boundingBox.min.z);
|
|
536
|
-
// this._boxMesh.visible = true;
|
|
537
|
-
// }
|
|
538
|
-
}
|
|
539
|
-
class ue extends E {
|
|
540
|
-
constructor() {
|
|
541
|
-
const e = new Z(1, 1);
|
|
542
|
-
e.scale(1e3, 1e3, 1), e.rotateX(-Math.PI / 2);
|
|
543
|
-
const t = new b({
|
|
544
|
-
color: new f(16777215),
|
|
545
|
-
side: M
|
|
347
|
+
const l = new _(c, this._lineMaterial);
|
|
348
|
+
l.layers.mask = d, l.renderOrder = 1 / 0, l.rotateX(Math.PI / 2), l.translateY(e / 2 - o / 4), this.add(l), this._box = new _(
|
|
349
|
+
new j(o, o, o),
|
|
350
|
+
this._lineMaterial
|
|
351
|
+
), this._box.layers.mask = d, this._box.renderOrder = 1 / 0, this._box.rotateX(Math.PI / 2), this._box.translateY(e - o / 2), this._box.rotateZ(a.x * Math.PI / 2), this._box.rotateX(a.z * Math.PI / 2), this.add(this._box);
|
|
352
|
+
const g = new m(
|
|
353
|
+
0.1,
|
|
354
|
+
0.1,
|
|
355
|
+
e + o / 2,
|
|
356
|
+
3
|
|
357
|
+
), E = new f({
|
|
358
|
+
color: 16711935,
|
|
359
|
+
transparent: !0,
|
|
360
|
+
opacity: 0.15,
|
|
361
|
+
depthTest: !1,
|
|
362
|
+
depthWrite: !1
|
|
546
363
|
});
|
|
547
|
-
|
|
548
|
-
r(this, "isDIVEFloor", !0);
|
|
549
|
-
this.name = "Floor", this.layers.mask = g, this.receiveShadow = !0;
|
|
364
|
+
this._colliderMesh = new _(g, E), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this._colliderMesh.rotateX(Math.PI / 2), this._colliderMesh.translateY(e / 2), this.add(this._colliderMesh), this.rotateX(a.y * -Math.PI / 2), this.rotateY(a.x * Math.PI / 2);
|
|
550
365
|
}
|
|
551
|
-
|
|
552
|
-
this.visible =
|
|
366
|
+
set debug(t) {
|
|
367
|
+
this._colliderMesh.visible = t;
|
|
553
368
|
}
|
|
554
|
-
|
|
555
|
-
this.
|
|
369
|
+
get highlight() {
|
|
370
|
+
return this._highlight;
|
|
556
371
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
constructor() {
|
|
560
|
-
super();
|
|
561
|
-
r(this, "isDIVERoot", !0);
|
|
562
|
-
r(this, "_floor");
|
|
563
|
-
r(this, "_assetLoader", null);
|
|
564
|
-
this.name = "Root", this._floor = new ue(), this.add(this._floor);
|
|
565
|
-
}
|
|
566
|
-
get floor() {
|
|
567
|
-
return this._floor;
|
|
568
|
-
}
|
|
569
|
-
async _getAssetLoader() {
|
|
570
|
-
return this._assetLoader || (this._assetLoader = new (await d("AssetLoader"))()), this._assetLoader;
|
|
571
|
-
}
|
|
572
|
-
computeSceneBB() {
|
|
573
|
-
const e = new V();
|
|
574
|
-
return this.children.forEach((t) => {
|
|
575
|
-
"isDIVEFloor" in t || t.traverse((s) => {
|
|
576
|
-
"isObject3D" in s && e.expandByObject(s);
|
|
577
|
-
});
|
|
578
|
-
}), e;
|
|
579
|
-
}
|
|
580
|
-
getSceneObject(e) {
|
|
581
|
-
let t;
|
|
582
|
-
return this.traverse((s) => {
|
|
583
|
-
t || s.userData.id === e.id && (t = s);
|
|
584
|
-
}), t;
|
|
585
|
-
}
|
|
586
|
-
addSceneObject(e) {
|
|
587
|
-
let t = this.getSceneObject(e);
|
|
588
|
-
if (t)
|
|
589
|
-
return console.warn(
|
|
590
|
-
`DIVERoot.addSceneObject: Scene object with id ${e.id} already exists`
|
|
591
|
-
), t;
|
|
592
|
-
switch (e.entityType) {
|
|
593
|
-
case "pov":
|
|
594
|
-
break;
|
|
595
|
-
case "light": {
|
|
596
|
-
switch (e.type) {
|
|
597
|
-
case "scene": {
|
|
598
|
-
t = new B();
|
|
599
|
-
break;
|
|
600
|
-
}
|
|
601
|
-
case "ambient": {
|
|
602
|
-
t = new he();
|
|
603
|
-
break;
|
|
604
|
-
}
|
|
605
|
-
case "point": {
|
|
606
|
-
t = new le();
|
|
607
|
-
break;
|
|
608
|
-
}
|
|
609
|
-
default:
|
|
610
|
-
throw new Error(
|
|
611
|
-
`DIVERoot.addSceneObject: Unknown light type: ${e.type}`
|
|
612
|
-
);
|
|
613
|
-
}
|
|
614
|
-
t.name = e.name, t.userData.id = e.id, this.add(t), this._updateLight(t, e);
|
|
615
|
-
break;
|
|
616
|
-
}
|
|
617
|
-
case "model": {
|
|
618
|
-
t = new k(), t.name = e.name, t.userData.id = e.id, t.userData.uri = e.uri, this.add(t), this._updateModel(t, e);
|
|
619
|
-
break;
|
|
620
|
-
}
|
|
621
|
-
case "primitive": {
|
|
622
|
-
t = new de(), t.name = e.name, t.userData.id = e.id, this.add(t), this._updatePrimitive(t, e);
|
|
623
|
-
break;
|
|
624
|
-
}
|
|
625
|
-
case "group": {
|
|
626
|
-
t = new ce(), t.name = e.name, t.userData.id = e.id, this.add(t), this._updateGroup(t, e);
|
|
627
|
-
break;
|
|
628
|
-
}
|
|
629
|
-
default:
|
|
630
|
-
throw new Error(
|
|
631
|
-
`DIVERoot.addSceneObject: Unknown entity type: ${e.entityType}`
|
|
632
|
-
);
|
|
633
|
-
}
|
|
634
|
-
return t;
|
|
372
|
+
set highlight(t) {
|
|
373
|
+
this._highlight = t, this._lineMaterial.color = this._highlight || this._hovered ? this._colorHover : this._color;
|
|
635
374
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
if (!t) {
|
|
639
|
-
console.warn(
|
|
640
|
-
`DIVERoot.updateSceneObject: Scene object with id ${e.id} does not exist`
|
|
641
|
-
);
|
|
642
|
-
return;
|
|
643
|
-
}
|
|
644
|
-
switch (e.entityType) {
|
|
645
|
-
case "pov":
|
|
646
|
-
break;
|
|
647
|
-
case "light": {
|
|
648
|
-
this._updateLight(t, e);
|
|
649
|
-
break;
|
|
650
|
-
}
|
|
651
|
-
case "model": {
|
|
652
|
-
this._updateModel(t, e);
|
|
653
|
-
break;
|
|
654
|
-
}
|
|
655
|
-
case "primitive": {
|
|
656
|
-
this._updatePrimitive(t, e);
|
|
657
|
-
break;
|
|
658
|
-
}
|
|
659
|
-
case "group": {
|
|
660
|
-
this._updateGroup(t, e);
|
|
661
|
-
break;
|
|
662
|
-
}
|
|
663
|
-
default:
|
|
664
|
-
throw new Error(
|
|
665
|
-
`DIVERoot.updateSceneObject: Unknown entity type: ${e.entityType}`
|
|
666
|
-
);
|
|
667
|
-
}
|
|
375
|
+
get forwardVector() {
|
|
376
|
+
return new h(0, 0, 1).applyQuaternion(this.quaternion).normalize();
|
|
668
377
|
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
if (!t) {
|
|
672
|
-
console.warn(
|
|
673
|
-
`DIVERoot.deleteSceneObject: Object with id ${e.id} not found`
|
|
674
|
-
);
|
|
675
|
-
return;
|
|
676
|
-
}
|
|
677
|
-
switch (e.entityType) {
|
|
678
|
-
case "pov":
|
|
679
|
-
break;
|
|
680
|
-
case "light": {
|
|
681
|
-
this._deleteLight(t);
|
|
682
|
-
break;
|
|
683
|
-
}
|
|
684
|
-
case "model": {
|
|
685
|
-
this._deleteModel(t);
|
|
686
|
-
break;
|
|
687
|
-
}
|
|
688
|
-
case "primitive": {
|
|
689
|
-
this._deletePrimitive(t);
|
|
690
|
-
break;
|
|
691
|
-
}
|
|
692
|
-
case "group": {
|
|
693
|
-
this._deleteGroup(t);
|
|
694
|
-
break;
|
|
695
|
-
}
|
|
696
|
-
default:
|
|
697
|
-
throw new Error(
|
|
698
|
-
`DIVERoot.deleteSceneObject: Unknown entity type: ${e.entityType}`
|
|
699
|
-
);
|
|
700
|
-
}
|
|
378
|
+
get rightVector() {
|
|
379
|
+
return new h(1, 0, 0).applyQuaternion(this.quaternion).normalize();
|
|
701
380
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
t.position.x,
|
|
705
|
-
t.position.y,
|
|
706
|
-
t.position.z
|
|
707
|
-
), t.intensity !== void 0 && t.intensity !== null && e.setIntensity(t.intensity), t.enabled !== void 0 && t.enabled !== null && e.setEnabled(t.enabled), t.color !== void 0 && t.color !== null && e.setColor(new f(t.color)), t.visible !== void 0 && t.visible !== null && (e.visible = t.visible), t.parentId !== void 0 && this._setParent({ ...t, parentId: t.parentId });
|
|
708
|
-
}
|
|
709
|
-
_updateModel(e, t) {
|
|
710
|
-
t.uri !== void 0 && e.setFromURL(t.uri), t.name !== void 0 && (e.name = t.name), t.position !== void 0 && e.setPosition(t.position), t.rotation !== void 0 && e.setRotation(t.rotation), t.scale !== void 0 && e.setScale(t.scale), t.visible !== void 0 && e.setVisibility(t.visible), t.material !== void 0 && e.setMaterial(t.material), t.parentId !== void 0 && this._setParent({ ...t, parentId: t.parentId });
|
|
711
|
-
}
|
|
712
|
-
_updatePrimitive(e, t) {
|
|
713
|
-
t.name !== void 0 && (e.name = t.name), t.geometry !== void 0 && e.setGeometry(t.geometry), t.position !== void 0 && e.setPosition(t.position), t.rotation !== void 0 && e.setRotation(t.rotation), t.scale !== void 0 && e.setScale(t.scale), t.visible !== void 0 && e.setVisibility(t.visible), t.material !== void 0 && e.setMaterial(t.material), t.parentId !== void 0 && this._setParent({ ...t, parentId: t.parentId });
|
|
714
|
-
}
|
|
715
|
-
_updateGroup(e, t) {
|
|
716
|
-
t.name !== void 0 && (e.name = t.name), t.position !== void 0 && e.setPosition(t.position), t.rotation !== void 0 && e.setRotation(t.rotation), t.scale !== void 0 && e.setScale(t.scale), t.visible !== void 0 && e.setVisibility(t.visible), t.bbVisible !== void 0 && e.setLinesVisibility(t.bbVisible), t.parentId !== void 0 && this._setParent({ ...t, parentId: t.parentId });
|
|
717
|
-
}
|
|
718
|
-
_deleteLight(e) {
|
|
719
|
-
this._detachTransformControls(e), e.parent.remove(e);
|
|
720
|
-
}
|
|
721
|
-
_deleteModel(e) {
|
|
722
|
-
this._detachTransformControls(e), e.parent.remove(e);
|
|
723
|
-
}
|
|
724
|
-
_deletePrimitive(e) {
|
|
725
|
-
this._detachTransformControls(e), e.parent.remove(e);
|
|
726
|
-
}
|
|
727
|
-
_deleteGroup(e) {
|
|
728
|
-
this._detachTransformControls(e);
|
|
729
|
-
for (let t = e.members.length - 1; t >= 0; t--)
|
|
730
|
-
this.attach(e.members[t]);
|
|
731
|
-
e.parent.remove(e);
|
|
732
|
-
}
|
|
733
|
-
_setParent(e) {
|
|
734
|
-
const t = this.getSceneObject(e);
|
|
735
|
-
if (e.parentId !== null) {
|
|
736
|
-
const s = this.getSceneObject({
|
|
737
|
-
id: e.parentId,
|
|
738
|
-
entityType: e.entityType
|
|
739
|
-
});
|
|
740
|
-
if (!s) return;
|
|
741
|
-
s.attach(t);
|
|
742
|
-
} else
|
|
743
|
-
this.attach(t);
|
|
744
|
-
}
|
|
745
|
-
_detachTransformControls(e) {
|
|
746
|
-
this._findScene(e).children.find((t) => {
|
|
747
|
-
"isTransformControls" in t && t.detach();
|
|
748
|
-
});
|
|
381
|
+
get upVector() {
|
|
382
|
+
return new h(0, 1, 0).applyQuaternion(this.quaternion).normalize();
|
|
749
383
|
}
|
|
750
|
-
|
|
751
|
-
|
|
384
|
+
reset() {
|
|
385
|
+
this._lineMaterial.color = this._color;
|
|
752
386
|
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
100,
|
|
761
|
-
me,
|
|
762
|
-
ge
|
|
387
|
+
update(t) {
|
|
388
|
+
this._box.scale.copy(
|
|
389
|
+
new h(1, 1, 1).sub(this.forwardVector).add(
|
|
390
|
+
// to then add ...
|
|
391
|
+
t.clone().multiply(this.forwardVector)
|
|
392
|
+
// that is scaled by the forward vector again to get the forward vector as the only direction
|
|
393
|
+
)
|
|
763
394
|
);
|
|
764
|
-
i.material.depthTest = !1, i.layers.mask = re, this.add(i);
|
|
765
395
|
}
|
|
766
|
-
|
|
767
|
-
this.
|
|
396
|
+
onPointerEnter() {
|
|
397
|
+
this._hovered = !0, this.parent && this.parent.onHoverAxis(this, !0);
|
|
768
398
|
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
constructor() {
|
|
772
|
-
super();
|
|
773
|
-
r(this, "_root");
|
|
774
|
-
r(this, "_grid");
|
|
775
|
-
this.background = new f(16777215), this._root = new _e(), this.add(this._root), this._grid = new fe(), this.add(this._grid);
|
|
776
|
-
}
|
|
777
|
-
get root() {
|
|
778
|
-
return this._root;
|
|
399
|
+
onPointerLeave() {
|
|
400
|
+
this._hovered = !1, this.parent && this.parent.onHoverAxis(this, !1);
|
|
779
401
|
}
|
|
780
|
-
|
|
781
|
-
|
|
402
|
+
onDragStart() {
|
|
403
|
+
this.parent && this.parent.onAxisDragStart(this);
|
|
782
404
|
}
|
|
783
|
-
|
|
784
|
-
this.
|
|
405
|
+
onDrag(t) {
|
|
406
|
+
this.parent && this.parent.onAxisDrag(this, t);
|
|
785
407
|
}
|
|
786
|
-
|
|
787
|
-
|
|
408
|
+
onDragEnd() {
|
|
409
|
+
this.parent && this.parent.onAxisDragEnd(this);
|
|
788
410
|
}
|
|
789
411
|
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
r(this, "_webglrenderer");
|
|
805
|
-
r(this, "_settings");
|
|
806
|
-
this._scene = i, this._camera = e, this._settings = {
|
|
807
|
-
...R,
|
|
808
|
-
...t ?? {}
|
|
809
|
-
}, this._webglrenderer = new L(this._settings), this._webglrenderer.shadowMap.enabled = this._settings.shadows, this._webglrenderer.shadowMap.type = this._settings.shadowQuality === "high" ? te : this._settings.shadowQuality === "medium" ? ie : se;
|
|
412
|
+
class q extends u {
|
|
413
|
+
constructor(t) {
|
|
414
|
+
super();
|
|
415
|
+
i(this, "isHoverable", !0);
|
|
416
|
+
i(this, "children");
|
|
417
|
+
i(this, "_controller");
|
|
418
|
+
i(this, "_startScale");
|
|
419
|
+
this.name = "DIVEScaleGizmo", this.children = [], this._startScale = null, this._controller = t, this.add(
|
|
420
|
+
new b("x", 1, new h(1, 0, 0), x)
|
|
421
|
+
), this.add(
|
|
422
|
+
new b("y", 1, new h(0, 1, 0), I)
|
|
423
|
+
), this.add(
|
|
424
|
+
new b("z", 1, new h(0, 0, 1), y)
|
|
425
|
+
);
|
|
810
426
|
}
|
|
811
|
-
|
|
812
|
-
|
|
427
|
+
set debug(t) {
|
|
428
|
+
this.children.forEach((e) => {
|
|
429
|
+
e.debug = t;
|
|
430
|
+
});
|
|
813
431
|
}
|
|
814
|
-
|
|
815
|
-
this.
|
|
432
|
+
reset() {
|
|
433
|
+
this.children.forEach((t) => {
|
|
434
|
+
t.reset();
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
update(t) {
|
|
438
|
+
this.children.forEach((e) => {
|
|
439
|
+
e.update(t);
|
|
440
|
+
});
|
|
816
441
|
}
|
|
817
|
-
|
|
818
|
-
this.
|
|
442
|
+
handleHighlight(t, e, a) {
|
|
443
|
+
this.children.forEach((n) => {
|
|
444
|
+
a ? n.highlight = n.axis === t && a : n.highlight = n.axis === t && e;
|
|
445
|
+
});
|
|
819
446
|
}
|
|
820
|
-
|
|
821
|
-
this.
|
|
447
|
+
onHoverAxis(t, e) {
|
|
448
|
+
this._startScale || this.parent && this.parent.parent && (this.parent.parent.onHover(
|
|
449
|
+
"translate",
|
|
450
|
+
t.axis,
|
|
451
|
+
e
|
|
452
|
+
), this.handleHighlight(t.axis, e, !1));
|
|
453
|
+
}
|
|
454
|
+
onAxisDragStart(t) {
|
|
455
|
+
if (!this.parent || !this.parent.parent) return;
|
|
456
|
+
const e = this.parent.parent.object;
|
|
457
|
+
e && (this._startScale = e.scale.clone(), this.handleHighlight(t.axis, !0, !0));
|
|
458
|
+
}
|
|
459
|
+
onAxisDrag(t, e) {
|
|
460
|
+
if (!this._startScale || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
|
|
461
|
+
const a = e.dragDelta.clone().projectOnVector(t.forwardVector);
|
|
462
|
+
this.parent.parent.onChange(
|
|
463
|
+
void 0,
|
|
464
|
+
void 0,
|
|
465
|
+
this._startScale.clone().add(a)
|
|
466
|
+
);
|
|
822
467
|
}
|
|
823
|
-
|
|
824
|
-
this.
|
|
468
|
+
onAxisDragEnd(t) {
|
|
469
|
+
this._startScale = null, this.handleHighlight(t.axis, !1, !1);
|
|
825
470
|
}
|
|
826
471
|
}
|
|
827
|
-
class
|
|
472
|
+
class Q extends u {
|
|
828
473
|
constructor() {
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
474
|
+
super();
|
|
475
|
+
i(this, "_meshX");
|
|
476
|
+
i(this, "_meshY");
|
|
477
|
+
i(this, "_meshZ");
|
|
478
|
+
this.name = "DIVEGizmoPlane";
|
|
479
|
+
const t = new f({
|
|
480
|
+
transparent: !0,
|
|
481
|
+
opacity: 0.15,
|
|
482
|
+
depthTest: !1,
|
|
483
|
+
depthWrite: !1,
|
|
484
|
+
side: 2
|
|
485
|
+
}), e = new D(100, 100, 2, 2), a = t.clone();
|
|
486
|
+
a.color.set(16711680), this._meshX = new _(e, a), this._meshX.layers.mask = d, this._meshX.rotateY(Math.PI / 2);
|
|
487
|
+
const n = new D(100, 100, 2, 2), o = t.clone();
|
|
488
|
+
o.color.set(65280), this._meshY = new _(n, o), this._meshY.layers.mask = d, this._meshY.rotateX(-Math.PI / 2);
|
|
489
|
+
const c = new D(100, 100, 2, 2), l = t.clone();
|
|
490
|
+
l.color.set(255), this._meshZ = new _(c, l), this._meshZ.layers.mask = d;
|
|
491
|
+
}
|
|
492
|
+
get XPlane() {
|
|
493
|
+
return this._meshX;
|
|
494
|
+
}
|
|
495
|
+
get YPlane() {
|
|
496
|
+
return this._meshY;
|
|
497
|
+
}
|
|
498
|
+
get ZPlane() {
|
|
499
|
+
return this._meshZ;
|
|
500
|
+
}
|
|
501
|
+
assemble(t, e) {
|
|
502
|
+
if (this.clear(), t === "translate" || t === "scale")
|
|
503
|
+
switch (e) {
|
|
504
|
+
case "x":
|
|
505
|
+
this.add(this._meshY), this.add(this._meshZ);
|
|
506
|
+
break;
|
|
507
|
+
case "y":
|
|
508
|
+
this.add(this._meshX), this.add(this._meshZ);
|
|
509
|
+
break;
|
|
510
|
+
case "z":
|
|
511
|
+
this.add(this._meshX), this.add(this._meshY);
|
|
512
|
+
break;
|
|
513
|
+
}
|
|
514
|
+
else if (t === "rotate")
|
|
515
|
+
switch (e) {
|
|
516
|
+
case "x":
|
|
517
|
+
this.add(this._meshX);
|
|
518
|
+
break;
|
|
519
|
+
case "y":
|
|
520
|
+
this.add(this._meshY);
|
|
521
|
+
break;
|
|
522
|
+
case "z":
|
|
523
|
+
this.add(this._meshZ);
|
|
524
|
+
break;
|
|
525
|
+
}
|
|
833
526
|
}
|
|
834
|
-
|
|
835
|
-
|
|
527
|
+
}
|
|
528
|
+
class B extends u {
|
|
529
|
+
constructor(t) {
|
|
530
|
+
super();
|
|
531
|
+
i(this, "_mode");
|
|
532
|
+
i(this, "_gizmoNode");
|
|
533
|
+
i(this, "_translateGizmo");
|
|
534
|
+
i(this, "_rotateGizmo");
|
|
535
|
+
i(this, "_scaleGizmo");
|
|
536
|
+
i(this, "_gizmoPlane");
|
|
537
|
+
// attachment stuff
|
|
538
|
+
i(this, "_object");
|
|
539
|
+
this.name = "DIVEGizmo", t.addEventListener("change", () => {
|
|
540
|
+
const e = t.getDistance() / 2.5;
|
|
541
|
+
this.scale.set(e, e, e);
|
|
542
|
+
}), this._mode = "translate", this._gizmoNode = new u(), this.add(this._gizmoNode), this._translateGizmo = new Z(t), this._rotateGizmo = new F(t), this._scaleGizmo = new q(t), this._gizmoPlane = new Q(), this._gizmoPlane.visible = !1, this._object = null;
|
|
836
543
|
}
|
|
837
|
-
|
|
838
|
-
this.
|
|
544
|
+
get mode() {
|
|
545
|
+
return this._mode;
|
|
839
546
|
}
|
|
840
|
-
|
|
841
|
-
this.
|
|
547
|
+
set mode(t) {
|
|
548
|
+
this._mode = t, this.assemble();
|
|
842
549
|
}
|
|
843
|
-
|
|
844
|
-
this.
|
|
550
|
+
set debug(t) {
|
|
551
|
+
this._translateGizmo.debug = t, this._rotateGizmo.debug = t, this._scaleGizmo.debug = t;
|
|
845
552
|
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
e !== -1 && this._tickers.splice(e, 1);
|
|
553
|
+
get gizmoNode() {
|
|
554
|
+
return this._gizmoNode;
|
|
849
555
|
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
var e;
|
|
853
|
-
return (e = i.dispose) == null ? void 0 : e.call(i);
|
|
854
|
-
}), this._tickers = [], this._isRunning = !1, this._lastTime = 0;
|
|
556
|
+
get gizmoPlane() {
|
|
557
|
+
return this._gizmoPlane;
|
|
855
558
|
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
if (!this._isRunning) return;
|
|
859
|
-
const e = (i - this._lastTime) / 1e3;
|
|
860
|
-
this._lastTime = i, this._tickers.forEach((s) => s.tick(e)), (t = this._renderer) == null || t.render(), requestAnimationFrame(this._tick.bind(this));
|
|
559
|
+
get object() {
|
|
560
|
+
return this._object;
|
|
861
561
|
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
constructor(i, e) {
|
|
865
|
-
r(this, "_resizeObserver");
|
|
866
|
-
r(this, "_width", 0);
|
|
867
|
-
r(this, "_height", 0);
|
|
868
|
-
this._resizeObserver = new ResizeObserver((t) => {
|
|
869
|
-
for (const s of t) {
|
|
870
|
-
const { width: o, height: a } = s.contentRect;
|
|
871
|
-
o === this._width && a === this._height || (i.onResize(o, a), e.onResize(o, a), this._width = o, this._height = a);
|
|
872
|
-
}
|
|
873
|
-
}), this._observeCanvas(i.webglrenderer.domElement);
|
|
562
|
+
attach(t) {
|
|
563
|
+
return this._object = t, this.assemble(), this;
|
|
874
564
|
}
|
|
875
|
-
|
|
876
|
-
this.
|
|
565
|
+
detach() {
|
|
566
|
+
return this._object = null, this.assemble(), this;
|
|
877
567
|
}
|
|
878
|
-
|
|
879
|
-
this.
|
|
568
|
+
onHover(t, e, a) {
|
|
569
|
+
a && this._gizmoPlane.assemble(t, e);
|
|
880
570
|
}
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
this._resizeObserver.observe(i.parentElement);
|
|
884
|
-
else {
|
|
885
|
-
const e = setInterval(() => {
|
|
886
|
-
i.parentElement && (this._resizeObserver.observe(i.parentElement), clearInterval(e));
|
|
887
|
-
}, 16);
|
|
888
|
-
}
|
|
571
|
+
onChange(t, e, a) {
|
|
572
|
+
this.object !== null && (t && (this.position.copy(t), this.object.position.copy(t)), e && this.object.rotation.copy(e), a && (this.object.scale.copy(a), this._scaleGizmo.update(a)));
|
|
889
573
|
}
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
autoStart: !0,
|
|
893
|
-
displayAxes: !1,
|
|
894
|
-
...oe,
|
|
895
|
-
...R
|
|
896
|
-
};
|
|
897
|
-
class be {
|
|
898
|
-
constructor(i) {
|
|
899
|
-
r(this, "_renderer");
|
|
900
|
-
r(this, "_scene");
|
|
901
|
-
r(this, "_camera");
|
|
902
|
-
r(this, "_resizeManager");
|
|
903
|
-
r(this, "_clock");
|
|
904
|
-
r(this, "_settings");
|
|
905
|
-
this._settings = {
|
|
906
|
-
...O,
|
|
907
|
-
...i ?? {}
|
|
908
|
-
}, this._scene = new pe(), this._camera = new ae(this._settings), this._renderer = new we(
|
|
909
|
-
this._scene,
|
|
910
|
-
this._camera,
|
|
911
|
-
this._settings
|
|
912
|
-
), this._resizeManager = new Ee(
|
|
913
|
-
this._renderer,
|
|
914
|
-
this._camera
|
|
915
|
-
), this._clock = new ye(), this._clock.setRenderer(this._renderer), this._settings.autoStart && this.start();
|
|
916
|
-
}
|
|
917
|
-
get scene() {
|
|
918
|
-
return this._scene;
|
|
919
|
-
}
|
|
920
|
-
get camera() {
|
|
921
|
-
return this._camera;
|
|
922
|
-
}
|
|
923
|
-
get renderer() {
|
|
924
|
-
return this._renderer;
|
|
925
|
-
}
|
|
926
|
-
setCanvas(i) {
|
|
927
|
-
this._renderer.setCanvas(i), this._resizeManager.setCanvas(i);
|
|
928
|
-
}
|
|
929
|
-
get clock() {
|
|
930
|
-
return this._clock;
|
|
931
|
-
}
|
|
932
|
-
start() {
|
|
933
|
-
this._clock.start();
|
|
934
|
-
}
|
|
935
|
-
stop() {
|
|
936
|
-
this._clock.stop();
|
|
937
|
-
}
|
|
938
|
-
dispose() {
|
|
939
|
-
this._clock.dispose(), this._resizeManager.dispose(), this._renderer.dispose();
|
|
574
|
+
assemble() {
|
|
575
|
+
this._gizmoNode.clear(), this._gizmoPlane.clear(), this._translateGizmo.reset(), this._rotateGizmo.reset(), this._scaleGizmo.reset(), this.object !== null && (this._mode === "translate" && this._gizmoNode.add(this._translateGizmo), this._mode === "rotate" && this._gizmoNode.add(this._rotateGizmo), this._mode === "scale" && this._gizmoNode.add(this._scaleGizmo), this.add(this._gizmoPlane));
|
|
940
576
|
}
|
|
941
577
|
}
|
|
942
|
-
|
|
943
|
-
const e = (n + "e").split("e");
|
|
944
|
-
return +(e[0] + "e" + (+e[1] + (i || 0)));
|
|
945
|
-
}
|
|
946
|
-
function ve(n, i = 0) {
|
|
947
|
-
const e = c(n, +i);
|
|
948
|
-
return c(Math.ceil(e), -i);
|
|
949
|
-
}
|
|
950
|
-
function De(n, i = 0) {
|
|
951
|
-
const e = c(n, +i);
|
|
952
|
-
return c(Math.floor(e), -i);
|
|
953
|
-
}
|
|
954
|
-
function A(n, i = 0) {
|
|
955
|
-
if (n < 0) return -A(-n, i);
|
|
956
|
-
const e = c(n, +i);
|
|
957
|
-
return c(Math.round(e), -i);
|
|
958
|
-
}
|
|
959
|
-
function Ie(n, i, e) {
|
|
960
|
-
return Math.atan2(
|
|
961
|
-
n.clone().cross(i).dot(e),
|
|
962
|
-
i.clone().dot(n)
|
|
963
|
-
);
|
|
964
|
-
}
|
|
965
|
-
function Se(n, i = 0) {
|
|
966
|
-
const e = c(n, +i);
|
|
967
|
-
return c(Math.round(e), -i).toFixed(i);
|
|
968
|
-
}
|
|
969
|
-
function Le(n, i = 0) {
|
|
970
|
-
const e = c(n, +i);
|
|
971
|
-
return c(Math.trunc(e), -i);
|
|
972
|
-
}
|
|
973
|
-
function xe(n) {
|
|
974
|
-
return (w.radToDeg(n) + 360) % 360;
|
|
975
|
-
}
|
|
976
|
-
function Ce(n) {
|
|
977
|
-
return w.degToRad(n);
|
|
978
|
-
}
|
|
979
|
-
const Ae = {
|
|
980
|
-
ceilExp: ve,
|
|
981
|
-
floorExp: De,
|
|
982
|
-
roundExp: A,
|
|
983
|
-
toFixedExp: Se,
|
|
984
|
-
truncateExp: Le,
|
|
985
|
-
signedAngleTo: Ie,
|
|
986
|
-
radToDeg: xe,
|
|
987
|
-
degToRad: Ce
|
|
988
|
-
};
|
|
989
|
-
window.DIVE = {
|
|
990
|
-
instances: [],
|
|
991
|
-
get instance() {
|
|
992
|
-
return window.DIVE.instances[0];
|
|
993
|
-
}
|
|
994
|
-
};
|
|
995
|
-
const Me = {
|
|
996
|
-
...O,
|
|
997
|
-
...U
|
|
998
|
-
};
|
|
999
|
-
class G {
|
|
1000
|
-
constructor(i) {
|
|
1001
|
-
// descriptive members
|
|
1002
|
-
r(this, "_instanceId", w.generateUUID());
|
|
1003
|
-
r(this, "_settings");
|
|
1004
|
-
r(this, "_engine");
|
|
1005
|
-
r(this, "orbitController");
|
|
1006
|
-
r(this, "axisCamera");
|
|
1007
|
-
this._settings = {
|
|
1008
|
-
...Me,
|
|
1009
|
-
...i ?? {}
|
|
1010
|
-
}, this._engine = new be(i), this.orbitController = new I(
|
|
1011
|
-
this._engine.camera,
|
|
1012
|
-
this._engine.renderer.webglrenderer.domElement,
|
|
1013
|
-
this._settings
|
|
1014
|
-
), this._engine.clock.addTicker(this.orbitController), this._settings.displayAxes ? (this.axisCamera = new W(
|
|
1015
|
-
this._engine.renderer,
|
|
1016
|
-
this._engine.scene,
|
|
1017
|
-
this._engine.camera
|
|
1018
|
-
), this._engine.clock.addTicker(this.axisCamera)) : this.axisCamera = null, import("./chunks/package-CIkS9WF6.mjs").then((e) => {
|
|
1019
|
-
console.log(
|
|
1020
|
-
`DIVE ${e.default.version} initialized successfully!`
|
|
1021
|
-
), console.log(`
|
|
1022
|
-
@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
|
|
1023
|
-
@@@@+-:::::::---------------------==------------------------------=#@@@@
|
|
1024
|
-
@@%=::::.......::---------------------------------------------------------+@@
|
|
1025
|
-
@@+:::...........::-----------------------------------------------------------#@@
|
|
1026
|
-
@@=:::.........::::::-------------------------------------------------------------%@
|
|
1027
|
-
@%:::.......:::::::-----------------------------------------------------------------#@
|
|
1028
|
-
@*:::.....:::::-----------------------------------------------------------------------*@
|
|
1029
|
-
@%::::::.::::---------------------------------------------------------------------------@@
|
|
1030
|
-
@@-:::::::::-----------------------------------------------------------------------------=@
|
|
1031
|
-
@%::::::::--------------------------------------------------------------------------------%@
|
|
1032
|
-
@+::::::::--------------------------------=@@@@@%-----------------------------------------%@
|
|
1033
|
-
@=:::::::--------------------------------*@@ @@+---------------------------------------#@
|
|
1034
|
-
@+:::::::-------------------------------*@ @*--------------------------------------%@
|
|
1035
|
-
@#::::::::-----------------------------=@@ @@=-------------------------------------%@
|
|
1036
|
-
@@-::::::::----------------------------@@ @@------------------------------------=@
|
|
1037
|
-
@%:::::::::--------------------------*@ @*-----------------------------------@@
|
|
1038
|
-
@*:::::::::-------------------------@@ @@----------------------------------%@
|
|
1039
|
-
@#::::::::::----------------------%@ @%--------------------------------%@
|
|
1040
|
-
@#:::::::::::-------------------=@@ @@=------------------------------%@
|
|
1041
|
-
@@-::::::::::::----------------%@ @%----------------------------=@@
|
|
1042
|
-
@@#::::::::::::::------------*@ @*--------------------------#@@
|
|
1043
|
-
@@+::::::::::::::::--------@@ @@------------------------+@@
|
|
1044
|
-
@@*:::::::::::::::::----@@ @@---------------------+@@
|
|
1045
|
-
@@@-:::::::::::::::--#@ @#-----------------=%@@
|
|
1046
|
-
@@%-::::::::::::-%@ @%-------------=%@@
|
|
1047
|
-
@@@@+:::::::#@@ @@*-------*@@@@
|
|
1048
|
-
@@@@@@@ @@@@@@
|
|
1049
|
-
|
|
1050
|
-
`);
|
|
1051
|
-
}), window.DIVE.instances.push(this);
|
|
1052
|
-
}
|
|
1053
|
-
// static members
|
|
1054
|
-
static async QuickView(i, e) {
|
|
1055
|
-
const t = new G(e);
|
|
1056
|
-
t.engine.scene.background = new f(16777215), t.engine.scene.grid.setVisibility(!1), t.engine.scene.root.floor.setVisibility(!0), t.engine.camera.position.set(0, 2, 2), t.orbitController.target.set(0, 0.5, 0);
|
|
1057
|
-
const s = new B();
|
|
1058
|
-
s.name = "SceneLight", s.userData.id = w.generateUUID(), s.setEnabled(!0), s.visible = !0, s.setIntensity((e == null ? void 0 : e.lightIntensity) ?? 1), s.setColor(new f(16777215)), t.engine.scene.root.add(s);
|
|
1059
|
-
const o = new k();
|
|
1060
|
-
o.name = "object", o.userData.id = w.generateUUID(), o.userData.uri = i, o.visible = !0, t.engine.scene.root.add(o), await o.setFromURL(i);
|
|
1061
|
-
const a = t.engine.scene.computeSceneBB(), h = t.orbitController.computeEncompassingView(a);
|
|
1062
|
-
return t.engine.camera.position.copy(h.position), t.orbitController.target.copy(h.target), t;
|
|
1063
|
-
}
|
|
1064
|
-
get engine() {
|
|
1065
|
-
return this._engine;
|
|
1066
|
-
}
|
|
1067
|
-
get canvas() {
|
|
1068
|
-
return this._engine.renderer.webglrenderer.domElement;
|
|
1069
|
-
}
|
|
1070
|
-
setCanvas(i) {
|
|
1071
|
-
this._engine.setCanvas(i), this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.orbitController = new I(
|
|
1072
|
-
this._engine.camera,
|
|
1073
|
-
i,
|
|
1074
|
-
this._settings
|
|
1075
|
-
), this._engine.clock.addTicker(this.orbitController);
|
|
1076
|
-
}
|
|
1077
|
-
async dispose() {
|
|
1078
|
-
return new Promise((i) => {
|
|
1079
|
-
this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.axisCamera && (this._engine.clock.removeTicker(this.axisCamera), this.axisCamera.dispose()), window.DIVE.instances = window.DIVE.instances.filter(
|
|
1080
|
-
(e) => e._instanceId !== this._instanceId
|
|
1081
|
-
), i();
|
|
1082
|
-
});
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
class Ge {
|
|
578
|
+
class J {
|
|
1086
579
|
constructor() {
|
|
1087
|
-
|
|
580
|
+
i(this, "isMovable", !0);
|
|
1088
581
|
}
|
|
1089
582
|
}
|
|
1090
|
-
class
|
|
583
|
+
class $ {
|
|
1091
584
|
constructor() {
|
|
1092
|
-
|
|
585
|
+
i(this, "isSelectable", !0);
|
|
1093
586
|
}
|
|
1094
587
|
}
|
|
1095
|
-
const
|
|
1096
|
-
if (Object.keys(
|
|
588
|
+
const V = (r, s) => {
|
|
589
|
+
if (Object.keys(r).length === 0 && Object.keys(s).length === 0)
|
|
1097
590
|
return {};
|
|
1098
|
-
if (typeof
|
|
1099
|
-
return
|
|
1100
|
-
let
|
|
1101
|
-
return Object.keys(
|
|
1102
|
-
if (!Object.keys(
|
|
1103
|
-
|
|
591
|
+
if (typeof r != "object" || typeof s != "object")
|
|
592
|
+
return s;
|
|
593
|
+
let t = {};
|
|
594
|
+
return Object.keys(s).forEach((e) => {
|
|
595
|
+
if (!Object.keys(r).includes(e)) {
|
|
596
|
+
t = { ...t, [e]: s[e] };
|
|
1104
597
|
return;
|
|
1105
598
|
}
|
|
1106
|
-
if (Array.isArray(
|
|
1107
|
-
if (!Array.isArray(
|
|
1108
|
-
|
|
599
|
+
if (Array.isArray(s[e])) {
|
|
600
|
+
if (!Array.isArray(r[e])) {
|
|
601
|
+
t = { ...t, [e]: s[e] };
|
|
1109
602
|
return;
|
|
1110
603
|
}
|
|
1111
|
-
const
|
|
1112
|
-
if (
|
|
1113
|
-
|
|
604
|
+
const a = r[e], n = s[e];
|
|
605
|
+
if (a.length === 0 && n.length === 0) {
|
|
606
|
+
t = { ...t };
|
|
1114
607
|
return;
|
|
1115
608
|
}
|
|
1116
|
-
if (
|
|
1117
|
-
|
|
609
|
+
if (a.length !== n.length) {
|
|
610
|
+
t = { ...t, [e]: s[e] };
|
|
1118
611
|
return;
|
|
1119
612
|
}
|
|
1120
|
-
const
|
|
1121
|
-
if (
|
|
1122
|
-
const
|
|
1123
|
-
|
|
1124
|
-
|
|
613
|
+
const o = [];
|
|
614
|
+
if (n.forEach((c, l) => {
|
|
615
|
+
const g = V(
|
|
616
|
+
a[l],
|
|
617
|
+
n[l]
|
|
1125
618
|
);
|
|
1126
|
-
Object.keys(
|
|
1127
|
-
}), Object.keys(
|
|
1128
|
-
|
|
619
|
+
Object.keys(g).length && o.push(n[l]);
|
|
620
|
+
}), Object.keys(o).length) {
|
|
621
|
+
t = { ...t, [e]: o };
|
|
1129
622
|
return;
|
|
1130
623
|
}
|
|
1131
624
|
return;
|
|
1132
625
|
}
|
|
1133
|
-
if (typeof
|
|
1134
|
-
if (typeof
|
|
1135
|
-
|
|
626
|
+
if (typeof s[e] == "object") {
|
|
627
|
+
if (typeof r[e] != "object") {
|
|
628
|
+
t = { ...t, [e]: s[e] };
|
|
1136
629
|
return;
|
|
1137
630
|
}
|
|
1138
|
-
const
|
|
1139
|
-
|
|
1140
|
-
|
|
631
|
+
const a = V(
|
|
632
|
+
r[e],
|
|
633
|
+
s[e]
|
|
1141
634
|
);
|
|
1142
|
-
if (Object.keys(
|
|
1143
|
-
|
|
635
|
+
if (Object.keys(a).length) {
|
|
636
|
+
t = { ...t, [e]: a };
|
|
1144
637
|
return;
|
|
1145
638
|
}
|
|
1146
639
|
}
|
|
1147
|
-
|
|
1148
|
-
}),
|
|
640
|
+
r[e] !== s[e] && (t = { ...t, [e]: s[e] });
|
|
641
|
+
}), t;
|
|
1149
642
|
};
|
|
1150
|
-
function
|
|
1151
|
-
return
|
|
1152
|
-
Object.getOwnPropertyNames(
|
|
1153
|
-
if (
|
|
643
|
+
function tt(r, s) {
|
|
644
|
+
return s.forEach((t) => {
|
|
645
|
+
Object.getOwnPropertyNames(t.prototype).forEach((a) => {
|
|
646
|
+
if (a === "constructor")
|
|
1154
647
|
return;
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1157
|
-
|
|
648
|
+
const n = Object.getOwnPropertyDescriptor(
|
|
649
|
+
t.prototype,
|
|
650
|
+
a
|
|
1158
651
|
);
|
|
1159
|
-
Object.defineProperty(
|
|
652
|
+
Object.defineProperty(r.prototype, a, n);
|
|
1160
653
|
});
|
|
1161
|
-
const
|
|
1162
|
-
Object.getOwnPropertyNames(
|
|
1163
|
-
const
|
|
1164
|
-
|
|
1165
|
-
|
|
654
|
+
const e = new t();
|
|
655
|
+
Object.getOwnPropertyNames(e).forEach((a) => {
|
|
656
|
+
const n = Object.getOwnPropertyDescriptor(
|
|
657
|
+
e,
|
|
658
|
+
a
|
|
1166
659
|
);
|
|
1167
|
-
Object.defineProperty(
|
|
660
|
+
Object.defineProperty(r.prototype, a, n);
|
|
1168
661
|
});
|
|
1169
|
-
}),
|
|
662
|
+
}), r;
|
|
663
|
+
}
|
|
664
|
+
function et(r) {
|
|
665
|
+
return r.entityType === "group";
|
|
666
|
+
}
|
|
667
|
+
function rt(r) {
|
|
668
|
+
return r.entityType === "light";
|
|
669
|
+
}
|
|
670
|
+
function it(r) {
|
|
671
|
+
return r.entityType === "primitive";
|
|
1170
672
|
}
|
|
1171
673
|
export {
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
674
|
+
y as AxesColorBlue,
|
|
675
|
+
nt as AxesColorBlueLetter,
|
|
676
|
+
I as AxesColorGreen,
|
|
677
|
+
ot as AxesColorGreenLetter,
|
|
678
|
+
x as AxesColorRed,
|
|
679
|
+
ht as AxesColorRedLetter,
|
|
680
|
+
jt as COORDINATE_LAYER_MASK,
|
|
681
|
+
Ot as DEFAULT_LAYER_MASK,
|
|
682
|
+
lt as DIVE,
|
|
683
|
+
ct as DIVEAmbientLight,
|
|
684
|
+
dt as DIVEClock,
|
|
685
|
+
_t as DIVEDefaultSettings,
|
|
686
|
+
pt as DIVEEngine,
|
|
687
|
+
ut as DIVEFloor,
|
|
688
|
+
B as DIVEGizmo,
|
|
689
|
+
gt as DIVEGrid,
|
|
690
|
+
ft as DIVEGroup,
|
|
691
|
+
N as DIVEMath,
|
|
692
|
+
mt as DIVEModel,
|
|
693
|
+
J as DIVEMovable,
|
|
694
|
+
Et as DIVENode,
|
|
695
|
+
Rt as DIVEPerspectiveCamera,
|
|
696
|
+
Tt as DIVEPerspectiveCameraDefaultSettings,
|
|
697
|
+
Dt as DIVEPointLight,
|
|
698
|
+
Mt as DIVEPrimitive,
|
|
699
|
+
wt as DIVERenderPipeline,
|
|
700
|
+
bt as DIVERenderPipelineDefaultSettings,
|
|
701
|
+
xt as DIVEResizeManager,
|
|
702
|
+
It as DIVERoot,
|
|
703
|
+
yt as DIVEScene,
|
|
704
|
+
Pt as DIVESceneLight,
|
|
705
|
+
$ as DIVESelectable,
|
|
706
|
+
Ht as EngineDefaultSettings,
|
|
707
|
+
Vt as FILE_TYPES,
|
|
708
|
+
Wt as FileTypeError,
|
|
709
|
+
zt as GRID_CENTER_LINE_COLOR,
|
|
710
|
+
vt as GRID_SIDE_LINE_COLOR,
|
|
711
|
+
Yt as HELPER_LAYER_MASK,
|
|
712
|
+
Xt as NetworkError,
|
|
713
|
+
Lt as PRODUCT_LAYER_MASK,
|
|
714
|
+
kt as ParseError,
|
|
715
|
+
Gt as SUPPORTED_FILE_TYPES,
|
|
716
|
+
d as UI_LAYER_MASK,
|
|
717
|
+
tt as applyMixins,
|
|
718
|
+
qt as findInterface,
|
|
719
|
+
St as findSceneRecursive,
|
|
720
|
+
Nt as getFileTypeFromUri,
|
|
721
|
+
V as getObjectDelta,
|
|
722
|
+
Qt as implementsInterface,
|
|
723
|
+
Ft as isFileTypeSupported,
|
|
724
|
+
et as isGroupSchema,
|
|
725
|
+
rt as isLightSchema,
|
|
726
|
+
Bt as isModelSchema,
|
|
727
|
+
Jt as isPovSchema,
|
|
728
|
+
it as isPrimitiveSchema
|
|
1201
729
|
};
|