@shopware-ag/dive 2.0.1-beta.10 → 2.0.1-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/chunks/{AssetCache-CZV5A70i.mjs → AssetCache-CsfCIl9J.mjs} +1 -1
- package/build/chunks/{AssetCache-C-7MpNrK.cjs → AssetCache-DGLqbo2B.cjs} +1 -1
- package/build/chunks/{AssetLoader-Dnh5tbUZ.mjs → AssetLoader-DvF8gL8a.mjs} +2 -2
- package/build/chunks/{AssetLoader-BZlqXTbf.cjs → AssetLoader-H_GSIMop.cjs} +1 -1
- package/build/chunks/FileTypes-CHutqD19.cjs +30 -0
- package/build/chunks/{FileTypes-DMybIHHj.mjs → FileTypes-IBuu9ohV.mjs} +153 -205
- package/build/chunks/OrbitController-BQ6SV1O_.mjs +1159 -0
- package/build/chunks/OrbitController-CpFQ3A1H.cjs +1 -0
- package/build/chunks/PerspectiveCamera-BByyG5R4.cjs +1 -0
- package/build/chunks/PerspectiveCamera-PMJPzAn3.mjs +34 -0
- package/build/chunks/{SelectTool-D5QfT5rr.mjs → SelectTool-BU0vTDXg.mjs} +4 -4
- package/build/chunks/SelectTool-CAqDMcoM.cjs +1 -0
- package/build/chunks/VisibilityLayerMask-BI7jPKdx.cjs +1 -0
- package/build/chunks/VisibilityLayerMask-CXgt1fJc.mjs +8 -0
- package/build/chunks/package-CmvmIjT5.cjs +1 -0
- package/build/chunks/package-DSKqbNMb.mjs +39 -0
- package/build/dive.cjs +1 -1
- package/build/dive.mjs +55 -53
- package/build/plugins/ar/index.cjs +1 -1
- package/build/plugins/ar/index.mjs +1 -1
- package/build/plugins/assetcache/index.cjs +1 -1
- package/build/plugins/assetcache/index.mjs +1 -1
- package/build/plugins/assetloader/index.cjs +1 -1
- package/build/plugins/assetloader/index.mjs +1 -1
- package/build/plugins/mediacreator/index.cjs +1 -1
- package/build/plugins/mediacreator/index.mjs +1 -1
- package/build/plugins/orbitcontroller/index.cjs +1 -1
- package/build/plugins/orbitcontroller/index.mjs +1 -1
- package/build/plugins/orientationdisplay/index.cjs +1 -0
- package/build/plugins/orientationdisplay/index.d.ts +2 -0
- package/build/plugins/orientationdisplay/index.mjs +5 -0
- package/build/plugins/state/index.cjs +3 -3
- package/build/plugins/state/index.mjs +353 -352
- package/build/plugins/toolbox/index.cjs +1 -1
- package/build/plugins/toolbox/index.mjs +12 -12
- package/build/src/components/boundingbox/BoundingBox.d.ts +136 -0
- package/build/src/core/Dive.d.ts +1 -1
- package/build/src/plugins/orbitcontroller/src/OrbitController.d.ts +17 -2
- package/build/src/plugins/orientationdisplay/index.d.ts +2 -0
- package/build/src/plugins/{axiscamera/src/AxisCamera.d.ts → orientationdisplay/src/OrientationDisplay.d.ts} +5 -5
- package/build/src/plugins/orientationdisplay/src/axes/Axes.d.ts +6 -0
- package/build/src/plugins/state/src/actions/toolbox/setgizmovisible.d.ts +2 -2
- package/build/src/plugins/toolbox/src/Toolbox.d.ts +1 -1
- package/build/src/plugins/toolbox/src/transform/TransformTool.d.ts +1 -1
- package/package.json +6 -6
- package/build/chunks/FileTypes-PEcAgRZ8.cjs +0 -30
- package/build/chunks/OrbitController-D-WNei2f.mjs +0 -940
- package/build/chunks/OrbitController-rMX8EHvJ.cjs +0 -1
- package/build/chunks/PerspectiveCamera-CONx93im.cjs +0 -1
- package/build/chunks/PerspectiveCamera-DUiWJJIj.mjs +0 -38
- package/build/chunks/SelectTool-BVxDEcnM.cjs +0 -1
- package/build/chunks/package-Bf92jAR_.cjs +0 -1
- package/build/chunks/package-ZPbjnXun.mjs +0 -39
- package/build/plugins/axiscamera/index.cjs +0 -1
- package/build/plugins/axiscamera/index.d.ts +0 -2
- package/build/plugins/axiscamera/index.mjs +0 -4
- package/build/src/plugins/axiscamera/index.d.ts +0 -1
|
@@ -1,46 +1,62 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var s = (o, i, e) =>
|
|
4
|
-
import { O as
|
|
5
|
-
import {
|
|
1
|
+
var z = Object.defineProperty;
|
|
2
|
+
var F = (o, i, e) => i in o ? z(o, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[i] = e;
|
|
3
|
+
var s = (o, i, e) => F(o, typeof i != "symbol" ? i + "" : i, e);
|
|
4
|
+
import { D as v, O as U, B as H, a as I } from "./OrbitController-BQ6SV1O_.mjs";
|
|
5
|
+
import { Object3D as g, AxesHelper as W, Color as l, Matrix4 as Y, OrthographicCamera as $, MathUtils as w, Vector4 as N, AmbientLight as J, PointLight as K, SphereGeometry as C, MeshBasicMaterial as Q, FrontSide as k, Mesh as b, HemisphereLight as q, DirectionalLight as X, MeshStandardMaterial as D, Vector3 as m, Raycaster as S, CylinderGeometry as Z, BufferGeometry as V, BufferAttribute as x, BoxGeometry as f, ConeGeometry as j, LineDashedMaterial as ee, Line as te, PlaneGeometry as ie, Box3 as se, GridHelper as re, Scene as ne, WebGLRenderer as L, PCFSoftShadowMap as oe, PCFShadowMap as ae, BasicShadowMap as he } from "three";
|
|
6
|
+
import { C as p, P as _, U as le, H as de } from "./VisibilityLayerMask-CXgt1fJc.mjs";
|
|
7
|
+
import { a as ce, D as _e } from "./PerspectiveCamera-PMJPzAn3.mjs";
|
|
6
8
|
import y from "three-spritetext";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
s(this, "_renderer");
|
|
13
|
-
s(this, "_scene");
|
|
14
|
-
s(this, "_camera");
|
|
15
|
-
s(this, "_restoreViewport", new Y());
|
|
16
|
-
this.layers.mask = p, this.axesHelper = new J(0.5), this.axesHelper.layers.mask = p, this.axesHelper.material.depthTest = !1, this.axesHelper.position.set(0, 0, -1), this.axesHelper.setColors(
|
|
17
|
-
new l(Le),
|
|
9
|
+
class ue extends g {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
s(this, "_axesHelper");
|
|
13
|
+
this._axesHelper = new W(0.5), this._axesHelper.layers.mask = p, this._axesHelper.material.depthTest = !1, this._axesHelper.position.set(0, 0, -1), this._axesHelper.setColors(
|
|
18
14
|
new l(Se),
|
|
19
|
-
new l(
|
|
15
|
+
new l(Ve),
|
|
16
|
+
new l(Me)
|
|
20
17
|
);
|
|
21
|
-
const
|
|
22
|
-
|
|
18
|
+
const e = new y("X", 0.2, R), t = new y("Y", 0.2, G), r = new y("Z", 0.2, A);
|
|
19
|
+
e.layers.mask = p, t.layers.mask = p, r.layers.mask = p, e.position.set(0.7, 0, 0), t.position.set(0, 0.7, 0), r.position.set(0, 0, 0.7), this._axesHelper.add(e), this._axesHelper.add(t), this._axesHelper.add(r);
|
|
20
|
+
}
|
|
21
|
+
setFromCameraMatrix(e) {
|
|
22
|
+
this._axesHelper.rotation.setFromRotationMatrix(
|
|
23
|
+
new Y().extractRotation(e).invert()
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
class me {
|
|
28
|
+
constructor(i, e, t) {
|
|
29
|
+
s(this, "uuid", w.generateUUID());
|
|
30
|
+
s(this, "_axes");
|
|
31
|
+
s(this, "_orthographicCamera");
|
|
32
|
+
s(this, "_restoreViewport", new N());
|
|
33
|
+
this._renderer = i, this._scene = e, this._camera = t, this._orthographicCamera = new $(
|
|
34
|
+
-1,
|
|
35
|
+
1,
|
|
36
|
+
1,
|
|
37
|
+
-1,
|
|
38
|
+
0.1,
|
|
39
|
+
100
|
|
40
|
+
), this._orthographicCamera.layers.mask = p, this._scene.add(this._orthographicCamera), this._axes = new ue(), this._scene.add(this._axes);
|
|
23
41
|
}
|
|
24
42
|
tick() {
|
|
25
|
-
const
|
|
26
|
-
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(
|
|
43
|
+
const i = this._scene.background;
|
|
44
|
+
this._scene.background = null, this._renderer.webglrenderer.getViewport(this._restoreViewport), this._renderer.webglrenderer.setViewport(0, 0, 150, 150), this._renderer.webglrenderer.autoClear = !1, this._axes.setFromCameraMatrix(this._camera.matrix), this._renderer.webglrenderer.render(
|
|
45
|
+
this._scene,
|
|
46
|
+
this._orthographicCamera
|
|
47
|
+
), this._renderer.webglrenderer.setViewport(this._restoreViewport), this._renderer.webglrenderer.autoClear = !0, this._scene.background = i;
|
|
27
48
|
}
|
|
28
49
|
dispose() {
|
|
29
|
-
this._scene.remove(this);
|
|
30
|
-
}
|
|
31
|
-
setFromCameraMatrix(e) {
|
|
32
|
-
this.axesHelper.rotation.setFromRotationMatrix(
|
|
33
|
-
new N().extractRotation(e).invert()
|
|
34
|
-
);
|
|
50
|
+
this._scene.remove(this._axes), this._scene.remove(this._orthographicCamera);
|
|
35
51
|
}
|
|
36
52
|
}
|
|
37
|
-
class
|
|
53
|
+
class ge extends g {
|
|
38
54
|
constructor() {
|
|
39
55
|
super();
|
|
40
56
|
s(this, "isDIVELight", !0);
|
|
41
57
|
s(this, "isDIVEAmbientLight", !0);
|
|
42
58
|
s(this, "_light");
|
|
43
|
-
this.name = "DIVEAmbientLight", this._light = new
|
|
59
|
+
this.name = "DIVEAmbientLight", this._light = new J(16777215, 1), this._light.layers.mask = _, this.add(this._light);
|
|
44
60
|
}
|
|
45
61
|
setColor(e) {
|
|
46
62
|
this._light.color = e;
|
|
@@ -52,7 +68,7 @@ class _e extends g {
|
|
|
52
68
|
this._light.visible = e;
|
|
53
69
|
}
|
|
54
70
|
}
|
|
55
|
-
class
|
|
71
|
+
class pe extends g {
|
|
56
72
|
constructor() {
|
|
57
73
|
super();
|
|
58
74
|
s(this, "isDIVELight", !0);
|
|
@@ -63,7 +79,7 @@ class me extends g {
|
|
|
63
79
|
s(this, "light");
|
|
64
80
|
s(this, "mesh");
|
|
65
81
|
this.name = "DIVEPointLight", this.light = new K(16777215, 1), this.light.layers.mask = _, this.light.castShadow = !0, this.light.shadow.mapSize.width = 512, this.light.shadow.mapSize.height = 512, this.add(this.light);
|
|
66
|
-
const e = 0.1, t = new
|
|
82
|
+
const e = 0.1, t = new C(
|
|
67
83
|
e,
|
|
68
84
|
e * 320,
|
|
69
85
|
e * 320
|
|
@@ -71,9 +87,9 @@ class me extends g {
|
|
|
71
87
|
color: this.light.color,
|
|
72
88
|
transparent: !0,
|
|
73
89
|
opacity: 0.8,
|
|
74
|
-
side:
|
|
90
|
+
side: k
|
|
75
91
|
});
|
|
76
|
-
this.mesh = new b(t, r), this.mesh.layers.mask =
|
|
92
|
+
this.mesh = new b(t, r), this.mesh.layers.mask = le, this.add(this.mesh);
|
|
77
93
|
}
|
|
78
94
|
setColor(e) {
|
|
79
95
|
this.light.color = e, this.mesh.material.color = e;
|
|
@@ -132,77 +148,7 @@ class M extends g {
|
|
|
132
148
|
}
|
|
133
149
|
}
|
|
134
150
|
const E = (o) => o.parent ? E(o.parent) : o;
|
|
135
|
-
class
|
|
136
|
-
constructor() {
|
|
137
|
-
super();
|
|
138
|
-
s(this, "isSelectable", !0);
|
|
139
|
-
s(this, "isMovable", !0);
|
|
140
|
-
s(this, "isDIVENode", !0);
|
|
141
|
-
s(this, "gizmo", null);
|
|
142
|
-
s(this, "_positionWorldBuffer");
|
|
143
|
-
s(this, "_boundingBox");
|
|
144
|
-
this.layers.mask = _, this._positionWorldBuffer = new u(), this._boundingBox = new k();
|
|
145
|
-
}
|
|
146
|
-
setPosition(e) {
|
|
147
|
-
if (!this.parent) {
|
|
148
|
-
this.position.set(e.x, e.y, e.z);
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
const t = new u(e.x, e.y, e.z);
|
|
152
|
-
this.position.copy(this.parent.worldToLocal(t)), "isDIVEGroup" in this.parent && this.parent.updateLineTo(this);
|
|
153
|
-
}
|
|
154
|
-
setRotation(e) {
|
|
155
|
-
this.rotation.set(e.x, e.y, e.z);
|
|
156
|
-
}
|
|
157
|
-
setScale(e) {
|
|
158
|
-
this.scale.set(e.x, e.y, e.z);
|
|
159
|
-
}
|
|
160
|
-
setVisibility(e) {
|
|
161
|
-
this.visible = e;
|
|
162
|
-
}
|
|
163
|
-
setToWorldOrigin() {
|
|
164
|
-
this.position.set(0, 0, 0), import("../plugins/state/index.mjs").then(({ State: e }) => {
|
|
165
|
-
var t;
|
|
166
|
-
(t = e.get(this.userData.id)) == null || t.performAction("UPDATE_OBJECT", {
|
|
167
|
-
id: this.userData.id,
|
|
168
|
-
position: this.getWorldPosition(this._positionWorldBuffer),
|
|
169
|
-
rotation: this.rotation,
|
|
170
|
-
scale: this.scale
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Can be called when the object is moved from a foreign object (gizmo, parent, etc.) to update the object's position.
|
|
176
|
-
*/
|
|
177
|
-
onMove() {
|
|
178
|
-
import("../plugins/state/index.mjs").then(({ State: e }) => {
|
|
179
|
-
var t;
|
|
180
|
-
(t = e.get(this.userData.id)) == null || t.performAction("UPDATE_OBJECT", {
|
|
181
|
-
id: this.userData.id,
|
|
182
|
-
position: this.getWorldPosition(this._positionWorldBuffer),
|
|
183
|
-
rotation: this.rotation,
|
|
184
|
-
scale: this.scale
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
onSelect() {
|
|
189
|
-
import("../plugins/state/index.mjs").then(({ State: e }) => {
|
|
190
|
-
var t;
|
|
191
|
-
(t = e.get(this.userData.id)) == null || t.performAction("SELECT_OBJECT", {
|
|
192
|
-
id: this.userData.id
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
onDeselect() {
|
|
197
|
-
import("../plugins/state/index.mjs").then(({ State: e }) => {
|
|
198
|
-
var t;
|
|
199
|
-
(t = e.get(this.userData.id)) == null || t.performAction("DESELECT_OBJECT", {
|
|
200
|
-
id: this.userData.id
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
class T extends D {
|
|
151
|
+
class B extends v {
|
|
206
152
|
constructor() {
|
|
207
153
|
super(...arguments);
|
|
208
154
|
s(this, "isDIVEModel", !0);
|
|
@@ -228,16 +174,16 @@ class T extends D {
|
|
|
228
174
|
}), this.add(e);
|
|
229
175
|
}
|
|
230
176
|
setMaterial(e) {
|
|
231
|
-
this._material || (this._material = new
|
|
177
|
+
this._material || (this._material = new D()), 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);
|
|
232
178
|
}
|
|
233
179
|
placeOnFloor() {
|
|
234
180
|
var n, a, h, d;
|
|
235
181
|
const e = this.getWorldPosition(this._positionWorldBuffer), t = e.clone();
|
|
236
182
|
(a = (n = this._mesh) == null ? void 0 : n.geometry) == null || a.computeBoundingBox();
|
|
237
183
|
const r = (d = (h = this._mesh) == null ? void 0 : h.geometry) == null ? void 0 : d.boundingBox;
|
|
238
|
-
!r || !this._mesh || (e.y = e.y - this._mesh.localToWorld(r.min.clone()).y, e.y !== t.y && import("../plugins/state/index.mjs").then(({ State:
|
|
184
|
+
!r || !this._mesh || (e.y = e.y - this._mesh.localToWorld(r.min.clone()).y, e.y !== t.y && import("../plugins/state/index.mjs").then(({ State: u }) => {
|
|
239
185
|
var c;
|
|
240
|
-
(c =
|
|
186
|
+
(c = u.get(this.userData.id)) == null || c.performAction("UPDATE_OBJECT", {
|
|
241
187
|
id: this.userData.id,
|
|
242
188
|
position: e,
|
|
243
189
|
rotation: this.rotation,
|
|
@@ -254,10 +200,10 @@ class T extends D {
|
|
|
254
200
|
return;
|
|
255
201
|
}
|
|
256
202
|
const e = this._boundingBox.min.y * this.scale.y, t = this.localToWorld(
|
|
257
|
-
this._boundingBox.getCenter(new
|
|
203
|
+
this._boundingBox.getCenter(new m()).multiply(this.scale)
|
|
258
204
|
);
|
|
259
205
|
t.y = e + this.position.y;
|
|
260
|
-
const r = new
|
|
206
|
+
const r = new S(t, new m(0, -1, 0));
|
|
261
207
|
r.layers.mask = _;
|
|
262
208
|
const n = r.intersectObjects(
|
|
263
209
|
E(this).root.children,
|
|
@@ -266,18 +212,18 @@ class T extends D {
|
|
|
266
212
|
if (n.length > 0) {
|
|
267
213
|
const a = n[0].object;
|
|
268
214
|
a.geometry.computeBoundingBox();
|
|
269
|
-
const h = a.geometry.boundingBox, d = a.localToWorld(h.max.clone()),
|
|
270
|
-
if (this.position.copy(c), this.position.y ===
|
|
215
|
+
const h = a.geometry.boundingBox, d = a.localToWorld(h.max.clone()), u = this.position.clone(), c = this.position.clone().setY(d.y).sub(new m(0, e, 0));
|
|
216
|
+
if (this.position.copy(c), this.position.y === u.y) return;
|
|
271
217
|
this.onMove();
|
|
272
218
|
}
|
|
273
219
|
}
|
|
274
220
|
}
|
|
275
|
-
class
|
|
221
|
+
class we extends v {
|
|
276
222
|
constructor() {
|
|
277
223
|
super();
|
|
278
224
|
s(this, "isDIVEPrimitive", !0);
|
|
279
225
|
s(this, "_mesh");
|
|
280
|
-
this._mesh = new b(), this._mesh.layers.mask = _, this._mesh.castShadow = !0, this._mesh.receiveShadow = !0, this._mesh.material = new
|
|
226
|
+
this._mesh = new b(), this._mesh.layers.mask = _, this._mesh.castShadow = !0, this._mesh.receiveShadow = !0, this._mesh.material = new D(), this.add(this._mesh);
|
|
281
227
|
}
|
|
282
228
|
setGeometry(e) {
|
|
283
229
|
const t = this.assembleGeometry(e);
|
|
@@ -292,9 +238,9 @@ class ge extends D {
|
|
|
292
238
|
const e = this.getWorldPosition(this._positionWorldBuffer), t = e.clone();
|
|
293
239
|
(a = (n = this._mesh) == null ? void 0 : n.geometry) == null || a.computeBoundingBox();
|
|
294
240
|
const r = (d = (h = this._mesh) == null ? void 0 : h.geometry) == null ? void 0 : d.boundingBox;
|
|
295
|
-
!r || !this._mesh || (e.y = e.y - this._mesh.localToWorld(r.min.clone()).y, e.y !== t.y && import("../plugins/state/index.mjs").then(({ State:
|
|
241
|
+
!r || !this._mesh || (e.y = e.y - this._mesh.localToWorld(r.min.clone()).y, e.y !== t.y && import("../plugins/state/index.mjs").then(({ State: u }) => {
|
|
296
242
|
var c;
|
|
297
|
-
(c =
|
|
243
|
+
(c = u.get(this.userData.id)) == null || c.performAction("UPDATE_OBJECT", {
|
|
298
244
|
id: this.userData.id,
|
|
299
245
|
position: e,
|
|
300
246
|
rotation: this.rotation,
|
|
@@ -311,10 +257,10 @@ class ge extends D {
|
|
|
311
257
|
return;
|
|
312
258
|
}
|
|
313
259
|
const e = this._boundingBox.min.y * this.scale.y, t = this.localToWorld(
|
|
314
|
-
this._boundingBox.getCenter(new
|
|
260
|
+
this._boundingBox.getCenter(new m()).multiply(this.scale)
|
|
315
261
|
);
|
|
316
262
|
t.y = e + this.position.y;
|
|
317
|
-
const r = new
|
|
263
|
+
const r = new S(t, new m(0, -1, 0));
|
|
318
264
|
r.layers.mask = _;
|
|
319
265
|
const n = r.intersectObjects(
|
|
320
266
|
E(this).root.children,
|
|
@@ -323,8 +269,8 @@ class ge extends D {
|
|
|
323
269
|
if (n.length > 0) {
|
|
324
270
|
const a = n[0].object;
|
|
325
271
|
a.geometry.computeBoundingBox();
|
|
326
|
-
const h = a.geometry.boundingBox, d = a.localToWorld(h.max.clone()),
|
|
327
|
-
if (this.position.copy(c), this.position.y ===
|
|
272
|
+
const h = a.geometry.boundingBox, d = a.localToWorld(h.max.clone()), u = this.position.clone(), c = this.position.clone().setY(d.y).sub(new m(0, e, 0));
|
|
273
|
+
if (this.position.copy(c), this.position.y === u.y) return;
|
|
328
274
|
this.onMove();
|
|
329
275
|
}
|
|
330
276
|
}
|
|
@@ -362,7 +308,7 @@ class ge extends D {
|
|
|
362
308
|
return t.translate(0, e.height / 2, 0), t;
|
|
363
309
|
}
|
|
364
310
|
createSphereGeometry(e) {
|
|
365
|
-
return new
|
|
311
|
+
return new C(e.width / 2, 256, 256);
|
|
366
312
|
}
|
|
367
313
|
createPyramidGeometry(e) {
|
|
368
314
|
const t = new Float32Array([
|
|
@@ -404,14 +350,14 @@ class ge extends D {
|
|
|
404
350
|
3,
|
|
405
351
|
4,
|
|
406
352
|
0
|
|
407
|
-
]), n = new
|
|
353
|
+
]), n = new V();
|
|
408
354
|
return n.setAttribute(
|
|
409
355
|
"position",
|
|
410
|
-
new
|
|
411
|
-
), n.setIndex(new
|
|
356
|
+
new x(t, 3)
|
|
357
|
+
), n.setIndex(new x(r, 1)), n.computeVertexNormals(), n.computeBoundingBox(), n.computeBoundingSphere(), n;
|
|
412
358
|
}
|
|
413
359
|
createBoxGeometry(e) {
|
|
414
|
-
const t = new
|
|
360
|
+
const t = new f(
|
|
415
361
|
e.width,
|
|
416
362
|
e.height,
|
|
417
363
|
e.depth
|
|
@@ -423,7 +369,7 @@ class ge extends D {
|
|
|
423
369
|
return t.translate(0, e.height / 2, 0), t;
|
|
424
370
|
}
|
|
425
371
|
createWallGeometry(e) {
|
|
426
|
-
const t = new
|
|
372
|
+
const t = new f(
|
|
427
373
|
e.width,
|
|
428
374
|
e.height,
|
|
429
375
|
e.depth || 0.05,
|
|
@@ -432,7 +378,7 @@ class ge extends D {
|
|
|
432
378
|
return t.translate(0, e.height / 2, 0), t;
|
|
433
379
|
}
|
|
434
380
|
createPlaneGeometry(e) {
|
|
435
|
-
const t = new
|
|
381
|
+
const t = new f(
|
|
436
382
|
e.width,
|
|
437
383
|
e.height,
|
|
438
384
|
e.depth
|
|
@@ -440,7 +386,7 @@ class ge extends D {
|
|
|
440
386
|
return t.translate(0, e.height / 2, 0), t;
|
|
441
387
|
}
|
|
442
388
|
}
|
|
443
|
-
class
|
|
389
|
+
class fe extends v {
|
|
444
390
|
// lines to children
|
|
445
391
|
constructor() {
|
|
446
392
|
super();
|
|
@@ -494,7 +440,7 @@ class pe extends D {
|
|
|
494
440
|
* Creates a line for visualization.
|
|
495
441
|
*/
|
|
496
442
|
createLine() {
|
|
497
|
-
const e = new
|
|
443
|
+
const e = new V(), t = new ee({
|
|
498
444
|
color: 6710886,
|
|
499
445
|
dashSize: 0.05,
|
|
500
446
|
gapSize: 0.025
|
|
@@ -506,7 +452,7 @@ class pe extends D {
|
|
|
506
452
|
*/
|
|
507
453
|
_updateLineTo(e, t) {
|
|
508
454
|
const r = [
|
|
509
|
-
new
|
|
455
|
+
new m(0, 0, 0),
|
|
510
456
|
t.position.clone()
|
|
511
457
|
];
|
|
512
458
|
e.geometry.setFromPoints(r), e.computeLineDistances();
|
|
@@ -559,13 +505,13 @@ class pe extends D {
|
|
|
559
505
|
// this._boxMesh.visible = true;
|
|
560
506
|
// }
|
|
561
507
|
}
|
|
562
|
-
class
|
|
508
|
+
class ye extends b {
|
|
563
509
|
constructor() {
|
|
564
510
|
const e = new ie(1, 1);
|
|
565
511
|
e.scale(1e3, 1e3, 1), e.rotateX(-Math.PI / 2);
|
|
566
|
-
const t = new
|
|
512
|
+
const t = new D({
|
|
567
513
|
color: new l(16777215),
|
|
568
|
-
side:
|
|
514
|
+
side: k
|
|
569
515
|
});
|
|
570
516
|
super(e, t);
|
|
571
517
|
s(this, "isDIVEFloor", !0);
|
|
@@ -578,18 +524,18 @@ class we extends b {
|
|
|
578
524
|
this.material.color = new l(e);
|
|
579
525
|
}
|
|
580
526
|
}
|
|
581
|
-
class
|
|
527
|
+
class ve extends g {
|
|
582
528
|
constructor() {
|
|
583
529
|
super();
|
|
584
530
|
s(this, "isDIVERoot", !0);
|
|
585
531
|
s(this, "_floor");
|
|
586
|
-
this.name = "Root", this._floor = new
|
|
532
|
+
this.name = "Root", this._floor = new ye(), this.add(this._floor);
|
|
587
533
|
}
|
|
588
534
|
get floor() {
|
|
589
535
|
return this._floor;
|
|
590
536
|
}
|
|
591
537
|
computeSceneBB() {
|
|
592
|
-
const e = new
|
|
538
|
+
const e = new se();
|
|
593
539
|
return this.children.forEach((t) => {
|
|
594
540
|
"isDIVEFloor" in t || t.traverse((r) => {
|
|
595
541
|
"isObject3D" in r && e.expandByObject(r);
|
|
@@ -618,11 +564,11 @@ class fe extends g {
|
|
|
618
564
|
break;
|
|
619
565
|
}
|
|
620
566
|
case "ambient": {
|
|
621
|
-
t = new
|
|
567
|
+
t = new ge();
|
|
622
568
|
break;
|
|
623
569
|
}
|
|
624
570
|
case "point": {
|
|
625
|
-
t = new
|
|
571
|
+
t = new pe();
|
|
626
572
|
break;
|
|
627
573
|
}
|
|
628
574
|
default:
|
|
@@ -634,15 +580,15 @@ class fe extends g {
|
|
|
634
580
|
break;
|
|
635
581
|
}
|
|
636
582
|
case "model": {
|
|
637
|
-
t = new
|
|
583
|
+
t = new B(), t.name = e.name, t.userData.id = e.id, t.userData.uri = e.uri, this.add(t), this._updateModel(t, e);
|
|
638
584
|
break;
|
|
639
585
|
}
|
|
640
586
|
case "primitive": {
|
|
641
|
-
t = new
|
|
587
|
+
t = new we(), t.name = e.name, t.userData.id = e.id, this.add(t), this._updatePrimitive(t, e);
|
|
642
588
|
break;
|
|
643
589
|
}
|
|
644
590
|
case "group": {
|
|
645
|
-
t = new
|
|
591
|
+
t = new fe(), t.name = e.name, t.userData.id = e.id, this.add(t), this._updateGroup(t, e);
|
|
646
592
|
break;
|
|
647
593
|
}
|
|
648
594
|
default:
|
|
@@ -770,28 +716,28 @@ class fe extends g {
|
|
|
770
716
|
return e.parent !== null ? this._findScene(e.parent) : e;
|
|
771
717
|
}
|
|
772
718
|
}
|
|
773
|
-
const
|
|
774
|
-
class
|
|
719
|
+
const be = "#888888", De = "#dddddd";
|
|
720
|
+
class Ee extends g {
|
|
775
721
|
constructor() {
|
|
776
722
|
super(), this.name = "Grid";
|
|
777
|
-
const i = new
|
|
723
|
+
const i = new re(
|
|
778
724
|
100,
|
|
779
725
|
100,
|
|
780
|
-
|
|
781
|
-
|
|
726
|
+
be,
|
|
727
|
+
De
|
|
782
728
|
);
|
|
783
|
-
i.material.depthTest = !1, i.layers.mask =
|
|
729
|
+
i.material.depthTest = !1, i.layers.mask = de, this.add(i);
|
|
784
730
|
}
|
|
785
731
|
setVisibility(i) {
|
|
786
732
|
this.visible = i;
|
|
787
733
|
}
|
|
788
734
|
}
|
|
789
|
-
class
|
|
735
|
+
class Ie extends ne {
|
|
790
736
|
constructor() {
|
|
791
737
|
super();
|
|
792
738
|
s(this, "_root");
|
|
793
739
|
s(this, "_grid");
|
|
794
|
-
this.background = new l(16777215), this._root = new
|
|
740
|
+
this.background = new l(16777215), this._root = new ve(), this.add(this._root), this._grid = new Ee(), this.add(this._grid);
|
|
795
741
|
}
|
|
796
742
|
get root() {
|
|
797
743
|
return this._root;
|
|
@@ -818,20 +764,20 @@ const P = {
|
|
|
818
764
|
shadows: !0,
|
|
819
765
|
shadowQuality: "high"
|
|
820
766
|
};
|
|
821
|
-
class
|
|
767
|
+
class xe {
|
|
822
768
|
constructor(i, e, t) {
|
|
823
769
|
s(this, "_webglrenderer");
|
|
824
770
|
s(this, "_settings");
|
|
825
771
|
this._scene = i, this._camera = e, this._settings = {
|
|
826
772
|
...P,
|
|
827
773
|
...t ?? {}
|
|
828
|
-
}, this._webglrenderer = new
|
|
774
|
+
}, this._webglrenderer = new L(this._settings), this._webglrenderer.shadowMap.enabled = this._settings.shadows, this._webglrenderer.shadowMap.type = this._settings.shadowQuality === "high" ? oe : this._settings.shadowQuality === "medium" ? ae : he;
|
|
829
775
|
}
|
|
830
776
|
get webglrenderer() {
|
|
831
777
|
return this._webglrenderer;
|
|
832
778
|
}
|
|
833
779
|
setCanvas(i) {
|
|
834
|
-
this._webglrenderer.dispose(), this._settings.canvas = i, this._webglrenderer = new
|
|
780
|
+
this._webglrenderer.dispose(), this._settings.canvas = i, this._webglrenderer = new L(this._settings);
|
|
835
781
|
}
|
|
836
782
|
render() {
|
|
837
783
|
this._webglrenderer.render(this._scene, this._camera);
|
|
@@ -843,7 +789,7 @@ class De {
|
|
|
843
789
|
this._webglrenderer.dispose();
|
|
844
790
|
}
|
|
845
791
|
}
|
|
846
|
-
class
|
|
792
|
+
class Le {
|
|
847
793
|
constructor() {
|
|
848
794
|
s(this, "_renderer", null);
|
|
849
795
|
s(this, "_lastTime", 0);
|
|
@@ -882,7 +828,7 @@ class xe {
|
|
|
882
828
|
this._lastTime = i, this._tickers.forEach((r) => r.tick(e)), (t = this._renderer) == null || t.render(), requestAnimationFrame(this._tick.bind(this));
|
|
883
829
|
}
|
|
884
830
|
}
|
|
885
|
-
class
|
|
831
|
+
class Ce {
|
|
886
832
|
constructor(i, e) {
|
|
887
833
|
s(this, "_resizeObserver");
|
|
888
834
|
s(this, "_width", 0);
|
|
@@ -910,13 +856,13 @@ class Ie {
|
|
|
910
856
|
}
|
|
911
857
|
}
|
|
912
858
|
}
|
|
913
|
-
const
|
|
859
|
+
const T = {
|
|
914
860
|
autoStart: !0,
|
|
915
861
|
displayAxes: !1,
|
|
916
|
-
...
|
|
862
|
+
...ce,
|
|
917
863
|
...P
|
|
918
864
|
};
|
|
919
|
-
class
|
|
865
|
+
class ke {
|
|
920
866
|
constructor(i) {
|
|
921
867
|
s(this, "_renderer");
|
|
922
868
|
s(this, "_scene");
|
|
@@ -925,16 +871,16 @@ class Ce {
|
|
|
925
871
|
s(this, "_clock");
|
|
926
872
|
s(this, "_settings");
|
|
927
873
|
this._settings = {
|
|
928
|
-
...
|
|
874
|
+
...T,
|
|
929
875
|
...i ?? {}
|
|
930
|
-
}, this._scene = new
|
|
876
|
+
}, this._scene = new Ie(), this._camera = new _e(this._settings), this._renderer = new xe(
|
|
931
877
|
this._scene,
|
|
932
878
|
this._camera,
|
|
933
879
|
this._settings
|
|
934
|
-
), this._resizeManager = new
|
|
880
|
+
), this._resizeManager = new Ce(
|
|
935
881
|
this._renderer,
|
|
936
882
|
this._camera
|
|
937
|
-
), this._clock = new
|
|
883
|
+
), this._clock = new Le(), this._clock.setRenderer(this._renderer), this._settings.autoStart && this.start();
|
|
938
884
|
}
|
|
939
885
|
get scene() {
|
|
940
886
|
return this._scene;
|
|
@@ -961,37 +907,37 @@ class Ce {
|
|
|
961
907
|
this._clock.dispose(), this._resizeManager.dispose(), this._renderer.dispose();
|
|
962
908
|
}
|
|
963
909
|
}
|
|
964
|
-
const
|
|
910
|
+
const R = "#c20017", G = "#00ab26", A = "#0081d4", Se = R, Ve = G, Me = A;
|
|
965
911
|
window.DIVE = {
|
|
966
912
|
instances: [],
|
|
967
913
|
get instance() {
|
|
968
914
|
return window.DIVE.instances[0];
|
|
969
915
|
}
|
|
970
916
|
};
|
|
971
|
-
const
|
|
972
|
-
...
|
|
973
|
-
...
|
|
917
|
+
const Be = {
|
|
918
|
+
...T,
|
|
919
|
+
...U
|
|
974
920
|
};
|
|
975
921
|
class O {
|
|
976
922
|
constructor(i) {
|
|
977
923
|
// descriptive members
|
|
978
|
-
s(this, "_instanceId",
|
|
924
|
+
s(this, "_instanceId", w.generateUUID());
|
|
979
925
|
s(this, "_settings");
|
|
980
926
|
s(this, "_engine");
|
|
981
927
|
s(this, "orbitController");
|
|
982
|
-
s(this, "
|
|
928
|
+
s(this, "orientationDisplay");
|
|
983
929
|
this._settings = {
|
|
984
|
-
...
|
|
930
|
+
...Be,
|
|
985
931
|
...i ?? {}
|
|
986
|
-
}, this._engine = new
|
|
932
|
+
}, this._engine = new ke(i), this.orbitController = new I(
|
|
987
933
|
this._engine.camera,
|
|
988
934
|
this._engine.renderer.webglrenderer.domElement,
|
|
989
935
|
this._settings
|
|
990
|
-
), this._engine.clock.addTicker(this.orbitController), this._settings.displayAxes ? (this.
|
|
936
|
+
), this._engine.clock.addTicker(this.orbitController), this._settings.displayAxes ? (this.orientationDisplay = new me(
|
|
991
937
|
this._engine.renderer,
|
|
992
938
|
this._engine.scene,
|
|
993
939
|
this._engine.camera
|
|
994
|
-
), this._engine.clock.addTicker(this.
|
|
940
|
+
), this._engine.clock.addTicker(this.orientationDisplay)) : this.orientationDisplay = null, import("./package-DSKqbNMb.mjs").then((e) => {
|
|
995
941
|
console.log(
|
|
996
942
|
`DIVE ${e.default.version} initialized successfully!`
|
|
997
943
|
), console.log(`
|
|
@@ -1031,10 +977,12 @@ class O {
|
|
|
1031
977
|
const t = new O(e);
|
|
1032
978
|
t.engine.scene.background = new l(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);
|
|
1033
979
|
const r = new M();
|
|
1034
|
-
r.name = "SceneLight", r.userData.id =
|
|
1035
|
-
const n = new
|
|
1036
|
-
n.name = "object", n.userData.id =
|
|
1037
|
-
const a =
|
|
980
|
+
r.name = "SceneLight", r.userData.id = w.generateUUID(), r.setEnabled(!0), r.visible = !0, r.setIntensity((e == null ? void 0 : e.lightIntensity) ?? 1), r.setColor(new l(16777215)), t.engine.scene.root.add(r);
|
|
981
|
+
const n = new B();
|
|
982
|
+
n.name = "object", n.userData.id = w.generateUUID(), n.userData.uri = i, n.visible = !0, t.engine.scene.root.add(n), await n.setFromURL(i);
|
|
983
|
+
const a = new H(n);
|
|
984
|
+
t.engine.scene.add(a);
|
|
985
|
+
const h = t.orbitController.computeEncompassingView(a);
|
|
1038
986
|
return t.engine.camera.position.copy(h.position), t.orbitController.target.copy(h.target), t;
|
|
1039
987
|
}
|
|
1040
988
|
get engine() {
|
|
@@ -1044,7 +992,7 @@ class O {
|
|
|
1044
992
|
return this._engine.renderer.webglrenderer.domElement;
|
|
1045
993
|
}
|
|
1046
994
|
setCanvas(i) {
|
|
1047
|
-
this._engine.setCanvas(i), this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.orbitController = new
|
|
995
|
+
this._engine.setCanvas(i), this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.orbitController = new I(
|
|
1048
996
|
this._engine.camera,
|
|
1049
997
|
i,
|
|
1050
998
|
this._settings
|
|
@@ -1052,13 +1000,13 @@ class O {
|
|
|
1052
1000
|
}
|
|
1053
1001
|
async dispose() {
|
|
1054
1002
|
return new Promise((i) => {
|
|
1055
|
-
this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.
|
|
1003
|
+
this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.orientationDisplay && (this._engine.clock.removeTicker(this.orientationDisplay), this.orientationDisplay.dispose()), window.DIVE.instances = window.DIVE.instances.filter(
|
|
1056
1004
|
(e) => e._instanceId !== this._instanceId
|
|
1057
1005
|
), i();
|
|
1058
1006
|
});
|
|
1059
1007
|
}
|
|
1060
1008
|
}
|
|
1061
|
-
const
|
|
1009
|
+
const Pe = {
|
|
1062
1010
|
glb: {
|
|
1063
1011
|
key: "glb",
|
|
1064
1012
|
extension: "glb"
|
|
@@ -1071,39 +1019,39 @@ const Be = {
|
|
|
1071
1019
|
key: "usdz",
|
|
1072
1020
|
extension: "usdz"
|
|
1073
1021
|
}
|
|
1074
|
-
},
|
|
1022
|
+
}, Fe = Object.values(Pe).map(
|
|
1075
1023
|
(o) => o.extension
|
|
1076
1024
|
);
|
|
1077
1025
|
export {
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
Ve as
|
|
1026
|
+
Se as A,
|
|
1027
|
+
Be as D,
|
|
1028
|
+
T as E,
|
|
1029
|
+
Pe as F,
|
|
1030
|
+
be as G,
|
|
1031
|
+
me as O,
|
|
1032
|
+
Fe as S,
|
|
1033
|
+
ue as a,
|
|
1034
|
+
Ve as b,
|
|
1035
|
+
Me as c,
|
|
1087
1036
|
O as d,
|
|
1088
|
-
|
|
1037
|
+
R as e,
|
|
1089
1038
|
G as f,
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1039
|
+
A as g,
|
|
1040
|
+
De as h,
|
|
1041
|
+
ye as i,
|
|
1042
|
+
Ee as j,
|
|
1043
|
+
fe as k,
|
|
1044
|
+
ge as l,
|
|
1045
|
+
pe as m,
|
|
1097
1046
|
M as n,
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1047
|
+
B as o,
|
|
1048
|
+
we as p,
|
|
1049
|
+
ve as q,
|
|
1050
|
+
Le as r,
|
|
1051
|
+
P as s,
|
|
1052
|
+
xe as t,
|
|
1053
|
+
Ce as u,
|
|
1105
1054
|
Ie as v,
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
E as y
|
|
1055
|
+
ke as w,
|
|
1056
|
+
E as x
|
|
1109
1057
|
};
|