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