@shopware-ag/dive 3.0.11 → 4.0.0
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/README.md +31 -5
- package/build/chunks/{AssetCache-MtISiPD2.cjs → AssetCache-DdxevusY.cjs} +1 -1
- package/build/chunks/{AssetCache-DOB996Vk.mjs → AssetCache-MXFCGzZU.mjs} +1 -1
- package/build/chunks/AssetExporter-CD2iuQce.mjs +108 -0
- package/build/chunks/AssetExporter-CoL-QXkB.cjs +1 -0
- package/build/chunks/{AssetLoader-B1n3KGOu.cjs → AssetLoader-BDDJG9JL.cjs} +2 -2
- package/build/chunks/{AssetLoader-BY5D3Cvc.mjs → AssetLoader-kRhuVN4p.mjs} +12 -21
- package/build/chunks/FileTypes-DGSsi-AX.mjs +2294 -0
- package/build/chunks/FileTypes-gD_1MonW.cjs +29 -0
- package/build/chunks/ModelComponent-Cj3ff6nL.cjs +1 -0
- package/build/chunks/ModelComponent-DkfAgTL0.mjs +87 -0
- package/build/chunks/OrbitController-DFPcXvlO.cjs +1 -0
- package/build/chunks/OrbitController-DLEyTvUt.mjs +612 -0
- package/build/chunks/SpriteTextComponent-ByefJLeU.cjs +1 -0
- package/build/chunks/SpriteTextComponent-CG5vfiFy.mjs +83 -0
- package/build/chunks/collectAnimations-BgYCN1le.mjs +35 -0
- package/build/chunks/collectAnimations-C3HfZHte.cjs +1 -0
- package/build/chunks/contributesToBounds-C1mva__U.cjs +1 -0
- package/build/chunks/contributesToBounds-DYmHYES4.mjs +14 -0
- package/build/chunks/detachTransformControls-2XQrpLN-.cjs +1 -0
- package/build/chunks/detachTransformControls-Dr3TIdVy.mjs +209 -0
- package/build/chunks/{isFileTypeSupported-C-hfGk-7.mjs → isFileExtensionSupported-CgcqpgqN.mjs} +1 -1
- package/build/chunks/{isFileTypeSupported-xoGjHFuz.cjs → isFileExtensionSupported-RvlnH2dr.cjs} +1 -1
- package/build/chunks/isVisibleInHierarchy-D9JcLqR5.cjs +1 -0
- package/build/chunks/isVisibleInHierarchy-KzVGvDEw.mjs +21 -0
- package/build/components/boundingbox/BoundingBoxComponent.d.ts +100 -0
- package/build/components/boundingbox/index.d.ts +1 -0
- package/build/components/camera/CameraComponent.d.ts +75 -0
- package/build/components/camera/index.d.ts +2 -0
- package/build/components/camera/perspective/PerspectiveCameraComponent.d.ts +39 -0
- package/build/components/grid/GridComponent.d.ts +50 -0
- package/build/components/index.d.ts +6 -9
- package/build/components/light/LightComponent.d.ts +65 -0
- package/build/components/light/ambient/AmbientLightComponent.d.ts +10 -0
- package/build/components/light/directional/DirectionalLightComponent.d.ts +23 -0
- package/build/components/light/hemi/HemisphereLightComponent.d.ts +21 -0
- package/build/components/light/index.d.ts +5 -3
- package/build/components/light/point/PointLightComponent.d.ts +26 -0
- package/build/components/line/MultiLineComponent.d.ts +133 -0
- package/build/components/line/index.d.ts +1 -0
- package/build/components/mesh/MeshComponent.d.ts +74 -0
- package/build/components/mesh/floor/FloorComponent.d.ts +36 -0
- package/build/components/mesh/index.d.ts +4 -0
- package/build/components/mesh/model/ModelComponent.d.ts +67 -0
- package/build/components/mesh/primitive/PrimitiveComponent.d.ts +43 -0
- package/build/components/spritetext/SpriteTextComponent.d.ts +58 -0
- package/build/constants/VisibilityLayerMask.d.ts +23 -0
- package/build/dive.cjs +1 -1
- package/build/dive.mjs +252 -774
- package/build/engine/Dive.d.ts +17 -13
- package/build/engine/boundingbox/BoundingBox.d.ts +76 -0
- package/build/engine/component/Component.d.ts +236 -0
- package/build/engine/environment/Environment.d.ts +8 -18
- package/build/engine/index.d.ts +4 -1
- package/build/engine/node/Node.d.ts +189 -0
- package/build/engine/promise/abortable/AbortablePromise.d.ts +8 -0
- package/build/engine/renderer/Renderer.d.ts +43 -7
- package/build/engine/scene/Scene.d.ts +88 -4
- package/build/engine/scene/root/Root.d.ts +29 -0
- package/build/engine/scene/xrroot/XRRoot.d.ts +1 -1
- package/build/engine/view/View.d.ts +15 -4
- package/build/helpers/collectAnimations/collectAnimations.d.ts +23 -0
- package/build/helpers/computeProductBounds/computeProductBounds.d.ts +18 -0
- package/build/helpers/contributesToBounds/contributesToBounds.d.ts +17 -0
- package/build/helpers/detachTransformControls/detachTransformControls.d.ts +15 -0
- package/build/helpers/disposeComponents/disposeComponents.d.ts +20 -0
- package/build/helpers/findSceneRecursive/findSceneRecursive.d.ts +7 -3
- package/build/helpers/implementsInterface/implementsInterface.d.ts +11 -0
- package/build/helpers/index.d.ts +6 -1
- package/build/helpers/isVisibleInHierarchy/isVisibleInHierarchy.d.ts +12 -0
- package/build/index.d.ts +0 -1
- package/build/plugins/animation/index.mjs +3 -2
- package/build/plugins/animation/src/system/AnimationSystem.d.ts +3 -2
- package/build/plugins/ar/index.cjs +1 -1
- package/build/plugins/ar/index.mjs +2 -2
- package/build/plugins/ar/src/webxr/WebXR.d.ts +7 -0
- package/build/plugins/assetcache/index.cjs +1 -1
- package/build/plugins/assetcache/index.mjs +1 -1
- package/build/plugins/assetexporter/index.cjs +1 -1
- package/build/plugins/assetexporter/index.mjs +1 -1
- package/build/plugins/assetexporter/src/AssetExporter.d.ts +12 -0
- package/build/plugins/assetloader/index.cjs +1 -1
- package/build/plugins/assetloader/index.mjs +2 -2
- package/build/plugins/mediacreator/index.cjs +1 -1
- package/build/plugins/mediacreator/index.mjs +32 -30
- package/build/plugins/mediacreator/src/MediaCreator.d.ts +1 -2
- package/build/plugins/orbitcontroller/index.cjs +1 -1
- package/build/plugins/orbitcontroller/index.d.ts +1 -0
- package/build/plugins/orbitcontroller/index.mjs +1 -1
- package/build/plugins/orbitcontroller/src/OrbitController.d.ts +39 -6
- package/build/plugins/orientationdisplay/index.cjs +1 -1
- package/build/plugins/orientationdisplay/index.mjs +41 -33
- package/build/plugins/orientationdisplay/src/OrientationDisplay.d.ts +3 -3
- package/build/plugins/quickview/index.cjs +1 -1
- package/build/plugins/quickview/index.mjs +71 -19
- package/build/plugins/quickview/src/QuickView.d.ts +40 -8
- package/build/plugins/quickview/types/QuickViewSettings.d.ts +14 -0
- package/build/plugins/state/index.cjs +1 -27
- package/build/plugins/state/index.mjs +2031 -4135
- package/build/plugins/state/src/EngineGateway.d.ts +98 -0
- package/build/plugins/state/src/EntityRegistry.d.ts +51 -0
- package/build/plugins/state/src/State.d.ts +20 -9
- package/build/plugins/state/src/actions/camera/computeencompassingview.d.ts +1 -1
- package/build/plugins/state/src/actions/camera/movecamera.d.ts +2 -2
- package/build/plugins/state/src/actions/index.d.ts +1 -0
- package/build/plugins/state/src/actions/media/generatemedia.d.ts +1 -1
- package/build/plugins/state/src/actions/object/addobject.d.ts +2 -3
- package/build/plugins/state/src/actions/object/deleteobject.d.ts +3 -4
- package/build/plugins/state/src/actions/object/deselectobject.d.ts +3 -4
- package/build/plugins/state/src/actions/object/dropit.d.ts +2 -2
- package/build/plugins/state/src/actions/object/getallobjects.d.ts +2 -3
- package/build/plugins/state/src/actions/object/getobjects.d.ts +3 -4
- package/build/plugins/state/src/actions/object/index.d.ts +0 -1
- package/build/plugins/state/src/actions/object/modelloaded.d.ts +2 -2
- package/build/plugins/state/src/actions/object/selectobject.d.ts +3 -4
- package/build/plugins/state/src/actions/object/setparent.d.ts +3 -4
- package/build/plugins/state/src/actions/object/updateobject.d.ts +3 -4
- package/build/plugins/state/src/actions/renderer/startrender.d.ts +1 -1
- package/build/plugins/state/src/actions/scene/exportscene.d.ts +2 -2
- package/build/plugins/state/src/actions/scene/index.d.ts +0 -1
- package/build/plugins/state/src/actions/scene/setbackground.d.ts +2 -2
- package/build/plugins/state/src/actions/scene/updatescene.d.ts +2 -2
- package/build/plugins/state/src/actions/state/getstate.d.ts +8 -0
- package/build/plugins/state/src/actions/state/index.d.ts +2 -0
- package/build/plugins/state/src/actions/state/setstate.d.ts +8 -0
- package/build/plugins/state/src/helpers/copyVectors/copyVectors.d.ts +17 -0
- package/build/plugins/state/src/helpers/updateParentLink/updateParentLink.d.ts +29 -0
- package/build/plugins/state/src/helpers/watchEntity/watchEntity.d.ts +30 -0
- package/build/plugins/state/types/ActionTypes.d.ts +18 -3
- package/build/plugins/state/types/RegisteredEntity.d.ts +27 -0
- package/build/plugins/state/types/{StateSceneData.d.ts → StateData.d.ts} +7 -8
- package/build/plugins/state/types/index.d.ts +3 -1
- package/build/plugins/state/types/schema/BaseEntitySchema.d.ts +25 -0
- package/build/plugins/state/types/schema/CameraSchema.d.ts +18 -0
- package/build/plugins/state/types/schema/EntitySchema.d.ts +21 -0
- package/build/plugins/state/types/schema/EntityTypeSchema.d.ts +9 -0
- package/build/{types → plugins/state/types}/schema/GroupSchema.d.ts +8 -1
- package/build/{types → plugins/state/types}/schema/LightSchema.d.ts +16 -0
- package/build/plugins/state/types/schema/ModelSchema.d.ts +33 -0
- package/build/{types → plugins/state/types}/schema/PrimitiveSchema.d.ts +8 -4
- package/build/{types → plugins/state/types}/schema/index.d.ts +1 -4
- package/build/plugins/toolbox/index.cjs +1 -1
- package/build/plugins/toolbox/index.mjs +194 -150
- package/build/plugins/toolbox/src/PointerContext.d.ts +7 -0
- package/build/plugins/toolbox/src/SelectionState.d.ts +21 -0
- package/build/plugins/toolbox/src/Toolbox.d.ts +9 -2
- package/build/{components → plugins/toolbox/src}/gizmo/Gizmo.d.ts +16 -2
- package/build/{components → plugins/toolbox/src}/gizmo/handles/AxisHandle.d.ts +2 -3
- package/build/{components → plugins/toolbox/src}/gizmo/handles/RadialHandle.d.ts +2 -3
- package/build/{components → plugins/toolbox/src}/gizmo/handles/ScaleHandle.d.ts +2 -3
- package/build/{components → plugins/toolbox/src}/gizmo/rotate/RotateGizmo.d.ts +2 -2
- package/build/{components → plugins/toolbox/src}/gizmo/scale/ScaleGizmo.d.ts +3 -3
- package/build/{components → plugins/toolbox/src}/gizmo/translate/TranslateGizmo.d.ts +2 -2
- package/build/types/components/DIVESceneObject.d.ts +13 -6
- package/build/types/components/index.d.ts +0 -1
- package/build/types/events/DIVEComponentEventMap.d.ts +14 -0
- package/build/types/events/DIVEEntityEventMap.d.ts +47 -0
- package/build/types/events/index.d.ts +2 -0
- package/build/types/geometry/DIVEGeometry.d.ts +16 -0
- package/build/types/geometry/DIVEGeometryType.d.ts +7 -0
- package/build/types/geometry/index.d.ts +2 -0
- package/build/types/index.d.ts +3 -1
- package/build/types/material/DIVEMaterial.d.ts +21 -0
- package/build/types/material/index.d.ts +1 -0
- package/package.json +8 -9
- package/build/chunks/AssetExporter-Cdxb04b3.cjs +0 -1
- package/build/chunks/AssetExporter-DLL_vJae.mjs +0 -67
- package/build/chunks/FileTypes-DMTSUCcK.cjs +0 -29
- package/build/chunks/FileTypes-DYtXCJQV.mjs +0 -2141
- package/build/chunks/PerspectiveCamera-B5TvUzTa.mjs +0 -39
- package/build/chunks/PerspectiveCamera-DwQUmkDv.cjs +0 -1
- package/build/chunks/PovSchema-Co9FznEz.cjs +0 -1
- package/build/chunks/PovSchema-DWWvr_ED.mjs +0 -10
- package/build/chunks/findInterface-C6mrvf_t.cjs +0 -1
- package/build/chunks/findInterface-DbJ5qzbc.mjs +0 -11
- package/build/components/boundingbox/BoundingBox.d.ts +0 -136
- package/build/components/floor/Floor.d.ts +0 -14
- package/build/components/grid/Grid.d.ts +0 -23
- package/build/components/group/Group.d.ts +0 -28
- package/build/components/light/AmbientLight.d.ts +0 -19
- package/build/components/light/PointLight.d.ts +0 -29
- package/build/components/light/SceneLight.d.ts +0 -20
- package/build/components/model/Model.d.ts +0 -26
- package/build/components/node/Node.d.ts +0 -24
- package/build/components/primitive/Primitive.d.ts +0 -27
- package/build/components/root/Root.d.ts +0 -34
- package/build/engine/camera/PerspectiveCamera.d.ts +0 -24
- package/build/helpers/isFileTypeSupported/isFileTypeSupported.d.ts +0 -9
- package/build/plugins/state/src/actions/object/placeonfloor.d.ts +0 -12
- package/build/plugins/state/src/actions/scene/getallscenedata.d.ts +0 -9
- package/build/types/components/DIVELight.d.ts +0 -4
- package/build/types/schema/BaseEntitySchema.d.ts +0 -8
- package/build/types/schema/EntitySchema.d.ts +0 -11
- package/build/types/schema/EntityTypeSchema.d.ts +0 -1
- package/build/types/schema/GeometrySchema.d.ts +0 -7
- package/build/types/schema/GeometryTypeSchema.d.ts +0 -1
- package/build/types/schema/MaterialSchema.d.ts +0 -11
- package/build/types/schema/ModelSchema.d.ts +0 -14
- package/build/types/schema/PovSchema.d.ts +0 -10
- /package/build/{components → plugins/toolbox/src}/gizmo/plane/GizmoPlane.d.ts +0 -0
package/build/dive.mjs
CHANGED
|
@@ -1,821 +1,299 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import { B as
|
|
6
|
-
import {
|
|
7
|
-
import { C as
|
|
8
|
-
import { A as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { i as
|
|
14
|
-
import {
|
|
15
|
-
import { F as
|
|
16
|
-
import {
|
|
17
|
-
class
|
|
18
|
-
constructor(t, e, n, o, a) {
|
|
19
|
-
super();
|
|
20
|
-
i(this, "isHoverable", !0);
|
|
21
|
-
i(this, "isDraggable", !0);
|
|
22
|
-
i(this, "parent", null);
|
|
23
|
-
i(this, "axis");
|
|
24
|
-
i(this, "_color", new b(16711935));
|
|
25
|
-
i(this, "_colorHover");
|
|
26
|
-
i(this, "_hovered");
|
|
27
|
-
i(this, "_highlight");
|
|
28
|
-
i(this, "_lineMaterial");
|
|
29
|
-
i(this, "_colliderMesh");
|
|
30
|
-
this.name = "DIVERadialHandle", this.axis = t, this._color.set(a), this._colorHover = this._color.clone().multiplyScalar(2), this._hovered = !1, this._highlight = !1;
|
|
31
|
-
const h = new H(e, 0.01, 13, 48, n);
|
|
32
|
-
this._lineMaterial = new g({
|
|
33
|
-
color: a,
|
|
34
|
-
depthTest: !1,
|
|
35
|
-
depthWrite: !1
|
|
36
|
-
});
|
|
37
|
-
const l = new p(h, this._lineMaterial);
|
|
38
|
-
l.layers.mask = d, l.renderOrder = 1 / 0, this.add(l);
|
|
39
|
-
const _ = new H(e, 0.1, 3, 48, n), D = new g({
|
|
40
|
-
color: 16711935,
|
|
41
|
-
transparent: !0,
|
|
42
|
-
opacity: 0.15,
|
|
43
|
-
depthTest: !1,
|
|
44
|
-
depthWrite: !1
|
|
45
|
-
});
|
|
46
|
-
this._colliderMesh = new p(_, D), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this.add(this._colliderMesh), this.lookAt(o);
|
|
47
|
-
}
|
|
48
|
-
set debug(t) {
|
|
49
|
-
this._colliderMesh.visible = t;
|
|
50
|
-
}
|
|
51
|
-
get highlight() {
|
|
52
|
-
return this._highlight;
|
|
53
|
-
}
|
|
54
|
-
set highlight(t) {
|
|
55
|
-
this._highlight = t, this._lineMaterial.color = this._highlight || this._hovered ? this._colorHover : this._color;
|
|
56
|
-
}
|
|
57
|
-
get forwardVector() {
|
|
58
|
-
return new c(0, 0, 1).applyQuaternion(this.quaternion).normalize();
|
|
59
|
-
}
|
|
60
|
-
get rightVector() {
|
|
61
|
-
return new c(1, 0, 0).applyQuaternion(this.quaternion).normalize();
|
|
62
|
-
}
|
|
63
|
-
get upVector() {
|
|
64
|
-
return new c(0, 1, 0).applyQuaternion(this.quaternion).normalize();
|
|
65
|
-
}
|
|
66
|
-
reset() {
|
|
67
|
-
this._lineMaterial.color = this._color;
|
|
68
|
-
}
|
|
69
|
-
onPointerEnter() {
|
|
70
|
-
this._hovered = !0, this.parent && this.parent.onHandleHover(this, !0);
|
|
71
|
-
}
|
|
72
|
-
onPointerLeave() {
|
|
73
|
-
this._hovered = !1, this.parent && this.parent.onHandleHover(this, !1);
|
|
74
|
-
}
|
|
75
|
-
onDragStart() {
|
|
76
|
-
this.parent && this.parent.onHandleDragStart(this);
|
|
77
|
-
}
|
|
78
|
-
onDrag(t) {
|
|
79
|
-
this.parent && this.parent.onHandleDrag(this, t);
|
|
80
|
-
}
|
|
81
|
-
onDragEnd() {
|
|
82
|
-
this.parent && this.parent.onHandleDragEnd(this);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function u(r, s) {
|
|
86
|
-
const t = (r + "e").split("e");
|
|
87
|
-
return +(t[0] + "e" + (+t[1] + (s || 0)));
|
|
88
|
-
}
|
|
89
|
-
function C(r, s = 0) {
|
|
90
|
-
const t = u(r, +s);
|
|
91
|
-
return u(Math.ceil(t), -s);
|
|
92
|
-
}
|
|
93
|
-
function j(r, s = 0) {
|
|
94
|
-
const t = u(r, +s);
|
|
95
|
-
return u(Math.floor(t), -s);
|
|
96
|
-
}
|
|
97
|
-
function O(r, s = 0) {
|
|
98
|
-
if (r < 0) return -O(-r, s);
|
|
99
|
-
const t = u(r, +s);
|
|
100
|
-
return u(Math.round(t), -s);
|
|
101
|
-
}
|
|
102
|
-
function N(r, s, t) {
|
|
103
|
-
return Math.atan2(
|
|
104
|
-
r.clone().cross(s).dot(t),
|
|
105
|
-
s.clone().dot(r)
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
function X(r, s = 0) {
|
|
109
|
-
const t = u(r, +s);
|
|
110
|
-
return u(Math.round(t), -s).toFixed(s);
|
|
111
|
-
}
|
|
112
|
-
function F(r, s = 0) {
|
|
113
|
-
const t = u(r, +s);
|
|
114
|
-
return u(Math.trunc(t), -s);
|
|
115
|
-
}
|
|
116
|
-
function Z(r) {
|
|
117
|
-
return (v.radToDeg(r) + 360) % 360;
|
|
118
|
-
}
|
|
119
|
-
function q(r) {
|
|
120
|
-
return v.degToRad(r);
|
|
121
|
-
}
|
|
122
|
-
const Q = {
|
|
123
|
-
ceilExp: C,
|
|
124
|
-
floorExp: j,
|
|
125
|
-
roundExp: O,
|
|
126
|
-
toFixedExp: X,
|
|
127
|
-
truncateExp: F,
|
|
128
|
-
signedAngleTo: N,
|
|
129
|
-
radToDeg: Z,
|
|
130
|
-
degToRad: q
|
|
131
|
-
};
|
|
132
|
-
class U extends f {
|
|
133
|
-
constructor(t) {
|
|
134
|
-
super();
|
|
135
|
-
i(this, "children");
|
|
136
|
-
i(this, "_controller");
|
|
137
|
-
i(this, "_startRot");
|
|
138
|
-
this.name = "DIVERotateGizmo", this.children = [], this._startRot = null, this._controller = t, this.add(
|
|
139
|
-
new y(
|
|
140
|
-
"x",
|
|
141
|
-
1,
|
|
142
|
-
Math.PI / 2,
|
|
143
|
-
new c(1, 0, 0),
|
|
144
|
-
I
|
|
145
|
-
)
|
|
146
|
-
), this.add(
|
|
147
|
-
new y(
|
|
148
|
-
"y",
|
|
149
|
-
1,
|
|
150
|
-
-Math.PI / 2,
|
|
151
|
-
new c(0, 1, 0),
|
|
152
|
-
P
|
|
153
|
-
)
|
|
154
|
-
), this.add(
|
|
155
|
-
new y(
|
|
156
|
-
"z",
|
|
157
|
-
1,
|
|
158
|
-
Math.PI / 2,
|
|
159
|
-
new c(0, 0, 1),
|
|
160
|
-
V
|
|
161
|
-
)
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
set debug(t) {
|
|
165
|
-
this.children.forEach((e) => {
|
|
166
|
-
e.debug = t;
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
reset() {
|
|
170
|
-
this.children.forEach((t) => {
|
|
171
|
-
t.reset();
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
handleHighlight(t, e, n) {
|
|
175
|
-
this.children.forEach((o) => {
|
|
176
|
-
n ? o.highlight = o.axis === t && n : o.highlight = o.axis === t && e;
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
onHandleHover(t, e) {
|
|
180
|
-
this._startRot || this.parent && this.parent.parent && (this.parent.parent.onHover("rotate", t.axis, e), this.handleHighlight(t.axis, e, !1));
|
|
181
|
-
}
|
|
182
|
-
onHandleDragStart(t) {
|
|
183
|
-
if (!this.parent || !this.parent.parent) return;
|
|
184
|
-
const e = this.parent.parent.object;
|
|
185
|
-
e && (this._startRot = e.rotation.clone(), this.handleHighlight(t.axis, !0, !0));
|
|
186
|
-
}
|
|
187
|
-
onHandleDrag(t, e) {
|
|
188
|
-
if (!this._startRot || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
|
|
189
|
-
const n = e.dragCurrent.clone().sub(this.parent.parent.position).normalize(), o = e.dragStart.clone().sub(this.parent.parent.position).normalize(), a = Q.signedAngleTo(
|
|
190
|
-
o,
|
|
191
|
-
n,
|
|
192
|
-
t.forwardVector
|
|
193
|
-
), h = new T(
|
|
194
|
-
this._startRot.x + t.forwardVector.x * a,
|
|
195
|
-
this._startRot.y + t.forwardVector.y * a,
|
|
196
|
-
this._startRot.z + t.forwardVector.z * a
|
|
197
|
-
);
|
|
198
|
-
this.parent.parent.onChange(void 0, h);
|
|
199
|
-
}
|
|
200
|
-
onHandleDragEnd(t) {
|
|
201
|
-
this._startRot = null, this.handleHighlight(t.axis, !1, !1);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
class M extends f {
|
|
205
|
-
constructor(t, e, n, o) {
|
|
206
|
-
super();
|
|
207
|
-
i(this, "isHoverable", !0);
|
|
208
|
-
i(this, "isDraggable", !0);
|
|
209
|
-
i(this, "parent", null);
|
|
210
|
-
i(this, "axis");
|
|
211
|
-
i(this, "_color", new b(16711935));
|
|
212
|
-
i(this, "_colorHover");
|
|
213
|
-
i(this, "_hovered");
|
|
214
|
-
i(this, "_highlight");
|
|
215
|
-
i(this, "_lineMaterial");
|
|
216
|
-
i(this, "_colliderMesh");
|
|
217
|
-
this.name = "DIVEAxisHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._highlight = !1, this._hovered = !1;
|
|
218
|
-
const a = new E(0.01, 0.01, e, 13);
|
|
219
|
-
this._lineMaterial = new g({
|
|
220
|
-
color: o,
|
|
221
|
-
depthTest: !1,
|
|
222
|
-
depthWrite: !1
|
|
223
|
-
});
|
|
224
|
-
const h = new p(a, this._lineMaterial);
|
|
225
|
-
h.layers.mask = d, h.renderOrder = 1 / 0, h.rotateX(Math.PI / 2), h.translateY(e / 2), this.add(h);
|
|
226
|
-
const l = new E(0.1, 0.1, e, 3), _ = new g({
|
|
227
|
-
color: 16711935,
|
|
228
|
-
transparent: !0,
|
|
229
|
-
opacity: 0.15,
|
|
230
|
-
depthTest: !1,
|
|
231
|
-
depthWrite: !1
|
|
232
|
-
});
|
|
233
|
-
this._colliderMesh = new p(l, _), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this._colliderMesh.rotateX(Math.PI / 2), this._colliderMesh.translateY(e / 2), this.add(this._colliderMesh), this.rotateX(n.y * -Math.PI / 2), this.rotateY(n.x * Math.PI / 2);
|
|
234
|
-
}
|
|
235
|
-
set debug(t) {
|
|
236
|
-
this._colliderMesh.visible = t;
|
|
237
|
-
}
|
|
238
|
-
get highlight() {
|
|
239
|
-
return this._highlight;
|
|
240
|
-
}
|
|
241
|
-
set highlight(t) {
|
|
242
|
-
this._highlight = t, this._lineMaterial.color = this._highlight || this._hovered ? this._colorHover : this._color;
|
|
243
|
-
}
|
|
244
|
-
get forwardVector() {
|
|
245
|
-
return new c(0, 0, 1).applyQuaternion(this.quaternion).normalize();
|
|
246
|
-
}
|
|
247
|
-
get rightVector() {
|
|
248
|
-
return new c(1, 0, 0).applyQuaternion(this.quaternion).normalize();
|
|
249
|
-
}
|
|
250
|
-
get upVector() {
|
|
251
|
-
return new c(0, 1, 0).applyQuaternion(this.quaternion).normalize();
|
|
252
|
-
}
|
|
253
|
-
reset() {
|
|
254
|
-
this._lineMaterial.color = this._color;
|
|
255
|
-
}
|
|
256
|
-
onPointerEnter() {
|
|
257
|
-
this._hovered = !0, this.parent && this.parent.onHandleHover(this, !0);
|
|
258
|
-
}
|
|
259
|
-
onPointerLeave() {
|
|
260
|
-
this._hovered = !1, this.parent && this.parent.onHandleHover(this, !1);
|
|
261
|
-
}
|
|
262
|
-
onDragStart() {
|
|
263
|
-
this.parent && this.parent.onHandleDragStart(this);
|
|
264
|
-
}
|
|
265
|
-
onDrag(t) {
|
|
266
|
-
this.parent && this.parent.onHandleDrag(this, t);
|
|
267
|
-
}
|
|
268
|
-
onDragEnd() {
|
|
269
|
-
this.parent && this.parent.onHandleDragEnd(this);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
class W extends f {
|
|
273
|
-
constructor(t) {
|
|
274
|
-
super();
|
|
275
|
-
i(this, "_controller");
|
|
276
|
-
i(this, "children");
|
|
277
|
-
i(this, "_startPos");
|
|
278
|
-
this.name = "DIVETranslateGizmo", this.children = [], this._startPos = null, this._controller = t, this.add(
|
|
279
|
-
new M("x", 1, new c(1, 0, 0), I)
|
|
280
|
-
), this.add(
|
|
281
|
-
new M("y", 1, new c(0, 1, 0), P)
|
|
282
|
-
), this.add(
|
|
283
|
-
new M("z", 1, new c(0, 0, 1), V)
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
set debug(t) {
|
|
287
|
-
this.children.forEach((e) => {
|
|
288
|
-
e.debug = t;
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
reset() {
|
|
292
|
-
this.children.forEach((t) => {
|
|
293
|
-
t.reset();
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
handleHighlight(t, e, n) {
|
|
297
|
-
this.children.forEach((o) => {
|
|
298
|
-
n ? o.highlight = o.axis === t && n : o.highlight = o.axis === t && e;
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
onHandleHover(t, e) {
|
|
302
|
-
this._startPos || this.parent && this.parent.parent && (this.parent.parent.onHover(
|
|
303
|
-
"translate",
|
|
304
|
-
t.axis,
|
|
305
|
-
e
|
|
306
|
-
), this.handleHighlight(t.axis, e, !1));
|
|
307
|
-
}
|
|
308
|
-
onHandleDragStart(t) {
|
|
309
|
-
if (!this.parent || !this.parent.parent) return;
|
|
310
|
-
const e = this.parent.parent.object;
|
|
311
|
-
e && (this._startPos = e.position.clone(), this.handleHighlight(t.axis, !0, !0));
|
|
312
|
-
}
|
|
313
|
-
onHandleDrag(t, e) {
|
|
314
|
-
if (!this._startPos || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
|
|
315
|
-
const n = e.dragDelta.clone().projectOnVector(t.forwardVector);
|
|
316
|
-
this.parent.parent.onChange(
|
|
317
|
-
this._startPos.clone().add(n)
|
|
318
|
-
);
|
|
319
|
-
}
|
|
320
|
-
onHandleDragEnd(t) {
|
|
321
|
-
this._startPos = null, this.handleHighlight(t.axis, !1, !1);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
class x extends f {
|
|
325
|
-
constructor(t, e, n, o, a = 0.05) {
|
|
326
|
-
super();
|
|
327
|
-
i(this, "isHoverable", !0);
|
|
328
|
-
i(this, "isDraggable", !0);
|
|
329
|
-
i(this, "parent", null);
|
|
330
|
-
i(this, "axis");
|
|
331
|
-
i(this, "_color", new b(16711935));
|
|
332
|
-
i(this, "_colorHover");
|
|
333
|
-
i(this, "_hovered");
|
|
334
|
-
i(this, "_highlight");
|
|
335
|
-
i(this, "_lineMaterial");
|
|
336
|
-
i(this, "_colliderMesh");
|
|
337
|
-
i(this, "_box");
|
|
338
|
-
i(this, "_boxSize");
|
|
339
|
-
this.name = "DIVEScaleHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._hovered = !1, this._highlight = !1, this._boxSize = a;
|
|
340
|
-
const h = new E(
|
|
341
|
-
0.01,
|
|
342
|
-
0.01,
|
|
343
|
-
e - a / 2,
|
|
344
|
-
13
|
|
345
|
-
);
|
|
346
|
-
this._lineMaterial = new g({
|
|
347
|
-
color: o,
|
|
348
|
-
depthTest: !1,
|
|
349
|
-
depthWrite: !1
|
|
350
|
-
});
|
|
351
|
-
const l = new p(h, this._lineMaterial);
|
|
352
|
-
l.layers.mask = d, l.renderOrder = 1 / 0, l.rotateX(Math.PI / 2), l.translateY(e / 2 - a / 4), this.add(l), this._box = new p(
|
|
353
|
-
new L(a, a, a),
|
|
354
|
-
this._lineMaterial
|
|
355
|
-
), this._box.layers.mask = d, this._box.renderOrder = 1 / 0, this._box.rotateX(Math.PI / 2), this._box.translateY(e - a / 2), this._box.rotateZ(n.x * Math.PI / 2), this._box.rotateX(n.z * Math.PI / 2), this.add(this._box);
|
|
356
|
-
const _ = new E(
|
|
357
|
-
0.1,
|
|
358
|
-
0.1,
|
|
359
|
-
e + a / 2,
|
|
360
|
-
3
|
|
361
|
-
), D = new g({
|
|
362
|
-
color: 16711935,
|
|
363
|
-
transparent: !0,
|
|
364
|
-
opacity: 0.15,
|
|
365
|
-
depthTest: !1,
|
|
366
|
-
depthWrite: !1
|
|
367
|
-
});
|
|
368
|
-
this._colliderMesh = new p(_, D), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this._colliderMesh.rotateX(Math.PI / 2), this._colliderMesh.translateY(e / 2), this.add(this._colliderMesh), this.rotateX(n.y * -Math.PI / 2), this.rotateY(n.x * Math.PI / 2);
|
|
369
|
-
}
|
|
370
|
-
set debug(t) {
|
|
371
|
-
this._colliderMesh.visible = t;
|
|
372
|
-
}
|
|
373
|
-
get highlight() {
|
|
374
|
-
return this._highlight;
|
|
375
|
-
}
|
|
376
|
-
set highlight(t) {
|
|
377
|
-
this._highlight = t, this._lineMaterial.color = this._highlight || this._hovered ? this._colorHover : this._color;
|
|
378
|
-
}
|
|
379
|
-
get forwardVector() {
|
|
380
|
-
return new c(0, 0, 1).applyQuaternion(this.quaternion).normalize();
|
|
381
|
-
}
|
|
382
|
-
get rightVector() {
|
|
383
|
-
return new c(1, 0, 0).applyQuaternion(this.quaternion).normalize();
|
|
384
|
-
}
|
|
385
|
-
get upVector() {
|
|
386
|
-
return new c(0, 1, 0).applyQuaternion(this.quaternion).normalize();
|
|
387
|
-
}
|
|
388
|
-
reset() {
|
|
389
|
-
this._lineMaterial.color = this._color;
|
|
390
|
-
}
|
|
391
|
-
update(t) {
|
|
392
|
-
this._box.scale.copy(
|
|
393
|
-
new c(1, 1, 1).sub(this.forwardVector).add(
|
|
394
|
-
// to then add ...
|
|
395
|
-
t.clone().multiply(this.forwardVector)
|
|
396
|
-
// that is scaled by the forward vector again to get the forward vector as the only direction
|
|
397
|
-
)
|
|
398
|
-
);
|
|
399
|
-
}
|
|
400
|
-
onPointerEnter() {
|
|
401
|
-
this._hovered = !0, this.parent && this.parent.onHoverAxis(this, !0);
|
|
402
|
-
}
|
|
403
|
-
onPointerLeave() {
|
|
404
|
-
this._hovered = !1, this.parent && this.parent.onHoverAxis(this, !1);
|
|
405
|
-
}
|
|
406
|
-
onDragStart() {
|
|
407
|
-
this.parent && this.parent.onAxisDragStart(this);
|
|
408
|
-
}
|
|
409
|
-
onDrag(t) {
|
|
410
|
-
this.parent && this.parent.onAxisDrag(this, t);
|
|
411
|
-
}
|
|
412
|
-
onDragEnd() {
|
|
413
|
-
this.parent && this.parent.onAxisDragEnd(this);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
class k extends f {
|
|
417
|
-
constructor(t) {
|
|
418
|
-
super();
|
|
419
|
-
i(this, "isHoverable", !0);
|
|
420
|
-
i(this, "children");
|
|
421
|
-
i(this, "_controller");
|
|
422
|
-
i(this, "_startScale");
|
|
423
|
-
this.name = "DIVEScaleGizmo", this.children = [], this._startScale = null, this._controller = t, this.add(
|
|
424
|
-
new x("x", 1, new c(1, 0, 0), I)
|
|
425
|
-
), this.add(
|
|
426
|
-
new x("y", 1, new c(0, 1, 0), P)
|
|
427
|
-
), this.add(
|
|
428
|
-
new x("z", 1, new c(0, 0, 1), V)
|
|
429
|
-
);
|
|
430
|
-
}
|
|
431
|
-
set debug(t) {
|
|
432
|
-
this.children.forEach((e) => {
|
|
433
|
-
e.debug = t;
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
reset() {
|
|
437
|
-
this.children.forEach((t) => {
|
|
438
|
-
t.reset();
|
|
439
|
-
});
|
|
440
|
-
}
|
|
441
|
-
update(t) {
|
|
442
|
-
this.children.forEach((e) => {
|
|
443
|
-
e.update(t);
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
handleHighlight(t, e, n) {
|
|
447
|
-
this.children.forEach((o) => {
|
|
448
|
-
n ? o.highlight = o.axis === t && n : o.highlight = o.axis === t && e;
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
onHoverAxis(t, e) {
|
|
452
|
-
this._startScale || this.parent && this.parent.parent && (this.parent.parent.onHover(
|
|
453
|
-
"translate",
|
|
454
|
-
t.axis,
|
|
455
|
-
e
|
|
456
|
-
), this.handleHighlight(t.axis, e, !1));
|
|
457
|
-
}
|
|
458
|
-
onAxisDragStart(t) {
|
|
459
|
-
if (!this.parent || !this.parent.parent) return;
|
|
460
|
-
const e = this.parent.parent.object;
|
|
461
|
-
e && (this._startScale = e.scale.clone(), this.handleHighlight(t.axis, !0, !0));
|
|
462
|
-
}
|
|
463
|
-
onAxisDrag(t, e) {
|
|
464
|
-
if (!this._startScale || !this.parent || !this.parent.parent || !("onChange" in this.parent.parent)) return;
|
|
465
|
-
const n = e.dragDelta.clone().projectOnVector(t.forwardVector);
|
|
466
|
-
this.parent.parent.onChange(
|
|
467
|
-
void 0,
|
|
468
|
-
void 0,
|
|
469
|
-
this._startScale.clone().add(n)
|
|
470
|
-
);
|
|
471
|
-
}
|
|
472
|
-
onAxisDragEnd(t) {
|
|
473
|
-
this._startScale = null, this.handleHighlight(t.axis, !1, !1);
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
class B extends f {
|
|
477
|
-
constructor() {
|
|
478
|
-
super();
|
|
479
|
-
i(this, "_meshX");
|
|
480
|
-
i(this, "_meshY");
|
|
481
|
-
i(this, "_meshZ");
|
|
482
|
-
this.name = "DIVEGizmoPlane";
|
|
483
|
-
const t = new g({
|
|
484
|
-
transparent: !0,
|
|
485
|
-
opacity: 0.15,
|
|
486
|
-
depthTest: !1,
|
|
487
|
-
depthWrite: !1,
|
|
488
|
-
side: 2
|
|
489
|
-
}), e = new w(100, 100, 2, 2), n = t.clone();
|
|
490
|
-
n.color.set(16711680), this._meshX = new p(e, n), this._meshX.layers.mask = d, this._meshX.rotateY(Math.PI / 2);
|
|
491
|
-
const o = new w(100, 100, 2, 2), a = t.clone();
|
|
492
|
-
a.color.set(65280), this._meshY = new p(o, a), this._meshY.layers.mask = d, this._meshY.rotateX(-Math.PI / 2);
|
|
493
|
-
const h = new w(100, 100, 2, 2), l = t.clone();
|
|
494
|
-
l.color.set(255), this._meshZ = new p(h, l), this._meshZ.layers.mask = d;
|
|
495
|
-
}
|
|
496
|
-
get XPlane() {
|
|
497
|
-
return this._meshX;
|
|
498
|
-
}
|
|
499
|
-
get YPlane() {
|
|
500
|
-
return this._meshY;
|
|
501
|
-
}
|
|
502
|
-
get ZPlane() {
|
|
503
|
-
return this._meshZ;
|
|
504
|
-
}
|
|
505
|
-
assemble(t, e) {
|
|
506
|
-
if (this.clear(), t === "translate" || t === "scale")
|
|
507
|
-
switch (e) {
|
|
508
|
-
case "x":
|
|
509
|
-
this.add(this._meshY), this.add(this._meshZ);
|
|
510
|
-
break;
|
|
511
|
-
case "y":
|
|
512
|
-
this.add(this._meshX), this.add(this._meshZ);
|
|
513
|
-
break;
|
|
514
|
-
case "z":
|
|
515
|
-
this.add(this._meshX), this.add(this._meshY);
|
|
516
|
-
break;
|
|
517
|
-
}
|
|
518
|
-
else if (t === "rotate")
|
|
519
|
-
switch (e) {
|
|
520
|
-
case "x":
|
|
521
|
-
this.add(this._meshX);
|
|
522
|
-
break;
|
|
523
|
-
case "y":
|
|
524
|
-
this.add(this._meshY);
|
|
525
|
-
break;
|
|
526
|
-
case "z":
|
|
527
|
-
this.add(this._meshZ);
|
|
528
|
-
break;
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
class it extends f {
|
|
533
|
-
constructor(t) {
|
|
534
|
-
super();
|
|
535
|
-
i(this, "_mode");
|
|
536
|
-
i(this, "_gizmoNode");
|
|
537
|
-
i(this, "_translateGizmo");
|
|
538
|
-
i(this, "_rotateGizmo");
|
|
539
|
-
i(this, "_scaleGizmo");
|
|
540
|
-
i(this, "_gizmoPlane");
|
|
541
|
-
// attachment stuff
|
|
542
|
-
i(this, "_object");
|
|
543
|
-
this.name = "DIVEGizmo", t.addEventListener("change", () => {
|
|
544
|
-
const e = t.getDistance() / 2.5;
|
|
545
|
-
this.scale.set(e, e, e);
|
|
546
|
-
}), this._mode = "translate", this._gizmoNode = new f(), this.add(this._gizmoNode), this._translateGizmo = new W(t), this._rotateGizmo = new U(t), this._scaleGizmo = new k(t), this._gizmoPlane = new B(), this._gizmoPlane.visible = !1, this._object = null;
|
|
547
|
-
}
|
|
548
|
-
get mode() {
|
|
549
|
-
return this._mode;
|
|
550
|
-
}
|
|
551
|
-
set mode(t) {
|
|
552
|
-
this._mode = t, this.assemble();
|
|
553
|
-
}
|
|
554
|
-
set debug(t) {
|
|
555
|
-
this._translateGizmo.debug = t, this._rotateGizmo.debug = t, this._scaleGizmo.debug = t;
|
|
556
|
-
}
|
|
557
|
-
get gizmoNode() {
|
|
558
|
-
return this._gizmoNode;
|
|
559
|
-
}
|
|
560
|
-
get gizmoPlane() {
|
|
561
|
-
return this._gizmoPlane;
|
|
562
|
-
}
|
|
563
|
-
get object() {
|
|
564
|
-
return this._object;
|
|
565
|
-
}
|
|
566
|
-
attach(t) {
|
|
567
|
-
return this._object = t, this.assemble(), this;
|
|
568
|
-
}
|
|
569
|
-
detach() {
|
|
570
|
-
return this._object = null, this.assemble(), this;
|
|
571
|
-
}
|
|
572
|
-
onHover(t, e, n) {
|
|
573
|
-
n && this._gizmoPlane.assemble(t, e);
|
|
574
|
-
}
|
|
575
|
-
onChange(t, e, n) {
|
|
576
|
-
this.object !== null && (t && (this.position.copy(t), this.object.position.copy(t)), e && this.object.rotation.copy(e), n && (this.object.scale.copy(n), this._scaleGizmo.update(n)));
|
|
577
|
-
}
|
|
578
|
-
assemble() {
|
|
579
|
-
this._gizmoNode.clear(), this._gizmoPlane.clear(), this._translateGizmo.reset(), this._rotateGizmo.reset(), this._scaleGizmo.reset(), this.object !== null && (this._mode === "translate" && this._gizmoNode.add(this._translateGizmo), this._mode === "rotate" && this._gizmoNode.add(this._rotateGizmo), this._mode === "scale" && this._gizmoNode.add(this._scaleGizmo), this.add(this._gizmoPlane));
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
class nt {
|
|
1
|
+
var g = Object.defineProperty;
|
|
2
|
+
var O = (e, t, r) => t in e ? g(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var u = (e, t, r) => O(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { h as d } from "./chunks/FileTypes-DGSsi-AX.mjs";
|
|
5
|
+
import { B as G, i as j, c as v, j as H, D as b, k as J, l as W, a as q, b as z, m as X, n as Q, o as Z, f as $, d as k, p as ee, q as te, r as re, s as ne, t as oe, u as se, v as ae, w as ce, F as ie, x as fe, G as pe, y as ue, z as le, H as Ee, M as me, A as De, P as ge, S as Oe, C as de, E as Ae, e as Ie, I as ye, g as he, J as Ce } from "./chunks/FileTypes-DGSsi-AX.mjs";
|
|
6
|
+
import { b as Me, e as xe, a as Se, d as Re, A as Le, c as Ve } from "./chunks/AxisHelperColors-JLBHYQDi.mjs";
|
|
7
|
+
import { C as Te, D as we, F as Fe, H as Ne, P as Ye, a as Be, U as Ue, c as Ke } from "./chunks/contributesToBounds-DYmHYES4.mjs";
|
|
8
|
+
import { A as je, P as ve, a as He, d as be } from "./chunks/detachTransformControls-Dr3TIdVy.mjs";
|
|
9
|
+
import { M as We } from "./chunks/ModelComponent-DkfAgTL0.mjs";
|
|
10
|
+
import { S as ze } from "./chunks/SpriteTextComponent-CG5vfiFy.mjs";
|
|
11
|
+
import { c as Qe } from "./chunks/collectAnimations-BgYCN1le.mjs";
|
|
12
|
+
import { f as $e, i as ke, a as et } from "./chunks/isVisibleInHierarchy-KzVGvDEw.mjs";
|
|
13
|
+
import { i as A, g as I } from "./chunks/isFileExtensionSupported-CgcqpgqN.mjs";
|
|
14
|
+
import { MathUtils as E } from "three/webgpu";
|
|
15
|
+
import { F as rt, N as nt } from "./chunks/network-error-BONfHWQq.mjs";
|
|
16
|
+
import { F as st, P as at } from "./chunks/parse-error-DfOPyLWM.mjs";
|
|
17
|
+
class T {
|
|
583
18
|
constructor() {
|
|
584
|
-
|
|
19
|
+
u(this, "isMovable", !0);
|
|
585
20
|
}
|
|
586
21
|
}
|
|
587
|
-
class
|
|
22
|
+
class w {
|
|
588
23
|
constructor() {
|
|
589
|
-
|
|
24
|
+
u(this, "isSelectable", !0);
|
|
590
25
|
}
|
|
591
26
|
}
|
|
592
|
-
function
|
|
593
|
-
return
|
|
594
|
-
Object.getOwnPropertyNames(
|
|
595
|
-
if (
|
|
27
|
+
function F(e, t) {
|
|
28
|
+
return t.forEach((r) => {
|
|
29
|
+
Object.getOwnPropertyNames(r.prototype).forEach((a) => {
|
|
30
|
+
if (a === "constructor")
|
|
596
31
|
return;
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
|
|
32
|
+
const c = Object.getOwnPropertyDescriptor(
|
|
33
|
+
r.prototype,
|
|
34
|
+
a
|
|
600
35
|
);
|
|
601
|
-
Object.defineProperty(
|
|
36
|
+
Object.defineProperty(e.prototype, a, c);
|
|
602
37
|
});
|
|
603
|
-
const
|
|
604
|
-
Object.getOwnPropertyNames(
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
|
|
38
|
+
const n = new r();
|
|
39
|
+
Object.getOwnPropertyNames(n).forEach((a) => {
|
|
40
|
+
const c = Object.getOwnPropertyDescriptor(
|
|
41
|
+
n,
|
|
42
|
+
a
|
|
608
43
|
);
|
|
609
|
-
Object.defineProperty(
|
|
44
|
+
Object.defineProperty(e.prototype, a, c);
|
|
610
45
|
});
|
|
611
|
-
}),
|
|
46
|
+
}), e;
|
|
612
47
|
}
|
|
613
|
-
function
|
|
614
|
-
if (
|
|
615
|
-
return
|
|
616
|
-
if (
|
|
617
|
-
return
|
|
618
|
-
if (
|
|
619
|
-
return new Date(
|
|
620
|
-
if (
|
|
621
|
-
return new RegExp(
|
|
622
|
-
if (Array.isArray(
|
|
623
|
-
const
|
|
624
|
-
|
|
625
|
-
for (let
|
|
626
|
-
|
|
627
|
-
return
|
|
628
|
-
}
|
|
629
|
-
if (
|
|
630
|
-
const
|
|
631
|
-
|
|
632
|
-
for (const [
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
Object.defineProperty(e, a, {
|
|
660
|
-
...h,
|
|
661
|
-
value: l
|
|
48
|
+
function p(e, t = /* @__PURE__ */ new WeakMap()) {
|
|
49
|
+
if (e === null || typeof e != "object")
|
|
50
|
+
return e;
|
|
51
|
+
if (t.has(e))
|
|
52
|
+
return t.get(e);
|
|
53
|
+
if (e instanceof Date)
|
|
54
|
+
return new Date(e.getTime());
|
|
55
|
+
if (e instanceof RegExp)
|
|
56
|
+
return new RegExp(e.source, e.flags);
|
|
57
|
+
if (Array.isArray(e)) {
|
|
58
|
+
const o = [];
|
|
59
|
+
t.set(e, o);
|
|
60
|
+
for (let s = 0; s < e.length; s++)
|
|
61
|
+
o[s] = p(e[s], t);
|
|
62
|
+
return o;
|
|
63
|
+
}
|
|
64
|
+
if (e instanceof Map) {
|
|
65
|
+
const o = /* @__PURE__ */ new Map();
|
|
66
|
+
t.set(e, o);
|
|
67
|
+
for (const [s, f] of e)
|
|
68
|
+
o.set(p(s, t), p(f, t));
|
|
69
|
+
return o;
|
|
70
|
+
}
|
|
71
|
+
if (e instanceof Set) {
|
|
72
|
+
const o = /* @__PURE__ */ new Set();
|
|
73
|
+
t.set(e, o);
|
|
74
|
+
for (const s of e)
|
|
75
|
+
o.add(p(s, t));
|
|
76
|
+
return o;
|
|
77
|
+
}
|
|
78
|
+
const r = e;
|
|
79
|
+
if (typeof r.clone == "function") {
|
|
80
|
+
const o = r.clone();
|
|
81
|
+
return t.set(e, o), o;
|
|
82
|
+
}
|
|
83
|
+
const n = Object.create(Object.getPrototypeOf(e));
|
|
84
|
+
t.set(e, n);
|
|
85
|
+
const a = Object.getOwnPropertyNames(e);
|
|
86
|
+
for (const o of a) {
|
|
87
|
+
const s = Object.getOwnPropertyDescriptor(e, o);
|
|
88
|
+
if (s)
|
|
89
|
+
if (s.value !== void 0) {
|
|
90
|
+
const f = p(s.value, t);
|
|
91
|
+
Object.defineProperty(n, o, {
|
|
92
|
+
...s,
|
|
93
|
+
value: f
|
|
662
94
|
});
|
|
663
95
|
} else
|
|
664
|
-
Object.defineProperty(
|
|
665
|
-
}
|
|
666
|
-
const
|
|
667
|
-
for (const
|
|
668
|
-
const
|
|
669
|
-
if (
|
|
670
|
-
if (
|
|
671
|
-
const
|
|
672
|
-
Object.defineProperty(
|
|
673
|
-
...
|
|
674
|
-
value:
|
|
96
|
+
Object.defineProperty(n, o, s);
|
|
97
|
+
}
|
|
98
|
+
const c = Object.getOwnPropertySymbols(e);
|
|
99
|
+
for (const o of c) {
|
|
100
|
+
const s = Object.getOwnPropertyDescriptor(e, o);
|
|
101
|
+
if (s)
|
|
102
|
+
if (s.value !== void 0) {
|
|
103
|
+
const f = p(s.value, t);
|
|
104
|
+
Object.defineProperty(n, o, {
|
|
105
|
+
...s,
|
|
106
|
+
value: f
|
|
675
107
|
});
|
|
676
108
|
} else
|
|
677
|
-
Object.defineProperty(
|
|
109
|
+
Object.defineProperty(n, o, s);
|
|
678
110
|
}
|
|
679
|
-
return
|
|
111
|
+
return n;
|
|
680
112
|
}
|
|
681
|
-
const
|
|
682
|
-
if (Object.keys(
|
|
113
|
+
const l = (e, t) => {
|
|
114
|
+
if (Object.keys(e).length === 0 && Object.keys(t).length === 0)
|
|
683
115
|
return {};
|
|
684
|
-
if (typeof
|
|
685
|
-
return
|
|
686
|
-
let
|
|
687
|
-
return Object.keys(
|
|
688
|
-
if (!Object.keys(
|
|
689
|
-
|
|
116
|
+
if (typeof e != "object" || typeof t != "object")
|
|
117
|
+
return t;
|
|
118
|
+
let r = {};
|
|
119
|
+
return Object.keys(t).forEach((n) => {
|
|
120
|
+
if (!Object.keys(e).includes(n)) {
|
|
121
|
+
r = { ...r, [n]: t[n] };
|
|
690
122
|
return;
|
|
691
123
|
}
|
|
692
|
-
if (Array.isArray(
|
|
693
|
-
if (!Array.isArray(
|
|
694
|
-
|
|
124
|
+
if (Array.isArray(t[n])) {
|
|
125
|
+
if (!Array.isArray(e[n])) {
|
|
126
|
+
r = { ...r, [n]: t[n] };
|
|
695
127
|
return;
|
|
696
128
|
}
|
|
697
|
-
const
|
|
698
|
-
if (
|
|
699
|
-
|
|
129
|
+
const a = e[n], c = t[n];
|
|
130
|
+
if (a.length === 0 && c.length === 0) {
|
|
131
|
+
r = { ...r };
|
|
700
132
|
return;
|
|
701
133
|
}
|
|
702
|
-
if (
|
|
703
|
-
|
|
134
|
+
if (a.length !== c.length) {
|
|
135
|
+
r = { ...r, [n]: t[n] };
|
|
704
136
|
return;
|
|
705
137
|
}
|
|
706
|
-
const
|
|
707
|
-
if (
|
|
708
|
-
const
|
|
709
|
-
|
|
710
|
-
|
|
138
|
+
const o = [];
|
|
139
|
+
if (c.forEach((s, f) => {
|
|
140
|
+
const D = l(
|
|
141
|
+
a[f],
|
|
142
|
+
c[f]
|
|
711
143
|
);
|
|
712
|
-
Object.keys(
|
|
713
|
-
}), Object.keys(
|
|
714
|
-
|
|
144
|
+
Object.keys(D).length && o.push(c[f]);
|
|
145
|
+
}), Object.keys(o).length) {
|
|
146
|
+
r = { ...r, [n]: o };
|
|
715
147
|
return;
|
|
716
148
|
}
|
|
717
149
|
return;
|
|
718
150
|
}
|
|
719
|
-
if (typeof
|
|
720
|
-
if (typeof
|
|
721
|
-
|
|
151
|
+
if (typeof t[n] == "object") {
|
|
152
|
+
if (typeof e[n] != "object") {
|
|
153
|
+
r = { ...r, [n]: t[n] };
|
|
722
154
|
return;
|
|
723
155
|
}
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
-
|
|
156
|
+
const a = l(
|
|
157
|
+
e[n],
|
|
158
|
+
t[n]
|
|
727
159
|
);
|
|
728
|
-
if (Object.keys(
|
|
729
|
-
|
|
160
|
+
if (Object.keys(a).length) {
|
|
161
|
+
r = { ...r, [n]: a };
|
|
730
162
|
return;
|
|
731
163
|
}
|
|
732
164
|
}
|
|
733
|
-
|
|
734
|
-
}),
|
|
165
|
+
e[n] !== t[n] && (r = { ...r, [n]: t[n] });
|
|
166
|
+
}), r;
|
|
735
167
|
};
|
|
736
|
-
function
|
|
737
|
-
return
|
|
168
|
+
function N(e) {
|
|
169
|
+
return d.includes(e.toLowerCase());
|
|
738
170
|
}
|
|
739
|
-
function
|
|
740
|
-
return
|
|
171
|
+
function Y(e) {
|
|
172
|
+
return A(I(e));
|
|
741
173
|
}
|
|
742
|
-
function
|
|
743
|
-
|
|
174
|
+
function i(e, t) {
|
|
175
|
+
const r = (e + "e").split("e");
|
|
176
|
+
return +(r[0] + "e" + (+r[1] + (t || 0)));
|
|
744
177
|
}
|
|
745
|
-
function
|
|
746
|
-
|
|
178
|
+
function y(e, t = 0) {
|
|
179
|
+
const r = i(e, +t);
|
|
180
|
+
return i(Math.ceil(r), -t);
|
|
747
181
|
}
|
|
748
|
-
function
|
|
749
|
-
|
|
182
|
+
function h(e, t = 0) {
|
|
183
|
+
const r = i(e, +t);
|
|
184
|
+
return i(Math.floor(r), -t);
|
|
750
185
|
}
|
|
751
|
-
function
|
|
752
|
-
return
|
|
186
|
+
function m(e, t = 0) {
|
|
187
|
+
if (e < 0) return -m(-e, t);
|
|
188
|
+
const r = i(e, +t);
|
|
189
|
+
return i(Math.round(r), -t);
|
|
753
190
|
}
|
|
191
|
+
function C(e, t, r) {
|
|
192
|
+
return Math.atan2(
|
|
193
|
+
e.clone().cross(t).dot(r),
|
|
194
|
+
t.clone().dot(e)
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
function P(e, t = 0) {
|
|
198
|
+
const r = i(e, +t);
|
|
199
|
+
return i(Math.round(r), -t).toFixed(t);
|
|
200
|
+
}
|
|
201
|
+
function M(e, t = 0) {
|
|
202
|
+
const r = i(e, +t);
|
|
203
|
+
return i(Math.trunc(r), -t);
|
|
204
|
+
}
|
|
205
|
+
function x(e) {
|
|
206
|
+
return (E.radToDeg(e) + 360) % 360;
|
|
207
|
+
}
|
|
208
|
+
function S(e) {
|
|
209
|
+
return E.degToRad(e);
|
|
210
|
+
}
|
|
211
|
+
const B = {
|
|
212
|
+
ceilExp: y,
|
|
213
|
+
floorExp: h,
|
|
214
|
+
roundExp: m,
|
|
215
|
+
toFixedExp: P,
|
|
216
|
+
truncateExp: M,
|
|
217
|
+
signedAngleTo: C,
|
|
218
|
+
radToDeg: x,
|
|
219
|
+
degToRad: S
|
|
220
|
+
};
|
|
754
221
|
export {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
222
|
+
je as AmbientLightComponent,
|
|
223
|
+
Me as AxesColorBlue,
|
|
224
|
+
xe as AxesColorBlueLetter,
|
|
225
|
+
Se as AxesColorGreen,
|
|
226
|
+
Re as AxesColorGreenLetter,
|
|
227
|
+
Le as AxesColorRed,
|
|
228
|
+
Ve as AxesColorRedLetter,
|
|
229
|
+
G as BoundingBox,
|
|
230
|
+
j as BoundingBoxComponent,
|
|
231
|
+
Te as COORDINATE_LAYER_MASK,
|
|
232
|
+
we as DEFAULT_LAYER_MASK,
|
|
233
|
+
v as DIVE,
|
|
234
|
+
H as DIVEAbortablePromise,
|
|
235
|
+
b as DIVECameraComponent,
|
|
236
|
+
J as DIVECanvasLifecycleManager,
|
|
237
|
+
W as DIVEClock,
|
|
238
|
+
q as DIVEComponent,
|
|
239
|
+
z as DIVEDefaultSettings,
|
|
240
|
+
X as DIVEDeferredPromise,
|
|
241
|
+
Q as DIVEEnvironment,
|
|
242
|
+
Z as DIVEEnvironmentDefaultSettings,
|
|
243
|
+
$ as DIVELightComponent,
|
|
244
|
+
B as DIVEMath,
|
|
245
|
+
T as DIVEMovable,
|
|
246
|
+
k as DIVENode,
|
|
247
|
+
ee as DIVEPerspectiveCameraDefaultSettings,
|
|
248
|
+
te as DIVERenderer,
|
|
249
|
+
re as DIVERendererDefaultSettings,
|
|
250
|
+
ne as DIVERoot,
|
|
251
|
+
oe as DIVEScene,
|
|
252
|
+
se as DIVESceneDefaultSettings,
|
|
253
|
+
w as DIVESelectable,
|
|
254
|
+
ae as DIVEView,
|
|
255
|
+
ce as DirectionalLightComponent,
|
|
256
|
+
ie as FILE_TYPES,
|
|
257
|
+
Fe as FLOOR_LAYER_MASK,
|
|
258
|
+
rt as FileContentError,
|
|
259
|
+
st as FileTypeError,
|
|
260
|
+
fe as FloorComponent,
|
|
261
|
+
pe as GRID_MAJOR_LINE_COLOR,
|
|
262
|
+
ue as GRID_MINOR_LINE_COLOR,
|
|
263
|
+
le as GridComponent,
|
|
264
|
+
Ne as HELPER_LAYER_MASK,
|
|
265
|
+
Ee as HemisphereLightComponent,
|
|
266
|
+
me as MeshComponent,
|
|
267
|
+
We as ModelComponent,
|
|
268
|
+
De as MultiLineComponent,
|
|
269
|
+
nt as NetworkError,
|
|
270
|
+
Ye as PRODUCT_LAYER_MASK,
|
|
271
|
+
Be as PROXY_LAYER_MASK,
|
|
272
|
+
at as ParseError,
|
|
273
|
+
ge as PerspectiveCameraComponent,
|
|
274
|
+
ve as PointLightComponent,
|
|
275
|
+
He as PrimitiveComponent,
|
|
276
|
+
Oe as SUPPORTED_FILE_TYPES,
|
|
277
|
+
d as SUPPORTED_MIME_TYPES,
|
|
278
|
+
ze as SpriteTextComponent,
|
|
279
|
+
Ue as UI_LAYER_MASK,
|
|
280
|
+
F as applyMixins,
|
|
281
|
+
Qe as collectAnimations,
|
|
282
|
+
de as computeProductBounds,
|
|
283
|
+
Ae as contributedBy,
|
|
284
|
+
Ke as contributesToBounds,
|
|
285
|
+
p as deepClone,
|
|
286
|
+
be as detachTransformControls,
|
|
287
|
+
Ie as disposeComponents,
|
|
288
|
+
ye as findComponent,
|
|
289
|
+
$e as findInterface,
|
|
290
|
+
he as findSceneRecursive,
|
|
291
|
+
I as getFileTypeFromUri,
|
|
292
|
+
l as getObjectDelta,
|
|
293
|
+
ke as implementsInterface,
|
|
294
|
+
Ce as isDIVEComponent,
|
|
295
|
+
A as isFileExtensionSupported,
|
|
296
|
+
N as isMimeTypeSupported,
|
|
297
|
+
Y as isURIFileExtensionSupported,
|
|
298
|
+
et as isVisibleInHierarchy
|
|
821
299
|
};
|