endset_three_editor 0.6.3 → 0.6.4
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/dist/three-editor.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var gn = Object.defineProperty;
|
|
2
2
|
var bn = (r, e, t) => e in r ? gn(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var Ue = (r, e, t) => bn(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { toRaw as Wt, defineComponent as ve, ref as
|
|
4
|
+
import { toRaw as Wt, defineComponent as ve, ref as N, inject as Cn, computed as $e, watchEffect as In, resolveComponent as yn, openBlock as R, createElementBlock as P, createElementVNode as b, normalizeClass as oe, withModifiers as Yt, unref as xn, toDisplayString as B, Fragment as Pe, renderList as jt, createBlock as nt, createCommentVNode as X, reactive as _t, watch as le, withDirectives as k, vModelText as O, withKeys as ze, vModelCheckbox as vn, toRef as Sn, provide as Tn, createVNode as zt, vShow as Le, shallowRef as ms, onMounted as Mn, onBeforeUnmount as wn } from "vue";
|
|
5
5
|
import * as w from "three";
|
|
6
|
-
import { Controls as qs, Vector3 as
|
|
6
|
+
import { Controls as qs, Vector3 as M, MOUSE as Ke, TOUCH as Ge, Quaternion as Q, Spherical as gs, Vector2 as F, Ray as Rn, Plane as En, MathUtils as Vs, Raycaster as kn, Object3D as Ze, MeshBasicMaterial as Oe, LineBasicMaterial as it, CylinderGeometry as V, BoxGeometry as K, BufferGeometry as De, Float32BufferAttribute as Ae, Mesh as T, OctahedronGeometry as gt, Line as he, TorusGeometry as Ve, SphereGeometry as Pn, Euler as Ln, Matrix4 as pe, PlaneGeometry as On, DoubleSide as Pt, OrthographicCamera as Js, ShaderMaterial as ke, UniformsUtils as ls, WebGLRenderTarget as be, HalfFloatType as Re, NoBlending as $t, Timer as Nn, Color as Z, RawShaderMaterial as Dn, ColorManagement as Lt, SRGBTransfer as Wn, LinearToneMapping as jn, ReinhardToneMapping as Fn, CineonToneMapping as Un, ACESFilmicToneMapping as Hn, AgXToneMapping as zn, NeutralToneMapping as Gn, CustomToneMapping as Kn, MeshDepthMaterial as Bn, RGBADepthPacking as Zn, AdditiveBlending as Xn, Loader as As, FileLoader as ct, SRGBColorSpace as fe, Group as Tt, Material as ot, PointsMaterial as et, MeshPhongMaterial as qn, LineSegments as es, Points as Mt, TrianglesDrawMode as Vn, TriangleFanDrawMode as ts, TriangleStripDrawMode as Qs, LoaderUtils as rt, MeshPhysicalMaterial as ue, LinearSRGBColorSpace as ce, SpotLight as Jn, PointLight as Qn, DirectionalLight as Yn, InstancedMesh as _n, InstancedBufferAttribute as $n, TextureLoader as ei, ImageBitmapLoader as ti, BufferAttribute as at, InterleavedBuffer as Ys, InterleavedBufferAttribute as _s, LinearMipmapLinearFilter as $s, NearestMipmapLinearFilter as si, LinearMipmapNearestFilter as ni, NearestMipmapNearestFilter as ii, LinearFilter as ss, NearestFilter as en, RepeatWrapping as ns, MirroredRepeatWrapping as oi, ClampToEdgeWrapping as ri, MeshStandardMaterial as tn, PropertyBinding as ai, SkinnedMesh as li, LineLoop as Ai, PerspectiveCamera as ci, Skeleton as ui, AnimationClip as di, Bone as hi, InterpolateDiscrete as fi, InterpolateLinear as sn, Texture as bs, VectorKeyframeTrack as Cs, NumberKeyframeTrack as Is, QuaternionKeyframeTrack as ys, FrontSide as pi, Interpolant as mi, Box3 as gi, Sphere as bi } from "three";
|
|
7
7
|
import ut from "@tweenjs/tween.js";
|
|
8
|
-
const xs = { type: "change" }, cs = { type: "start" }, nn = { type: "end" }, bt = new Rn(), vs = new En(), Ci = Math.cos(70 * Vs.DEG2RAD), z = new
|
|
8
|
+
const xs = { type: "change" }, cs = { type: "start" }, nn = { type: "end" }, bt = new Rn(), vs = new En(), Ci = Math.cos(70 * Vs.DEG2RAD), z = new M(), J = 2 * Math.PI, D = {
|
|
9
9
|
NONE: -1,
|
|
10
10
|
ROTATE: 0,
|
|
11
11
|
DOLLY: 1,
|
|
@@ -23,7 +23,7 @@ class Ii extends qs {
|
|
|
23
23
|
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
24
24
|
*/
|
|
25
25
|
constructor(e, t = null) {
|
|
26
|
-
super(e, t), this.state = D.NONE, this.target = new
|
|
26
|
+
super(e, t), this.state = D.NONE, 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.keyRotateSpeed = 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: Ke.ROTATE, MIDDLE: Ke.DOLLY, RIGHT: Ke.PAN }, this.touches = { ONE: Ge.ROTATE, TWO: Ge.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new M(), this._lastQuaternion = new Q(), this._lastTargetPosition = new M(), this._quat = new Q().setFromUnitVectors(e.up, new M(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new gs(), this._sphericalDelta = new gs(), this._scale = 1, this._panOffset = new M(), this._rotateStart = new F(), this._rotateEnd = new F(), this._rotateDelta = new F(), this._panStart = new F(), this._panEnd = new F(), this._panDelta = new F(), this._dollyStart = new F(), this._dollyEnd = new F(), this._dollyDelta = new F(), this._dollyDirection = new M(), this._mouse = new F(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = xi.bind(this), this._onPointerDown = yi.bind(this), this._onPointerUp = vi.bind(this), this._onContextMenu = ki.bind(this), this._onMouseWheel = Mi.bind(this), this._onKeyDown = wi.bind(this), this._onTouchStart = Ri.bind(this), this._onTouchMove = Ei.bind(this), this._onMouseDown = Si.bind(this), this._onMouseMove = Ti.bind(this), this._interceptControlDown = Pi.bind(this), this._interceptControlUp = Li.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Defines the visual representation of the cursor.
|
|
@@ -143,7 +143,7 @@ class Ii extends qs {
|
|
|
143
143
|
const t = this.object.position;
|
|
144
144
|
z.copy(t).sub(this.target), z.applyQuaternion(this._quat), this._spherical.setFromVector3(z), this.autoRotate && this.state === D.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
|
|
145
145
|
let n = this.minAzimuthAngle, s = this.maxAzimuthAngle;
|
|
146
|
-
isFinite(n) && isFinite(s) && (n < -Math.PI ? n +=
|
|
146
|
+
isFinite(n) && isFinite(s) && (n < -Math.PI ? n += J : n > Math.PI && (n -= J), s < -Math.PI ? s += J : s > Math.PI && (s -= J), n <= s ? this._spherical.theta = Math.max(n, Math.min(s, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (n + s) / 2 ? Math.max(n, this._spherical.theta) : Math.min(s, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
|
|
147
147
|
let i = !1;
|
|
148
148
|
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
|
|
149
149
|
this._spherical.radius = this._clampDistance(this._spherical.radius);
|
|
@@ -159,11 +159,11 @@ class Ii extends qs {
|
|
|
159
159
|
const l = a - o;
|
|
160
160
|
this.object.position.addScaledVector(this._dollyDirection, l), this.object.updateMatrixWorld(), i = !!l;
|
|
161
161
|
} else if (this.object.isOrthographicCamera) {
|
|
162
|
-
const a = new
|
|
162
|
+
const a = new M(this._mouse.x, this._mouse.y, 0);
|
|
163
163
|
a.unproject(this.object);
|
|
164
164
|
const l = this.object.zoom;
|
|
165
165
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), i = l !== this.object.zoom;
|
|
166
|
-
const A = new
|
|
166
|
+
const A = new M(this._mouse.x, this._mouse.y, 0);
|
|
167
167
|
A.unproject(this.object), this.object.position.sub(A).add(a), this.object.updateMatrixWorld(), o = z.length();
|
|
168
168
|
} else
|
|
169
169
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
@@ -175,7 +175,7 @@ class Ii extends qs {
|
|
|
175
175
|
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > Gt || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Gt || this._lastTargetPosition.distanceToSquared(this.target) > Gt ? (this.dispatchEvent(xs), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
176
176
|
}
|
|
177
177
|
_getAutoRotationAngle(e) {
|
|
178
|
-
return e !== null ?
|
|
178
|
+
return e !== null ? J / 60 * this.autoRotateSpeed * e : J / 60 / 60 * this.autoRotateSpeed;
|
|
179
179
|
}
|
|
180
180
|
_getZoomScale(e) {
|
|
181
181
|
const t = Math.abs(e * 0.01);
|
|
@@ -234,7 +234,7 @@ class Ii extends qs {
|
|
|
234
234
|
_handleMouseMoveRotate(e) {
|
|
235
235
|
this._rotateEnd.set(e.clientX, e.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
236
236
|
const t = this.domElement;
|
|
237
|
-
this._rotateLeft(
|
|
237
|
+
this._rotateLeft(J * this._rotateDelta.x / t.clientHeight), this._rotateUp(J * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
|
|
238
238
|
}
|
|
239
239
|
_handleMouseMoveDolly(e) {
|
|
240
240
|
this._dollyEnd.set(e.clientX, e.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
|
|
@@ -249,16 +249,16 @@ class Ii extends qs {
|
|
|
249
249
|
let t = !1;
|
|
250
250
|
switch (e.code) {
|
|
251
251
|
case this.keys.UP:
|
|
252
|
-
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(
|
|
252
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(J * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), t = !0;
|
|
253
253
|
break;
|
|
254
254
|
case this.keys.BOTTOM:
|
|
255
|
-
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-
|
|
255
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-J * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), t = !0;
|
|
256
256
|
break;
|
|
257
257
|
case this.keys.LEFT:
|
|
258
|
-
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(
|
|
258
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(J * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), t = !0;
|
|
259
259
|
break;
|
|
260
260
|
case this.keys.RIGHT:
|
|
261
|
-
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-
|
|
261
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-J * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), t = !0;
|
|
262
262
|
break;
|
|
263
263
|
}
|
|
264
264
|
t && (e.preventDefault(), this.update());
|
|
@@ -298,7 +298,7 @@ class Ii extends qs {
|
|
|
298
298
|
}
|
|
299
299
|
this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
300
300
|
const t = this.domElement;
|
|
301
|
-
this._rotateLeft(
|
|
301
|
+
this._rotateLeft(J * this._rotateDelta.x / t.clientHeight), this._rotateUp(J * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd);
|
|
302
302
|
}
|
|
303
303
|
_handleTouchMovePan(e) {
|
|
304
304
|
if (this._pointers.length === 1)
|
|
@@ -512,12 +512,12 @@ function Pi(r) {
|
|
|
512
512
|
function Li(r) {
|
|
513
513
|
r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
514
514
|
}
|
|
515
|
-
const Me = new kn(), G = new
|
|
516
|
-
X: new
|
|
517
|
-
Y: new
|
|
518
|
-
Z: new
|
|
515
|
+
const Me = new kn(), G = new M(), me = new M(), j = new Q(), Ss = {
|
|
516
|
+
X: new M(1, 0, 0),
|
|
517
|
+
Y: new M(0, 1, 0),
|
|
518
|
+
Z: new M(0, 0, 1)
|
|
519
519
|
}, Kt = { type: "change" }, Ts = { type: "mouseDown", mode: null }, Ms = { type: "mouseUp", mode: null }, ws = { type: "objectChange" };
|
|
520
|
-
class
|
|
520
|
+
class Oi extends qs {
|
|
521
521
|
/**
|
|
522
522
|
* Constructs a new controls instance.
|
|
523
523
|
*
|
|
@@ -533,20 +533,20 @@ class Ni extends qs {
|
|
|
533
533
|
const i = new zi();
|
|
534
534
|
this._plane = i, n.add(i);
|
|
535
535
|
const o = this;
|
|
536
|
-
function a(
|
|
537
|
-
let v =
|
|
538
|
-
Object.defineProperty(o,
|
|
536
|
+
function a(I, y) {
|
|
537
|
+
let v = y;
|
|
538
|
+
Object.defineProperty(o, I, {
|
|
539
539
|
get: function() {
|
|
540
|
-
return v !== void 0 ? v :
|
|
540
|
+
return v !== void 0 ? v : y;
|
|
541
541
|
},
|
|
542
|
-
set: function(
|
|
543
|
-
v !==
|
|
542
|
+
set: function(S) {
|
|
543
|
+
v !== S && (v = S, i[I] = S, s[I] = S, o.dispatchEvent({ type: I + "-changed", value: S }), o.dispatchEvent(Kt));
|
|
544
544
|
}
|
|
545
|
-
}), o[
|
|
545
|
+
}), o[I] = y, i[I] = y, s[I] = y;
|
|
546
546
|
}
|
|
547
547
|
a("camera", e), a("object", void 0), a("enabled", !0), a("axis", null), a("mode", "translate"), a("translationSnap", null), a("rotationSnap", null), a("scaleSnap", null), a("space", "world"), a("size", 1), a("dragging", !1), a("showX", !0), a("showY", !0), a("showZ", !0), a("showXY", !0), a("showYZ", !0), a("showXZ", !0), a("minX", -1 / 0), a("maxX", 1 / 0), a("minY", -1 / 0), a("maxY", 1 / 0), a("minZ", -1 / 0), a("maxZ", 1 / 0);
|
|
548
|
-
const l = new
|
|
549
|
-
a("worldPosition", l), a("worldPositionStart", A), a("worldQuaternion", d), a("worldQuaternionStart",
|
|
548
|
+
const l = new M(), A = new M(), d = new Q(), u = new Q(), c = new M(), h = new Q(), p = new M(), f = new M(), m = new M(), g = 0, x = new M();
|
|
549
|
+
a("worldPosition", l), a("worldPositionStart", A), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition", c), a("cameraQuaternion", h), a("pointStart", p), a("pointEnd", f), a("rotationAxis", m), a("rotationAngle", g), a("eye", x), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new Q(), this._parentQuaternionInv = new Q(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new Q(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new Q(), this._scaleStart = new M(), this._getPointer = Ni.bind(this), this._onPointerDown = Wi.bind(this), this._onPointerHover = Di.bind(this), this._onPointerMove = ji.bind(this), this._onPointerUp = Fi.bind(this), t !== null && this.connect(t);
|
|
550
550
|
}
|
|
551
551
|
connect(e) {
|
|
552
552
|
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
|
|
@@ -708,7 +708,7 @@ class Ni extends qs {
|
|
|
708
708
|
i.xAxis.color.set(e), i.yAxis.color.set(t), i.zAxis.color.set(n), i.active.color.set(s), i.xAxisTransparent.color.set(e), i.yAxisTransparent.color.set(t), i.zAxisTransparent.color.set(n), i.activeTransparent.color.set(s), i.xAxis._color && i.xAxis._color.set(e), i.yAxis._color && i.yAxis._color.set(t), i.zAxis._color && i.zAxis._color.set(n), i.active._color && i.active._color.set(s), i.xAxisTransparent._color && i.xAxisTransparent._color.set(e), i.yAxisTransparent._color && i.yAxisTransparent._color.set(t), i.zAxisTransparent._color && i.zAxisTransparent._color.set(n), i.activeTransparent._color && i.activeTransparent._color.set(s);
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
|
-
function
|
|
711
|
+
function Ni(r) {
|
|
712
712
|
if (this.domElement.ownerDocument.pointerLockElement)
|
|
713
713
|
return {
|
|
714
714
|
x: 0,
|
|
@@ -749,7 +749,7 @@ function Bt(r, e, t) {
|
|
|
749
749
|
return n[s];
|
|
750
750
|
return !1;
|
|
751
751
|
}
|
|
752
|
-
const Ct = new Ln(), W = new
|
|
752
|
+
const Ct = new Ln(), W = new M(0, 1, 0), Rs = new M(0, 0, 0), Es = new pe(), It = new Q(), wt = new Q(), re = new M(), ks = new pe(), tt = new M(1, 0, 0), Ee = new M(0, 1, 0), st = new M(0, 0, 1), yt = new M(), Je = new M(), Qe = new M();
|
|
753
753
|
class Ui extends Ze {
|
|
754
754
|
constructor(e) {
|
|
755
755
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
@@ -768,7 +768,7 @@ class Ui extends Ze {
|
|
|
768
768
|
class Hi extends Ze {
|
|
769
769
|
constructor() {
|
|
770
770
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
|
771
|
-
const e = new
|
|
771
|
+
const e = new Oe({
|
|
772
772
|
depthTest: !1,
|
|
773
773
|
depthWrite: !1,
|
|
774
774
|
fog: !1,
|
|
@@ -796,14 +796,14 @@ class Hi extends Ze {
|
|
|
796
796
|
A.color.setHex(65280), A.opacity = 0.5;
|
|
797
797
|
const d = e.clone();
|
|
798
798
|
d.color.setHex(255), d.opacity = 0.5;
|
|
799
|
-
const c = e.clone();
|
|
800
|
-
c.opacity = 0.25;
|
|
801
799
|
const u = e.clone();
|
|
802
|
-
u.
|
|
800
|
+
u.opacity = 0.25;
|
|
801
|
+
const c = e.clone();
|
|
802
|
+
c.color.setHex(16776960), c.opacity = 0.25;
|
|
803
803
|
const h = e.clone();
|
|
804
804
|
h.color.setHex(16776960);
|
|
805
|
-
const
|
|
806
|
-
|
|
805
|
+
const p = e.clone();
|
|
806
|
+
p.color.setHex(7895160), this.materialLib = {
|
|
807
807
|
xAxis: i,
|
|
808
808
|
yAxis: o,
|
|
809
809
|
zAxis: a,
|
|
@@ -811,208 +811,208 @@ class Hi extends Ze {
|
|
|
811
811
|
xAxisTransparent: l,
|
|
812
812
|
yAxisTransparent: A,
|
|
813
813
|
zAxisTransparent: d,
|
|
814
|
-
activeTransparent:
|
|
814
|
+
activeTransparent: c
|
|
815
815
|
};
|
|
816
|
-
const
|
|
817
|
-
|
|
816
|
+
const f = new V(0, 0.04, 0.1, 12);
|
|
817
|
+
f.translate(0, 0.05, 0);
|
|
818
818
|
const m = new K(0.08, 0.08, 0.08);
|
|
819
819
|
m.translate(0, 0.04, 0);
|
|
820
820
|
const g = new De();
|
|
821
|
-
g.setAttribute("position", new
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
function
|
|
821
|
+
g.setAttribute("position", new Ae([0, 0, 0, 1, 0, 0], 3));
|
|
822
|
+
const x = new V(75e-4, 75e-4, 0.5, 3);
|
|
823
|
+
x.translate(0, 0.25, 0);
|
|
824
|
+
function I(te, ht) {
|
|
825
825
|
const ie = new Ve(te, 75e-4, 3, 64, ht * Math.PI * 2);
|
|
826
826
|
return ie.rotateY(Math.PI / 2), ie.rotateX(Math.PI / 2), ie;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function y() {
|
|
829
829
|
const te = new De();
|
|
830
|
-
return te.setAttribute("position", new
|
|
830
|
+
return te.setAttribute("position", new Ae([0, 0, 0, 1, 1, 1], 3)), te;
|
|
831
831
|
}
|
|
832
832
|
const v = {
|
|
833
833
|
X: [
|
|
834
|
-
[new
|
|
835
|
-
[new
|
|
836
|
-
[new
|
|
834
|
+
[new T(f, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
835
|
+
[new T(f, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
836
|
+
[new T(x, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
837
837
|
],
|
|
838
838
|
Y: [
|
|
839
|
-
[new
|
|
840
|
-
[new
|
|
841
|
-
[new
|
|
839
|
+
[new T(f, o), [0, 0.5, 0]],
|
|
840
|
+
[new T(f, o), [0, -0.5, 0], [Math.PI, 0, 0]],
|
|
841
|
+
[new T(x, o)]
|
|
842
842
|
],
|
|
843
843
|
Z: [
|
|
844
|
-
[new
|
|
845
|
-
[new
|
|
846
|
-
[new
|
|
844
|
+
[new T(f, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
845
|
+
[new T(f, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
|
|
846
|
+
[new T(x, a), null, [Math.PI / 2, 0, 0]]
|
|
847
847
|
],
|
|
848
848
|
XYZ: [
|
|
849
|
-
[new
|
|
849
|
+
[new T(new gt(0.1, 0), u), [0, 0, 0]]
|
|
850
850
|
],
|
|
851
851
|
XY: [
|
|
852
|
-
[new
|
|
852
|
+
[new T(new K(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
|
|
853
853
|
],
|
|
854
854
|
YZ: [
|
|
855
|
-
[new
|
|
855
|
+
[new T(new K(0.15, 0.15, 0.01), l), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
856
856
|
],
|
|
857
857
|
XZ: [
|
|
858
|
-
[new
|
|
858
|
+
[new T(new K(0.15, 0.15, 0.01), A), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
859
859
|
]
|
|
860
|
-
},
|
|
860
|
+
}, S = {
|
|
861
861
|
X: [
|
|
862
|
-
[new
|
|
863
|
-
[new
|
|
862
|
+
[new T(new V(0.2, 0, 0.6, 4), n), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
|
863
|
+
[new T(new V(0.2, 0, 0.6, 4), n), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
|
864
864
|
],
|
|
865
865
|
Y: [
|
|
866
|
-
[new
|
|
867
|
-
[new
|
|
866
|
+
[new T(new V(0.2, 0, 0.6, 4), n), [0, 0.3, 0]],
|
|
867
|
+
[new T(new V(0.2, 0, 0.6, 4), n), [0, -0.3, 0], [0, 0, Math.PI]]
|
|
868
868
|
],
|
|
869
869
|
Z: [
|
|
870
|
-
[new
|
|
871
|
-
[new
|
|
870
|
+
[new T(new V(0.2, 0, 0.6, 4), n), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
|
|
871
|
+
[new T(new V(0.2, 0, 0.6, 4), n), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
|
872
872
|
],
|
|
873
873
|
XYZ: [
|
|
874
|
-
[new
|
|
874
|
+
[new T(new gt(0.2, 0), n)]
|
|
875
875
|
],
|
|
876
876
|
XY: [
|
|
877
|
-
[new
|
|
877
|
+
[new T(new K(0.2, 0.2, 0.01), n), [0.15, 0.15, 0]]
|
|
878
878
|
],
|
|
879
879
|
YZ: [
|
|
880
|
-
[new
|
|
880
|
+
[new T(new K(0.2, 0.2, 0.01), n), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
881
881
|
],
|
|
882
882
|
XZ: [
|
|
883
|
-
[new
|
|
883
|
+
[new T(new K(0.2, 0.2, 0.01), n), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
884
884
|
]
|
|
885
885
|
}, L = {
|
|
886
886
|
START: [
|
|
887
|
-
[new
|
|
887
|
+
[new T(new gt(0.01, 2), s), null, null, null, "helper"]
|
|
888
888
|
],
|
|
889
889
|
END: [
|
|
890
|
-
[new
|
|
890
|
+
[new T(new gt(0.01, 2), s), null, null, null, "helper"]
|
|
891
891
|
],
|
|
892
892
|
DELTA: [
|
|
893
|
-
[new
|
|
893
|
+
[new he(y(), s), null, null, null, "helper"]
|
|
894
894
|
],
|
|
895
895
|
X: [
|
|
896
|
-
[new
|
|
896
|
+
[new he(g, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
897
897
|
],
|
|
898
898
|
Y: [
|
|
899
|
-
[new
|
|
899
|
+
[new he(g, s), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
|
|
900
900
|
],
|
|
901
901
|
Z: [
|
|
902
|
-
[new
|
|
902
|
+
[new he(g, s), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
|
903
903
|
]
|
|
904
|
-
},
|
|
904
|
+
}, Y = {
|
|
905
905
|
XYZE: [
|
|
906
|
-
[new
|
|
906
|
+
[new T(I(0.5, 1), p), null, [0, Math.PI / 2, 0]]
|
|
907
907
|
],
|
|
908
908
|
X: [
|
|
909
|
-
[new
|
|
909
|
+
[new T(I(0.5, 0.5), i)]
|
|
910
910
|
],
|
|
911
911
|
Y: [
|
|
912
|
-
[new
|
|
912
|
+
[new T(I(0.5, 0.5), o), null, [0, 0, -Math.PI / 2]]
|
|
913
913
|
],
|
|
914
914
|
Z: [
|
|
915
|
-
[new
|
|
915
|
+
[new T(I(0.5, 0.5), a), null, [0, Math.PI / 2, 0]]
|
|
916
916
|
],
|
|
917
917
|
E: [
|
|
918
|
-
[new
|
|
918
|
+
[new T(I(0.75, 1), c), null, [0, Math.PI / 2, 0]]
|
|
919
919
|
]
|
|
920
920
|
}, ee = {
|
|
921
921
|
AXIS: [
|
|
922
|
-
[new
|
|
922
|
+
[new he(g, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
923
923
|
]
|
|
924
|
-
},
|
|
924
|
+
}, _ = {
|
|
925
925
|
XYZE: [
|
|
926
|
-
[new
|
|
926
|
+
[new T(new Pn(0.25, 10, 8), n)]
|
|
927
927
|
],
|
|
928
928
|
X: [
|
|
929
|
-
[new
|
|
929
|
+
[new T(new Ve(0.5, 0.1, 4, 24), n), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
|
|
930
930
|
],
|
|
931
931
|
Y: [
|
|
932
|
-
[new
|
|
932
|
+
[new T(new Ve(0.5, 0.1, 4, 24), n), [0, 0, 0], [Math.PI / 2, 0, 0]]
|
|
933
933
|
],
|
|
934
934
|
Z: [
|
|
935
|
-
[new
|
|
935
|
+
[new T(new Ve(0.5, 0.1, 4, 24), n), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
936
936
|
],
|
|
937
937
|
E: [
|
|
938
|
-
[new
|
|
938
|
+
[new T(new Ve(0.75, 0.1, 2, 24), n)]
|
|
939
939
|
]
|
|
940
940
|
}, Te = {
|
|
941
941
|
X: [
|
|
942
|
-
[new
|
|
943
|
-
[new
|
|
944
|
-
[new
|
|
942
|
+
[new T(m, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
943
|
+
[new T(x, i), [0, 0, 0], [0, 0, -Math.PI / 2]],
|
|
944
|
+
[new T(m, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
|
|
945
945
|
],
|
|
946
946
|
Y: [
|
|
947
|
-
[new
|
|
948
|
-
[new
|
|
949
|
-
[new
|
|
947
|
+
[new T(m, o), [0, 0.5, 0]],
|
|
948
|
+
[new T(x, o)],
|
|
949
|
+
[new T(m, o), [0, -0.5, 0], [0, 0, Math.PI]]
|
|
950
950
|
],
|
|
951
951
|
Z: [
|
|
952
|
-
[new
|
|
953
|
-
[new
|
|
954
|
-
[new
|
|
952
|
+
[new T(m, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
953
|
+
[new T(x, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
|
|
954
|
+
[new T(m, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
|
|
955
955
|
],
|
|
956
956
|
XY: [
|
|
957
|
-
[new
|
|
957
|
+
[new T(new K(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
|
|
958
958
|
],
|
|
959
959
|
YZ: [
|
|
960
|
-
[new
|
|
960
|
+
[new T(new K(0.15, 0.15, 0.01), l), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
961
961
|
],
|
|
962
962
|
XZ: [
|
|
963
|
-
[new
|
|
963
|
+
[new T(new K(0.15, 0.15, 0.01), A), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
964
964
|
],
|
|
965
965
|
XYZ: [
|
|
966
|
-
[new
|
|
966
|
+
[new T(new K(0.1, 0.1, 0.1), u)]
|
|
967
967
|
]
|
|
968
968
|
}, Ht = {
|
|
969
969
|
X: [
|
|
970
|
-
[new
|
|
971
|
-
[new
|
|
970
|
+
[new T(new V(0.2, 0, 0.6, 4), n), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
|
971
|
+
[new T(new V(0.2, 0, 0.6, 4), n), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
|
972
972
|
],
|
|
973
973
|
Y: [
|
|
974
|
-
[new
|
|
975
|
-
[new
|
|
974
|
+
[new T(new V(0.2, 0, 0.6, 4), n), [0, 0.3, 0]],
|
|
975
|
+
[new T(new V(0.2, 0, 0.6, 4), n), [0, -0.3, 0], [0, 0, Math.PI]]
|
|
976
976
|
],
|
|
977
977
|
Z: [
|
|
978
|
-
[new
|
|
979
|
-
[new
|
|
978
|
+
[new T(new V(0.2, 0, 0.6, 4), n), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
|
|
979
|
+
[new T(new V(0.2, 0, 0.6, 4), n), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
|
980
980
|
],
|
|
981
981
|
XY: [
|
|
982
|
-
[new
|
|
982
|
+
[new T(new K(0.2, 0.2, 0.01), n), [0.15, 0.15, 0]]
|
|
983
983
|
],
|
|
984
984
|
YZ: [
|
|
985
|
-
[new
|
|
985
|
+
[new T(new K(0.2, 0.2, 0.01), n), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
986
986
|
],
|
|
987
987
|
XZ: [
|
|
988
|
-
[new
|
|
988
|
+
[new T(new K(0.2, 0.2, 0.01), n), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
989
989
|
],
|
|
990
990
|
XYZ: [
|
|
991
|
-
[new
|
|
991
|
+
[new T(new K(0.2, 0.2, 0.2), n), [0, 0, 0]]
|
|
992
992
|
]
|
|
993
993
|
}, pn = {
|
|
994
994
|
X: [
|
|
995
|
-
[new
|
|
995
|
+
[new he(g, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
996
996
|
],
|
|
997
997
|
Y: [
|
|
998
|
-
[new
|
|
998
|
+
[new he(g, s), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
|
|
999
999
|
],
|
|
1000
1000
|
Z: [
|
|
1001
|
-
[new
|
|
1001
|
+
[new he(g, s), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
|
1002
1002
|
]
|
|
1003
1003
|
};
|
|
1004
|
-
function
|
|
1004
|
+
function de(te) {
|
|
1005
1005
|
const ht = new Ze();
|
|
1006
1006
|
for (const ie in te)
|
|
1007
1007
|
for (let Fe = te[ie].length; Fe--; ) {
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1010
|
-
const ps =
|
|
1011
|
-
ps.applyMatrix4(
|
|
1008
|
+
const q = te[ie][Fe][0].clone(), ft = te[ie][Fe][1], pt = te[ie][Fe][2], mt = te[ie][Fe][3], mn = te[ie][Fe][4];
|
|
1009
|
+
q.name = ie, q.tag = mn, ft && q.position.set(ft[0], ft[1], ft[2]), pt && q.rotation.set(pt[0], pt[1], pt[2]), mt && q.scale.set(mt[0], mt[1], mt[2]), q.updateMatrix();
|
|
1010
|
+
const ps = q.geometry.clone();
|
|
1011
|
+
ps.applyMatrix4(q.matrix), q.geometry = ps, q.renderOrder = 1 / 0, q.position.set(0, 0, 0), q.rotation.set(0, 0, 0), q.scale.set(1, 1, 1), ht.add(q);
|
|
1012
1012
|
}
|
|
1013
1013
|
return ht;
|
|
1014
1014
|
}
|
|
1015
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate =
|
|
1015
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = de(v)), this.add(this.gizmo.rotate = de(Y)), this.add(this.gizmo.scale = de(Te)), this.add(this.picker.translate = de(S)), this.add(this.picker.rotate = de(_)), this.add(this.picker.scale = de(Ht)), this.add(this.helper.translate = de(L)), this.add(this.helper.rotate = de(ee)), this.add(this.helper.scale = de(pn)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
1016
1016
|
}
|
|
1017
1017
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
1018
1018
|
updateMatrixWorld(e) {
|
|
@@ -1035,11 +1035,11 @@ class Hi extends Ze {
|
|
|
1035
1035
|
super.updateMatrixWorld(e);
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
|
-
class zi extends
|
|
1038
|
+
class zi extends T {
|
|
1039
1039
|
constructor() {
|
|
1040
1040
|
super(
|
|
1041
|
-
new
|
|
1042
|
-
new
|
|
1041
|
+
new On(1e5, 1e5, 2, 2),
|
|
1042
|
+
new Oe({ visible: !1, wireframe: !0, side: Pt, transparent: !0, opacity: 0.1, toneMapped: !1 })
|
|
1043
1043
|
), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
|
|
1044
1044
|
}
|
|
1045
1045
|
updateMatrixWorld(e) {
|
|
@@ -1160,7 +1160,7 @@ class qe {
|
|
|
1160
1160
|
const Gi = new Js(-1, 1, 1, -1, 0, 1);
|
|
1161
1161
|
class Ki extends De {
|
|
1162
1162
|
constructor() {
|
|
1163
|
-
super(), this.setAttribute("position", new
|
|
1163
|
+
super(), this.setAttribute("position", new Ae([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)), this.setAttribute("uv", new Ae([0, 2, 0, 0, 2, 0], 2));
|
|
1164
1164
|
}
|
|
1165
1165
|
}
|
|
1166
1166
|
const Bi = new Ki();
|
|
@@ -1171,7 +1171,7 @@ class us {
|
|
|
1171
1171
|
* @param {?Material} material - The material to render te full screen quad with.
|
|
1172
1172
|
*/
|
|
1173
1173
|
constructor(e) {
|
|
1174
|
-
this._mesh = new
|
|
1174
|
+
this._mesh = new T(Bi, e);
|
|
1175
1175
|
}
|
|
1176
1176
|
/**
|
|
1177
1177
|
* Frees the GPU-related resources allocated by this instance. Call this
|
|
@@ -1305,7 +1305,7 @@ class qi {
|
|
|
1305
1305
|
this._width = n.width, this._height = n.height, t = new be(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: Re }), t.texture.name = "EffectComposer.rt1";
|
|
1306
1306
|
} else
|
|
1307
1307
|
this._width = t.width, this._height = t.height;
|
|
1308
|
-
this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.renderTarget2.texture.name = "EffectComposer.rt2", this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.renderToScreen = !0, this.passes = [], this.copyPass = new Zi(on), this.copyPass.material.blending = $t, this.timer = new
|
|
1308
|
+
this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.renderTarget2.texture.name = "EffectComposer.rt2", this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.renderToScreen = !0, this.passes = [], this.copyPass = new Zi(on), this.copyPass.material.blending = $t, this.timer = new Nn();
|
|
1309
1309
|
}
|
|
1310
1310
|
/**
|
|
1311
1311
|
* Swaps the internal read/write buffers.
|
|
@@ -1433,7 +1433,7 @@ class Vi extends qe {
|
|
|
1433
1433
|
* @param {?number} [clearAlpha=null] - The clear alpha of the render pass.
|
|
1434
1434
|
*/
|
|
1435
1435
|
constructor(e, t, n = null, s = null, i = null) {
|
|
1436
|
-
super(), this.scene = e, this.camera = t, this.overrideMaterial = n, this.clearColor = s, this.clearAlpha = i, this.clear = !0, this.clearDepth = !1, this.needsSwap = !1, this.isRenderPass = !0, this._oldClearColor = new
|
|
1436
|
+
super(), this.scene = e, this.camera = t, this.overrideMaterial = n, this.clearColor = s, this.clearAlpha = i, this.clear = !0, this.clearDepth = !1, this.needsSwap = !1, this.isRenderPass = !0, this._oldClearColor = new Z();
|
|
1437
1437
|
}
|
|
1438
1438
|
/**
|
|
1439
1439
|
* Performs a beauty pass with the configured scene and camera.
|
|
@@ -1584,7 +1584,7 @@ class Ce extends qe {
|
|
|
1584
1584
|
*
|
|
1585
1585
|
*/
|
|
1586
1586
|
constructor(e, t, n, s) {
|
|
1587
|
-
super(), this.renderScene = t, this.renderCamera = n, this.selectedObjects = s !== void 0 ? s : [], this.visibleEdgeColor = new
|
|
1587
|
+
super(), this.renderScene = t, this.renderCamera = n, this.selectedObjects = s !== void 0 ? s : [], this.visibleEdgeColor = new Z(1, 1, 1), this.hiddenEdgeColor = new Z(0.1, 0.04, 0.02), this.edgeGlow = 0, this.usePatternTexture = !1, this.patternTexture = null, this.edgeThickness = 1, this.edgeStrength = 3, this.downSampleRatio = 2, this.pulsePeriod = 0, this._visibilityCache = /* @__PURE__ */ new Map(), this._selectionCache = /* @__PURE__ */ new Set(), this.resolution = e !== void 0 ? new F(e.x, e.y) : new F(256, 256);
|
|
1588
1588
|
const i = Math.round(this.resolution.x / this.downSampleRatio), o = Math.round(this.resolution.y / this.downSampleRatio);
|
|
1589
1589
|
this.renderTargetMaskBuffer = new be(this.resolution.x, this.resolution.y), this.renderTargetMaskBuffer.texture.name = "OutlinePass.mask", this.renderTargetMaskBuffer.texture.generateMipmaps = !1, this.depthMaterial = new Bn(), this.depthMaterial.side = Pt, this.depthMaterial.depthPacking = Zn, this.depthMaterial.blending = $t, this.prepareMaskMaterial = this._getPrepareMaskMaterial(), this.prepareMaskMaterial.side = Pt, this.prepareMaskMaterial.fragmentShader = d(this.prepareMaskMaterial.fragmentShader, this.renderCamera), this.renderTargetDepthBuffer = new be(this.resolution.x, this.resolution.y, { type: Re }), this.renderTargetDepthBuffer.texture.name = "OutlinePass.depth", this.renderTargetDepthBuffer.texture.generateMipmaps = !1, this.renderTargetMaskDownSampleBuffer = new be(i, o, { type: Re }), this.renderTargetMaskDownSampleBuffer.texture.name = "OutlinePass.depthDownSample", this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps = !1, this.renderTargetBlurBuffer1 = new be(i, o, { type: Re }), this.renderTargetBlurBuffer1.texture.name = "OutlinePass.blur1", this.renderTargetBlurBuffer1.texture.generateMipmaps = !1, this.renderTargetBlurBuffer2 = new be(Math.round(i / 2), Math.round(o / 2), { type: Re }), this.renderTargetBlurBuffer2.texture.name = "OutlinePass.blur2", this.renderTargetBlurBuffer2.texture.generateMipmaps = !1, this.edgeDetectionMaterial = this._getEdgeDetectionMaterial(), this.renderTargetEdgeBuffer1 = new be(i, o, { type: Re }), this.renderTargetEdgeBuffer1.texture.name = "OutlinePass.edge1", this.renderTargetEdgeBuffer1.texture.generateMipmaps = !1, this.renderTargetEdgeBuffer2 = new be(Math.round(i / 2), Math.round(o / 2), { type: Re }), this.renderTargetEdgeBuffer2.texture.name = "OutlinePass.edge2", this.renderTargetEdgeBuffer2.texture.generateMipmaps = !1;
|
|
1590
1590
|
const a = 4, l = 4;
|
|
@@ -1597,10 +1597,10 @@ class Ce extends qe {
|
|
|
1597
1597
|
blending: $t,
|
|
1598
1598
|
depthTest: !1,
|
|
1599
1599
|
depthWrite: !1
|
|
1600
|
-
}), this.enabled = !0, this.needsSwap = !1, this._oldClearColor = new
|
|
1601
|
-
function d(
|
|
1602
|
-
const h =
|
|
1603
|
-
return
|
|
1600
|
+
}), this.enabled = !0, this.needsSwap = !1, this._oldClearColor = new Z(), this.oldClearAlpha = 1, this._fsQuad = new us(null), this.tempPulseColor1 = new Z(), this.tempPulseColor2 = new Z(), this.textureMatrix = new pe();
|
|
1601
|
+
function d(u, c) {
|
|
1602
|
+
const h = c.isPerspectiveCamera ? "perspective" : "orthographic";
|
|
1603
|
+
return u.replace(/DEPTH_TO_VIEW_Z/g, h + "DepthToViewZ");
|
|
1604
1604
|
}
|
|
1605
1605
|
}
|
|
1606
1606
|
/**
|
|
@@ -1753,8 +1753,8 @@ class Ce extends qe {
|
|
|
1753
1753
|
uniforms: {
|
|
1754
1754
|
maskTexture: { value: null },
|
|
1755
1755
|
texSize: { value: new F(0.5, 0.5) },
|
|
1756
|
-
visibleEdgeColor: { value: new
|
|
1757
|
-
hiddenEdgeColor: { value: new
|
|
1756
|
+
visibleEdgeColor: { value: new M(1, 1, 1) },
|
|
1757
|
+
hiddenEdgeColor: { value: new M(1, 1, 1) }
|
|
1758
1758
|
},
|
|
1759
1759
|
vertexShader: `varying vec2 vUv;
|
|
1760
1760
|
|
|
@@ -1901,7 +1901,7 @@ class Yi extends Ze {
|
|
|
1901
1901
|
return super.copy(e, t), this.element = e.element.cloneNode(!0), this.center = e.center, this;
|
|
1902
1902
|
}
|
|
1903
1903
|
}
|
|
1904
|
-
const He = new
|
|
1904
|
+
const He = new M(), Ls = new pe(), Os = new pe(), Ns = new M(), Ds = new M();
|
|
1905
1905
|
class _i {
|
|
1906
1906
|
/**
|
|
1907
1907
|
* Constructs a new CSS2D renderer.
|
|
@@ -1919,51 +1919,51 @@ class _i {
|
|
|
1919
1919
|
width: n,
|
|
1920
1920
|
height: s
|
|
1921
1921
|
};
|
|
1922
|
-
}, this.render = function(
|
|
1923
|
-
|
|
1924
|
-
}, this.setSize = function(
|
|
1925
|
-
n =
|
|
1922
|
+
}, this.render = function(p, f) {
|
|
1923
|
+
p.matrixWorldAutoUpdate === !0 && p.updateMatrixWorld(), f.parent === null && f.matrixWorldAutoUpdate === !0 && f.updateMatrixWorld(), Ls.copy(f.matrixWorldInverse), Os.multiplyMatrices(f.projectionMatrix, Ls), d(p, p, f), this.sortObjects && h(p);
|
|
1924
|
+
}, this.setSize = function(p, f) {
|
|
1925
|
+
n = p, s = f, i = n / 2, o = s / 2, l.style.width = p + "px", l.style.height = f + "px";
|
|
1926
1926
|
};
|
|
1927
|
-
function A(
|
|
1928
|
-
|
|
1929
|
-
for (let
|
|
1930
|
-
A(
|
|
1927
|
+
function A(p) {
|
|
1928
|
+
p.isCSS2DObject && (p.element.style.display = "none");
|
|
1929
|
+
for (let f = 0, m = p.children.length; f < m; f++)
|
|
1930
|
+
A(p.children[f]);
|
|
1931
1931
|
}
|
|
1932
|
-
function d(
|
|
1933
|
-
if (
|
|
1934
|
-
A(
|
|
1932
|
+
function d(p, f, m) {
|
|
1933
|
+
if (p.visible === !1) {
|
|
1934
|
+
A(p);
|
|
1935
1935
|
return;
|
|
1936
1936
|
}
|
|
1937
|
-
if (
|
|
1938
|
-
He.setFromMatrixPosition(
|
|
1939
|
-
const g = He.z >= -1 && He.z <= 1 &&
|
|
1940
|
-
|
|
1941
|
-
const
|
|
1942
|
-
distanceToCameraSquared:
|
|
1937
|
+
if (p.isCSS2DObject) {
|
|
1938
|
+
He.setFromMatrixPosition(p.matrixWorld), He.applyMatrix4(Os);
|
|
1939
|
+
const g = He.z >= -1 && He.z <= 1 && p.layers.test(m.layers) === !0, x = p.element;
|
|
1940
|
+
x.style.display = g === !0 ? "" : "none", g === !0 && (p.onBeforeRender(t, f, m), x.style.transform = "translate(" + -100 * p.center.x + "%," + -100 * p.center.y + "%)translate(" + (He.x * i + i) + "px," + (-He.y * o + o) + "px)", x.parentNode !== l && l.appendChild(x), p.onAfterRender(t, f, m));
|
|
1941
|
+
const I = {
|
|
1942
|
+
distanceToCameraSquared: u(m, p)
|
|
1943
1943
|
};
|
|
1944
|
-
a.objects.set(
|
|
1944
|
+
a.objects.set(p, I);
|
|
1945
1945
|
}
|
|
1946
|
-
for (let g = 0,
|
|
1947
|
-
d(
|
|
1946
|
+
for (let g = 0, x = p.children.length; g < x; g++)
|
|
1947
|
+
d(p.children[g], f, m);
|
|
1948
1948
|
}
|
|
1949
|
-
function
|
|
1950
|
-
return
|
|
1949
|
+
function u(p, f) {
|
|
1950
|
+
return Ns.setFromMatrixPosition(p.matrixWorld), Ds.setFromMatrixPosition(f.matrixWorld), Ns.distanceToSquared(Ds);
|
|
1951
1951
|
}
|
|
1952
|
-
function
|
|
1953
|
-
const
|
|
1954
|
-
return
|
|
1955
|
-
m.isCSS2DObject &&
|
|
1956
|
-
}),
|
|
1952
|
+
function c(p) {
|
|
1953
|
+
const f = [];
|
|
1954
|
+
return p.traverseVisible(function(m) {
|
|
1955
|
+
m.isCSS2DObject && f.push(m);
|
|
1956
|
+
}), f;
|
|
1957
1957
|
}
|
|
1958
|
-
function h(
|
|
1959
|
-
const
|
|
1960
|
-
if (g.renderOrder !==
|
|
1961
|
-
return
|
|
1962
|
-
const
|
|
1963
|
-
return
|
|
1964
|
-
}), m =
|
|
1965
|
-
for (let g = 0,
|
|
1966
|
-
|
|
1958
|
+
function h(p) {
|
|
1959
|
+
const f = c(p).sort(function(g, x) {
|
|
1960
|
+
if (g.renderOrder !== x.renderOrder)
|
|
1961
|
+
return x.renderOrder - g.renderOrder;
|
|
1962
|
+
const I = a.objects.get(g).distanceToCameraSquared, y = a.objects.get(x).distanceToCameraSquared;
|
|
1963
|
+
return I - y;
|
|
1964
|
+
}), m = f.length;
|
|
1965
|
+
for (let g = 0, x = f.length; g < x; g++)
|
|
1966
|
+
f[g].element.style.zIndex = m - g;
|
|
1967
1967
|
}
|
|
1968
1968
|
}
|
|
1969
1969
|
}
|
|
@@ -1992,6 +1992,7 @@ class dt {
|
|
|
1992
1992
|
title: e.title || "",
|
|
1993
1993
|
items: e.items || [],
|
|
1994
1994
|
offsetY: e.offsetY ?? 0.1,
|
|
1995
|
+
offsetX: e.offsetX ?? 0,
|
|
1995
1996
|
fontSize: e.fontSize || "13px",
|
|
1996
1997
|
width: e.width || "220px",
|
|
1997
1998
|
backgroundColor: e.backgroundColor || "linear-gradient(135deg, rgba(6, 16, 42, 0.55) 0%, rgba(2, 6, 18, 0.40) 100%)",
|
|
@@ -2089,7 +2090,7 @@ class dt {
|
|
|
2089
2090
|
const n = new w.Box3().setFromObject(e), s = new w.Vector3(), i = new w.Vector3();
|
|
2090
2091
|
n.getCenter(s), n.getSize(i);
|
|
2091
2092
|
const a = n.max.y - t.y + this.options.offsetY;
|
|
2092
|
-
this.css2dObject || (this.css2dObject = new Yi(this.container), this.css2dObject.name = `DataPanel_${e.name || e.uuid}`, this.css2dObject.center.set(0.5, 1)), this.css2dObject.position.set(
|
|
2093
|
+
this.css2dObject || (this.css2dObject = new Yi(this.container), this.css2dObject.name = `DataPanel_${e.name || e.uuid}`, this.css2dObject.center.set(0.5, 1)), this.css2dObject.position.set(this.options.offsetX, a, 0), e.add(this.css2dObject), this.attachedObject = e;
|
|
2093
2094
|
}
|
|
2094
2095
|
/**
|
|
2095
2096
|
* 从附着的物体上移除面板
|
|
@@ -2197,9 +2198,17 @@ class dt {
|
|
|
2197
2198
|
const t = new w.Vector3();
|
|
2198
2199
|
this.attachedObject.getWorldPosition(t);
|
|
2199
2200
|
const s = new w.Box3().setFromObject(this.attachedObject).max.y - t.y;
|
|
2200
|
-
this.css2dObject.position.set(0, s + e, 0);
|
|
2201
|
+
this.css2dObject.position.set(this.options.offsetX ?? 0, s + e, 0);
|
|
2201
2202
|
}
|
|
2202
2203
|
}
|
|
2204
|
+
/** 获取面板 X 轴偏移 */
|
|
2205
|
+
getOffsetX() {
|
|
2206
|
+
return this.options.offsetX ?? 0;
|
|
2207
|
+
}
|
|
2208
|
+
/** 更新面板 X 轴偏移(轻量,不重建 DOM) */
|
|
2209
|
+
setOffsetX(e) {
|
|
2210
|
+
this.options.offsetX = e, this.css2dObject && this.attachedObject && (this.css2dObject.position.x = e);
|
|
2211
|
+
}
|
|
2203
2212
|
/** 获取面板宽度 */
|
|
2204
2213
|
getWidth() {
|
|
2205
2214
|
return this.options.width || "200px";
|
|
@@ -2230,23 +2239,23 @@ class dt {
|
|
|
2230
2239
|
this.detach(), (e = this.container) != null && e.parentNode && this.container.parentNode.removeChild(this.container), this.css2dObject = null, this.container = null, this.attachedObject = null;
|
|
2231
2240
|
}
|
|
2232
2241
|
}
|
|
2233
|
-
const
|
|
2242
|
+
const Ot = /* @__PURE__ */ new WeakMap();
|
|
2234
2243
|
function rn(r, e) {
|
|
2235
2244
|
const t = Wt(r);
|
|
2236
|
-
|
|
2245
|
+
Ot.set(t, e), t.userData._hasDataPanel = !0;
|
|
2237
2246
|
}
|
|
2238
2247
|
function Ft(r) {
|
|
2239
|
-
return
|
|
2248
|
+
return Ot.get(Wt(r)) || null;
|
|
2240
2249
|
}
|
|
2241
2250
|
function ao(r) {
|
|
2242
|
-
const e = Wt(r), t =
|
|
2243
|
-
t && (t.dispose(),
|
|
2251
|
+
const e = Wt(r), t = Ot.get(e);
|
|
2252
|
+
t && (t.dispose(), Ot.delete(e)), e.userData._hasDataPanel = void 0;
|
|
2244
2253
|
}
|
|
2245
2254
|
let U = null;
|
|
2246
2255
|
function lo(r) {
|
|
2247
2256
|
return U ? (U.domElement.parentNode !== r && r.appendChild(U.domElement), U) : (U = new _i(), U.setSize(r.clientWidth, r.clientHeight), U.domElement.style.position = "absolute", U.domElement.style.top = "0", U.domElement.style.left = "0", U.domElement.style.pointerEvents = "none", r.appendChild(U.domElement), U);
|
|
2248
2257
|
}
|
|
2249
|
-
function
|
|
2258
|
+
function Ol() {
|
|
2250
2259
|
return U;
|
|
2251
2260
|
}
|
|
2252
2261
|
function Ao(r, e) {
|
|
@@ -2258,7 +2267,7 @@ function co(r, e) {
|
|
|
2258
2267
|
function uo() {
|
|
2259
2268
|
U && (U.domElement.parentNode && U.domElement.parentNode.removeChild(U.domElement), U = null);
|
|
2260
2269
|
}
|
|
2261
|
-
const
|
|
2270
|
+
const C = {
|
|
2262
2271
|
/** 场景模式 */
|
|
2263
2272
|
mode: "",
|
|
2264
2273
|
/** 控制器模式 */
|
|
@@ -2284,28 +2293,28 @@ const b = {
|
|
|
2284
2293
|
};
|
|
2285
2294
|
let Rt = !1, We = !1, Ie = null, ye = null;
|
|
2286
2295
|
const ho = 16755200, Ws = 16733440;
|
|
2287
|
-
let is = [], vt = [],
|
|
2296
|
+
let is = [], vt = [], Nt = !0, Ne = null, os = null, Et = null, xe = [];
|
|
2288
2297
|
const je = /* @__PURE__ */ new Map();
|
|
2289
2298
|
let Dt, kt = null, lt = null, At = null;
|
|
2290
2299
|
function fo(r, e = "edit", t) {
|
|
2291
|
-
|
|
2300
|
+
C.container = r, C.mode = e, mo(), bo(), Io(), t && (Xo(t.scene, e, t.dataPanels), t != null && t.camera && (C.defaultMainCamera = t.camera, an(!0))), xo(), yo(), Dt && C.orbitControls && (C.orbitControls.target.fromArray(Dt), C.orbitControls.update()), go(), Fo(), ln(), lt = (n) => wo(n), At = () => So(), e === "edit" && r.addEventListener("click", lt), window.addEventListener("resize", At), t || vo(), e === "edit" && Co();
|
|
2292
2301
|
}
|
|
2293
2302
|
function po() {
|
|
2294
2303
|
var i, o;
|
|
2295
|
-
const r = window.devicePixelRatio, e = ((i =
|
|
2304
|
+
const r = window.devicePixelRatio, e = ((i = C.container) == null ? void 0 : i.clientWidth) || window.innerWidth, t = ((o = C.container) == null ? void 0 : o.clientHeight) || window.innerHeight, n = e * r * t * r;
|
|
2296
2305
|
let s;
|
|
2297
2306
|
return n <= 5e6 ? s = Math.min(r, 2) : n <= 12e6 ? s = Math.min(r, 1.5) : n <= 2e7 ? s = Math.min(r, 1.3) : s = Math.min(r, 1), s;
|
|
2298
2307
|
}
|
|
2299
2308
|
function mo() {
|
|
2300
2309
|
const r = po(), e = new w.WebGLRenderer({ antialias: !0, alpha: !0 });
|
|
2301
|
-
e.setSize(
|
|
2302
|
-
`[Renderer] css=${
|
|
2303
|
-
), e.shadowMap.enabled = !0, e.shadowMap.type = w.PCFSoftShadowMap,
|
|
2310
|
+
e.setSize(C.container.clientWidth, C.container.clientHeight), e.setPixelRatio(r), console.log(
|
|
2311
|
+
`[Renderer] css=${C.container.clientWidth}×${C.container.clientHeight}, dpr=${window.devicePixelRatio}, targetRatio=${r}, antialias=true`
|
|
2312
|
+
), e.shadowMap.enabled = !0, e.shadowMap.type = w.PCFSoftShadowMap, C.container.appendChild(e.domElement), C.renderer = e;
|
|
2304
2313
|
}
|
|
2305
2314
|
function go() {
|
|
2306
|
-
if (!
|
|
2307
|
-
const r = new qi(
|
|
2308
|
-
r.addPass(new Vi(
|
|
2315
|
+
if (!C.renderer || !C.scene || !C.camera) return;
|
|
2316
|
+
const r = new qi(C.renderer);
|
|
2317
|
+
r.addPass(new Vi(C.scene, C.camera)), r.addPass(new Ji());
|
|
2309
2318
|
const e = window.innerWidth * window.devicePixelRatio, t = window.innerWidth * window.devicePixelRatio * window.innerHeight * window.devicePixelRatio, s = e / 1920, o = Math.round(
|
|
2310
2319
|
4 * Math.min(Math.max(s, 0.6), 8)
|
|
2311
2320
|
), a = t > 25e6 ? 1 : t > 12e6 ? 1.5 : 2;
|
|
@@ -2314,20 +2323,20 @@ function go() {
|
|
|
2314
2323
|
);
|
|
2315
2324
|
const l = new Ce(
|
|
2316
2325
|
new w.Vector2(
|
|
2317
|
-
|
|
2318
|
-
|
|
2326
|
+
C.container.clientWidth,
|
|
2327
|
+
C.container.clientHeight
|
|
2319
2328
|
),
|
|
2320
|
-
|
|
2321
|
-
|
|
2329
|
+
C.scene,
|
|
2330
|
+
C.camera
|
|
2322
2331
|
);
|
|
2323
2332
|
l.edgeStrength = 8, l.edgeGlow = 1.5, l.edgeThickness = o, l.visibleEdgeColor.set(Ws), l.hiddenEdgeColor.set(Ws), l.downSampleRatio = a, l.pulsePeriod = 2, r.addPass(l), Ie = r, ye = l;
|
|
2324
2333
|
}
|
|
2325
2334
|
function bo() {
|
|
2326
|
-
|
|
2335
|
+
C.scene = new w.Scene(), C.scene.name = "sl_scene", new w.TextureLoader().load(
|
|
2327
2336
|
Qi,
|
|
2328
2337
|
(e) => {
|
|
2329
|
-
const t = new w.PMREMGenerator(
|
|
2330
|
-
|
|
2338
|
+
const t = new w.PMREMGenerator(C.renderer), n = t.fromEquirectangular(e).texture;
|
|
2339
|
+
C.scene.environment = n, t.dispose();
|
|
2331
2340
|
},
|
|
2332
2341
|
void 0,
|
|
2333
2342
|
(e) => console.error("背景图加载失败:", e)
|
|
@@ -2335,40 +2344,40 @@ function bo() {
|
|
|
2335
2344
|
}
|
|
2336
2345
|
function Co() {
|
|
2337
2346
|
const r = new w.GridHelper(30, 30, 8956671, 3364232);
|
|
2338
|
-
r.name = "地板", r.userData.type = "initFloor",
|
|
2347
|
+
r.name = "地板", r.userData.type = "initFloor", C.scene.add(r), C.gridHelper = r;
|
|
2339
2348
|
const e = new w.PlaneGeometry(30, 30), t = new w.ShadowMaterial({
|
|
2340
2349
|
opacity: 0.3,
|
|
2341
2350
|
color: 0
|
|
2342
2351
|
}), n = new w.Mesh(e, t);
|
|
2343
|
-
n.rotation.x = -Math.PI / 2, n.position.y = -0.01, n.name = "阴影接收平面", n.userData.type = "initFloor", n.receiveShadow = !0,
|
|
2352
|
+
n.rotation.x = -Math.PI / 2, n.position.y = -0.01, n.name = "阴影接收平面", n.userData.type = "initFloor", n.receiveShadow = !0, C.scene.add(n);
|
|
2344
2353
|
}
|
|
2345
2354
|
function Io() {
|
|
2346
|
-
const r =
|
|
2347
|
-
t.position.set(0, 6, 15), t.lookAt(0, 0, 0),
|
|
2355
|
+
const r = C.container, e = r.clientWidth / r.clientHeight, t = new w.PerspectiveCamera(45, e, 0.1, 1e3);
|
|
2356
|
+
t.position.set(0, 6, 15), t.lookAt(0, 0, 0), C.camera = t;
|
|
2348
2357
|
}
|
|
2349
2358
|
function an(r = !1) {
|
|
2350
|
-
if (!
|
|
2351
|
-
const e =
|
|
2359
|
+
if (!C.defaultMainCamera) return;
|
|
2360
|
+
const e = C.defaultMainCamera;
|
|
2352
2361
|
if (r) {
|
|
2353
|
-
|
|
2362
|
+
C.camera.position.set(
|
|
2354
2363
|
e.position[0],
|
|
2355
2364
|
e.position[1],
|
|
2356
2365
|
e.position[2]
|
|
2357
|
-
),
|
|
2366
|
+
), C.camera.rotation.set(
|
|
2358
2367
|
e.rotation[0],
|
|
2359
2368
|
e.rotation[1],
|
|
2360
2369
|
e.rotation[2]
|
|
2361
|
-
),
|
|
2370
|
+
), C.camera.updateProjectionMatrix(), Dt = e.target;
|
|
2362
2371
|
return;
|
|
2363
2372
|
} else
|
|
2364
2373
|
cn(""), hs();
|
|
2365
|
-
if (!
|
|
2366
|
-
const t =
|
|
2374
|
+
if (!C.camera || !C.orbitControls) return;
|
|
2375
|
+
const t = C.camera.position.clone(), n = C.orbitControls.target.clone(), s = new w.Vector3(
|
|
2367
2376
|
e.position[0],
|
|
2368
2377
|
e.position[1],
|
|
2369
2378
|
e.position[2]
|
|
2370
2379
|
), i = e.target ? new w.Vector3(e.target[0], e.target[1], e.target[2]) : new w.Vector3(0, 0, 0);
|
|
2371
|
-
|
|
2380
|
+
C.orbitControls.enabled = !1, new ut.Tween({
|
|
2372
2381
|
x: t.x,
|
|
2373
2382
|
y: t.y,
|
|
2374
2383
|
z: t.z,
|
|
@@ -2386,13 +2395,13 @@ function an(r = !1) {
|
|
|
2386
2395
|
},
|
|
2387
2396
|
1e3
|
|
2388
2397
|
).easing(ut.Easing.Quadratic.InOut).onUpdate((o) => {
|
|
2389
|
-
|
|
2398
|
+
C.camera.position.set(o.x, o.y, o.z), C.orbitControls.target.set(o.tx, o.ty, o.tz), C.orbitControls.update();
|
|
2390
2399
|
}).onComplete(() => {
|
|
2391
|
-
Dt = e.target,
|
|
2400
|
+
Dt = e.target, C.orbitControls.enabled = !0;
|
|
2392
2401
|
}).start();
|
|
2393
2402
|
}
|
|
2394
2403
|
function yo() {
|
|
2395
|
-
const r = new Ii(
|
|
2404
|
+
const r = new Ii(C.camera, C.renderer.domElement);
|
|
2396
2405
|
r.minDistance = 0, r.maxDistance = 1 / 0, r.addEventListener("start", () => {
|
|
2397
2406
|
Rt = !1;
|
|
2398
2407
|
}), r.addEventListener("change", () => {
|
|
@@ -2401,34 +2410,34 @@ function yo() {
|
|
|
2401
2410
|
Rt && (We = !0, setTimeout(() => {
|
|
2402
2411
|
We = !1;
|
|
2403
2412
|
}, 200));
|
|
2404
|
-
}),
|
|
2413
|
+
}), C.orbitControls = r;
|
|
2405
2414
|
}
|
|
2406
2415
|
function xo() {
|
|
2407
|
-
const r = new
|
|
2408
|
-
|
|
2409
|
-
|
|
2416
|
+
const r = new Oi(
|
|
2417
|
+
C.camera,
|
|
2418
|
+
C.renderer.domElement
|
|
2410
2419
|
);
|
|
2411
2420
|
r.addEventListener("dragging-changed", (e) => {
|
|
2412
|
-
|
|
2421
|
+
C.orbitControls.enabled = !e.value, e.value || (We = !0, setTimeout(() => {
|
|
2413
2422
|
We = !1;
|
|
2414
2423
|
}, 200));
|
|
2415
2424
|
}), r.addEventListener("objectChange", () => {
|
|
2416
|
-
const e =
|
|
2425
|
+
const e = C.selectedObject;
|
|
2417
2426
|
if (os && e && os(e), e && e.type === "DirectionalLight") {
|
|
2418
2427
|
const t = e.userData.helper;
|
|
2419
2428
|
t && t.update && t.update();
|
|
2420
2429
|
}
|
|
2421
|
-
}),
|
|
2430
|
+
}), C.scene.add(r.getHelper()), C.transformControls = r;
|
|
2422
2431
|
}
|
|
2423
2432
|
function vo() {
|
|
2424
2433
|
const r = new w.AmbientLight(16777215, 1);
|
|
2425
|
-
|
|
2434
|
+
C.scene.add(r);
|
|
2426
2435
|
}
|
|
2427
2436
|
function ln() {
|
|
2428
2437
|
var e, t;
|
|
2429
|
-
kt = requestAnimationFrame(ln), ut.update(), (e =
|
|
2438
|
+
kt = requestAnimationFrame(ln), ut.update(), (e = C.orbitControls) == null || e.update(), C.mode === "run" && Ie && C.scene && C.camera ? Ie.render() : (t = C.renderer) == null || t.render(C.scene, C.camera), C.scene && C.camera && Ao(C.scene, C.camera), Nt && C.scene && (vt = [], C.scene.traverse((n) => {
|
|
2430
2439
|
n.userData.isWater && n.type === "Mesh" && vt.push(n);
|
|
2431
|
-
}),
|
|
2440
|
+
}), Nt = !1);
|
|
2432
2441
|
for (let n = 0; n < vt.length; n++) {
|
|
2433
2442
|
const s = vt[n], i = s.material;
|
|
2434
2443
|
if (i.normalMap) {
|
|
@@ -2438,25 +2447,25 @@ function ln() {
|
|
|
2438
2447
|
}
|
|
2439
2448
|
}
|
|
2440
2449
|
function So() {
|
|
2441
|
-
if (!
|
|
2442
|
-
const r =
|
|
2443
|
-
r === 0 || e === 0 || (
|
|
2450
|
+
if (!C.container || !C.camera || !C.renderer) return;
|
|
2451
|
+
const r = C.container.clientWidth, e = C.container.clientHeight;
|
|
2452
|
+
r === 0 || e === 0 || (C.camera.aspect = r / e, C.camera.updateProjectionMatrix(), C.renderer.setSize(r, e), Ie && Ie.setSize(r, e), ye && ye.resolution.set(r, e), co(r, e));
|
|
2444
2453
|
}
|
|
2445
2454
|
function ds(r) {
|
|
2446
|
-
|
|
2455
|
+
C.selectedObject !== r && (C.selectedObject && C.transformControls.detach(), C.selectedObject = r, C.transformControls.attach(r), C.transformControls.setMode(C.transformControlsMode), C.transformControls.showX = !0, C.transformControls.showY = !0, C.transformControls.showZ = !0, An(r), Ne == null || Ne(r));
|
|
2447
2456
|
}
|
|
2448
|
-
let
|
|
2457
|
+
let $ = null;
|
|
2449
2458
|
function To(r) {
|
|
2450
|
-
|
|
2459
|
+
$ = r;
|
|
2451
2460
|
}
|
|
2452
2461
|
function Zt(r) {
|
|
2453
|
-
|
|
2462
|
+
$ == null || $(r);
|
|
2454
2463
|
}
|
|
2455
2464
|
function Mo(r) {
|
|
2456
|
-
|
|
2465
|
+
C.transformControlsMode = r, C.transformControls && C.transformControls.setMode(C.transformControlsMode);
|
|
2457
2466
|
}
|
|
2458
2467
|
function An(r) {
|
|
2459
|
-
if (
|
|
2468
|
+
if (C.mode === "edit")
|
|
2460
2469
|
hs(), r.traverse((t) => {
|
|
2461
2470
|
if (t.isMesh) {
|
|
2462
2471
|
const n = t, s = new w.EdgesGeometry(n.geometry), i = new w.LineBasicMaterial({
|
|
@@ -2475,7 +2484,7 @@ function An(r) {
|
|
|
2475
2484
|
}
|
|
2476
2485
|
}
|
|
2477
2486
|
function hs() {
|
|
2478
|
-
if (
|
|
2487
|
+
if (C.mode === "edit") {
|
|
2479
2488
|
for (const r of is)
|
|
2480
2489
|
r.parent && r.parent.remove(r), r.geometry.dispose(), r.material.dispose();
|
|
2481
2490
|
is = [];
|
|
@@ -2483,7 +2492,7 @@ function hs() {
|
|
|
2483
2492
|
ye && (ye.selectedObjects = []);
|
|
2484
2493
|
}
|
|
2485
2494
|
function fs() {
|
|
2486
|
-
|
|
2495
|
+
C.selectedObject && (hs(), C.transformControls.detach(), C.selectedObject = null, Ne == null || Ne(null));
|
|
2487
2496
|
}
|
|
2488
2497
|
function cn(r) {
|
|
2489
2498
|
let e = null;
|
|
@@ -2502,13 +2511,13 @@ function wo(r) {
|
|
|
2502
2511
|
We = !1;
|
|
2503
2512
|
return;
|
|
2504
2513
|
}
|
|
2505
|
-
const e =
|
|
2514
|
+
const e = C.renderer.domElement.getBoundingClientRect(), t = new w.Vector2(
|
|
2506
2515
|
(r.clientX - e.left) / e.width * 2 - 1,
|
|
2507
2516
|
-((r.clientY - e.top) / e.height) * 2 + 1
|
|
2508
2517
|
), n = new w.Raycaster();
|
|
2509
|
-
n.setFromCamera(t,
|
|
2518
|
+
n.setFromCamera(t, C.camera);
|
|
2510
2519
|
const s = [];
|
|
2511
|
-
|
|
2520
|
+
C.scene.traverse((o) => {
|
|
2512
2521
|
(o.userData.isMovable || o.userData.type === "lightHelper") && s.push(o);
|
|
2513
2522
|
});
|
|
2514
2523
|
const i = n.intersectObjects(s);
|
|
@@ -2533,7 +2542,7 @@ function Ro(r) {
|
|
|
2533
2542
|
return r;
|
|
2534
2543
|
}
|
|
2535
2544
|
function Eo(r, e = 500) {
|
|
2536
|
-
if (!
|
|
2545
|
+
if (!C.camera || !C.orbitControls) {
|
|
2537
2546
|
console.warn(
|
|
2538
2547
|
"[focusOnObject] 编辑器尚未初始化或已销毁,无法执行聚焦操作。请确保已调用 initEditor()"
|
|
2539
2548
|
);
|
|
@@ -2547,17 +2556,17 @@ function Eo(r, e = 500) {
|
|
|
2547
2556
|
r.userData.closeUpView && typeof r.userData.closeUpView.x == "number" && typeof r.userData.closeUpView.y == "number" && typeof r.userData.closeUpView.z == "number" && (t = r.userData.closeUpView);
|
|
2548
2557
|
const n = new w.Vector3();
|
|
2549
2558
|
r.getWorldPosition(n);
|
|
2550
|
-
const i = new w.Box3().setFromObject(r).getSize(new w.Vector3()), o = Math.max(i.x, i.y, i.z) * 0.5, a = Math.max(o * 3.5, 5), l = new w.Vector3().copy(
|
|
2559
|
+
const i = new w.Box3().setFromObject(r).getSize(new w.Vector3()), o = Math.max(i.x, i.y, i.z) * 0.5, a = Math.max(o * 3.5, 5), l = new w.Vector3().copy(C.camera.position).sub(n).normalize();
|
|
2551
2560
|
l.lengthSq() < 1e-3 && l.set(0, 0, 1);
|
|
2552
|
-
const A = n.clone().add(l.multiplyScalar(a)), d =
|
|
2561
|
+
const A = n.clone().add(l.multiplyScalar(a)), d = C.camera.position.clone(), u = C.orbitControls.target.clone();
|
|
2553
2562
|
try {
|
|
2554
2563
|
new ut.Tween({
|
|
2555
2564
|
x: d.x,
|
|
2556
2565
|
y: d.y,
|
|
2557
2566
|
z: d.z,
|
|
2558
|
-
tx:
|
|
2559
|
-
ty:
|
|
2560
|
-
tz:
|
|
2567
|
+
tx: u.x,
|
|
2568
|
+
ty: u.y,
|
|
2569
|
+
tz: u.z
|
|
2561
2570
|
}).to(
|
|
2562
2571
|
{
|
|
2563
2572
|
x: t ? t.x : A.x,
|
|
@@ -2568,13 +2577,13 @@ function Eo(r, e = 500) {
|
|
|
2568
2577
|
tz: n.z
|
|
2569
2578
|
},
|
|
2570
2579
|
e
|
|
2571
|
-
).easing(ut.Easing.Quadratic.InOut).onUpdate((
|
|
2572
|
-
|
|
2580
|
+
).easing(ut.Easing.Quadratic.InOut).onUpdate((c) => {
|
|
2581
|
+
C.camera.position.set(c.x, c.y, c.z), C.orbitControls.target.set(c.tx, c.ty, c.tz), C.orbitControls.update();
|
|
2573
2582
|
}).start();
|
|
2574
|
-
} catch (
|
|
2583
|
+
} catch (c) {
|
|
2575
2584
|
console.error(
|
|
2576
2585
|
"[focusOnObject] TWEEN 动画创建失败,请检查 @tweenjs/tween.js 是否已正确安装且版本兼容(^23.1.3):",
|
|
2577
|
-
|
|
2586
|
+
c
|
|
2578
2587
|
);
|
|
2579
2588
|
}
|
|
2580
2589
|
}
|
|
@@ -2593,7 +2602,7 @@ function Lo(r, e) {
|
|
|
2593
2602
|
r.userData.id = n, je.set(n, r);
|
|
2594
2603
|
}
|
|
2595
2604
|
}
|
|
2596
|
-
function
|
|
2605
|
+
function Oo(r) {
|
|
2597
2606
|
r.traverse((e) => {
|
|
2598
2607
|
if (e.name && e.name.startsWith("DataPanel_")) {
|
|
2599
2608
|
const t = e;
|
|
@@ -2602,17 +2611,17 @@ function No(r) {
|
|
|
2602
2611
|
});
|
|
2603
2612
|
}
|
|
2604
2613
|
function Xe(r, e = !1) {
|
|
2605
|
-
|
|
2614
|
+
C.scene.add(r), Nt = !0, r.userData.isMovable && (Wo(r), Ut()), e && C.mode === "edit" && ds(r);
|
|
2606
2615
|
}
|
|
2607
|
-
function
|
|
2608
|
-
|
|
2616
|
+
function No(r) {
|
|
2617
|
+
C.selectedObject === r && fs(), Nt = !0, Oo(r), Po(r), r.userData.helper && C.scene.remove(r.userData.helper), r.parent ? r.parent.remove(r) : C.scene.remove(r), jo(r), Ut();
|
|
2609
2618
|
}
|
|
2610
2619
|
function Do(r) {
|
|
2611
|
-
const e =
|
|
2612
|
-
e &&
|
|
2620
|
+
const e = C.scene.getObjectByProperty("uuid", r);
|
|
2621
|
+
e && No(e);
|
|
2613
2622
|
}
|
|
2614
2623
|
function Wo(r) {
|
|
2615
|
-
r.userData.isMovable && r.parent ===
|
|
2624
|
+
r.userData.isMovable && r.parent === C.scene && (xe.includes(r) || xe.push(r));
|
|
2616
2625
|
}
|
|
2617
2626
|
function jo(r) {
|
|
2618
2627
|
const e = xe.indexOf(r);
|
|
@@ -2620,7 +2629,7 @@ function jo(r) {
|
|
|
2620
2629
|
}
|
|
2621
2630
|
function Fo() {
|
|
2622
2631
|
const r = [];
|
|
2623
|
-
|
|
2632
|
+
C.scene.children.forEach((e) => {
|
|
2624
2633
|
e.userData.isMovable && r.push(e);
|
|
2625
2634
|
}), xe = r, Ut();
|
|
2626
2635
|
}
|
|
@@ -2628,7 +2637,7 @@ function Ut() {
|
|
|
2628
2637
|
Et == null || Et([...xe]);
|
|
2629
2638
|
}
|
|
2630
2639
|
function Uo(r) {
|
|
2631
|
-
|
|
2640
|
+
Ne = r;
|
|
2632
2641
|
}
|
|
2633
2642
|
function Ho(r) {
|
|
2634
2643
|
os = r;
|
|
@@ -2640,84 +2649,84 @@ function Go() {
|
|
|
2640
2649
|
return xe;
|
|
2641
2650
|
}
|
|
2642
2651
|
function Ko() {
|
|
2643
|
-
return
|
|
2652
|
+
return C.selectedObject;
|
|
2644
2653
|
}
|
|
2645
|
-
function
|
|
2646
|
-
if (!
|
|
2654
|
+
function Nl(r, e, t) {
|
|
2655
|
+
if (!C.scene) return;
|
|
2647
2656
|
const n = je.get(r);
|
|
2648
2657
|
if (n) {
|
|
2649
2658
|
const s = Ft(n);
|
|
2650
2659
|
s && s.updateItemByCode(e, t);
|
|
2651
2660
|
}
|
|
2652
2661
|
}
|
|
2653
|
-
function
|
|
2654
|
-
return
|
|
2662
|
+
function Dl() {
|
|
2663
|
+
return C.scene;
|
|
2655
2664
|
}
|
|
2656
2665
|
function Bo() {
|
|
2657
|
-
return
|
|
2666
|
+
return C.camera;
|
|
2658
2667
|
}
|
|
2659
|
-
function
|
|
2660
|
-
return
|
|
2668
|
+
function Wl() {
|
|
2669
|
+
return C.renderer;
|
|
2661
2670
|
}
|
|
2662
2671
|
async function Zo() {
|
|
2663
|
-
var A, d,
|
|
2664
|
-
|
|
2665
|
-
const r =
|
|
2672
|
+
var A, d, u;
|
|
2673
|
+
$ == null || $(!0), await new Promise((c) => setTimeout(c, 50)), fs();
|
|
2674
|
+
const r = C.scene;
|
|
2666
2675
|
if (!r)
|
|
2667
|
-
return
|
|
2676
|
+
return $ == null || $(!1), "{}";
|
|
2668
2677
|
const e = [], t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
2669
|
-
r.traverse((
|
|
2678
|
+
r.traverse((c) => {
|
|
2670
2679
|
var h;
|
|
2671
|
-
if (
|
|
2672
|
-
const
|
|
2673
|
-
if (
|
|
2674
|
-
const
|
|
2680
|
+
if (c.userData.type === "lightHelper" && e.push(c), c.type === "DirectionalLight" && c.userData.helper && (t.set(c, c.userData.helper), c.userData.helper = void 0), c.name && c.name.startsWith("DataPanel_")) {
|
|
2681
|
+
const p = c;
|
|
2682
|
+
if (p.element) {
|
|
2683
|
+
const f = p.element.querySelector(
|
|
2675
2684
|
"[data-panel-title]"
|
|
2676
2685
|
), m = [];
|
|
2677
|
-
if (
|
|
2686
|
+
if (p.element.querySelectorAll(
|
|
2678
2687
|
".sl-css2d-data-panel-item"
|
|
2679
|
-
).forEach((
|
|
2680
|
-
var v,
|
|
2681
|
-
const
|
|
2682
|
-
if (
|
|
2683
|
-
const
|
|
2688
|
+
).forEach((x) => {
|
|
2689
|
+
var v, S, L;
|
|
2690
|
+
const I = x.querySelector(".item-label"), y = x.querySelector(".item-value");
|
|
2691
|
+
if (I && y) {
|
|
2692
|
+
const Y = (I.textContent || "").trim(), ee = ((S = (v = y.childNodes[0]) == null ? void 0 : v.textContent) == null ? void 0 : S.trim()) || "", _ = y.querySelector(
|
|
2684
2693
|
"span"
|
|
2685
|
-
), Te =
|
|
2686
|
-
m.push({ label:
|
|
2694
|
+
), Te = _ ? (_.textContent || "").trim() : void 0, Ht = ((L = x.getAttribute("data-item-code")) == null ? void 0 : L.trim()) || void 0;
|
|
2695
|
+
m.push({ label: Y, value: ee, unit: Te, code: Ht });
|
|
2687
2696
|
}
|
|
2688
|
-
}),
|
|
2689
|
-
const
|
|
2697
|
+
}), c.parent) {
|
|
2698
|
+
const x = p.element.style.width || "", I = p.element.style.fontSize || "", y = Ft(c.parent), v = y ? y.getOffsetY() : 0.1;
|
|
2690
2699
|
n.set(
|
|
2691
|
-
|
|
2700
|
+
c.parent.userData.id ? c.parent.userData.id : c.parent.uuid,
|
|
2692
2701
|
{
|
|
2693
|
-
title: ((h =
|
|
2702
|
+
title: ((h = f == null ? void 0 : f.textContent) == null ? void 0 : h.trim()) || "",
|
|
2694
2703
|
items: m,
|
|
2695
|
-
width:
|
|
2696
|
-
fontSize:
|
|
2704
|
+
width: x,
|
|
2705
|
+
fontSize: I,
|
|
2697
2706
|
offsetY: v
|
|
2698
2707
|
}
|
|
2699
2708
|
);
|
|
2700
2709
|
}
|
|
2701
2710
|
}
|
|
2702
2711
|
}
|
|
2703
|
-
}), e.forEach((
|
|
2712
|
+
}), e.forEach((c) => r.remove(c));
|
|
2704
2713
|
const s = r.clone();
|
|
2705
2714
|
s.children = s.children.filter(
|
|
2706
|
-
(
|
|
2707
|
-
), s.traverse((
|
|
2708
|
-
|
|
2715
|
+
(c) => c.userData.type !== "initFloor"
|
|
2716
|
+
), s.traverse((c) => {
|
|
2717
|
+
c.name && c.name.startsWith("DataPanel_") && c.parent && c.parent.remove(c);
|
|
2709
2718
|
});
|
|
2710
2719
|
const i = s.toJSON();
|
|
2711
|
-
e.forEach((
|
|
2712
|
-
h.userData.helper =
|
|
2720
|
+
e.forEach((c) => r.add(c)), t.forEach((c, h) => {
|
|
2721
|
+
h.userData.helper = c;
|
|
2713
2722
|
});
|
|
2714
2723
|
const o = {
|
|
2715
|
-
position: (A =
|
|
2716
|
-
rotation: (d =
|
|
2717
|
-
target: ((
|
|
2724
|
+
position: (A = C.camera) == null ? void 0 : A.position.toArray(),
|
|
2725
|
+
rotation: (d = C.camera) == null ? void 0 : d.rotation.toArray(),
|
|
2726
|
+
target: ((u = C.orbitControls) == null ? void 0 : u.target.toArray()) || [0, 0, 0]
|
|
2718
2727
|
}, a = {};
|
|
2719
|
-
n.forEach((
|
|
2720
|
-
a[h] =
|
|
2728
|
+
n.forEach((c, h) => {
|
|
2729
|
+
a[h] = c;
|
|
2721
2730
|
});
|
|
2722
2731
|
const l = JSON.stringify({
|
|
2723
2732
|
scene: i,
|
|
@@ -2725,28 +2734,28 @@ async function Zo() {
|
|
|
2725
2734
|
dataPanels: a
|
|
2726
2735
|
// lightHelpers: lightHelpers,
|
|
2727
2736
|
});
|
|
2728
|
-
return
|
|
2737
|
+
return $ == null || $(!1), l;
|
|
2729
2738
|
}
|
|
2730
2739
|
function Xo(r, e = "edit", t) {
|
|
2731
2740
|
var o, a, l;
|
|
2732
2741
|
const n = typeof r == "string" ? JSON.parse(r) : r, i = new w.ObjectLoader().parse(n);
|
|
2733
|
-
i.type === "Scene" ?
|
|
2734
|
-
const d = A.userData.id || A.uuid,
|
|
2735
|
-
if (
|
|
2742
|
+
i.type === "Scene" ? C.scene = i : (o = C.scene) == null || o.add(i), t && ((a = C.scene) == null || a.traverse((A) => {
|
|
2743
|
+
const d = A.userData.id || A.uuid, u = t[d];
|
|
2744
|
+
if (u && A.userData.isMovable) {
|
|
2736
2745
|
ko(A);
|
|
2737
|
-
const
|
|
2738
|
-
title:
|
|
2739
|
-
items:
|
|
2746
|
+
const c = new dt({
|
|
2747
|
+
title: u.title,
|
|
2748
|
+
items: u.items
|
|
2740
2749
|
});
|
|
2741
|
-
|
|
2750
|
+
c.attachTo(A), c.visible = !1, u.width && c.setWidth(u.width), u.fontSize && c.setFontSize(u.fontSize), u.offsetY !== void 0 && c.setOffsetY(u.offsetY), rn(A, c);
|
|
2742
2751
|
}
|
|
2743
|
-
})), e === "edit" && ((l =
|
|
2752
|
+
})), e === "edit" && ((l = C.scene) == null || l.traverse((A) => {
|
|
2744
2753
|
var d;
|
|
2745
2754
|
if (A.type === "DirectionalLight") {
|
|
2746
|
-
const
|
|
2747
|
-
if (!
|
|
2748
|
-
const
|
|
2749
|
-
|
|
2755
|
+
const u = A;
|
|
2756
|
+
if (!u.userData.helper) {
|
|
2757
|
+
const c = new w.DirectionalLightHelper(u, 1);
|
|
2758
|
+
c.userData.type = "lightHelper", u.userData.helper = c, (d = C.scene) == null || d.add(c);
|
|
2750
2759
|
}
|
|
2751
2760
|
}
|
|
2752
2761
|
}));
|
|
@@ -2764,9 +2773,9 @@ function un(r) {
|
|
|
2764
2773
|
un(t);
|
|
2765
2774
|
}
|
|
2766
2775
|
function qo() {
|
|
2767
|
-
kt !== null && (cancelAnimationFrame(kt), kt = null), lt &&
|
|
2776
|
+
kt !== null && (cancelAnimationFrame(kt), kt = null), lt && C.container && (C.container.removeEventListener("click", lt), lt = null), At && (window.removeEventListener("resize", At), At = null), C.orbitControls && (C.orbitControls.dispose(), C.orbitControls = null), C.transformControls && (C.transformControls.dispose(), C.transformControls = null), Ie && (Ie.dispose(), Ie = null, ye = null), C.scene && (un(C.scene), C.scene = null), C.renderer && (C.renderer.dispose(), C.renderer.domElement && C.container && C.container.removeChild(C.renderer.domElement), C.renderer = null), uo(), C.camera = null, C.gridHelper = null, C.selectedObject = null, C.container = null, C.mode = "", xe = [], je.clear(), Ut(), Rt = !1, We = !1;
|
|
2768
2777
|
}
|
|
2769
|
-
const Vo = /^[og]\s*(.+)?/, Jo = /^mtllib /, Qo = /^usemtl /, Yo = /^usemap /, js = /\s+/, Fs = new
|
|
2778
|
+
const Vo = /^[og]\s*(.+)?/, Jo = /^mtllib /, Qo = /^usemtl /, Yo = /^usemap /, js = /\s+/, Fs = new M(), Xt = new M(), Us = new M(), Hs = new M(), se = new M(), St = new Z();
|
|
2770
2779
|
function _o() {
|
|
2771
2780
|
const r = {
|
|
2772
2781
|
objects: [],
|
|
@@ -2896,15 +2905,15 @@ function _o() {
|
|
|
2896
2905
|
},
|
|
2897
2906
|
addFace: function(e, t, n, s, i, o, a, l, A) {
|
|
2898
2907
|
const d = this.vertices.length;
|
|
2899
|
-
let
|
|
2900
|
-
if (this.addVertex(
|
|
2901
|
-
const
|
|
2902
|
-
|
|
2908
|
+
let u = this.parseVertexIndex(e, d), c = this.parseVertexIndex(t, d), h = this.parseVertexIndex(n, d);
|
|
2909
|
+
if (this.addVertex(u, c, h), this.addColor(u, c, h), a !== void 0 && a !== "") {
|
|
2910
|
+
const p = this.normals.length;
|
|
2911
|
+
u = this.parseNormalIndex(a, p), c = this.parseNormalIndex(l, p), h = this.parseNormalIndex(A, p), this.addNormal(u, c, h);
|
|
2903
2912
|
} else
|
|
2904
|
-
this.addFaceNormal(
|
|
2913
|
+
this.addFaceNormal(u, c, h);
|
|
2905
2914
|
if (s !== void 0 && s !== "") {
|
|
2906
|
-
const
|
|
2907
|
-
|
|
2915
|
+
const p = this.uvs.length;
|
|
2916
|
+
u = this.parseUVIndex(s, p), c = this.parseUVIndex(i, p), h = this.parseUVIndex(o, p), this.addUV(u, c, h), this.object.geometry.hasUVIndices = !0;
|
|
2908
2917
|
} else
|
|
2909
2918
|
this.addDefaultUV();
|
|
2910
2919
|
},
|
|
@@ -2985,76 +2994,76 @@ class $o extends As {
|
|
|
2985
2994
|
const d = A.charAt(0);
|
|
2986
2995
|
if (d !== "#")
|
|
2987
2996
|
if (d === "v") {
|
|
2988
|
-
const
|
|
2989
|
-
switch (
|
|
2997
|
+
const u = A.split(js);
|
|
2998
|
+
switch (u[0]) {
|
|
2990
2999
|
case "v":
|
|
2991
3000
|
t.vertices.push(
|
|
2992
|
-
parseFloat(
|
|
2993
|
-
parseFloat(
|
|
2994
|
-
parseFloat(
|
|
2995
|
-
),
|
|
2996
|
-
parseFloat(
|
|
2997
|
-
parseFloat(
|
|
2998
|
-
parseFloat(
|
|
3001
|
+
parseFloat(u[1]),
|
|
3002
|
+
parseFloat(u[2]),
|
|
3003
|
+
parseFloat(u[3])
|
|
3004
|
+
), u.length >= 7 ? (St.setRGB(
|
|
3005
|
+
parseFloat(u[4]),
|
|
3006
|
+
parseFloat(u[5]),
|
|
3007
|
+
parseFloat(u[6]),
|
|
2999
3008
|
fe
|
|
3000
3009
|
), t.colors.push(St.r, St.g, St.b)) : t.colors.push(void 0, void 0, void 0);
|
|
3001
3010
|
break;
|
|
3002
3011
|
case "vn":
|
|
3003
3012
|
t.normals.push(
|
|
3004
|
-
parseFloat(
|
|
3005
|
-
parseFloat(
|
|
3006
|
-
parseFloat(
|
|
3013
|
+
parseFloat(u[1]),
|
|
3014
|
+
parseFloat(u[2]),
|
|
3015
|
+
parseFloat(u[3])
|
|
3007
3016
|
);
|
|
3008
3017
|
break;
|
|
3009
3018
|
case "vt":
|
|
3010
3019
|
t.uvs.push(
|
|
3011
|
-
parseFloat(
|
|
3012
|
-
parseFloat(
|
|
3020
|
+
parseFloat(u[1]),
|
|
3021
|
+
parseFloat(u[2])
|
|
3013
3022
|
);
|
|
3014
3023
|
break;
|
|
3015
3024
|
}
|
|
3016
3025
|
} else if (d === "f") {
|
|
3017
|
-
const
|
|
3018
|
-
for (let
|
|
3019
|
-
const g =
|
|
3026
|
+
const c = A.slice(1).trim().split(js), h = [];
|
|
3027
|
+
for (let f = 0, m = c.length; f < m; f++) {
|
|
3028
|
+
const g = c[f];
|
|
3020
3029
|
if (g.length > 0) {
|
|
3021
|
-
const
|
|
3022
|
-
h.push(
|
|
3030
|
+
const x = g.split("/");
|
|
3031
|
+
h.push(x);
|
|
3023
3032
|
}
|
|
3024
3033
|
}
|
|
3025
|
-
const
|
|
3026
|
-
for (let
|
|
3027
|
-
const g = h[
|
|
3034
|
+
const p = h[0];
|
|
3035
|
+
for (let f = 1, m = h.length - 1; f < m; f++) {
|
|
3036
|
+
const g = h[f], x = h[f + 1];
|
|
3028
3037
|
t.addFace(
|
|
3029
|
-
|
|
3038
|
+
p[0],
|
|
3030
3039
|
g[0],
|
|
3031
|
-
|
|
3032
|
-
|
|
3040
|
+
x[0],
|
|
3041
|
+
p[1],
|
|
3033
3042
|
g[1],
|
|
3034
|
-
|
|
3035
|
-
|
|
3043
|
+
x[1],
|
|
3044
|
+
p[2],
|
|
3036
3045
|
g[2],
|
|
3037
|
-
|
|
3046
|
+
x[2]
|
|
3038
3047
|
);
|
|
3039
3048
|
}
|
|
3040
3049
|
} else if (d === "l") {
|
|
3041
|
-
const
|
|
3042
|
-
let
|
|
3050
|
+
const u = A.substring(1).trim().split(" ");
|
|
3051
|
+
let c = [];
|
|
3043
3052
|
const h = [];
|
|
3044
3053
|
if (A.indexOf("/") === -1)
|
|
3045
|
-
|
|
3054
|
+
c = u;
|
|
3046
3055
|
else
|
|
3047
|
-
for (let
|
|
3048
|
-
const m =
|
|
3049
|
-
m[0] !== "" &&
|
|
3056
|
+
for (let p = 0, f = u.length; p < f; p++) {
|
|
3057
|
+
const m = u[p].split("/");
|
|
3058
|
+
m[0] !== "" && c.push(m[0]), m[1] !== "" && h.push(m[1]);
|
|
3050
3059
|
}
|
|
3051
|
-
t.addLineGeometry(
|
|
3060
|
+
t.addLineGeometry(c, h);
|
|
3052
3061
|
} else if (d === "p") {
|
|
3053
|
-
const
|
|
3054
|
-
t.addPointGeometry(
|
|
3062
|
+
const c = A.slice(1).trim().split(" ");
|
|
3063
|
+
t.addPointGeometry(c);
|
|
3055
3064
|
} else if ((s = Vo.exec(A)) !== null) {
|
|
3056
|
-
const
|
|
3057
|
-
t.startObject(
|
|
3065
|
+
const u = (" " + s[0].slice(1).trim()).slice(1);
|
|
3066
|
+
t.startObject(u);
|
|
3058
3067
|
} else if (Qo.test(A))
|
|
3059
3068
|
t.object.startMaterial(A.substring(7).trim(), t.materialLibraries);
|
|
3060
3069
|
else if (Jo.test(A))
|
|
@@ -3063,12 +3072,12 @@ class $o extends As {
|
|
|
3063
3072
|
console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
|
|
3064
3073
|
else if (d === "s") {
|
|
3065
3074
|
if (s = A.split(" "), s.length > 1) {
|
|
3066
|
-
const
|
|
3067
|
-
t.object.smooth =
|
|
3075
|
+
const c = s[1].trim().toLowerCase();
|
|
3076
|
+
t.object.smooth = c !== "0" && c !== "off";
|
|
3068
3077
|
} else
|
|
3069
3078
|
t.object.smooth = !0;
|
|
3070
|
-
const
|
|
3071
|
-
|
|
3079
|
+
const u = t.object.currentMaterial();
|
|
3080
|
+
u && (u.smooth = t.object.smooth);
|
|
3072
3081
|
} else {
|
|
3073
3082
|
if (A === "\0") continue;
|
|
3074
3083
|
console.warn('THREE.OBJLoader: Unexpected line: "' + A + '"');
|
|
@@ -3078,40 +3087,40 @@ class $o extends As {
|
|
|
3078
3087
|
const i = new Tt();
|
|
3079
3088
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
|
|
3080
3089
|
for (let a = 0, l = t.objects.length; a < l; a++) {
|
|
3081
|
-
const A = t.objects[a], d = A.geometry,
|
|
3082
|
-
let
|
|
3090
|
+
const A = t.objects[a], d = A.geometry, u = A.materials, c = d.type === "Line", h = d.type === "Points";
|
|
3091
|
+
let p = !1;
|
|
3083
3092
|
if (d.vertices.length === 0) continue;
|
|
3084
|
-
const
|
|
3085
|
-
|
|
3093
|
+
const f = new De();
|
|
3094
|
+
f.setAttribute("position", new Ae(d.vertices, 3)), d.normals.length > 0 && f.setAttribute("normal", new Ae(d.normals, 3)), d.colors.length > 0 && (p = !0, f.setAttribute("color", new Ae(d.colors, 3))), d.hasUVIndices === !0 && f.setAttribute("uv", new Ae(d.uvs, 2));
|
|
3086
3095
|
const m = [];
|
|
3087
|
-
for (let
|
|
3088
|
-
const
|
|
3089
|
-
let
|
|
3096
|
+
for (let x = 0, I = u.length; x < I; x++) {
|
|
3097
|
+
const y = u[x], v = y.name + "_" + y.smooth + "_" + p;
|
|
3098
|
+
let S = t.materials[v];
|
|
3090
3099
|
if (this.materials !== null) {
|
|
3091
|
-
if (
|
|
3100
|
+
if (S = this.materials.create(y.name), c && S && !(S instanceof it)) {
|
|
3092
3101
|
const L = new it();
|
|
3093
|
-
ot.prototype.copy.call(L,
|
|
3094
|
-
} else if (h &&
|
|
3102
|
+
ot.prototype.copy.call(L, S), L.color.copy(S.color), S = L;
|
|
3103
|
+
} else if (h && S && !(S instanceof et)) {
|
|
3095
3104
|
const L = new et({ size: 10, sizeAttenuation: !1 });
|
|
3096
|
-
ot.prototype.copy.call(L,
|
|
3105
|
+
ot.prototype.copy.call(L, S), L.color.copy(S.color), L.map = S.map, S = L;
|
|
3097
3106
|
}
|
|
3098
3107
|
}
|
|
3099
|
-
|
|
3108
|
+
S === void 0 && (c ? S = new it() : h ? S = new et({ size: 1, sizeAttenuation: !1 }) : S = new qn(), S.name = y.name, S.flatShading = !y.smooth, S.vertexColors = p, t.materials[v] = S), m.push(S);
|
|
3100
3109
|
}
|
|
3101
3110
|
let g;
|
|
3102
3111
|
if (m.length > 1) {
|
|
3103
|
-
for (let
|
|
3104
|
-
const
|
|
3105
|
-
|
|
3112
|
+
for (let x = 0, I = u.length; x < I; x++) {
|
|
3113
|
+
const y = u[x];
|
|
3114
|
+
f.addGroup(y.groupStart, y.groupCount, x);
|
|
3106
3115
|
}
|
|
3107
|
-
|
|
3116
|
+
c ? g = new es(f, m) : h ? g = new Mt(f, m) : g = new T(f, m);
|
|
3108
3117
|
} else
|
|
3109
|
-
|
|
3118
|
+
c ? g = new es(f, m[0]) : h ? g = new Mt(f, m[0]) : g = new T(f, m[0]);
|
|
3110
3119
|
g.name = A.name, i.add(g);
|
|
3111
3120
|
}
|
|
3112
3121
|
else if (t.vertices.length > 0) {
|
|
3113
3122
|
const a = new et({ size: 1, sizeAttenuation: !1 }), l = new De();
|
|
3114
|
-
l.setAttribute("position", new
|
|
3123
|
+
l.setAttribute("position", new Ae(t.vertices, 3)), t.colors.length > 0 && t.colors[0] !== void 0 && (l.setAttribute("color", new Ae(t.colors, 3)), a.vertexColors = !0);
|
|
3115
3124
|
const A = new Mt(l, a);
|
|
3116
3125
|
i.add(A);
|
|
3117
3126
|
}
|
|
@@ -3307,8 +3316,8 @@ class tr extends As {
|
|
|
3307
3316
|
if (l.decode(new Uint8Array(e, 0, 4)) === hn) {
|
|
3308
3317
|
try {
|
|
3309
3318
|
o[E.KHR_BINARY_GLTF] = new Ir(e);
|
|
3310
|
-
} catch (
|
|
3311
|
-
s && s(
|
|
3319
|
+
} catch (u) {
|
|
3320
|
+
s && s(u);
|
|
3312
3321
|
return;
|
|
3313
3322
|
}
|
|
3314
3323
|
i = JSON.parse(o[E.KHR_BINARY_GLTF].content);
|
|
@@ -3320,7 +3329,7 @@ class tr extends As {
|
|
|
3320
3329
|
s && s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
3321
3330
|
return;
|
|
3322
3331
|
}
|
|
3323
|
-
const A = new
|
|
3332
|
+
const A = new Or(i, {
|
|
3324
3333
|
path: t || this.resourcePath || "",
|
|
3325
3334
|
crossOrigin: this.crossOrigin,
|
|
3326
3335
|
requestHeader: this.requestHeader,
|
|
@@ -3330,27 +3339,27 @@ class tr extends As {
|
|
|
3330
3339
|
});
|
|
3331
3340
|
A.fileLoader.setRequestHeader(this.requestHeader);
|
|
3332
3341
|
for (let d = 0; d < this.pluginCallbacks.length; d++) {
|
|
3333
|
-
const
|
|
3334
|
-
|
|
3342
|
+
const u = this.pluginCallbacks[d](A);
|
|
3343
|
+
u.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[u.name] = u, o[u.name] = !0;
|
|
3335
3344
|
}
|
|
3336
3345
|
if (i.extensionsUsed)
|
|
3337
3346
|
for (let d = 0; d < i.extensionsUsed.length; ++d) {
|
|
3338
|
-
const
|
|
3339
|
-
switch (
|
|
3347
|
+
const u = i.extensionsUsed[d], c = i.extensionsRequired || [];
|
|
3348
|
+
switch (u) {
|
|
3340
3349
|
case E.KHR_MATERIALS_UNLIT:
|
|
3341
|
-
o[
|
|
3350
|
+
o[u] = new ir();
|
|
3342
3351
|
break;
|
|
3343
3352
|
case E.KHR_DRACO_MESH_COMPRESSION:
|
|
3344
|
-
o[
|
|
3353
|
+
o[u] = new yr(i, this.dracoLoader);
|
|
3345
3354
|
break;
|
|
3346
3355
|
case E.KHR_TEXTURE_TRANSFORM:
|
|
3347
|
-
o[
|
|
3356
|
+
o[u] = new xr();
|
|
3348
3357
|
break;
|
|
3349
3358
|
case E.KHR_MESH_QUANTIZATION:
|
|
3350
|
-
o[
|
|
3359
|
+
o[u] = new vr();
|
|
3351
3360
|
break;
|
|
3352
3361
|
default:
|
|
3353
|
-
|
|
3362
|
+
c.indexOf(u) >= 0 && a[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".');
|
|
3354
3363
|
}
|
|
3355
3364
|
}
|
|
3356
3365
|
A.setExtensions(o), A.setPlugins(a), A.parse(n, s);
|
|
@@ -3433,18 +3442,18 @@ class nr {
|
|
|
3433
3442
|
if (s) return s;
|
|
3434
3443
|
const i = t.json, l = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
|
|
3435
3444
|
let A;
|
|
3436
|
-
const d = new
|
|
3437
|
-
l.color !== void 0 && d.setRGB(l.color[0], l.color[1], l.color[2],
|
|
3438
|
-
const
|
|
3445
|
+
const d = new Z(16777215);
|
|
3446
|
+
l.color !== void 0 && d.setRGB(l.color[0], l.color[1], l.color[2], ce);
|
|
3447
|
+
const u = l.range !== void 0 ? l.range : 0;
|
|
3439
3448
|
switch (l.type) {
|
|
3440
3449
|
case "directional":
|
|
3441
3450
|
A = new Yn(d), A.target.position.set(0, 0, -1), A.add(A.target);
|
|
3442
3451
|
break;
|
|
3443
3452
|
case "point":
|
|
3444
|
-
A = new Qn(d), A.distance =
|
|
3453
|
+
A = new Qn(d), A.distance = u;
|
|
3445
3454
|
break;
|
|
3446
3455
|
case "spot":
|
|
3447
|
-
A = new Jn(d), A.distance =
|
|
3456
|
+
A = new Jn(d), A.distance = u, l.spot = l.spot || {}, l.spot.innerConeAngle = l.spot.innerConeAngle !== void 0 ? l.spot.innerConeAngle : 0, l.spot.outerConeAngle = l.spot.outerConeAngle !== void 0 ? l.spot.outerConeAngle : Math.PI / 4, A.angle = l.spot.outerConeAngle, A.penumbra = 1 - l.spot.innerConeAngle / l.spot.outerConeAngle, A.target.position.set(0, 0, -1), A.add(A.target);
|
|
3448
3457
|
break;
|
|
3449
3458
|
default:
|
|
3450
3459
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + l.type);
|
|
@@ -3467,16 +3476,16 @@ class ir {
|
|
|
3467
3476
|
this.name = E.KHR_MATERIALS_UNLIT;
|
|
3468
3477
|
}
|
|
3469
3478
|
getMaterialType() {
|
|
3470
|
-
return
|
|
3479
|
+
return Oe;
|
|
3471
3480
|
}
|
|
3472
3481
|
extendParams(e, t, n) {
|
|
3473
3482
|
const s = [];
|
|
3474
|
-
e.color = new
|
|
3483
|
+
e.color = new Z(1, 1, 1), e.opacity = 1;
|
|
3475
3484
|
const i = t.pbrMetallicRoughness;
|
|
3476
3485
|
if (i) {
|
|
3477
3486
|
if (Array.isArray(i.baseColorFactor)) {
|
|
3478
3487
|
const o = i.baseColorFactor;
|
|
3479
|
-
e.color.setRGB(o[0], o[1], o[2],
|
|
3488
|
+
e.color.setRGB(o[0], o[1], o[2], ce), e.opacity = o[3];
|
|
3480
3489
|
}
|
|
3481
3490
|
i.baseColorTexture !== void 0 && s.push(n.assignTexture(e, "map", i.baseColorTexture, fe));
|
|
3482
3491
|
}
|
|
@@ -3497,7 +3506,7 @@ class rr {
|
|
|
3497
3506
|
this.parser = e, this.name = E.KHR_MATERIALS_CLEARCOAT;
|
|
3498
3507
|
}
|
|
3499
3508
|
getMaterialType(e) {
|
|
3500
|
-
return H(this.parser, e, this.name) !== null ?
|
|
3509
|
+
return H(this.parser, e, this.name) !== null ? ue : null;
|
|
3501
3510
|
}
|
|
3502
3511
|
extendMaterialParams(e, t) {
|
|
3503
3512
|
const n = H(this.parser, e, this.name);
|
|
@@ -3515,7 +3524,7 @@ class ar {
|
|
|
3515
3524
|
this.parser = e, this.name = E.KHR_MATERIALS_DISPERSION;
|
|
3516
3525
|
}
|
|
3517
3526
|
getMaterialType(e) {
|
|
3518
|
-
return H(this.parser, e, this.name) !== null ?
|
|
3527
|
+
return H(this.parser, e, this.name) !== null ? ue : null;
|
|
3519
3528
|
}
|
|
3520
3529
|
extendMaterialParams(e, t) {
|
|
3521
3530
|
const n = H(this.parser, e, this.name);
|
|
@@ -3527,7 +3536,7 @@ class lr {
|
|
|
3527
3536
|
this.parser = e, this.name = E.KHR_MATERIALS_IRIDESCENCE;
|
|
3528
3537
|
}
|
|
3529
3538
|
getMaterialType(e) {
|
|
3530
|
-
return H(this.parser, e, this.name) !== null ?
|
|
3539
|
+
return H(this.parser, e, this.name) !== null ? ue : null;
|
|
3531
3540
|
}
|
|
3532
3541
|
extendMaterialParams(e, t) {
|
|
3533
3542
|
const n = H(this.parser, e, this.name);
|
|
@@ -3541,15 +3550,15 @@ class Ar {
|
|
|
3541
3550
|
this.parser = e, this.name = E.KHR_MATERIALS_SHEEN;
|
|
3542
3551
|
}
|
|
3543
3552
|
getMaterialType(e) {
|
|
3544
|
-
return H(this.parser, e, this.name) !== null ?
|
|
3553
|
+
return H(this.parser, e, this.name) !== null ? ue : null;
|
|
3545
3554
|
}
|
|
3546
3555
|
extendMaterialParams(e, t) {
|
|
3547
3556
|
const n = H(this.parser, e, this.name);
|
|
3548
3557
|
if (n === null) return Promise.resolve();
|
|
3549
3558
|
const s = [];
|
|
3550
|
-
if (t.sheenColor = new
|
|
3559
|
+
if (t.sheenColor = new Z(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, n.sheenColorFactor !== void 0) {
|
|
3551
3560
|
const i = n.sheenColorFactor;
|
|
3552
|
-
t.sheenColor.setRGB(i[0], i[1], i[2],
|
|
3561
|
+
t.sheenColor.setRGB(i[0], i[1], i[2], ce);
|
|
3553
3562
|
}
|
|
3554
3563
|
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture, fe)), n.sheenRoughnessTexture !== void 0 && s.push(this.parser.assignTexture(t, "sheenRoughnessMap", n.sheenRoughnessTexture)), Promise.all(s);
|
|
3555
3564
|
}
|
|
@@ -3559,7 +3568,7 @@ class cr {
|
|
|
3559
3568
|
this.parser = e, this.name = E.KHR_MATERIALS_TRANSMISSION;
|
|
3560
3569
|
}
|
|
3561
3570
|
getMaterialType(e) {
|
|
3562
|
-
return H(this.parser, e, this.name) !== null ?
|
|
3571
|
+
return H(this.parser, e, this.name) !== null ? ue : null;
|
|
3563
3572
|
}
|
|
3564
3573
|
extendMaterialParams(e, t) {
|
|
3565
3574
|
const n = H(this.parser, e, this.name);
|
|
@@ -3573,7 +3582,7 @@ class ur {
|
|
|
3573
3582
|
this.parser = e, this.name = E.KHR_MATERIALS_VOLUME;
|
|
3574
3583
|
}
|
|
3575
3584
|
getMaterialType(e) {
|
|
3576
|
-
return H(this.parser, e, this.name) !== null ?
|
|
3585
|
+
return H(this.parser, e, this.name) !== null ? ue : null;
|
|
3577
3586
|
}
|
|
3578
3587
|
extendMaterialParams(e, t) {
|
|
3579
3588
|
const n = H(this.parser, e, this.name);
|
|
@@ -3581,7 +3590,7 @@ class ur {
|
|
|
3581
3590
|
const s = [];
|
|
3582
3591
|
t.thickness = n.thicknessFactor !== void 0 ? n.thicknessFactor : 0, n.thicknessTexture !== void 0 && s.push(this.parser.assignTexture(t, "thicknessMap", n.thicknessTexture)), t.attenuationDistance = n.attenuationDistance || 1 / 0;
|
|
3583
3592
|
const i = n.attenuationColor || [1, 1, 1];
|
|
3584
|
-
return t.attenuationColor = new
|
|
3593
|
+
return t.attenuationColor = new Z().setRGB(i[0], i[1], i[2], ce), Promise.all(s);
|
|
3585
3594
|
}
|
|
3586
3595
|
}
|
|
3587
3596
|
class dr {
|
|
@@ -3589,7 +3598,7 @@ class dr {
|
|
|
3589
3598
|
this.parser = e, this.name = E.KHR_MATERIALS_IOR;
|
|
3590
3599
|
}
|
|
3591
3600
|
getMaterialType(e) {
|
|
3592
|
-
return H(this.parser, e, this.name) !== null ?
|
|
3601
|
+
return H(this.parser, e, this.name) !== null ? ue : null;
|
|
3593
3602
|
}
|
|
3594
3603
|
extendMaterialParams(e, t) {
|
|
3595
3604
|
const n = H(this.parser, e, this.name);
|
|
@@ -3601,7 +3610,7 @@ class hr {
|
|
|
3601
3610
|
this.parser = e, this.name = E.KHR_MATERIALS_SPECULAR;
|
|
3602
3611
|
}
|
|
3603
3612
|
getMaterialType(e) {
|
|
3604
|
-
return H(this.parser, e, this.name) !== null ?
|
|
3613
|
+
return H(this.parser, e, this.name) !== null ? ue : null;
|
|
3605
3614
|
}
|
|
3606
3615
|
extendMaterialParams(e, t) {
|
|
3607
3616
|
const n = H(this.parser, e, this.name);
|
|
@@ -3609,7 +3618,7 @@ class hr {
|
|
|
3609
3618
|
const s = [];
|
|
3610
3619
|
t.specularIntensity = n.specularFactor !== void 0 ? n.specularFactor : 1, n.specularTexture !== void 0 && s.push(this.parser.assignTexture(t, "specularIntensityMap", n.specularTexture));
|
|
3611
3620
|
const i = n.specularColorFactor || [1, 1, 1];
|
|
3612
|
-
return t.specularColor = new
|
|
3621
|
+
return t.specularColor = new Z().setRGB(i[0], i[1], i[2], ce), n.specularColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "specularColorMap", n.specularColorTexture, fe)), Promise.all(s);
|
|
3613
3622
|
}
|
|
3614
3623
|
}
|
|
3615
3624
|
class fr {
|
|
@@ -3617,7 +3626,7 @@ class fr {
|
|
|
3617
3626
|
this.parser = e, this.name = E.EXT_MATERIALS_BUMP;
|
|
3618
3627
|
}
|
|
3619
3628
|
getMaterialType(e) {
|
|
3620
|
-
return H(this.parser, e, this.name) !== null ?
|
|
3629
|
+
return H(this.parser, e, this.name) !== null ? ue : null;
|
|
3621
3630
|
}
|
|
3622
3631
|
extendMaterialParams(e, t) {
|
|
3623
3632
|
const n = H(this.parser, e, this.name);
|
|
@@ -3631,7 +3640,7 @@ class pr {
|
|
|
3631
3640
|
this.parser = e, this.name = E.KHR_MATERIALS_ANISOTROPY;
|
|
3632
3641
|
}
|
|
3633
3642
|
getMaterialType(e) {
|
|
3634
|
-
return H(this.parser, e, this.name) !== null ?
|
|
3643
|
+
return H(this.parser, e, this.name) !== null ? ue : null;
|
|
3635
3644
|
}
|
|
3636
3645
|
extendMaterialParams(e, t) {
|
|
3637
3646
|
const n = H(this.parser, e, this.name);
|
|
@@ -3705,12 +3714,12 @@ class Gs {
|
|
|
3705
3714
|
return null;
|
|
3706
3715
|
}
|
|
3707
3716
|
return i.then(function(a) {
|
|
3708
|
-
const l = s.byteOffset || 0, A = s.byteLength || 0, d = s.count,
|
|
3709
|
-
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d,
|
|
3717
|
+
const l = s.byteOffset || 0, A = s.byteLength || 0, d = s.count, u = s.byteStride, c = new Uint8Array(a, l, A);
|
|
3718
|
+
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u, c, s.mode, s.filter).then(function(h) {
|
|
3710
3719
|
return h.buffer;
|
|
3711
3720
|
}) : o.ready.then(function() {
|
|
3712
|
-
const h = new ArrayBuffer(d *
|
|
3713
|
-
return o.decodeGltfBuffer(new Uint8Array(h), d,
|
|
3721
|
+
const h = new ArrayBuffer(d * u);
|
|
3722
|
+
return o.decodeGltfBuffer(new Uint8Array(h), d, u, c, s.mode, s.filter), h;
|
|
3714
3723
|
});
|
|
3715
3724
|
});
|
|
3716
3725
|
} else
|
|
@@ -3733,17 +3742,17 @@ class Cr {
|
|
|
3733
3742
|
for (const A in o)
|
|
3734
3743
|
a.push(this.parser.getDependency("accessor", o[A]).then((d) => (l[A] = d, l[A])));
|
|
3735
3744
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((A) => {
|
|
3736
|
-
const d = A.pop(),
|
|
3737
|
-
for (const
|
|
3738
|
-
const
|
|
3739
|
-
for (let
|
|
3740
|
-
l.TRANSLATION && m.fromBufferAttribute(l.TRANSLATION,
|
|
3741
|
-
for (const
|
|
3742
|
-
if (
|
|
3743
|
-
const v = l[
|
|
3744
|
-
|
|
3745
|
-
} else
|
|
3746
|
-
Ze.prototype.copy.call(
|
|
3745
|
+
const d = A.pop(), u = d.isGroup ? d.children : [d], c = A[0].count, h = [];
|
|
3746
|
+
for (const p of u) {
|
|
3747
|
+
const f = new pe(), m = new M(), g = new Q(), x = new M(1, 1, 1), I = new _n(p.geometry, p.material, c);
|
|
3748
|
+
for (let y = 0; y < c; y++)
|
|
3749
|
+
l.TRANSLATION && m.fromBufferAttribute(l.TRANSLATION, y), l.ROTATION && g.fromBufferAttribute(l.ROTATION, y), l.SCALE && x.fromBufferAttribute(l.SCALE, y), I.setMatrixAt(y, f.compose(m, g, x));
|
|
3750
|
+
for (const y in l)
|
|
3751
|
+
if (y === "_COLOR_0") {
|
|
3752
|
+
const v = l[y];
|
|
3753
|
+
I.instanceColor = new $n(v.array, v.itemSize, v.normalized);
|
|
3754
|
+
} else y !== "TRANSLATION" && y !== "ROTATION" && y !== "SCALE" && p.geometry.setAttribute(y, l[y]);
|
|
3755
|
+
Ze.prototype.copy.call(I, p), this.parser.assignFinalMaterial(I), h.push(I);
|
|
3747
3756
|
}
|
|
3748
3757
|
return d.isGroup ? (d.clear(), d.add(...h), d) : h[0];
|
|
3749
3758
|
}));
|
|
@@ -3790,25 +3799,25 @@ class yr {
|
|
|
3790
3799
|
decodePrimitive(e, t) {
|
|
3791
3800
|
const n = this.json, s = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, A = {};
|
|
3792
3801
|
for (const d in o) {
|
|
3793
|
-
const
|
|
3794
|
-
a[
|
|
3802
|
+
const u = rs[d] || d.toLowerCase();
|
|
3803
|
+
a[u] = o[d];
|
|
3795
3804
|
}
|
|
3796
3805
|
for (const d in e.attributes) {
|
|
3797
|
-
const
|
|
3806
|
+
const u = rs[d] || d.toLowerCase();
|
|
3798
3807
|
if (o[d] !== void 0) {
|
|
3799
|
-
const
|
|
3800
|
-
A[
|
|
3808
|
+
const c = n.accessors[e.attributes[d]], h = Be[c.componentType];
|
|
3809
|
+
A[u] = h.name, l[u] = c.normalized === !0;
|
|
3801
3810
|
}
|
|
3802
3811
|
}
|
|
3803
3812
|
return t.getDependency("bufferView", i).then(function(d) {
|
|
3804
|
-
return new Promise(function(
|
|
3813
|
+
return new Promise(function(u, c) {
|
|
3805
3814
|
s.decodeDracoFile(d, function(h) {
|
|
3806
|
-
for (const
|
|
3807
|
-
const
|
|
3808
|
-
m !== void 0 && (
|
|
3815
|
+
for (const p in h.attributes) {
|
|
3816
|
+
const f = h.attributes[p], m = l[p];
|
|
3817
|
+
m !== void 0 && (f.normalized = m);
|
|
3809
3818
|
}
|
|
3810
|
-
|
|
3811
|
-
}, a, A,
|
|
3819
|
+
u(h);
|
|
3820
|
+
}, a, A, ce, c);
|
|
3812
3821
|
});
|
|
3813
3822
|
});
|
|
3814
3823
|
}
|
|
@@ -3837,15 +3846,15 @@ class fn extends mi {
|
|
|
3837
3846
|
return t;
|
|
3838
3847
|
}
|
|
3839
3848
|
interpolate_(e, t, n, s) {
|
|
3840
|
-
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, A = a * 3, d = s - t,
|
|
3841
|
-
for (let
|
|
3842
|
-
const v = o[
|
|
3843
|
-
i[
|
|
3849
|
+
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, A = a * 3, d = s - t, u = (n - t) / d, c = u * u, h = c * u, p = e * A, f = p - A, m = -2 * h + 3 * c, g = h - c, x = 1 - m, I = g - c + u;
|
|
3850
|
+
for (let y = 0; y !== a; y++) {
|
|
3851
|
+
const v = o[f + y + a], S = o[f + y + l] * d, L = o[p + y + a], Y = o[p + y] * d;
|
|
3852
|
+
i[y] = x * v + I * S + m * L + g * Y;
|
|
3844
3853
|
}
|
|
3845
3854
|
return i;
|
|
3846
3855
|
}
|
|
3847
3856
|
}
|
|
3848
|
-
const Sr = new
|
|
3857
|
+
const Sr = new Q();
|
|
3849
3858
|
class Tr extends fn {
|
|
3850
3859
|
interpolate_(e, t, n, s) {
|
|
3851
3860
|
const i = super.interpolate_(e, t, n, s);
|
|
@@ -3934,24 +3943,24 @@ function ae(r, e) {
|
|
|
3934
3943
|
function Rr(r, e, t) {
|
|
3935
3944
|
let n = !1, s = !1, i = !1;
|
|
3936
3945
|
for (let A = 0, d = e.length; A < d; A++) {
|
|
3937
|
-
const
|
|
3938
|
-
if (
|
|
3946
|
+
const u = e[A];
|
|
3947
|
+
if (u.POSITION !== void 0 && (n = !0), u.NORMAL !== void 0 && (s = !0), u.COLOR_0 !== void 0 && (i = !0), n && s && i) break;
|
|
3939
3948
|
}
|
|
3940
3949
|
if (!n && !s && !i) return Promise.resolve(r);
|
|
3941
3950
|
const o = [], a = [], l = [];
|
|
3942
3951
|
for (let A = 0, d = e.length; A < d; A++) {
|
|
3943
|
-
const
|
|
3952
|
+
const u = e[A];
|
|
3944
3953
|
if (n) {
|
|
3945
|
-
const
|
|
3946
|
-
o.push(
|
|
3954
|
+
const c = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) : r.attributes.position;
|
|
3955
|
+
o.push(c);
|
|
3947
3956
|
}
|
|
3948
3957
|
if (s) {
|
|
3949
|
-
const
|
|
3950
|
-
a.push(
|
|
3958
|
+
const c = u.NORMAL !== void 0 ? t.getDependency("accessor", u.NORMAL) : r.attributes.normal;
|
|
3959
|
+
a.push(c);
|
|
3951
3960
|
}
|
|
3952
3961
|
if (i) {
|
|
3953
|
-
const
|
|
3954
|
-
l.push(
|
|
3962
|
+
const c = u.COLOR_0 !== void 0 ? t.getDependency("accessor", u.COLOR_0) : r.attributes.color;
|
|
3963
|
+
l.push(c);
|
|
3955
3964
|
}
|
|
3956
3965
|
}
|
|
3957
3966
|
return Promise.all([
|
|
@@ -3959,8 +3968,8 @@ function Rr(r, e, t) {
|
|
|
3959
3968
|
Promise.all(a),
|
|
3960
3969
|
Promise.all(l)
|
|
3961
3970
|
]).then(function(A) {
|
|
3962
|
-
const d = A[0],
|
|
3963
|
-
return n && (r.morphAttributes.position = d), s && (r.morphAttributes.normal =
|
|
3971
|
+
const d = A[0], u = A[1], c = A[2];
|
|
3972
|
+
return n && (r.morphAttributes.position = d), s && (r.morphAttributes.normal = u), i && (r.morphAttributes.color = c), r.morphTargetsRelative = !0, r;
|
|
3964
3973
|
});
|
|
3965
3974
|
}
|
|
3966
3975
|
function Er(r, e) {
|
|
@@ -4010,7 +4019,7 @@ function Pr(r) {
|
|
|
4010
4019
|
return r.search(/\.jpe?g($|\?)/i) > 0 || r.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : r.search(/\.webp($|\?)/i) > 0 || r.search(/^data\:image\/webp/) === 0 ? "image/webp" : r.search(/\.ktx2($|\?)/i) > 0 || r.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
4011
4020
|
}
|
|
4012
4021
|
const Lr = new pe();
|
|
4013
|
-
class
|
|
4022
|
+
class Or {
|
|
4014
4023
|
constructor(e = {}, t = {}) {
|
|
4015
4024
|
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new sr(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
4016
4025
|
let n = !1, s = -1, i = !1, o = -1;
|
|
@@ -4265,22 +4274,22 @@ class Nr {
|
|
|
4265
4274
|
}
|
|
4266
4275
|
const i = [];
|
|
4267
4276
|
return s.bufferView !== void 0 ? i.push(this.getDependency("bufferView", s.bufferView)) : i.push(null), s.sparse !== void 0 && (i.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(i).then(function(o) {
|
|
4268
|
-
const a = o[0], l = qt[s.type], A = Be[s.componentType], d = A.BYTES_PER_ELEMENT,
|
|
4269
|
-
let
|
|
4270
|
-
if (h && h !==
|
|
4271
|
-
const g = Math.floor(
|
|
4272
|
-
let
|
|
4273
|
-
|
|
4277
|
+
const a = o[0], l = qt[s.type], A = Be[s.componentType], d = A.BYTES_PER_ELEMENT, u = d * l, c = s.byteOffset || 0, h = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, p = s.normalized === !0;
|
|
4278
|
+
let f, m;
|
|
4279
|
+
if (h && h !== u) {
|
|
4280
|
+
const g = Math.floor(c / h), x = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + g + ":" + s.count;
|
|
4281
|
+
let I = t.cache.get(x);
|
|
4282
|
+
I || (f = new A(a, g * h, s.count * h / d), I = new Ys(f, h / d), t.cache.add(x, I)), m = new _s(I, l, c % h / d, p);
|
|
4274
4283
|
} else
|
|
4275
|
-
a === null ?
|
|
4284
|
+
a === null ? f = new A(s.count * l) : f = new A(a, c, s.count * l), m = new at(f, l, p);
|
|
4276
4285
|
if (s.sparse !== void 0) {
|
|
4277
|
-
const g = qt.SCALAR,
|
|
4286
|
+
const g = qt.SCALAR, x = Be[s.sparse.indices.componentType], I = s.sparse.indices.byteOffset || 0, y = s.sparse.values.byteOffset || 0, v = new x(o[1], I, s.sparse.count * g), S = new A(o[2], y, s.sparse.count * l);
|
|
4278
4287
|
a !== null && (m = new at(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
|
|
4279
|
-
for (let L = 0,
|
|
4288
|
+
for (let L = 0, Y = v.length; L < Y; L++) {
|
|
4280
4289
|
const ee = v[L];
|
|
4281
|
-
if (m.setX(ee,
|
|
4290
|
+
if (m.setX(ee, S[L * l]), l >= 2 && m.setY(ee, S[L * l + 1]), l >= 3 && m.setZ(ee, S[L * l + 2]), l >= 4 && m.setW(ee, S[L * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
4282
4291
|
}
|
|
4283
|
-
m.normalized =
|
|
4292
|
+
m.normalized = p;
|
|
4284
4293
|
}
|
|
4285
4294
|
return m;
|
|
4286
4295
|
});
|
|
@@ -4307,8 +4316,8 @@ class Nr {
|
|
|
4307
4316
|
return this.textureCache[l];
|
|
4308
4317
|
const A = this.loadImageSource(t, n).then(function(d) {
|
|
4309
4318
|
d.flipY = !1, d.name = o.name || a.name || "", d.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (d.name = a.uri);
|
|
4310
|
-
const
|
|
4311
|
-
return d.magFilter = Bs[
|
|
4319
|
+
const c = (i.samplers || {})[o.sampler] || {};
|
|
4320
|
+
return d.magFilter = Bs[c.magFilter] || ss, d.minFilter = Bs[c.minFilter] || $s, d.wrapS = Zs[c.wrapS] || ns, d.wrapT = Zs[c.wrapT] || ns, d.generateMipmaps = !d.isCompressedTexture && d.minFilter !== en && d.minFilter !== ss, s.associations.set(d, { textures: e }), d;
|
|
4312
4321
|
}).catch(function() {
|
|
4313
4322
|
return null;
|
|
4314
4323
|
});
|
|
@@ -4317,29 +4326,29 @@ class Nr {
|
|
|
4317
4326
|
loadImageSource(e, t) {
|
|
4318
4327
|
const n = this, s = this.json, i = this.options;
|
|
4319
4328
|
if (this.sourceCache[e] !== void 0)
|
|
4320
|
-
return this.sourceCache[e].then((
|
|
4329
|
+
return this.sourceCache[e].then((u) => u.clone());
|
|
4321
4330
|
const o = s.images[e], a = self.URL || self.webkitURL;
|
|
4322
4331
|
let l = o.uri || "", A = !1;
|
|
4323
4332
|
if (o.bufferView !== void 0)
|
|
4324
|
-
l = n.getDependency("bufferView", o.bufferView).then(function(
|
|
4333
|
+
l = n.getDependency("bufferView", o.bufferView).then(function(u) {
|
|
4325
4334
|
A = !0;
|
|
4326
|
-
const
|
|
4327
|
-
return l = a.createObjectURL(
|
|
4335
|
+
const c = new Blob([u], { type: o.mimeType });
|
|
4336
|
+
return l = a.createObjectURL(c), l;
|
|
4328
4337
|
});
|
|
4329
4338
|
else if (o.uri === void 0)
|
|
4330
4339
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
4331
|
-
const d = Promise.resolve(l).then(function(
|
|
4332
|
-
return new Promise(function(
|
|
4333
|
-
let
|
|
4334
|
-
t.isImageBitmapLoader === !0 && (
|
|
4335
|
-
const m = new bs(
|
|
4336
|
-
m.needsUpdate = !0,
|
|
4337
|
-
}), t.load(rt.resolveURL(
|
|
4340
|
+
const d = Promise.resolve(l).then(function(u) {
|
|
4341
|
+
return new Promise(function(c, h) {
|
|
4342
|
+
let p = c;
|
|
4343
|
+
t.isImageBitmapLoader === !0 && (p = function(f) {
|
|
4344
|
+
const m = new bs(f);
|
|
4345
|
+
m.needsUpdate = !0, c(m);
|
|
4346
|
+
}), t.load(rt.resolveURL(u, i.path), p, void 0, h);
|
|
4338
4347
|
});
|
|
4339
|
-
}).then(function(
|
|
4340
|
-
return A === !0 && a.revokeObjectURL(l), ae(
|
|
4341
|
-
}).catch(function(
|
|
4342
|
-
throw console.error("THREE.GLTFLoader: Couldn't load texture", l),
|
|
4348
|
+
}).then(function(u) {
|
|
4349
|
+
return A === !0 && a.revokeObjectURL(l), ae(u, o), u.userData.mimeType = o.mimeType || Pr(o.uri), u;
|
|
4350
|
+
}).catch(function(u) {
|
|
4351
|
+
throw console.error("THREE.GLTFLoader: Couldn't load texture", l), u;
|
|
4343
4352
|
});
|
|
4344
4353
|
return this.sourceCache[e] = d, d;
|
|
4345
4354
|
}
|
|
@@ -4413,33 +4422,33 @@ class Nr {
|
|
|
4413
4422
|
let o;
|
|
4414
4423
|
const a = {}, l = i.extensions || {}, A = [];
|
|
4415
4424
|
if (l[E.KHR_MATERIALS_UNLIT]) {
|
|
4416
|
-
const
|
|
4417
|
-
o =
|
|
4425
|
+
const u = s[E.KHR_MATERIALS_UNLIT];
|
|
4426
|
+
o = u.getMaterialType(), A.push(u.extendParams(a, i, t));
|
|
4418
4427
|
} else {
|
|
4419
|
-
const
|
|
4420
|
-
if (a.color = new
|
|
4421
|
-
const
|
|
4422
|
-
a.color.setRGB(
|
|
4428
|
+
const u = i.pbrMetallicRoughness || {};
|
|
4429
|
+
if (a.color = new Z(1, 1, 1), a.opacity = 1, Array.isArray(u.baseColorFactor)) {
|
|
4430
|
+
const c = u.baseColorFactor;
|
|
4431
|
+
a.color.setRGB(c[0], c[1], c[2], ce), a.opacity = c[3];
|
|
4423
4432
|
}
|
|
4424
|
-
|
|
4425
|
-
return
|
|
4426
|
-
}), A.push(Promise.all(this._invokeAll(function(
|
|
4427
|
-
return
|
|
4433
|
+
u.baseColorTexture !== void 0 && A.push(t.assignTexture(a, "map", u.baseColorTexture, fe)), a.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, a.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (A.push(t.assignTexture(a, "metalnessMap", u.metallicRoughnessTexture)), A.push(t.assignTexture(a, "roughnessMap", u.metallicRoughnessTexture))), o = this._invokeOne(function(c) {
|
|
4434
|
+
return c.getMaterialType && c.getMaterialType(e);
|
|
4435
|
+
}), A.push(Promise.all(this._invokeAll(function(c) {
|
|
4436
|
+
return c.extendMaterialParams && c.extendMaterialParams(e, a);
|
|
4428
4437
|
})));
|
|
4429
4438
|
}
|
|
4430
4439
|
i.doubleSided === !0 && (a.side = Pt);
|
|
4431
4440
|
const d = i.alphaMode || Vt.OPAQUE;
|
|
4432
|
-
if (d === Vt.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === Vt.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !==
|
|
4433
|
-
const
|
|
4434
|
-
a.normalScale.set(
|
|
4441
|
+
if (d === Vt.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === Vt.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== Oe && (A.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new F(1, 1), i.normalTexture.scale !== void 0)) {
|
|
4442
|
+
const u = i.normalTexture.scale;
|
|
4443
|
+
a.normalScale.set(u, u);
|
|
4435
4444
|
}
|
|
4436
|
-
if (i.occlusionTexture !== void 0 && o !==
|
|
4437
|
-
const
|
|
4438
|
-
a.emissive = new
|
|
4445
|
+
if (i.occlusionTexture !== void 0 && o !== Oe && (A.push(t.assignTexture(a, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && o !== Oe) {
|
|
4446
|
+
const u = i.emissiveFactor;
|
|
4447
|
+
a.emissive = new Z().setRGB(u[0], u[1], u[2], ce);
|
|
4439
4448
|
}
|
|
4440
|
-
return i.emissiveTexture !== void 0 && o !==
|
|
4441
|
-
const
|
|
4442
|
-
return i.name && (
|
|
4449
|
+
return i.emissiveTexture !== void 0 && o !== Oe && A.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, fe)), Promise.all(A).then(function() {
|
|
4450
|
+
const u = new o(a);
|
|
4451
|
+
return i.name && (u.name = i.name), ae(u, i), t.associations.set(u, { materials: e }), i.extensions && we(s, u, i), u;
|
|
4443
4452
|
});
|
|
4444
4453
|
}
|
|
4445
4454
|
/**
|
|
@@ -4471,12 +4480,12 @@ class Nr {
|
|
|
4471
4480
|
}
|
|
4472
4481
|
const o = [];
|
|
4473
4482
|
for (let a = 0, l = e.length; a < l; a++) {
|
|
4474
|
-
const A = e[a], d = kr(A),
|
|
4475
|
-
if (
|
|
4476
|
-
o.push(
|
|
4483
|
+
const A = e[a], d = kr(A), u = s[d];
|
|
4484
|
+
if (u)
|
|
4485
|
+
o.push(u.promise);
|
|
4477
4486
|
else {
|
|
4478
|
-
let
|
|
4479
|
-
A.extensions && A.extensions[E.KHR_DRACO_MESH_COMPRESSION] ?
|
|
4487
|
+
let c;
|
|
4488
|
+
A.extensions && A.extensions[E.KHR_DRACO_MESH_COMPRESSION] ? c = i(A) : c = Xs(new De(), A, t), s[d] = { primitive: A, promise: c }, o.push(c);
|
|
4480
4489
|
}
|
|
4481
4490
|
}
|
|
4482
4491
|
return Promise.all(o);
|
|
@@ -4495,37 +4504,37 @@ class Nr {
|
|
|
4495
4504
|
a.push(d);
|
|
4496
4505
|
}
|
|
4497
4506
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
|
|
4498
|
-
const A = l.slice(0, l.length - 1), d = l[l.length - 1],
|
|
4499
|
-
for (let h = 0,
|
|
4500
|
-
const
|
|
4507
|
+
const A = l.slice(0, l.length - 1), d = l[l.length - 1], u = [];
|
|
4508
|
+
for (let h = 0, p = d.length; h < p; h++) {
|
|
4509
|
+
const f = d[h], m = o[h];
|
|
4501
4510
|
let g;
|
|
4502
|
-
const
|
|
4511
|
+
const x = A[h];
|
|
4503
4512
|
if (m.mode === ne.TRIANGLES || m.mode === ne.TRIANGLE_STRIP || m.mode === ne.TRIANGLE_FAN || m.mode === void 0)
|
|
4504
|
-
g = i.isSkinnedMesh === !0 ? new li(
|
|
4513
|
+
g = i.isSkinnedMesh === !0 ? new li(f, x) : new T(f, x), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), m.mode === ne.TRIANGLE_STRIP ? g.geometry = zs(g.geometry, Qs) : m.mode === ne.TRIANGLE_FAN && (g.geometry = zs(g.geometry, ts));
|
|
4505
4514
|
else if (m.mode === ne.LINES)
|
|
4506
|
-
g = new es(
|
|
4515
|
+
g = new es(f, x);
|
|
4507
4516
|
else if (m.mode === ne.LINE_STRIP)
|
|
4508
|
-
g = new
|
|
4517
|
+
g = new he(f, x);
|
|
4509
4518
|
else if (m.mode === ne.LINE_LOOP)
|
|
4510
|
-
g = new Ai(
|
|
4519
|
+
g = new Ai(f, x);
|
|
4511
4520
|
else if (m.mode === ne.POINTS)
|
|
4512
|
-
g = new Mt(
|
|
4521
|
+
g = new Mt(f, x);
|
|
4513
4522
|
else
|
|
4514
4523
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
|
|
4515
|
-
Object.keys(g.geometry.morphAttributes).length > 0 && Er(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), ae(g, i), m.extensions && we(s, g, m), t.assignFinalMaterial(g),
|
|
4524
|
+
Object.keys(g.geometry.morphAttributes).length > 0 && Er(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), ae(g, i), m.extensions && we(s, g, m), t.assignFinalMaterial(g), u.push(g);
|
|
4516
4525
|
}
|
|
4517
|
-
for (let h = 0,
|
|
4518
|
-
t.associations.set(
|
|
4526
|
+
for (let h = 0, p = u.length; h < p; h++)
|
|
4527
|
+
t.associations.set(u[h], {
|
|
4519
4528
|
meshes: e,
|
|
4520
4529
|
primitives: h
|
|
4521
4530
|
});
|
|
4522
|
-
if (
|
|
4523
|
-
return i.extensions && we(s,
|
|
4524
|
-
const
|
|
4525
|
-
i.extensions && we(s,
|
|
4526
|
-
for (let h = 0,
|
|
4527
|
-
|
|
4528
|
-
return
|
|
4531
|
+
if (u.length === 1)
|
|
4532
|
+
return i.extensions && we(s, u[0], i), u[0];
|
|
4533
|
+
const c = new Tt();
|
|
4534
|
+
i.extensions && we(s, c, i), t.associations.set(c, { meshes: e });
|
|
4535
|
+
for (let h = 0, p = u.length; h < p; h++)
|
|
4536
|
+
c.add(u[h]);
|
|
4537
|
+
return c;
|
|
4529
4538
|
});
|
|
4530
4539
|
}
|
|
4531
4540
|
/**
|
|
@@ -4558,11 +4567,11 @@ class Nr {
|
|
|
4558
4567
|
return t.inverseBindMatrices !== void 0 ? n.push(this.getDependency("accessor", t.inverseBindMatrices)) : n.push(null), Promise.all(n).then(function(s) {
|
|
4559
4568
|
const i = s.pop(), o = s, a = [], l = [];
|
|
4560
4569
|
for (let A = 0, d = o.length; A < d; A++) {
|
|
4561
|
-
const
|
|
4562
|
-
if (
|
|
4563
|
-
a.push(
|
|
4564
|
-
const
|
|
4565
|
-
i !== null &&
|
|
4570
|
+
const u = o[A];
|
|
4571
|
+
if (u) {
|
|
4572
|
+
a.push(u);
|
|
4573
|
+
const c = new pe();
|
|
4574
|
+
i !== null && c.fromArray(i.array, A * 16), l.push(c);
|
|
4566
4575
|
} else
|
|
4567
4576
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[A]);
|
|
4568
4577
|
}
|
|
@@ -4578,9 +4587,9 @@ class Nr {
|
|
|
4578
4587
|
*/
|
|
4579
4588
|
loadAnimation(e) {
|
|
4580
4589
|
const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, o = [], a = [], l = [], A = [], d = [];
|
|
4581
|
-
for (let
|
|
4582
|
-
const h = s.channels[
|
|
4583
|
-
|
|
4590
|
+
for (let u = 0, c = s.channels.length; u < c; u++) {
|
|
4591
|
+
const h = s.channels[u], p = s.samplers[h.sampler], f = h.target, m = f.node, g = s.parameters !== void 0 ? s.parameters[p.input] : p.input, x = s.parameters !== void 0 ? s.parameters[p.output] : p.output;
|
|
4592
|
+
f.node !== void 0 && (o.push(this.getDependency("node", m)), a.push(this.getDependency("accessor", g)), l.push(this.getDependency("accessor", x)), A.push(p), d.push(f));
|
|
4584
4593
|
}
|
|
4585
4594
|
return Promise.all([
|
|
4586
4595
|
Promise.all(o),
|
|
@@ -4588,19 +4597,19 @@ class Nr {
|
|
|
4588
4597
|
Promise.all(l),
|
|
4589
4598
|
Promise.all(A),
|
|
4590
4599
|
Promise.all(d)
|
|
4591
|
-
]).then(function(
|
|
4592
|
-
const
|
|
4593
|
-
for (let
|
|
4594
|
-
const v =
|
|
4600
|
+
]).then(function(u) {
|
|
4601
|
+
const c = u[0], h = u[1], p = u[2], f = u[3], m = u[4], g = [];
|
|
4602
|
+
for (let I = 0, y = c.length; I < y; I++) {
|
|
4603
|
+
const v = c[I], S = h[I], L = p[I], Y = f[I], ee = m[I];
|
|
4595
4604
|
if (v === void 0) continue;
|
|
4596
4605
|
v.updateMatrix && v.updateMatrix();
|
|
4597
|
-
const
|
|
4598
|
-
if (
|
|
4599
|
-
for (let Te = 0; Te <
|
|
4600
|
-
g.push(
|
|
4606
|
+
const _ = n._createAnimationTracks(v, S, L, Y, ee);
|
|
4607
|
+
if (_)
|
|
4608
|
+
for (let Te = 0; Te < _.length; Te++)
|
|
4609
|
+
g.push(_[Te]);
|
|
4601
4610
|
}
|
|
4602
|
-
const
|
|
4603
|
-
return ae(
|
|
4611
|
+
const x = new di(i, void 0, g);
|
|
4612
|
+
return ae(x, s), x;
|
|
4604
4613
|
});
|
|
4605
4614
|
}
|
|
4606
4615
|
createNodeMesh(e) {
|
|
@@ -4631,15 +4640,15 @@ class Nr {
|
|
|
4631
4640
|
Promise.all(o),
|
|
4632
4641
|
l
|
|
4633
4642
|
]).then(function(A) {
|
|
4634
|
-
const d = A[0],
|
|
4635
|
-
|
|
4636
|
-
h.isSkinnedMesh && h.bind(
|
|
4643
|
+
const d = A[0], u = A[1], c = A[2];
|
|
4644
|
+
c !== null && d.traverse(function(h) {
|
|
4645
|
+
h.isSkinnedMesh && h.bind(c, Lr);
|
|
4637
4646
|
});
|
|
4638
|
-
for (let h = 0,
|
|
4639
|
-
d.add(
|
|
4640
|
-
if (d.userData.pivot !== void 0 &&
|
|
4641
|
-
const h = d.userData.pivot,
|
|
4642
|
-
d.pivot = new
|
|
4647
|
+
for (let h = 0, p = u.length; h < p; h++)
|
|
4648
|
+
d.add(u[h]);
|
|
4649
|
+
if (d.userData.pivot !== void 0 && u.length > 0) {
|
|
4650
|
+
const h = d.userData.pivot, p = u[0];
|
|
4651
|
+
d.pivot = new M().fromArray(h), d.position.x -= h[0], d.position.y -= h[1], d.position.z -= h[2], p.position.set(0, 0, 0), delete d.userData.pivot;
|
|
4643
4652
|
}
|
|
4644
4653
|
return d;
|
|
4645
4654
|
});
|
|
@@ -4662,18 +4671,18 @@ class Nr {
|
|
|
4662
4671
|
}), this.nodeCache[e] = Promise.all(a).then(function(A) {
|
|
4663
4672
|
let d;
|
|
4664
4673
|
if (i.isBone === !0 ? d = new hi() : A.length > 1 ? d = new Tt() : A.length === 1 ? d = A[0] : d = new Ze(), d !== A[0])
|
|
4665
|
-
for (let
|
|
4666
|
-
d.add(A[
|
|
4674
|
+
for (let u = 0, c = A.length; u < c; u++)
|
|
4675
|
+
d.add(A[u]);
|
|
4667
4676
|
if (i.name && (d.userData.name = i.name, d.name = o), ae(d, i), i.extensions && we(n, d, i), i.matrix !== void 0) {
|
|
4668
|
-
const
|
|
4669
|
-
|
|
4677
|
+
const u = new pe();
|
|
4678
|
+
u.fromArray(i.matrix), d.applyMatrix4(u);
|
|
4670
4679
|
} else
|
|
4671
4680
|
i.translation !== void 0 && d.position.fromArray(i.translation), i.rotation !== void 0 && d.quaternion.fromArray(i.rotation), i.scale !== void 0 && d.scale.fromArray(i.scale);
|
|
4672
4681
|
if (!s.associations.has(d))
|
|
4673
4682
|
s.associations.set(d, {});
|
|
4674
4683
|
else if (i.mesh !== void 0 && s.meshCache.refs[i.mesh] > 1) {
|
|
4675
|
-
const
|
|
4676
|
-
s.associations.set(d, { ...
|
|
4684
|
+
const u = s.associations.get(d);
|
|
4685
|
+
s.associations.set(d, { ...u });
|
|
4677
4686
|
}
|
|
4678
4687
|
return s.associations.get(d).nodes = e, d;
|
|
4679
4688
|
}), this.nodeCache[e];
|
|
@@ -4692,18 +4701,18 @@ class Nr {
|
|
|
4692
4701
|
for (let l = 0, A = o.length; l < A; l++)
|
|
4693
4702
|
a.push(s.getDependency("node", o[l]));
|
|
4694
4703
|
return Promise.all(a).then(function(l) {
|
|
4695
|
-
for (let d = 0,
|
|
4696
|
-
const
|
|
4697
|
-
|
|
4704
|
+
for (let d = 0, u = l.length; d < u; d++) {
|
|
4705
|
+
const c = l[d];
|
|
4706
|
+
c.parent !== null ? i.add(er(c)) : i.add(c);
|
|
4698
4707
|
}
|
|
4699
4708
|
const A = (d) => {
|
|
4700
|
-
const
|
|
4701
|
-
for (const [
|
|
4702
|
-
(
|
|
4703
|
-
return d.traverse((
|
|
4704
|
-
const h = s.associations.get(
|
|
4705
|
-
h != null &&
|
|
4706
|
-
}),
|
|
4709
|
+
const u = /* @__PURE__ */ new Map();
|
|
4710
|
+
for (const [c, h] of s.associations)
|
|
4711
|
+
(c instanceof ot || c instanceof bs) && u.set(c, h);
|
|
4712
|
+
return d.traverse((c) => {
|
|
4713
|
+
const h = s.associations.get(c);
|
|
4714
|
+
h != null && u.set(c, h);
|
|
4715
|
+
}), u;
|
|
4707
4716
|
};
|
|
4708
4717
|
return s.associations = A(i), i;
|
|
4709
4718
|
});
|
|
@@ -4739,15 +4748,15 @@ class Nr {
|
|
|
4739
4748
|
}
|
|
4740
4749
|
break;
|
|
4741
4750
|
}
|
|
4742
|
-
const
|
|
4743
|
-
for (let h = 0,
|
|
4744
|
-
const
|
|
4751
|
+
const u = s.interpolation !== void 0 ? Mr[s.interpolation] : sn, c = this._getArrayFromAccessor(n);
|
|
4752
|
+
for (let h = 0, p = l.length; h < p; h++) {
|
|
4753
|
+
const f = new d(
|
|
4745
4754
|
l[h] + "." + ge[i.path],
|
|
4746
4755
|
t.array,
|
|
4747
|
-
|
|
4748
|
-
|
|
4756
|
+
c,
|
|
4757
|
+
u
|
|
4749
4758
|
);
|
|
4750
|
-
s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(
|
|
4759
|
+
s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(f), o.push(f);
|
|
4751
4760
|
}
|
|
4752
4761
|
return o;
|
|
4753
4762
|
}
|
|
@@ -4768,14 +4777,14 @@ class Nr {
|
|
|
4768
4777
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
4769
4778
|
}
|
|
4770
4779
|
}
|
|
4771
|
-
function
|
|
4780
|
+
function Nr(r, e, t) {
|
|
4772
4781
|
const n = e.attributes, s = new gi();
|
|
4773
4782
|
if (n.POSITION !== void 0) {
|
|
4774
4783
|
const a = t.json.accessors[n.POSITION], l = a.min, A = a.max;
|
|
4775
4784
|
if (l !== void 0 && A !== void 0) {
|
|
4776
4785
|
if (s.set(
|
|
4777
|
-
new
|
|
4778
|
-
new
|
|
4786
|
+
new M(l[0], l[1], l[2]),
|
|
4787
|
+
new M(A[0], A[1], A[2])
|
|
4779
4788
|
), a.normalized) {
|
|
4780
4789
|
const d = as(Be[a.componentType]);
|
|
4781
4790
|
s.min.multiplyScalar(d), s.max.multiplyScalar(d);
|
|
@@ -4788,15 +4797,15 @@ function Or(r, e, t) {
|
|
|
4788
4797
|
return;
|
|
4789
4798
|
const i = e.targets;
|
|
4790
4799
|
if (i !== void 0) {
|
|
4791
|
-
const a = new
|
|
4800
|
+
const a = new M(), l = new M();
|
|
4792
4801
|
for (let A = 0, d = i.length; A < d; A++) {
|
|
4793
|
-
const
|
|
4794
|
-
if (
|
|
4795
|
-
const
|
|
4796
|
-
if (h !== void 0 &&
|
|
4797
|
-
if (l.setX(Math.max(Math.abs(h[0]), Math.abs(
|
|
4798
|
-
const
|
|
4799
|
-
l.multiplyScalar(
|
|
4802
|
+
const u = i[A];
|
|
4803
|
+
if (u.POSITION !== void 0) {
|
|
4804
|
+
const c = t.json.accessors[u.POSITION], h = c.min, p = c.max;
|
|
4805
|
+
if (h !== void 0 && p !== void 0) {
|
|
4806
|
+
if (l.setX(Math.max(Math.abs(h[0]), Math.abs(p[0]))), l.setY(Math.max(Math.abs(h[1]), Math.abs(p[1]))), l.setZ(Math.max(Math.abs(h[2]), Math.abs(p[2]))), c.normalized) {
|
|
4807
|
+
const f = as(Be[c.componentType]);
|
|
4808
|
+
l.multiplyScalar(f);
|
|
4800
4809
|
}
|
|
4801
4810
|
a.max(l);
|
|
4802
4811
|
} else
|
|
@@ -4826,7 +4835,7 @@ function Xs(r, e, t) {
|
|
|
4826
4835
|
});
|
|
4827
4836
|
s.push(o);
|
|
4828
4837
|
}
|
|
4829
|
-
return Lt.workingColorSpace !==
|
|
4838
|
+
return Lt.workingColorSpace !== ce && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Lt.workingColorSpace}" not supported.`), ae(r, e), Nr(r, e, t), Promise.all(s).then(function() {
|
|
4830
4839
|
return e.targets !== void 0 ? Rr(r, e.targets, t) : r;
|
|
4831
4840
|
});
|
|
4832
4841
|
}
|
|
@@ -4905,7 +4914,7 @@ class Dr extends As {
|
|
|
4905
4914
|
this.decodeDracoFile(e, t, null, null, fe, n).catch(n);
|
|
4906
4915
|
}
|
|
4907
4916
|
//
|
|
4908
|
-
decodeDracoFile(e, t, n, s, i =
|
|
4917
|
+
decodeDracoFile(e, t, n, s, i = ce, o = () => {
|
|
4909
4918
|
}) {
|
|
4910
4919
|
const a = {
|
|
4911
4920
|
attributeIDs: n || this.defaultAttributeIDs,
|
|
@@ -4955,7 +4964,7 @@ class Dr extends As {
|
|
|
4955
4964
|
}
|
|
4956
4965
|
_assignVertexColorSpace(e, t) {
|
|
4957
4966
|
if (t !== fe) return;
|
|
4958
|
-
const n = new
|
|
4967
|
+
const n = new Z();
|
|
4959
4968
|
for (let s = 0, i = e.count; s < i; s++)
|
|
4960
4969
|
n.fromBufferAttribute(e, s), Lt.colorSpaceToWorking(n, fe), e.setXYZ(s, n.r, n.g, n.b);
|
|
4961
4970
|
}
|
|
@@ -5029,81 +5038,81 @@ function Wr() {
|
|
|
5029
5038
|
switch (a.type) {
|
|
5030
5039
|
case "init":
|
|
5031
5040
|
r = a.decoderConfig, e = new Promise(function(d) {
|
|
5032
|
-
r.onModuleLoaded = function(
|
|
5033
|
-
d({ draco:
|
|
5041
|
+
r.onModuleLoaded = function(u) {
|
|
5042
|
+
d({ draco: u });
|
|
5034
5043
|
}, DracoDecoderModule(r);
|
|
5035
5044
|
});
|
|
5036
5045
|
break;
|
|
5037
5046
|
case "decode":
|
|
5038
5047
|
const l = a.buffer, A = a.taskConfig;
|
|
5039
5048
|
e.then((d) => {
|
|
5040
|
-
const
|
|
5049
|
+
const u = d.draco, c = new u.Decoder();
|
|
5041
5050
|
try {
|
|
5042
|
-
const h = t(
|
|
5043
|
-
h.index &&
|
|
5051
|
+
const h = t(u, c, new Int8Array(l), A), p = h.attributes.map((f) => f.array.buffer);
|
|
5052
|
+
h.index && p.push(h.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: h }, p);
|
|
5044
5053
|
} catch (h) {
|
|
5045
5054
|
console.error(h), self.postMessage({ type: "error", id: a.id, error: h.message });
|
|
5046
5055
|
} finally {
|
|
5047
|
-
|
|
5056
|
+
u.destroy(c);
|
|
5048
5057
|
}
|
|
5049
5058
|
});
|
|
5050
5059
|
break;
|
|
5051
5060
|
}
|
|
5052
5061
|
};
|
|
5053
5062
|
function t(o, a, l, A) {
|
|
5054
|
-
const d = A.attributeIDs,
|
|
5055
|
-
let
|
|
5056
|
-
const
|
|
5057
|
-
if (
|
|
5058
|
-
|
|
5059
|
-
else if (
|
|
5060
|
-
|
|
5063
|
+
const d = A.attributeIDs, u = A.attributeTypes;
|
|
5064
|
+
let c, h;
|
|
5065
|
+
const p = a.GetEncodedGeometryType(l);
|
|
5066
|
+
if (p === o.TRIANGULAR_MESH)
|
|
5067
|
+
c = new o.Mesh(), h = a.DecodeArrayToMesh(l, l.byteLength, c);
|
|
5068
|
+
else if (p === o.POINT_CLOUD)
|
|
5069
|
+
c = new o.PointCloud(), h = a.DecodeArrayToPointCloud(l, l.byteLength, c);
|
|
5061
5070
|
else
|
|
5062
5071
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
5063
|
-
if (!h.ok() ||
|
|
5072
|
+
if (!h.ok() || c.ptr === 0)
|
|
5064
5073
|
throw new Error("THREE.DRACOLoader: Decoding failed: " + h.error_msg());
|
|
5065
|
-
const
|
|
5074
|
+
const f = { index: null, attributes: [] };
|
|
5066
5075
|
for (const m in d) {
|
|
5067
|
-
const g = self[
|
|
5068
|
-
let
|
|
5076
|
+
const g = self[u[m]];
|
|
5077
|
+
let x, I;
|
|
5069
5078
|
if (A.useUniqueIDs)
|
|
5070
|
-
|
|
5079
|
+
I = d[m], x = a.GetAttributeByUniqueId(c, I);
|
|
5071
5080
|
else {
|
|
5072
|
-
if (
|
|
5073
|
-
|
|
5081
|
+
if (I = a.GetAttributeId(c, o[d[m]]), I === -1) continue;
|
|
5082
|
+
x = a.GetAttribute(c, I);
|
|
5074
5083
|
}
|
|
5075
|
-
const
|
|
5076
|
-
m === "color" && (
|
|
5084
|
+
const y = s(o, a, c, m, g, x);
|
|
5085
|
+
m === "color" && (y.vertexColorSpace = A.vertexColorSpace), f.attributes.push(y);
|
|
5077
5086
|
}
|
|
5078
|
-
return
|
|
5087
|
+
return p === o.TRIANGULAR_MESH && (f.index = n(o, a, c)), o.destroy(c), f;
|
|
5079
5088
|
}
|
|
5080
5089
|
function n(o, a, l) {
|
|
5081
|
-
const d = l.num_faces() * 3,
|
|
5082
|
-
a.GetTrianglesUInt32Array(l,
|
|
5083
|
-
const h = new Uint32Array(o.HEAPF32.buffer,
|
|
5084
|
-
return o._free(
|
|
5085
|
-
}
|
|
5086
|
-
function s(o, a, l, A, d,
|
|
5087
|
-
const
|
|
5088
|
-
a.GetAttributeDataArrayForAllPoints(l,
|
|
5089
|
-
const v = new d(o.HEAPF32.buffer,
|
|
5090
|
-
let
|
|
5091
|
-
if (
|
|
5092
|
-
|
|
5090
|
+
const d = l.num_faces() * 3, u = d * 4, c = o._malloc(u);
|
|
5091
|
+
a.GetTrianglesUInt32Array(l, u, c);
|
|
5092
|
+
const h = new Uint32Array(o.HEAPF32.buffer, c, d).slice();
|
|
5093
|
+
return o._free(c), { array: h, itemSize: 1 };
|
|
5094
|
+
}
|
|
5095
|
+
function s(o, a, l, A, d, u) {
|
|
5096
|
+
const c = l.num_points(), h = u.num_components(), p = i(o, d), f = h * d.BYTES_PER_ELEMENT, m = Math.ceil(f / 4) * 4, g = m / d.BYTES_PER_ELEMENT, x = c * f, I = c * m, y = o._malloc(x);
|
|
5097
|
+
a.GetAttributeDataArrayForAllPoints(l, u, p, x, y);
|
|
5098
|
+
const v = new d(o.HEAPF32.buffer, y, x / d.BYTES_PER_ELEMENT);
|
|
5099
|
+
let S;
|
|
5100
|
+
if (f === m)
|
|
5101
|
+
S = v.slice();
|
|
5093
5102
|
else {
|
|
5094
|
-
|
|
5103
|
+
S = new d(I / d.BYTES_PER_ELEMENT);
|
|
5095
5104
|
let L = 0;
|
|
5096
|
-
for (let
|
|
5097
|
-
for (let
|
|
5098
|
-
|
|
5105
|
+
for (let Y = 0, ee = v.length; Y < ee; Y++) {
|
|
5106
|
+
for (let _ = 0; _ < h; _++)
|
|
5107
|
+
S[L + _] = v[Y * h + _];
|
|
5099
5108
|
L += g;
|
|
5100
5109
|
}
|
|
5101
5110
|
}
|
|
5102
|
-
return o._free(
|
|
5111
|
+
return o._free(y), {
|
|
5103
5112
|
name: A,
|
|
5104
|
-
count:
|
|
5113
|
+
count: c,
|
|
5105
5114
|
itemSize: h,
|
|
5106
|
-
array:
|
|
5115
|
+
array: S,
|
|
5107
5116
|
stride: g
|
|
5108
5117
|
};
|
|
5109
5118
|
}
|
|
@@ -5155,9 +5164,9 @@ function zr(r) {
|
|
|
5155
5164
|
repeatY: l = 4,
|
|
5156
5165
|
speedX: A = 5e-4,
|
|
5157
5166
|
speedY: d = 5e-4
|
|
5158
|
-
} = r || {},
|
|
5167
|
+
} = r || {}, u = new w.PlaneGeometry(e, t), h = new w.TextureLoader().load(jr, (m) => {
|
|
5159
5168
|
m.wrapS = m.wrapT = w.RepeatWrapping, m.repeat.set(a, l), m.generateMipmaps = !1, m.minFilter = w.LinearFilter, m.magFilter = w.LinearFilter;
|
|
5160
|
-
}),
|
|
5169
|
+
}), p = new w.MeshStandardMaterial({
|
|
5161
5170
|
color: n,
|
|
5162
5171
|
roughness: s,
|
|
5163
5172
|
metalness: i,
|
|
@@ -5167,8 +5176,8 @@ function zr(r) {
|
|
|
5167
5176
|
// 双面渲染,避免从侧面或底部看到黑色
|
|
5168
5177
|
transparent: !0,
|
|
5169
5178
|
opacity: 0.6
|
|
5170
|
-
}),
|
|
5171
|
-
|
|
5179
|
+
}), f = new w.Mesh(u, p);
|
|
5180
|
+
f.rotation.x = -Math.PI / 2, f.position.y = 0, f.name = "水面(标准材质)", f.userData.isWater = !0, f.userData.isMovable = !0, f.userData.waterSpeed = { x: A, y: d }, Xe(f);
|
|
5172
5181
|
}
|
|
5173
5182
|
function Gr(r) {
|
|
5174
5183
|
const e = Ko();
|
|
@@ -5209,9 +5218,9 @@ function Kr(r) {
|
|
|
5209
5218
|
s,
|
|
5210
5219
|
(a) => {
|
|
5211
5220
|
const l = n === "gltf" || n === "glb" ? a.scene : a;
|
|
5212
|
-
l.traverse((
|
|
5213
|
-
var
|
|
5214
|
-
|
|
5221
|
+
l.traverse((u) => {
|
|
5222
|
+
var c;
|
|
5223
|
+
u.userData.isMovable = !0, u.name || (u.name = u.type), u.type === "Mesh" && (u.frustumCulled = !0, (c = u.geometry) == null || c.computeVertexNormals(), u.castShadow = !0, u.receiveShadow = !0);
|
|
5215
5224
|
});
|
|
5216
5225
|
const d = new w.Box3().setFromObject(l).getCenter(new w.Vector3());
|
|
5217
5226
|
l.position.sub(d), Xe(l, !0), Zt(!1), e(l);
|
|
@@ -5257,12 +5266,12 @@ const Zr = {
|
|
|
5257
5266
|
},
|
|
5258
5267
|
emits: ["select", "delete"],
|
|
5259
5268
|
setup(r, { emit: e }) {
|
|
5260
|
-
const t = r, n = e, s =
|
|
5261
|
-
(
|
|
5269
|
+
const t = r, n = e, s = N(null), { expandedSet: i, toggleExpand: o } = Cn("treeExpand"), a = $e(() => i.value.has(t.node.uuid)), l = $e(() => (t.version, t.node.children.some((f) => f.userData.isMovable === !0))), A = $e(() => (t.version, t.node.children.filter(
|
|
5270
|
+
(f) => f.userData.isMovable === !0
|
|
5262
5271
|
))), d = $e(
|
|
5263
5272
|
() => {
|
|
5264
|
-
var
|
|
5265
|
-
return ((
|
|
5273
|
+
var f;
|
|
5274
|
+
return ((f = t.selectedObject) == null ? void 0 : f.uuid) === t.node.uuid;
|
|
5266
5275
|
}
|
|
5267
5276
|
);
|
|
5268
5277
|
In(
|
|
@@ -5276,44 +5285,44 @@ const Zr = {
|
|
|
5276
5285
|
},
|
|
5277
5286
|
{ flush: "post" }
|
|
5278
5287
|
);
|
|
5279
|
-
const
|
|
5280
|
-
|
|
5281
|
-
},
|
|
5282
|
-
|
|
5283
|
-
}, h = (
|
|
5284
|
-
return (
|
|
5288
|
+
const u = (f) => {
|
|
5289
|
+
f.stopPropagation(), n("select", t.node);
|
|
5290
|
+
}, c = (f) => {
|
|
5291
|
+
f.stopPropagation(), n("delete", t.node);
|
|
5292
|
+
}, h = (f) => f.type === "Mesh" || f.type === "Sprite" ? "🟦" : f.type === "Light" ? "💡" : "📦", p = (f) => f.name || `${f.type} (${f.id})`;
|
|
5293
|
+
return (f, m) => {
|
|
5285
5294
|
const g = yn("TreeItem", !0);
|
|
5286
5295
|
return R(), P("div", {
|
|
5287
5296
|
class: "tree-node",
|
|
5288
5297
|
ref_key: "nodeRef",
|
|
5289
5298
|
ref: s
|
|
5290
5299
|
}, [
|
|
5291
|
-
|
|
5300
|
+
b("div", {
|
|
5292
5301
|
class: oe(["tree-item", { selected: d.value }]),
|
|
5293
|
-
onClick:
|
|
5302
|
+
onClick: u
|
|
5294
5303
|
}, [
|
|
5295
5304
|
l.value ? (R(), P("span", {
|
|
5296
5305
|
key: 0,
|
|
5297
5306
|
class: "toggle-icon",
|
|
5298
|
-
onClick: m[0] || (m[0] = Yt((
|
|
5299
|
-
},
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5307
|
+
onClick: m[0] || (m[0] = Yt((x) => xn(o)(f.node.uuid), ["stop"]))
|
|
5308
|
+
}, B(a.value ? "▼" : "▶"), 1)) : (R(), P("span", Zr)),
|
|
5309
|
+
b("span", Xr, B(h(f.node)), 1),
|
|
5310
|
+
b("span", qr, B(p(f.node)), 1),
|
|
5311
|
+
b("button", {
|
|
5303
5312
|
class: "tree-delete",
|
|
5304
|
-
onClick: Yt(
|
|
5313
|
+
onClick: Yt(c, ["stop"])
|
|
5305
5314
|
}, "×")
|
|
5306
5315
|
], 2),
|
|
5307
5316
|
a.value && l.value ? (R(), P("div", Vr, [
|
|
5308
|
-
(R(!0), P(Pe, null, jt(A.value, (
|
|
5309
|
-
key:
|
|
5310
|
-
node:
|
|
5311
|
-
"selected-object":
|
|
5312
|
-
version:
|
|
5313
|
-
onSelect: m[1] || (m[1] = (
|
|
5314
|
-
onDelete: m[2] || (m[2] = (
|
|
5317
|
+
(R(!0), P(Pe, null, jt(A.value, (x) => (R(), nt(g, {
|
|
5318
|
+
key: x.uuid,
|
|
5319
|
+
node: x,
|
|
5320
|
+
"selected-object": f.selectedObject,
|
|
5321
|
+
version: f.version,
|
|
5322
|
+
onSelect: m[1] || (m[1] = (I) => n("select", I)),
|
|
5323
|
+
onDelete: m[2] || (m[2] = (I) => n("delete", I))
|
|
5315
5324
|
}, null, 8, ["node", "selected-object", "version"]))), 128))
|
|
5316
|
-
])) :
|
|
5325
|
+
])) : X("", !0)
|
|
5317
5326
|
], 512);
|
|
5318
5327
|
};
|
|
5319
5328
|
}
|
|
@@ -5343,23 +5352,23 @@ const Zr = {
|
|
|
5343
5352
|
metalness: 0,
|
|
5344
5353
|
roughness: 0.5,
|
|
5345
5354
|
opacity: 1
|
|
5346
|
-
}), o =
|
|
5355
|
+
}), o = N(!1), a = _t({
|
|
5347
5356
|
intensity: 1
|
|
5348
5357
|
});
|
|
5349
5358
|
function l() {
|
|
5350
5359
|
t.selectedObject && t.selectedObject.type === "DirectionalLight" && (t.selectedObject.intensity = a.intensity);
|
|
5351
5360
|
}
|
|
5352
|
-
function A(
|
|
5361
|
+
function A(c) {
|
|
5353
5362
|
let h = null;
|
|
5354
|
-
return
|
|
5355
|
-
if (
|
|
5356
|
-
const
|
|
5363
|
+
return c.traverse((p) => {
|
|
5364
|
+
if (p.type === "Mesh" && !h) {
|
|
5365
|
+
const f = p, m = Array.isArray(f.material) ? f.material : [f.material];
|
|
5357
5366
|
for (const g of m)
|
|
5358
5367
|
if (g && (g.type === "MeshStandardMaterial" || g.type === "MeshPhongMaterial")) {
|
|
5359
|
-
const
|
|
5368
|
+
const x = g;
|
|
5360
5369
|
h = {
|
|
5361
|
-
metalness:
|
|
5362
|
-
roughness:
|
|
5370
|
+
metalness: x.metalness ?? 0,
|
|
5371
|
+
roughness: x.roughness ?? 0.5,
|
|
5363
5372
|
opacity: g.opacity ?? 1
|
|
5364
5373
|
};
|
|
5365
5374
|
break;
|
|
@@ -5367,276 +5376,276 @@ const Zr = {
|
|
|
5367
5376
|
}
|
|
5368
5377
|
}), h;
|
|
5369
5378
|
}
|
|
5370
|
-
function d(
|
|
5371
|
-
let
|
|
5372
|
-
return
|
|
5373
|
-
if (
|
|
5374
|
-
const m =
|
|
5375
|
-
for (const
|
|
5376
|
-
|
|
5379
|
+
function d(c, h) {
|
|
5380
|
+
let p = !1;
|
|
5381
|
+
return c.traverse((f) => {
|
|
5382
|
+
if (f.type === "Mesh") {
|
|
5383
|
+
const m = f, g = Array.isArray(m.material) ? m.material : [m.material];
|
|
5384
|
+
for (const x of g)
|
|
5385
|
+
x && (x.type === "MeshStandardMaterial" || x.type === "MeshPhongMaterial") && (h.metalness !== void 0 && (x.metalness = h.metalness), h.roughness !== void 0 && (x.roughness = h.roughness), h.opacity !== void 0 && (x.opacity = h.opacity, x.transparent = h.opacity < 1), x.needsUpdate = !0, p = !0);
|
|
5377
5386
|
}
|
|
5378
|
-
}),
|
|
5387
|
+
}), p;
|
|
5379
5388
|
}
|
|
5380
|
-
function
|
|
5389
|
+
function u() {
|
|
5381
5390
|
if (t.selectedObject) {
|
|
5382
|
-
const
|
|
5391
|
+
const c = d(t.selectedObject, {
|
|
5383
5392
|
metalness: i.metalness,
|
|
5384
5393
|
roughness: i.roughness,
|
|
5385
5394
|
opacity: i.opacity
|
|
5386
5395
|
});
|
|
5387
|
-
o.value =
|
|
5396
|
+
o.value = c;
|
|
5388
5397
|
}
|
|
5389
5398
|
}
|
|
5390
|
-
return
|
|
5399
|
+
return le(
|
|
5391
5400
|
() => t.selectedObject,
|
|
5392
|
-
(
|
|
5393
|
-
if (
|
|
5394
|
-
const h = A(
|
|
5395
|
-
h ? (i.metalness = h.metalness, i.roughness = h.roughness, i.opacity = h.opacity, o.value = !0) : (i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = !1),
|
|
5401
|
+
(c) => {
|
|
5402
|
+
if (c) {
|
|
5403
|
+
const h = A(c);
|
|
5404
|
+
h ? (i.metalness = h.metalness, i.roughness = h.roughness, i.opacity = h.opacity, o.value = !0) : (i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = !1), c.type === "DirectionalLight" && (a.intensity = c.intensity ?? 1);
|
|
5396
5405
|
} else
|
|
5397
5406
|
i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = !1;
|
|
5398
5407
|
},
|
|
5399
5408
|
{ immediate: !0 }
|
|
5400
|
-
), (
|
|
5401
|
-
|
|
5402
|
-
h[17] || (h[17] =
|
|
5403
|
-
|
|
5404
|
-
h[14] || (h[14] =
|
|
5405
|
-
k(
|
|
5409
|
+
), (c, h) => (R(), P("div", null, [
|
|
5410
|
+
b("div", Yr, [
|
|
5411
|
+
h[17] || (h[17] = b("label", null, "位置", -1)),
|
|
5412
|
+
b("div", _r, [
|
|
5413
|
+
h[14] || (h[14] = b("span", null, "X:", -1)),
|
|
5414
|
+
k(b("input", {
|
|
5406
5415
|
type: "number",
|
|
5407
|
-
"onUpdate:modelValue": h[0] || (h[0] = (
|
|
5416
|
+
"onUpdate:modelValue": h[0] || (h[0] = (p) => c.transform.position.x = p),
|
|
5408
5417
|
step: "0.01",
|
|
5409
5418
|
onInput: s
|
|
5410
5419
|
}, null, 544), [
|
|
5411
5420
|
[
|
|
5412
|
-
|
|
5413
|
-
|
|
5421
|
+
O,
|
|
5422
|
+
c.transform.position.x,
|
|
5414
5423
|
void 0,
|
|
5415
5424
|
{ number: !0 }
|
|
5416
5425
|
]
|
|
5417
5426
|
]),
|
|
5418
|
-
h[15] || (h[15] =
|
|
5419
|
-
k(
|
|
5427
|
+
h[15] || (h[15] = b("span", null, "Y:", -1)),
|
|
5428
|
+
k(b("input", {
|
|
5420
5429
|
type: "number",
|
|
5421
|
-
"onUpdate:modelValue": h[1] || (h[1] = (
|
|
5430
|
+
"onUpdate:modelValue": h[1] || (h[1] = (p) => c.transform.position.y = p),
|
|
5422
5431
|
step: "0.01",
|
|
5423
5432
|
onInput: s
|
|
5424
5433
|
}, null, 544), [
|
|
5425
5434
|
[
|
|
5426
|
-
|
|
5427
|
-
|
|
5435
|
+
O,
|
|
5436
|
+
c.transform.position.y,
|
|
5428
5437
|
void 0,
|
|
5429
5438
|
{ number: !0 }
|
|
5430
5439
|
]
|
|
5431
5440
|
]),
|
|
5432
|
-
h[16] || (h[16] =
|
|
5433
|
-
k(
|
|
5441
|
+
h[16] || (h[16] = b("span", null, "Z:", -1)),
|
|
5442
|
+
k(b("input", {
|
|
5434
5443
|
type: "number",
|
|
5435
|
-
"onUpdate:modelValue": h[2] || (h[2] = (
|
|
5444
|
+
"onUpdate:modelValue": h[2] || (h[2] = (p) => c.transform.position.z = p),
|
|
5436
5445
|
step: "0.01",
|
|
5437
5446
|
onInput: s
|
|
5438
5447
|
}, null, 544), [
|
|
5439
5448
|
[
|
|
5440
|
-
|
|
5441
|
-
|
|
5449
|
+
O,
|
|
5450
|
+
c.transform.position.z,
|
|
5442
5451
|
void 0,
|
|
5443
5452
|
{ number: !0 }
|
|
5444
5453
|
]
|
|
5445
5454
|
])
|
|
5446
5455
|
])
|
|
5447
5456
|
]),
|
|
5448
|
-
|
|
5449
|
-
h[21] || (h[21] =
|
|
5450
|
-
|
|
5451
|
-
h[18] || (h[18] =
|
|
5452
|
-
k(
|
|
5457
|
+
b("div", $r, [
|
|
5458
|
+
h[21] || (h[21] = b("label", null, "旋转 (弧度)", -1)),
|
|
5459
|
+
b("div", ea, [
|
|
5460
|
+
h[18] || (h[18] = b("span", null, "X:", -1)),
|
|
5461
|
+
k(b("input", {
|
|
5453
5462
|
type: "number",
|
|
5454
|
-
"onUpdate:modelValue": h[3] || (h[3] = (
|
|
5463
|
+
"onUpdate:modelValue": h[3] || (h[3] = (p) => c.transform.rotation.x = p),
|
|
5455
5464
|
step: "0.01",
|
|
5456
5465
|
onInput: s
|
|
5457
5466
|
}, null, 544), [
|
|
5458
5467
|
[
|
|
5459
|
-
|
|
5460
|
-
|
|
5468
|
+
O,
|
|
5469
|
+
c.transform.rotation.x,
|
|
5461
5470
|
void 0,
|
|
5462
5471
|
{ number: !0 }
|
|
5463
5472
|
]
|
|
5464
5473
|
]),
|
|
5465
|
-
h[19] || (h[19] =
|
|
5466
|
-
k(
|
|
5474
|
+
h[19] || (h[19] = b("span", null, "Y:", -1)),
|
|
5475
|
+
k(b("input", {
|
|
5467
5476
|
type: "number",
|
|
5468
|
-
"onUpdate:modelValue": h[4] || (h[4] = (
|
|
5477
|
+
"onUpdate:modelValue": h[4] || (h[4] = (p) => c.transform.rotation.y = p),
|
|
5469
5478
|
step: "0.01",
|
|
5470
5479
|
onInput: s
|
|
5471
5480
|
}, null, 544), [
|
|
5472
5481
|
[
|
|
5473
|
-
|
|
5474
|
-
|
|
5482
|
+
O,
|
|
5483
|
+
c.transform.rotation.y,
|
|
5475
5484
|
void 0,
|
|
5476
5485
|
{ number: !0 }
|
|
5477
5486
|
]
|
|
5478
5487
|
]),
|
|
5479
|
-
h[20] || (h[20] =
|
|
5480
|
-
k(
|
|
5488
|
+
h[20] || (h[20] = b("span", null, "Z:", -1)),
|
|
5489
|
+
k(b("input", {
|
|
5481
5490
|
type: "number",
|
|
5482
|
-
"onUpdate:modelValue": h[5] || (h[5] = (
|
|
5491
|
+
"onUpdate:modelValue": h[5] || (h[5] = (p) => c.transform.rotation.z = p),
|
|
5483
5492
|
step: "0.01",
|
|
5484
5493
|
onInput: s
|
|
5485
5494
|
}, null, 544), [
|
|
5486
5495
|
[
|
|
5487
|
-
|
|
5488
|
-
|
|
5496
|
+
O,
|
|
5497
|
+
c.transform.rotation.z,
|
|
5489
5498
|
void 0,
|
|
5490
5499
|
{ number: !0 }
|
|
5491
5500
|
]
|
|
5492
5501
|
])
|
|
5493
5502
|
])
|
|
5494
5503
|
]),
|
|
5495
|
-
|
|
5496
|
-
h[25] || (h[25] =
|
|
5497
|
-
|
|
5498
|
-
h[22] || (h[22] =
|
|
5499
|
-
k(
|
|
5504
|
+
b("div", ta, [
|
|
5505
|
+
h[25] || (h[25] = b("label", null, "缩放", -1)),
|
|
5506
|
+
b("div", sa, [
|
|
5507
|
+
h[22] || (h[22] = b("span", null, "X:", -1)),
|
|
5508
|
+
k(b("input", {
|
|
5500
5509
|
type: "number",
|
|
5501
|
-
"onUpdate:modelValue": h[6] || (h[6] = (
|
|
5510
|
+
"onUpdate:modelValue": h[6] || (h[6] = (p) => c.transform.scale.x = p),
|
|
5502
5511
|
step: "0.01",
|
|
5503
5512
|
onInput: s
|
|
5504
5513
|
}, null, 544), [
|
|
5505
5514
|
[
|
|
5506
|
-
|
|
5507
|
-
|
|
5515
|
+
O,
|
|
5516
|
+
c.transform.scale.x,
|
|
5508
5517
|
void 0,
|
|
5509
5518
|
{ number: !0 }
|
|
5510
5519
|
]
|
|
5511
5520
|
]),
|
|
5512
|
-
h[23] || (h[23] =
|
|
5513
|
-
k(
|
|
5521
|
+
h[23] || (h[23] = b("span", null, "Y:", -1)),
|
|
5522
|
+
k(b("input", {
|
|
5514
5523
|
type: "number",
|
|
5515
|
-
"onUpdate:modelValue": h[7] || (h[7] = (
|
|
5524
|
+
"onUpdate:modelValue": h[7] || (h[7] = (p) => c.transform.scale.y = p),
|
|
5516
5525
|
step: "0.01",
|
|
5517
5526
|
onInput: s
|
|
5518
5527
|
}, null, 544), [
|
|
5519
5528
|
[
|
|
5520
|
-
|
|
5521
|
-
|
|
5529
|
+
O,
|
|
5530
|
+
c.transform.scale.y,
|
|
5522
5531
|
void 0,
|
|
5523
5532
|
{ number: !0 }
|
|
5524
5533
|
]
|
|
5525
5534
|
]),
|
|
5526
|
-
h[24] || (h[24] =
|
|
5527
|
-
k(
|
|
5535
|
+
h[24] || (h[24] = b("span", null, "Z:", -1)),
|
|
5536
|
+
k(b("input", {
|
|
5528
5537
|
type: "number",
|
|
5529
|
-
"onUpdate:modelValue": h[8] || (h[8] = (
|
|
5538
|
+
"onUpdate:modelValue": h[8] || (h[8] = (p) => c.transform.scale.z = p),
|
|
5530
5539
|
step: "0.01",
|
|
5531
5540
|
onInput: s
|
|
5532
5541
|
}, null, 544), [
|
|
5533
5542
|
[
|
|
5534
|
-
|
|
5535
|
-
|
|
5543
|
+
O,
|
|
5544
|
+
c.transform.scale.z,
|
|
5536
5545
|
void 0,
|
|
5537
5546
|
{ number: !0 }
|
|
5538
5547
|
]
|
|
5539
5548
|
])
|
|
5540
5549
|
])
|
|
5541
5550
|
]),
|
|
5542
|
-
|
|
5543
|
-
h[27] || (h[27] =
|
|
5544
|
-
|
|
5545
|
-
h[26] || (h[26] =
|
|
5546
|
-
k(
|
|
5551
|
+
c.selectedObject && c.selectedObject.type === "DirectionalLight" ? (R(), P("div", na, [
|
|
5552
|
+
h[27] || (h[27] = b("label", null, "光源属性", -1)),
|
|
5553
|
+
b("div", ia, [
|
|
5554
|
+
h[26] || (h[26] = b("span", { class: "slider-label" }, "强度", -1)),
|
|
5555
|
+
k(b("input", {
|
|
5547
5556
|
type: "range",
|
|
5548
5557
|
min: "0",
|
|
5549
5558
|
max: "10",
|
|
5550
5559
|
step: "0.1",
|
|
5551
|
-
"onUpdate:modelValue": h[9] || (h[9] = (
|
|
5560
|
+
"onUpdate:modelValue": h[9] || (h[9] = (p) => a.intensity = p),
|
|
5552
5561
|
onInput: l
|
|
5553
5562
|
}, null, 544), [
|
|
5554
5563
|
[
|
|
5555
|
-
|
|
5564
|
+
O,
|
|
5556
5565
|
a.intensity,
|
|
5557
5566
|
void 0,
|
|
5558
5567
|
{ number: !0 }
|
|
5559
5568
|
]
|
|
5560
5569
|
]),
|
|
5561
|
-
k(
|
|
5570
|
+
k(b("input", {
|
|
5562
5571
|
type: "number",
|
|
5563
5572
|
min: "0",
|
|
5564
5573
|
max: "100",
|
|
5565
5574
|
step: "0.1",
|
|
5566
|
-
"onUpdate:modelValue": h[10] || (h[10] = (
|
|
5575
|
+
"onUpdate:modelValue": h[10] || (h[10] = (p) => a.intensity = p),
|
|
5567
5576
|
class: "intensity-input",
|
|
5568
5577
|
onInput: l
|
|
5569
5578
|
}, null, 544), [
|
|
5570
5579
|
[
|
|
5571
|
-
|
|
5580
|
+
O,
|
|
5572
5581
|
a.intensity,
|
|
5573
5582
|
void 0,
|
|
5574
5583
|
{ number: !0 }
|
|
5575
5584
|
]
|
|
5576
5585
|
])
|
|
5577
5586
|
])
|
|
5578
|
-
])) :
|
|
5579
|
-
|
|
5580
|
-
h[31] || (h[31] =
|
|
5581
|
-
|
|
5582
|
-
h[28] || (h[28] =
|
|
5583
|
-
k(
|
|
5587
|
+
])) : X("", !0),
|
|
5588
|
+
c.selectedObject ? (R(), P("div", oa, [
|
|
5589
|
+
h[31] || (h[31] = b("label", null, "材质", -1)),
|
|
5590
|
+
b("div", ra, [
|
|
5591
|
+
h[28] || (h[28] = b("span", { class: "slider-label" }, "金属度", -1)),
|
|
5592
|
+
k(b("input", {
|
|
5584
5593
|
type: "range",
|
|
5585
5594
|
min: "0",
|
|
5586
5595
|
max: "1",
|
|
5587
5596
|
step: "0.01",
|
|
5588
|
-
"onUpdate:modelValue": h[11] || (h[11] = (
|
|
5589
|
-
onInput:
|
|
5597
|
+
"onUpdate:modelValue": h[11] || (h[11] = (p) => i.metalness = p),
|
|
5598
|
+
onInput: u
|
|
5590
5599
|
}, null, 544), [
|
|
5591
5600
|
[
|
|
5592
|
-
|
|
5601
|
+
O,
|
|
5593
5602
|
i.metalness,
|
|
5594
5603
|
void 0,
|
|
5595
5604
|
{ number: !0 }
|
|
5596
5605
|
]
|
|
5597
5606
|
]),
|
|
5598
|
-
|
|
5607
|
+
b("span", aa, B(i.metalness.toFixed(2)), 1)
|
|
5599
5608
|
]),
|
|
5600
|
-
|
|
5601
|
-
h[29] || (h[29] =
|
|
5602
|
-
k(
|
|
5609
|
+
b("div", la, [
|
|
5610
|
+
h[29] || (h[29] = b("span", { class: "slider-label" }, "粗糙度", -1)),
|
|
5611
|
+
k(b("input", {
|
|
5603
5612
|
type: "range",
|
|
5604
5613
|
min: "0",
|
|
5605
5614
|
max: "1",
|
|
5606
5615
|
step: "0.01",
|
|
5607
|
-
"onUpdate:modelValue": h[12] || (h[12] = (
|
|
5608
|
-
onInput:
|
|
5616
|
+
"onUpdate:modelValue": h[12] || (h[12] = (p) => i.roughness = p),
|
|
5617
|
+
onInput: u
|
|
5609
5618
|
}, null, 544), [
|
|
5610
5619
|
[
|
|
5611
|
-
|
|
5620
|
+
O,
|
|
5612
5621
|
i.roughness,
|
|
5613
5622
|
void 0,
|
|
5614
5623
|
{ number: !0 }
|
|
5615
5624
|
]
|
|
5616
5625
|
]),
|
|
5617
|
-
|
|
5626
|
+
b("span", Aa, B(i.roughness.toFixed(2)), 1)
|
|
5618
5627
|
]),
|
|
5619
|
-
|
|
5620
|
-
h[30] || (h[30] =
|
|
5621
|
-
k(
|
|
5628
|
+
b("div", ca, [
|
|
5629
|
+
h[30] || (h[30] = b("span", { class: "slider-label" }, "透明度", -1)),
|
|
5630
|
+
k(b("input", {
|
|
5622
5631
|
type: "range",
|
|
5623
5632
|
min: "0",
|
|
5624
5633
|
max: "1",
|
|
5625
5634
|
step: "0.01",
|
|
5626
|
-
"onUpdate:modelValue": h[13] || (h[13] = (
|
|
5627
|
-
onInput:
|
|
5635
|
+
"onUpdate:modelValue": h[13] || (h[13] = (p) => i.opacity = p),
|
|
5636
|
+
onInput: u
|
|
5628
5637
|
}, null, 544), [
|
|
5629
5638
|
[
|
|
5630
|
-
|
|
5639
|
+
O,
|
|
5631
5640
|
i.opacity,
|
|
5632
5641
|
void 0,
|
|
5633
5642
|
{ number: !0 }
|
|
5634
5643
|
]
|
|
5635
5644
|
]),
|
|
5636
|
-
|
|
5645
|
+
b("span", ua, B(i.opacity.toFixed(2)), 1)
|
|
5637
5646
|
]),
|
|
5638
|
-
o.value ?
|
|
5639
|
-
])) :
|
|
5647
|
+
o.value ? X("", !0) : (R(), P("div", da, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
|
|
5648
|
+
])) : X("", !0)
|
|
5640
5649
|
]));
|
|
5641
5650
|
}
|
|
5642
5651
|
}), fa = /* @__PURE__ */ Se(ha, [["__scopeId", "data-v-4cecf018"]]), pa = { class: "userdata-tab" }, ma = { class: "property-group userdata-group" }, ga = { class: "userdata-add-row" }, ba = ["onKeyup"], Ca = {
|
|
@@ -5658,176 +5667,176 @@ const Zr = {
|
|
|
5658
5667
|
selectedObject: {}
|
|
5659
5668
|
},
|
|
5660
5669
|
setup(r) {
|
|
5661
|
-
const e = r, t =
|
|
5662
|
-
function l(
|
|
5663
|
-
if (
|
|
5664
|
-
if (
|
|
5665
|
-
if (Array.isArray(
|
|
5666
|
-
const
|
|
5667
|
-
return
|
|
5670
|
+
const e = r, t = N(""), n = N(""), s = N(null), i = N(""), o = N(null), a = N([]);
|
|
5671
|
+
function l(I) {
|
|
5672
|
+
if (I === null) return "null";
|
|
5673
|
+
if (I === void 0) return "undefined";
|
|
5674
|
+
if (Array.isArray(I)) return "array";
|
|
5675
|
+
const y = typeof I;
|
|
5676
|
+
return y === "object" ? "object" : y === "number" ? "number" : y === "boolean" ? "boolean" : "string";
|
|
5668
5677
|
}
|
|
5669
|
-
function A(
|
|
5670
|
-
const
|
|
5671
|
-
if (
|
|
5672
|
-
for (const [v,
|
|
5673
|
-
typeof v == "string" && !v.startsWith("_") &&
|
|
5678
|
+
function A(I) {
|
|
5679
|
+
const y = [];
|
|
5680
|
+
if (I.userData)
|
|
5681
|
+
for (const [v, S] of Object.entries(I.userData))
|
|
5682
|
+
typeof v == "string" && !v.startsWith("_") && y.push({
|
|
5674
5683
|
key: v,
|
|
5675
|
-
value: typeof
|
|
5676
|
-
rawType: l(
|
|
5684
|
+
value: typeof S == "object" ? JSON.stringify(S) : String(S),
|
|
5685
|
+
rawType: l(S)
|
|
5677
5686
|
});
|
|
5678
|
-
a.value =
|
|
5687
|
+
a.value = y;
|
|
5679
5688
|
}
|
|
5680
|
-
function d(
|
|
5681
|
-
const
|
|
5682
|
-
if (
|
|
5683
|
-
if (
|
|
5684
|
-
if (
|
|
5685
|
-
if (
|
|
5686
|
-
const v = Number(
|
|
5687
|
-
if (
|
|
5688
|
-
return String(v) !==
|
|
5689
|
-
if (
|
|
5689
|
+
function d(I) {
|
|
5690
|
+
const y = I.trim();
|
|
5691
|
+
if (y === "true") return !0;
|
|
5692
|
+
if (y === "false") return !1;
|
|
5693
|
+
if (y === "null") return null;
|
|
5694
|
+
if (y === "undefined") return;
|
|
5695
|
+
const v = Number(y);
|
|
5696
|
+
if (y !== "" && !isNaN(v))
|
|
5697
|
+
return String(v) !== y ? y : v;
|
|
5698
|
+
if (y.startsWith("{") && y.endsWith("}") || y.startsWith("[") && y.endsWith("]"))
|
|
5690
5699
|
try {
|
|
5691
|
-
return JSON.parse(
|
|
5700
|
+
return JSON.parse(y);
|
|
5692
5701
|
} catch {
|
|
5693
5702
|
}
|
|
5694
|
-
return
|
|
5703
|
+
return y;
|
|
5695
5704
|
}
|
|
5696
|
-
function
|
|
5705
|
+
function u() {
|
|
5697
5706
|
if (!e.selectedObject || !t.value.trim()) return;
|
|
5698
|
-
const
|
|
5699
|
-
if (
|
|
5707
|
+
const I = t.value.trim();
|
|
5708
|
+
if (I === "isMovable") {
|
|
5700
5709
|
t.value = "";
|
|
5701
5710
|
return;
|
|
5702
5711
|
}
|
|
5703
|
-
const
|
|
5704
|
-
e.selectedObject.userData[
|
|
5712
|
+
const y = d(n.value);
|
|
5713
|
+
e.selectedObject.userData[I] = y, A(e.selectedObject), t.value = "", n.value = "";
|
|
5705
5714
|
}
|
|
5706
|
-
function
|
|
5707
|
-
e.selectedObject && (delete e.selectedObject.userData[
|
|
5715
|
+
function c(I, y) {
|
|
5716
|
+
e.selectedObject && (delete e.selectedObject.userData[I], A(e.selectedObject));
|
|
5708
5717
|
}
|
|
5709
|
-
function h(
|
|
5710
|
-
return
|
|
5718
|
+
function h(I) {
|
|
5719
|
+
return I.length <= 28 ? I : I.substring(0, 28) + "…";
|
|
5711
5720
|
}
|
|
5712
|
-
function
|
|
5713
|
-
s.value =
|
|
5714
|
-
const
|
|
5715
|
-
if (!
|
|
5716
|
-
const v =
|
|
5721
|
+
function p(I) {
|
|
5722
|
+
s.value = I;
|
|
5723
|
+
const y = e.selectedObject;
|
|
5724
|
+
if (!y) return;
|
|
5725
|
+
const v = y.userData[I];
|
|
5717
5726
|
try {
|
|
5718
5727
|
i.value = JSON.stringify(v, null, 2);
|
|
5719
5728
|
} catch {
|
|
5720
5729
|
i.value = String(v);
|
|
5721
5730
|
}
|
|
5722
|
-
|
|
5731
|
+
f();
|
|
5723
5732
|
}
|
|
5724
|
-
function
|
|
5725
|
-
const
|
|
5726
|
-
if (!
|
|
5733
|
+
function f() {
|
|
5734
|
+
const I = i.value.trim();
|
|
5735
|
+
if (!I) {
|
|
5727
5736
|
o.value = null;
|
|
5728
5737
|
return;
|
|
5729
5738
|
}
|
|
5730
|
-
if (!
|
|
5739
|
+
if (!I.startsWith("{") && !I.startsWith("[")) {
|
|
5731
5740
|
o.value = "提示:当前输入不是 JSON 格式,将作为普通字符串保存";
|
|
5732
5741
|
return;
|
|
5733
5742
|
}
|
|
5734
5743
|
try {
|
|
5735
|
-
JSON.parse(
|
|
5736
|
-
} catch (
|
|
5737
|
-
o.value = "JSON 格式错误:" +
|
|
5744
|
+
JSON.parse(I), o.value = null;
|
|
5745
|
+
} catch (y) {
|
|
5746
|
+
o.value = "JSON 格式错误:" + y.message;
|
|
5738
5747
|
}
|
|
5739
5748
|
}
|
|
5740
|
-
function m(
|
|
5741
|
-
const
|
|
5742
|
-
if (!
|
|
5749
|
+
function m(I) {
|
|
5750
|
+
const y = e.selectedObject;
|
|
5751
|
+
if (!y) return;
|
|
5743
5752
|
const v = i.value.trim();
|
|
5744
5753
|
try {
|
|
5745
|
-
const
|
|
5746
|
-
|
|
5754
|
+
const S = JSON.parse(v);
|
|
5755
|
+
y.userData[I] = S, A(y), s.value = null, i.value = "";
|
|
5747
5756
|
} catch {
|
|
5748
|
-
|
|
5757
|
+
y.userData[I] = v, A(y), s.value = null, i.value = "";
|
|
5749
5758
|
}
|
|
5750
5759
|
}
|
|
5751
5760
|
function g() {
|
|
5752
5761
|
s.value = null, i.value = "";
|
|
5753
5762
|
}
|
|
5754
|
-
function
|
|
5755
|
-
const
|
|
5756
|
-
if (!
|
|
5757
|
-
const
|
|
5758
|
-
|
|
5759
|
-
x:
|
|
5760
|
-
y:
|
|
5761
|
-
z:
|
|
5762
|
-
}, A(
|
|
5763
|
+
function x() {
|
|
5764
|
+
const I = e.selectedObject;
|
|
5765
|
+
if (!I) return;
|
|
5766
|
+
const y = Bo();
|
|
5767
|
+
y && (I.userData.closeUpView = {
|
|
5768
|
+
x: y.position.x,
|
|
5769
|
+
y: y.position.y,
|
|
5770
|
+
z: y.position.z
|
|
5771
|
+
}, A(I));
|
|
5763
5772
|
}
|
|
5764
|
-
return
|
|
5773
|
+
return le(
|
|
5765
5774
|
() => e.selectedObject,
|
|
5766
|
-
(
|
|
5767
|
-
|
|
5775
|
+
(I) => {
|
|
5776
|
+
I ? A(I) : a.value = [], s.value = null, i.value = "";
|
|
5768
5777
|
},
|
|
5769
5778
|
{ immediate: !0 }
|
|
5770
|
-
), (
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
k(
|
|
5779
|
+
), (I, y) => (R(), P("div", pa, [
|
|
5780
|
+
b("div", ma, [
|
|
5781
|
+
y[3] || (y[3] = b("label", null, "userData 属性", -1)),
|
|
5782
|
+
b("div", ga, [
|
|
5783
|
+
k(b("input", {
|
|
5775
5784
|
type: "text",
|
|
5776
|
-
"onUpdate:modelValue":
|
|
5785
|
+
"onUpdate:modelValue": y[0] || (y[0] = (v) => t.value = v),
|
|
5777
5786
|
placeholder: "属性名",
|
|
5778
5787
|
class: "ud-input",
|
|
5779
|
-
onKeyup: ze(
|
|
5788
|
+
onKeyup: ze(u, ["enter"])
|
|
5780
5789
|
}, null, 544), [
|
|
5781
|
-
[
|
|
5790
|
+
[O, t.value]
|
|
5782
5791
|
]),
|
|
5783
|
-
k(
|
|
5784
|
-
"onUpdate:modelValue":
|
|
5792
|
+
k(b("textarea", {
|
|
5793
|
+
"onUpdate:modelValue": y[1] || (y[1] = (v) => n.value = v),
|
|
5785
5794
|
placeholder: "值",
|
|
5786
5795
|
class: "ud-input ud-textarea",
|
|
5787
|
-
onKeyup: ze(Yt(
|
|
5796
|
+
onKeyup: ze(Yt(u, ["prevent"]), ["enter"])
|
|
5788
5797
|
}, null, 40, ba), [
|
|
5789
|
-
[
|
|
5798
|
+
[O, n.value]
|
|
5790
5799
|
]),
|
|
5791
|
-
|
|
5800
|
+
b("button", {
|
|
5792
5801
|
class: "ud-btn add-btn",
|
|
5793
5802
|
title: "添加",
|
|
5794
|
-
onClick:
|
|
5803
|
+
onClick: u
|
|
5795
5804
|
}, " + ")
|
|
5796
5805
|
]),
|
|
5797
5806
|
a.value.length > 0 ? (R(), P("div", Ca, [
|
|
5798
|
-
(R(!0), P(Pe, null, jt(a.value, (v,
|
|
5807
|
+
(R(!0), P(Pe, null, jt(a.value, (v, S) => (R(), P("div", {
|
|
5799
5808
|
key: v.key,
|
|
5800
5809
|
class: oe(["userdata-item", {
|
|
5801
5810
|
readonly: v.key === "isMovable",
|
|
5802
5811
|
"editing-json": s.value === v.key
|
|
5803
5812
|
}])
|
|
5804
5813
|
}, [
|
|
5805
|
-
|
|
5806
|
-
v.key === "isMovable" ? (R(), P("span", ya,
|
|
5814
|
+
b("span", Ia, B(v.key), 1),
|
|
5815
|
+
v.key === "isMovable" ? (R(), P("span", ya, B(String(v.value)) + " 🔒 ", 1)) : v.key !== "isMovable" ? (R(), P(Pe, { key: 1 }, [
|
|
5807
5816
|
s.value !== v.key ? (R(), P(Pe, { key: 0 }, [
|
|
5808
|
-
|
|
5809
|
-
|
|
5817
|
+
b("span", xa, B(h(v.value)), 1),
|
|
5818
|
+
b("button", {
|
|
5810
5819
|
class: "ud-btn edit-json-btn",
|
|
5811
5820
|
title: "编辑对象",
|
|
5812
|
-
onClick: (L) =>
|
|
5821
|
+
onClick: (L) => p(v.key)
|
|
5813
5822
|
}, " ✎ ", 8, va)
|
|
5814
5823
|
], 64)) : (R(), P(Pe, { key: 1 }, [
|
|
5815
|
-
o.value ? (R(), P("div", Sa, " ⚠ " +
|
|
5816
|
-
k(
|
|
5817
|
-
"onUpdate:modelValue":
|
|
5824
|
+
o.value ? (R(), P("div", Sa, " ⚠ " + B(o.value), 1)) : X("", !0),
|
|
5825
|
+
k(b("textarea", {
|
|
5826
|
+
"onUpdate:modelValue": y[2] || (y[2] = (L) => i.value = L),
|
|
5818
5827
|
class: oe(["ud-json-textarea", { "has-error": o.value }]),
|
|
5819
5828
|
rows: "3",
|
|
5820
|
-
onInput:
|
|
5829
|
+
onInput: f
|
|
5821
5830
|
}, null, 34), [
|
|
5822
|
-
[
|
|
5831
|
+
[O, i.value]
|
|
5823
5832
|
]),
|
|
5824
|
-
|
|
5825
|
-
|
|
5833
|
+
b("div", Ta, [
|
|
5834
|
+
b("button", {
|
|
5826
5835
|
class: "ud-btn apply-btn",
|
|
5827
5836
|
title: "应用修改",
|
|
5828
5837
|
onClick: (L) => m(v.key)
|
|
5829
5838
|
}, " ✓ ", 8, Ma),
|
|
5830
|
-
|
|
5839
|
+
b("button", {
|
|
5831
5840
|
class: "ud-btn cancel-btn",
|
|
5832
5841
|
title: "取消编辑",
|
|
5833
5842
|
onClick: g
|
|
@@ -5838,224 +5847,249 @@ const Zr = {
|
|
|
5838
5847
|
key: 2,
|
|
5839
5848
|
class: "ud-btn del-btn",
|
|
5840
5849
|
title: "删除",
|
|
5841
|
-
onClick: (L) =>
|
|
5842
|
-
}, " ✕ ", 8, wa)) :
|
|
5843
|
-
], 64)) :
|
|
5850
|
+
onClick: (L) => c(v.key)
|
|
5851
|
+
}, " ✕ ", 8, wa)) : X("", !0)
|
|
5852
|
+
], 64)) : X("", !0)
|
|
5844
5853
|
], 2))), 128))
|
|
5845
5854
|
])) : (R(), P("div", Ra, "暂无自定义数据")),
|
|
5846
|
-
|
|
5855
|
+
b("button", {
|
|
5847
5856
|
class: "get-camera-btn",
|
|
5848
|
-
onClick:
|
|
5857
|
+
onClick: x
|
|
5849
5858
|
}, " 添加当前相机位置 ")
|
|
5850
5859
|
])
|
|
5851
5860
|
]));
|
|
5852
5861
|
}
|
|
5853
|
-
}), ka = /* @__PURE__ */ Se(Ea, [["__scopeId", "data-v-4e117415"]]), Pa = { class: "datapanel-tab" }, La = { class: "property-group" },
|
|
5862
|
+
}), ka = /* @__PURE__ */ Se(Ea, [["__scopeId", "data-v-4e117415"]]), Pa = { class: "datapanel-tab" }, La = { class: "property-group" }, Oa = { class: "dp-section" }, Na = { class: "dp-visibility-row" }, Da = { class: "dp-toggle" }, Wa = { class: "dp-visibility-text" }, ja = { class: "dp-section" }, Fa = { class: "dp-section" }, Ua = { class: "dp-size-row" }, Ha = { class: "dp-size-value" }, za = { class: "dp-section" }, Ga = { class: "dp-size-row" }, Ka = { class: "dp-size-value" }, Ba = { class: "dp-section" }, Za = { class: "dp-size-row" }, Xa = { class: "dp-size-value" }, qa = { class: "dp-section" }, Va = { class: "dp-list" }, Ja = ["onUpdate:modelValue"], Qa = ["onUpdate:modelValue"], Ya = ["onUpdate:modelValue"], _a = ["onUpdate:modelValue"], $a = ["onClick"], el = { class: "dp-add-row" }, tl = /* @__PURE__ */ ve({
|
|
5854
5863
|
__name: "DataPanelTab",
|
|
5855
5864
|
props: {
|
|
5856
5865
|
selectedObject: {}
|
|
5857
5866
|
},
|
|
5858
5867
|
setup(r) {
|
|
5859
|
-
const e = r, t =
|
|
5860
|
-
let c =
|
|
5861
|
-
function
|
|
5862
|
-
const
|
|
5863
|
-
return
|
|
5868
|
+
const e = r, t = N(""), n = N([]), s = N(!0), i = N(0.1), o = N(0), a = N(220), l = N(""), A = N(""), d = N(""), u = N("");
|
|
5869
|
+
let c = p(), h = !1;
|
|
5870
|
+
function p() {
|
|
5871
|
+
const x = e.selectedObject;
|
|
5872
|
+
return x ? Ft(Wt(x)) : null;
|
|
5864
5873
|
}
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
}),
|
|
5868
|
-
|
|
5869
|
-
}),
|
|
5870
|
-
|
|
5874
|
+
le(s, (x) => {
|
|
5875
|
+
h || !c || (c.visible = x);
|
|
5876
|
+
}), le(a, (x) => {
|
|
5877
|
+
h || !c || c.setWidth(`${x}px`);
|
|
5878
|
+
}), le(o, (x) => {
|
|
5879
|
+
h || !c || c.setOffsetX(x);
|
|
5880
|
+
}), le(i, (x) => {
|
|
5881
|
+
h || !c || c.setOffsetY(x);
|
|
5871
5882
|
});
|
|
5872
5883
|
function f() {
|
|
5873
|
-
|
|
5884
|
+
h || !c || (c.setTitle(t.value), c.setItems([...n.value]));
|
|
5874
5885
|
}
|
|
5875
|
-
|
|
5876
|
-
function
|
|
5877
|
-
n.value = n.value.filter((I, y) => y !==
|
|
5886
|
+
le(t, () => f()), le(n, () => f(), { deep: !0 });
|
|
5887
|
+
function m(x) {
|
|
5888
|
+
n.value = n.value.filter((I, y) => y !== x), f();
|
|
5878
5889
|
}
|
|
5879
|
-
function
|
|
5880
|
-
!
|
|
5890
|
+
function g() {
|
|
5891
|
+
!l.value.trim() || !A.value.trim() || (n.value = [
|
|
5881
5892
|
...n.value,
|
|
5882
5893
|
{
|
|
5883
|
-
label:
|
|
5884
|
-
value:
|
|
5885
|
-
unit:
|
|
5886
|
-
code:
|
|
5894
|
+
label: l.value.trim(),
|
|
5895
|
+
value: A.value.trim(),
|
|
5896
|
+
unit: d.value.trim() || void 0,
|
|
5897
|
+
code: u.value.trim() || void 0
|
|
5887
5898
|
}
|
|
5888
|
-
], f(),
|
|
5899
|
+
], f(), l.value = "", A.value = "", d.value = "", u.value = "");
|
|
5889
5900
|
}
|
|
5890
|
-
return
|
|
5901
|
+
return le(
|
|
5891
5902
|
() => e.selectedObject,
|
|
5892
5903
|
() => {
|
|
5893
|
-
|
|
5894
|
-
|
|
5904
|
+
h = !0, c = p(), c ? (t.value = c.getTitle(), n.value = c.getItems(), s.value = c.visible, i.value = c.getOffsetY(), o.value = c.getOffsetX(), a.value = parseInt(c.getWidth()) || 220) : (t.value = "", n.value = [], s.value = !0, i.value = 0.1, o.value = 0, a.value = 220), l.value = "", A.value = "", d.value = "", u.value = "", setTimeout(() => {
|
|
5905
|
+
h = !1;
|
|
5895
5906
|
}, 0);
|
|
5896
5907
|
},
|
|
5897
5908
|
{ immediate: !0 }
|
|
5898
|
-
), (
|
|
5899
|
-
|
|
5900
|
-
I[
|
|
5901
|
-
|
|
5902
|
-
I[
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
k(
|
|
5909
|
+
), (x, I) => (R(), P("div", Pa, [
|
|
5910
|
+
b("div", La, [
|
|
5911
|
+
I[22] || (I[22] = b("label", null, "📊 数据面板", -1)),
|
|
5912
|
+
b("div", Oa, [
|
|
5913
|
+
I[10] || (I[10] = b("span", { class: "dp-label-sm" }, "可见性", -1)),
|
|
5914
|
+
b("div", Na, [
|
|
5915
|
+
b("label", Da, [
|
|
5916
|
+
k(b("input", {
|
|
5906
5917
|
type: "checkbox",
|
|
5907
5918
|
"onUpdate:modelValue": I[0] || (I[0] = (y) => s.value = y)
|
|
5908
5919
|
}, null, 512), [
|
|
5909
5920
|
[vn, s.value]
|
|
5910
5921
|
]),
|
|
5911
|
-
I[
|
|
5922
|
+
I[9] || (I[9] = b("span", { class: "dp-toggle-slider" }, null, -1))
|
|
5912
5923
|
]),
|
|
5913
|
-
|
|
5924
|
+
b("span", Wa, B(s.value ? "显示中" : "已隐藏"), 1)
|
|
5914
5925
|
])
|
|
5915
5926
|
]),
|
|
5916
|
-
|
|
5917
|
-
I[
|
|
5918
|
-
k(
|
|
5927
|
+
b("div", ja, [
|
|
5928
|
+
I[11] || (I[11] = b("span", { class: "dp-label-sm" }, "标题", -1)),
|
|
5929
|
+
k(b("input", {
|
|
5919
5930
|
type: "text",
|
|
5920
5931
|
class: "dp-input",
|
|
5921
5932
|
"onUpdate:modelValue": I[1] || (I[1] = (y) => t.value = y),
|
|
5922
5933
|
placeholder: "面板标题"
|
|
5923
5934
|
}, null, 512), [
|
|
5924
|
-
[
|
|
5935
|
+
[O, t.value]
|
|
5925
5936
|
])
|
|
5926
5937
|
]),
|
|
5927
|
-
|
|
5928
|
-
I[
|
|
5929
|
-
|
|
5930
|
-
I[
|
|
5931
|
-
k(
|
|
5938
|
+
b("div", Fa, [
|
|
5939
|
+
I[14] || (I[14] = b("span", { class: "dp-label-sm" }, "面板宽度", -1)),
|
|
5940
|
+
b("div", Ua, [
|
|
5941
|
+
I[12] || (I[12] = b("span", { class: "dp-range-label" }, "窄", -1)),
|
|
5942
|
+
k(b("input", {
|
|
5932
5943
|
type: "range",
|
|
5933
5944
|
class: "dp-range",
|
|
5934
5945
|
min: "120",
|
|
5935
5946
|
max: "600",
|
|
5936
5947
|
step: "10",
|
|
5937
|
-
"onUpdate:modelValue": I[2] || (I[2] = (y) =>
|
|
5948
|
+
"onUpdate:modelValue": I[2] || (I[2] = (y) => a.value = y)
|
|
5949
|
+
}, null, 512), [
|
|
5950
|
+
[
|
|
5951
|
+
O,
|
|
5952
|
+
a.value,
|
|
5953
|
+
void 0,
|
|
5954
|
+
{ number: !0 }
|
|
5955
|
+
]
|
|
5956
|
+
]),
|
|
5957
|
+
I[13] || (I[13] = b("span", { class: "dp-range-label" }, "宽", -1)),
|
|
5958
|
+
b("span", Ha, B(a.value), 1)
|
|
5959
|
+
])
|
|
5960
|
+
]),
|
|
5961
|
+
b("div", za, [
|
|
5962
|
+
I[17] || (I[17] = b("span", { class: "dp-label-sm" }, "面板左右位置", -1)),
|
|
5963
|
+
b("div", Ga, [
|
|
5964
|
+
I[15] || (I[15] = b("span", { class: "dp-range-label" }, "偏左", -1)),
|
|
5965
|
+
k(b("input", {
|
|
5966
|
+
type: "range",
|
|
5967
|
+
class: "dp-range",
|
|
5968
|
+
min: "-20",
|
|
5969
|
+
max: "20",
|
|
5970
|
+
step: "0.1",
|
|
5971
|
+
"onUpdate:modelValue": I[3] || (I[3] = (y) => o.value = y)
|
|
5938
5972
|
}, null, 512), [
|
|
5939
5973
|
[
|
|
5940
|
-
|
|
5974
|
+
O,
|
|
5941
5975
|
o.value,
|
|
5942
5976
|
void 0,
|
|
5943
5977
|
{ number: !0 }
|
|
5944
5978
|
]
|
|
5945
5979
|
]),
|
|
5946
|
-
I[
|
|
5947
|
-
|
|
5980
|
+
I[16] || (I[16] = b("span", { class: "dp-range-label" }, "偏右", -1)),
|
|
5981
|
+
b("span", Ka, B(o.value > 0 ? "+" : "") + B(o.value), 1)
|
|
5948
5982
|
])
|
|
5949
5983
|
]),
|
|
5950
|
-
|
|
5951
|
-
I[
|
|
5952
|
-
|
|
5953
|
-
I[
|
|
5954
|
-
k(
|
|
5984
|
+
b("div", Ba, [
|
|
5985
|
+
I[20] || (I[20] = b("span", { class: "dp-label-sm" }, "面板离模型距离", -1)),
|
|
5986
|
+
b("div", Za, [
|
|
5987
|
+
I[18] || (I[18] = b("span", { class: "dp-range-label" }, "近", -1)),
|
|
5988
|
+
k(b("input", {
|
|
5955
5989
|
type: "range",
|
|
5956
5990
|
class: "dp-range",
|
|
5957
5991
|
min: "-0.5",
|
|
5958
5992
|
max: "0.5",
|
|
5959
5993
|
step: "0.01",
|
|
5960
|
-
"onUpdate:modelValue": I[
|
|
5994
|
+
"onUpdate:modelValue": I[4] || (I[4] = (y) => i.value = y)
|
|
5961
5995
|
}, null, 512), [
|
|
5962
5996
|
[
|
|
5963
|
-
|
|
5997
|
+
O,
|
|
5964
5998
|
i.value,
|
|
5965
5999
|
void 0,
|
|
5966
6000
|
{ number: !0 }
|
|
5967
6001
|
]
|
|
5968
6002
|
]),
|
|
5969
|
-
I[
|
|
5970
|
-
|
|
6003
|
+
I[19] || (I[19] = b("span", { class: "dp-range-label" }, "远", -1)),
|
|
6004
|
+
b("span", Xa, B((i.value * 100).toFixed(0)), 1)
|
|
5971
6005
|
])
|
|
5972
6006
|
]),
|
|
5973
|
-
|
|
5974
|
-
I[
|
|
5975
|
-
|
|
5976
|
-
(R(!0), P(Pe, null, jt(n.value, (y,
|
|
5977
|
-
key:
|
|
6007
|
+
b("div", qa, [
|
|
6008
|
+
I[21] || (I[21] = b("span", { class: "dp-label-sm" }, "数据项", -1)),
|
|
6009
|
+
b("div", Va, [
|
|
6010
|
+
(R(!0), P(Pe, null, jt(n.value, (y, v) => (R(), P("div", {
|
|
6011
|
+
key: v,
|
|
5978
6012
|
class: "dp-item"
|
|
5979
6013
|
}, [
|
|
5980
|
-
k(
|
|
6014
|
+
k(b("input", {
|
|
5981
6015
|
type: "text",
|
|
5982
6016
|
class: "dp-input dp-input-sm",
|
|
5983
|
-
"onUpdate:modelValue": (
|
|
6017
|
+
"onUpdate:modelValue": (S) => y.label = S,
|
|
5984
6018
|
placeholder: "标签"
|
|
5985
|
-
}, null, 8,
|
|
5986
|
-
[
|
|
6019
|
+
}, null, 8, Ja), [
|
|
6020
|
+
[O, y.label]
|
|
5987
6021
|
]),
|
|
5988
|
-
k(
|
|
6022
|
+
k(b("input", {
|
|
5989
6023
|
type: "text",
|
|
5990
6024
|
class: "dp-input dp-input-sm",
|
|
5991
|
-
"onUpdate:modelValue": (
|
|
6025
|
+
"onUpdate:modelValue": (S) => y.value = S,
|
|
5992
6026
|
placeholder: "值"
|
|
5993
|
-
}, null, 8,
|
|
5994
|
-
[
|
|
6027
|
+
}, null, 8, Qa), [
|
|
6028
|
+
[O, y.value]
|
|
5995
6029
|
]),
|
|
5996
|
-
k(
|
|
6030
|
+
k(b("input", {
|
|
5997
6031
|
type: "text",
|
|
5998
6032
|
class: "dp-input dp-input-xs",
|
|
5999
|
-
"onUpdate:modelValue": (
|
|
6033
|
+
"onUpdate:modelValue": (S) => y.unit = S,
|
|
6000
6034
|
placeholder: "单位"
|
|
6001
|
-
}, null, 8,
|
|
6002
|
-
[
|
|
6035
|
+
}, null, 8, Ya), [
|
|
6036
|
+
[O, y.unit]
|
|
6003
6037
|
]),
|
|
6004
|
-
k(
|
|
6038
|
+
k(b("input", {
|
|
6005
6039
|
type: "text",
|
|
6006
6040
|
class: "dp-input dp-input-xs",
|
|
6007
|
-
"onUpdate:modelValue": (
|
|
6041
|
+
"onUpdate:modelValue": (S) => y.code = S,
|
|
6008
6042
|
placeholder: "编码"
|
|
6009
|
-
}, null, 8,
|
|
6010
|
-
[
|
|
6043
|
+
}, null, 8, _a), [
|
|
6044
|
+
[O, y.code]
|
|
6011
6045
|
]),
|
|
6012
|
-
|
|
6046
|
+
b("button", {
|
|
6013
6047
|
class: "dp-btn dp-btn-del",
|
|
6014
|
-
onClick: (
|
|
6048
|
+
onClick: (S) => m(v),
|
|
6015
6049
|
title: "删除此项"
|
|
6016
|
-
}, "✕", 8,
|
|
6050
|
+
}, "✕", 8, $a)
|
|
6017
6051
|
]))), 128))
|
|
6018
6052
|
]),
|
|
6019
|
-
|
|
6020
|
-
k(
|
|
6053
|
+
b("div", el, [
|
|
6054
|
+
k(b("input", {
|
|
6021
6055
|
type: "text",
|
|
6022
6056
|
class: "dp-input dp-input-sm",
|
|
6023
|
-
"onUpdate:modelValue": I[
|
|
6057
|
+
"onUpdate:modelValue": I[5] || (I[5] = (y) => l.value = y),
|
|
6024
6058
|
placeholder: "标签",
|
|
6025
|
-
onKeyup: ze(
|
|
6059
|
+
onKeyup: ze(g, ["enter"])
|
|
6026
6060
|
}, null, 544), [
|
|
6027
|
-
[
|
|
6061
|
+
[O, l.value]
|
|
6028
6062
|
]),
|
|
6029
|
-
k(
|
|
6063
|
+
k(b("input", {
|
|
6030
6064
|
type: "text",
|
|
6031
6065
|
class: "dp-input dp-input-sm",
|
|
6032
|
-
"onUpdate:modelValue": I[
|
|
6066
|
+
"onUpdate:modelValue": I[6] || (I[6] = (y) => A.value = y),
|
|
6033
6067
|
placeholder: "值",
|
|
6034
|
-
onKeyup: ze(
|
|
6068
|
+
onKeyup: ze(g, ["enter"])
|
|
6035
6069
|
}, null, 544), [
|
|
6036
|
-
[
|
|
6070
|
+
[O, A.value]
|
|
6037
6071
|
]),
|
|
6038
|
-
k(
|
|
6072
|
+
k(b("input", {
|
|
6039
6073
|
type: "text",
|
|
6040
6074
|
class: "dp-input dp-input-xs",
|
|
6041
|
-
"onUpdate:modelValue": I[
|
|
6075
|
+
"onUpdate:modelValue": I[7] || (I[7] = (y) => d.value = y),
|
|
6042
6076
|
placeholder: "单位",
|
|
6043
|
-
onKeyup: ze(
|
|
6077
|
+
onKeyup: ze(g, ["enter"])
|
|
6044
6078
|
}, null, 544), [
|
|
6045
|
-
[
|
|
6079
|
+
[O, d.value]
|
|
6046
6080
|
]),
|
|
6047
|
-
k(
|
|
6081
|
+
k(b("input", {
|
|
6048
6082
|
type: "text",
|
|
6049
6083
|
class: "dp-input dp-input-xs",
|
|
6050
|
-
"onUpdate:modelValue": I[
|
|
6084
|
+
"onUpdate:modelValue": I[8] || (I[8] = (y) => u.value = y),
|
|
6051
6085
|
placeholder: "编码",
|
|
6052
|
-
onKeyup: ze(
|
|
6086
|
+
onKeyup: ze(g, ["enter"])
|
|
6053
6087
|
}, null, 544), [
|
|
6054
|
-
[
|
|
6088
|
+
[O, u.value]
|
|
6055
6089
|
]),
|
|
6056
|
-
|
|
6090
|
+
b("button", {
|
|
6057
6091
|
class: "dp-btn dp-btn-add",
|
|
6058
|
-
onClick:
|
|
6092
|
+
onClick: g,
|
|
6059
6093
|
title: "添加"
|
|
6060
6094
|
}, "+")
|
|
6061
6095
|
])
|
|
@@ -6063,9 +6097,9 @@ const Zr = {
|
|
|
6063
6097
|
])
|
|
6064
6098
|
]));
|
|
6065
6099
|
}
|
|
6066
|
-
}),
|
|
6067
|
-
function
|
|
6068
|
-
const e =
|
|
6100
|
+
}), sl = /* @__PURE__ */ Se(tl, [["__scopeId", "data-v-1badeb81"]]);
|
|
6101
|
+
function nl(r) {
|
|
6102
|
+
const e = N(/* @__PURE__ */ new Set()), t = (s) => {
|
|
6069
6103
|
const i = new Set(e.value);
|
|
6070
6104
|
i.has(s) ? i.delete(s) : i.add(s), e.value = i;
|
|
6071
6105
|
}, n = (s) => {
|
|
@@ -6076,7 +6110,7 @@ function el(r) {
|
|
|
6076
6110
|
i.add(o.uuid), o = o.parent;
|
|
6077
6111
|
e.value = i;
|
|
6078
6112
|
};
|
|
6079
|
-
return
|
|
6113
|
+
return le(
|
|
6080
6114
|
r,
|
|
6081
6115
|
(s) => {
|
|
6082
6116
|
s && n(s);
|
|
@@ -6084,22 +6118,22 @@ function el(r) {
|
|
|
6084
6118
|
{ immediate: !0 }
|
|
6085
6119
|
), { expandedSet: e, toggleExpand: t };
|
|
6086
6120
|
}
|
|
6087
|
-
const
|
|
6121
|
+
const il = {
|
|
6088
6122
|
key: 0,
|
|
6089
6123
|
class: "property-panel"
|
|
6090
|
-
},
|
|
6124
|
+
}, ol = { class: "property-group tree-group" }, rl = { class: "tree-container" }, al = {
|
|
6091
6125
|
key: 0,
|
|
6092
6126
|
class: "tree-empty"
|
|
6093
|
-
},
|
|
6127
|
+
}, ll = { class: "property-group" }, Al = { class: "transform-mode-row" }, cl = {
|
|
6094
6128
|
key: 0,
|
|
6095
6129
|
class: "tabs"
|
|
6096
|
-
},
|
|
6130
|
+
}, ul = {
|
|
6097
6131
|
key: 1,
|
|
6098
6132
|
class: "tab-content"
|
|
6099
|
-
},
|
|
6133
|
+
}, dl = {
|
|
6100
6134
|
key: 1,
|
|
6101
6135
|
class: "property-panel empty"
|
|
6102
|
-
},
|
|
6136
|
+
}, hl = /* @__PURE__ */ ve({
|
|
6103
6137
|
__name: "index",
|
|
6104
6138
|
props: {
|
|
6105
6139
|
transform: {},
|
|
@@ -6108,137 +6142,137 @@ const tl = {
|
|
|
6108
6142
|
},
|
|
6109
6143
|
emits: ["propertyChange", "treeSelect", "treeDelete", "transformModeChange"],
|
|
6110
6144
|
setup(r, { emit: e }) {
|
|
6111
|
-
const t = r, n = e, s =
|
|
6112
|
-
function i(
|
|
6113
|
-
s.value =
|
|
6145
|
+
const t = r, n = e, s = N("translate");
|
|
6146
|
+
function i(p) {
|
|
6147
|
+
s.value = p, n("transformModeChange", p);
|
|
6114
6148
|
}
|
|
6115
|
-
const o = () => n("propertyChange"), a =
|
|
6116
|
-
var
|
|
6117
|
-
return !!(t.selectedObject && ((
|
|
6118
|
-
}), A =
|
|
6119
|
-
Tn("treeExpand", { expandedSet:
|
|
6120
|
-
const h = (
|
|
6121
|
-
A.value++, n("treeDelete",
|
|
6149
|
+
const o = () => n("propertyChange"), a = N("transform"), l = $e(() => {
|
|
6150
|
+
var p;
|
|
6151
|
+
return !!(t.selectedObject && ((p = t.selectedObject.userData) != null && p._hasDataPanel));
|
|
6152
|
+
}), A = N(0), d = Sn(t, "selectedObject"), { expandedSet: u, toggleExpand: c } = nl(d);
|
|
6153
|
+
Tn("treeExpand", { expandedSet: u, toggleExpand: c });
|
|
6154
|
+
const h = (p) => {
|
|
6155
|
+
A.value++, n("treeDelete", p);
|
|
6122
6156
|
};
|
|
6123
|
-
return (
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
(R(!0), P(Pe, null, jt(
|
|
6157
|
+
return (p, f) => p.transform ? (R(), P("div", il, [
|
|
6158
|
+
b("div", ol, [
|
|
6159
|
+
f[7] || (f[7] = b("label", null, "场景物体", -1)),
|
|
6160
|
+
b("div", rl, [
|
|
6161
|
+
(R(!0), P(Pe, null, jt(p.treeData, (m) => (R(), nt(Qr, {
|
|
6128
6162
|
key: m.uuid,
|
|
6129
6163
|
node: m,
|
|
6130
|
-
"selected-object":
|
|
6164
|
+
"selected-object": p.selectedObject,
|
|
6131
6165
|
version: A.value,
|
|
6132
|
-
onSelect:
|
|
6166
|
+
onSelect: f[0] || (f[0] = (g) => n("treeSelect", g)),
|
|
6133
6167
|
onDelete: h
|
|
6134
6168
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
6135
|
-
|
|
6169
|
+
p.treeData.length === 0 ? (R(), P("div", al, "暂无物体")) : X("", !0)
|
|
6136
6170
|
])
|
|
6137
6171
|
]),
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6172
|
+
b("div", ll, [
|
|
6173
|
+
f[8] || (f[8] = b("label", null, "全局属性", -1)),
|
|
6174
|
+
b("div", Al, [
|
|
6175
|
+
b("button", {
|
|
6142
6176
|
class: oe(["mode-btn", { active: s.value === "translate" }]),
|
|
6143
6177
|
title: "移动 (W)",
|
|
6144
|
-
onClick:
|
|
6178
|
+
onClick: f[1] || (f[1] = (m) => i("translate"))
|
|
6145
6179
|
}, " ↕ 移动 ", 2),
|
|
6146
|
-
|
|
6180
|
+
b("button", {
|
|
6147
6181
|
class: oe(["mode-btn", { active: s.value === "rotate" }]),
|
|
6148
6182
|
title: "旋转 (E)",
|
|
6149
|
-
onClick:
|
|
6183
|
+
onClick: f[2] || (f[2] = (m) => i("rotate"))
|
|
6150
6184
|
}, " ↻ 旋转 ", 2),
|
|
6151
|
-
|
|
6185
|
+
b("button", {
|
|
6152
6186
|
class: oe(["mode-btn", { active: s.value === "scale" }]),
|
|
6153
6187
|
title: "缩放 (R)",
|
|
6154
|
-
onClick:
|
|
6188
|
+
onClick: f[3] || (f[3] = (m) => i("scale"))
|
|
6155
6189
|
}, " ⤡ 缩放 ", 2)
|
|
6156
6190
|
])
|
|
6157
6191
|
]),
|
|
6158
|
-
|
|
6159
|
-
|
|
6192
|
+
p.selectedObject ? (R(), P("div", cl, [
|
|
6193
|
+
b("button", {
|
|
6160
6194
|
class: oe(["tab-btn", { active: a.value === "transform" }]),
|
|
6161
|
-
onClick:
|
|
6195
|
+
onClick: f[4] || (f[4] = (m) => a.value = "transform")
|
|
6162
6196
|
}, " 🔄 变换 ", 2),
|
|
6163
|
-
|
|
6197
|
+
b("button", {
|
|
6164
6198
|
class: oe(["tab-btn", { active: a.value === "userdata" }]),
|
|
6165
|
-
onClick:
|
|
6199
|
+
onClick: f[5] || (f[5] = (m) => a.value = "userdata")
|
|
6166
6200
|
}, " 📋 自定义数据 ", 2),
|
|
6167
6201
|
l.value ? (R(), P("button", {
|
|
6168
6202
|
key: 0,
|
|
6169
6203
|
class: oe(["tab-btn", { active: a.value === "datapanel" }]),
|
|
6170
|
-
onClick:
|
|
6171
|
-
}, " 📊 数据面板 ", 2)) :
|
|
6172
|
-
])) :
|
|
6173
|
-
|
|
6204
|
+
onClick: f[6] || (f[6] = (m) => a.value = "datapanel")
|
|
6205
|
+
}, " 📊 数据面板 ", 2)) : X("", !0)
|
|
6206
|
+
])) : X("", !0),
|
|
6207
|
+
p.selectedObject ? (R(), P("div", ul, [
|
|
6174
6208
|
k(zt(fa, {
|
|
6175
|
-
transform:
|
|
6176
|
-
"selected-object":
|
|
6209
|
+
transform: p.transform,
|
|
6210
|
+
"selected-object": p.selectedObject,
|
|
6177
6211
|
onPropertyChange: o
|
|
6178
6212
|
}, null, 8, ["transform", "selected-object"]), [
|
|
6179
6213
|
[Le, a.value === "transform"]
|
|
6180
6214
|
]),
|
|
6181
|
-
k(zt(ka, { "selected-object":
|
|
6215
|
+
k(zt(ka, { "selected-object": p.selectedObject }, null, 8, ["selected-object"]), [
|
|
6182
6216
|
[Le, a.value === "userdata"]
|
|
6183
6217
|
]),
|
|
6184
|
-
k(zt(
|
|
6218
|
+
k(zt(sl, { "selected-object": p.selectedObject }, null, 8, ["selected-object"]), [
|
|
6185
6219
|
[Le, a.value === "datapanel"]
|
|
6186
6220
|
])
|
|
6187
|
-
])) :
|
|
6188
|
-
])) : (R(), P("div",
|
|
6189
|
-
|
|
6221
|
+
])) : X("", !0)
|
|
6222
|
+
])) : (R(), P("div", dl, f[9] || (f[9] = [
|
|
6223
|
+
b("p", null, "未选中任何模型", -1)
|
|
6190
6224
|
])));
|
|
6191
6225
|
}
|
|
6192
|
-
}),
|
|
6226
|
+
}), fl = /* @__PURE__ */ Se(hl, [["__scopeId", "data-v-c92c9fa7"]]), pl = { class: "top-bar" }, ml = { class: "left-section" }, gl = { class: "dropdown-menu" }, bl = { class: "dropdown-menu sub-menu" }, Cl = { class: "dropdown-menu sub-menu" }, Il = { class: "dropdown-menu" }, yl = /* @__PURE__ */ ve({
|
|
6193
6227
|
__name: "TopBar",
|
|
6194
6228
|
emits: ["addModel", "importModel"],
|
|
6195
6229
|
setup(r, { emit: e }) {
|
|
6196
|
-
const t =
|
|
6197
|
-
var
|
|
6198
|
-
return (
|
|
6199
|
-
}, A = (
|
|
6200
|
-
const m =
|
|
6230
|
+
const t = N(!1), n = N(!1), s = N(!1), i = N(!1), o = e, a = N(null), l = () => {
|
|
6231
|
+
var f;
|
|
6232
|
+
return (f = a.value) == null ? void 0 : f.click();
|
|
6233
|
+
}, A = (f) => {
|
|
6234
|
+
const m = f.target;
|
|
6201
6235
|
m.files && m.files.length > 0 && (o("importModel", m.files[0]), m.value = "");
|
|
6202
|
-
}, d = () => console.log("撤销"),
|
|
6203
|
-
const
|
|
6204
|
-
console.log(JSON.parse(await
|
|
6236
|
+
}, d = () => console.log("撤销"), u = () => console.log("删除物体"), c = async () => {
|
|
6237
|
+
const f = Zo();
|
|
6238
|
+
console.log(JSON.parse(await f));
|
|
6205
6239
|
}, h = () => {
|
|
6206
6240
|
if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
|
|
6207
6241
|
cn(localStorage.getItem("test_id"));
|
|
6208
|
-
},
|
|
6209
|
-
return (
|
|
6210
|
-
|
|
6211
|
-
|
|
6242
|
+
}, p = () => an();
|
|
6243
|
+
return (f, m) => (R(), P("div", pl, [
|
|
6244
|
+
b("div", ml, [
|
|
6245
|
+
b("div", {
|
|
6212
6246
|
class: "dropdown-wrapper",
|
|
6213
6247
|
onMouseenter: m[9] || (m[9] = (g) => n.value = !0),
|
|
6214
6248
|
onMouseleave: m[10] || (m[10] = (g) => n.value = !1)
|
|
6215
6249
|
}, [
|
|
6216
|
-
m[15] || (m[15] =
|
|
6217
|
-
k(
|
|
6218
|
-
|
|
6250
|
+
m[15] || (m[15] = b("button", { class: "menu-btn" }, "添加", -1)),
|
|
6251
|
+
k(b("div", gl, [
|
|
6252
|
+
b("div", {
|
|
6219
6253
|
class: "menu-item",
|
|
6220
6254
|
onClick: d
|
|
6221
6255
|
}, "组"),
|
|
6222
|
-
|
|
6256
|
+
b("div", {
|
|
6223
6257
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
6224
6258
|
onMouseenter: m[3] || (m[3] = (g) => s.value = !0),
|
|
6225
6259
|
onMouseleave: m[4] || (m[4] = (g) => s.value = !1)
|
|
6226
6260
|
}, [
|
|
6227
|
-
m[13] || (m[13] =
|
|
6228
|
-
k(
|
|
6229
|
-
|
|
6261
|
+
m[13] || (m[13] = b("span", null, "网格", -1)),
|
|
6262
|
+
k(b("div", bl, [
|
|
6263
|
+
b("div", {
|
|
6230
6264
|
class: "menu-item",
|
|
6231
6265
|
onClick: m[0] || (m[0] = (g) => o("addModel", "box"))
|
|
6232
6266
|
}, " 正方体 "),
|
|
6233
|
-
|
|
6267
|
+
b("div", {
|
|
6234
6268
|
class: "menu-item",
|
|
6235
6269
|
onClick: m[1] || (m[1] = (g) => o("addModel", "sphere"))
|
|
6236
6270
|
}, " 球体 "),
|
|
6237
|
-
|
|
6271
|
+
b("div", {
|
|
6238
6272
|
class: "menu-item",
|
|
6239
6273
|
onClick: m[2] || (m[2] = (g) => o("addModel", "waterPlane"))
|
|
6240
6274
|
}, " 水面 "),
|
|
6241
|
-
|
|
6275
|
+
b("div", {
|
|
6242
6276
|
class: "menu-item",
|
|
6243
6277
|
onClick: l
|
|
6244
6278
|
}, "导入")
|
|
@@ -6246,14 +6280,14 @@ const tl = {
|
|
|
6246
6280
|
[Le, s.value]
|
|
6247
6281
|
])
|
|
6248
6282
|
], 32),
|
|
6249
|
-
|
|
6283
|
+
b("div", {
|
|
6250
6284
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
6251
6285
|
onMouseenter: m[6] || (m[6] = (g) => i.value = !0),
|
|
6252
6286
|
onMouseleave: m[7] || (m[7] = (g) => i.value = !1)
|
|
6253
6287
|
}, [
|
|
6254
|
-
m[14] || (m[14] =
|
|
6255
|
-
k(
|
|
6256
|
-
|
|
6288
|
+
m[14] || (m[14] = b("span", null, "光源", -1)),
|
|
6289
|
+
k(b("div", Cl, [
|
|
6290
|
+
b("div", {
|
|
6257
6291
|
class: "menu-item",
|
|
6258
6292
|
onClick: m[5] || (m[5] = (g) => o("addModel", "directionalLight"))
|
|
6259
6293
|
}, " 平行光 ")
|
|
@@ -6261,11 +6295,11 @@ const tl = {
|
|
|
6261
6295
|
[Le, i.value]
|
|
6262
6296
|
])
|
|
6263
6297
|
], 32),
|
|
6264
|
-
|
|
6298
|
+
b("div", {
|
|
6265
6299
|
class: "menu-item",
|
|
6266
|
-
onClick:
|
|
6300
|
+
onClick: u
|
|
6267
6301
|
}, "摄像机"),
|
|
6268
|
-
|
|
6302
|
+
b("div", {
|
|
6269
6303
|
class: "menu-item",
|
|
6270
6304
|
onClick: m[8] || (m[8] = (g) => o("addModel", "dataPanel"))
|
|
6271
6305
|
}, " 数据面板 ")
|
|
@@ -6273,34 +6307,34 @@ const tl = {
|
|
|
6273
6307
|
[Le, n.value]
|
|
6274
6308
|
])
|
|
6275
6309
|
], 32),
|
|
6276
|
-
|
|
6310
|
+
b("div", {
|
|
6277
6311
|
class: "dropdown-wrapper",
|
|
6278
6312
|
onMouseenter: m[11] || (m[11] = (g) => t.value = !0),
|
|
6279
6313
|
onMouseleave: m[12] || (m[12] = (g) => t.value = !1)
|
|
6280
6314
|
}, [
|
|
6281
|
-
m[16] || (m[16] =
|
|
6282
|
-
k(
|
|
6283
|
-
|
|
6315
|
+
m[16] || (m[16] = b("button", { class: "menu-btn" }, "帮助", -1)),
|
|
6316
|
+
k(b("div", Il, [
|
|
6317
|
+
b("div", {
|
|
6284
6318
|
class: "menu-item",
|
|
6285
|
-
onClick:
|
|
6319
|
+
onClick: c
|
|
6286
6320
|
}, "获取场景"),
|
|
6287
|
-
|
|
6321
|
+
b("div", {
|
|
6288
6322
|
class: "menu-item",
|
|
6289
6323
|
onClick: h
|
|
6290
6324
|
}, "镜头拉近"),
|
|
6291
|
-
|
|
6325
|
+
b("div", {
|
|
6292
6326
|
class: "menu-item",
|
|
6293
|
-
onClick:
|
|
6327
|
+
onClick: p
|
|
6294
6328
|
}, " 重置相机位置 ")
|
|
6295
6329
|
], 512), [
|
|
6296
6330
|
[Le, t.value]
|
|
6297
6331
|
])
|
|
6298
6332
|
], 32)
|
|
6299
6333
|
]),
|
|
6300
|
-
m[17] || (m[17] =
|
|
6301
|
-
|
|
6334
|
+
m[17] || (m[17] = b("div", { class: "right-section" }, [
|
|
6335
|
+
b("span", { class: "app-title" }, "3D 模型编辑器")
|
|
6302
6336
|
], -1)),
|
|
6303
|
-
|
|
6337
|
+
b("input", {
|
|
6304
6338
|
type: "file",
|
|
6305
6339
|
ref_key: "fileInput",
|
|
6306
6340
|
ref: a,
|
|
@@ -6310,29 +6344,29 @@ const tl = {
|
|
|
6310
6344
|
}, null, 544)
|
|
6311
6345
|
]));
|
|
6312
6346
|
}
|
|
6313
|
-
}),
|
|
6347
|
+
}), xl = /* @__PURE__ */ Se(yl, [["__scopeId", "data-v-45df3361"]]), vl = { class: "bottom-bar" }, Sl = /* @__PURE__ */ ve({
|
|
6314
6348
|
__name: "BottomBar",
|
|
6315
6349
|
setup(r) {
|
|
6316
|
-
return (e, t) => (R(), P("div",
|
|
6317
|
-
|
|
6318
|
-
|
|
6350
|
+
return (e, t) => (R(), P("div", vl, t[0] || (t[0] = [
|
|
6351
|
+
b("div", { class: "status-left" }, [
|
|
6352
|
+
b("span", null, "就绪")
|
|
6319
6353
|
], -1),
|
|
6320
|
-
|
|
6321
|
-
|
|
6354
|
+
b("div", { class: "status-right" }, [
|
|
6355
|
+
b("span", null, "顶点: 0 | 面: 0")
|
|
6322
6356
|
], -1)
|
|
6323
6357
|
])));
|
|
6324
6358
|
}
|
|
6325
|
-
}),
|
|
6359
|
+
}), Tl = /* @__PURE__ */ Se(Sl, [["__scopeId", "data-v-3427bb27"]]), Ml = { class: "app-layout" }, wl = {
|
|
6326
6360
|
key: 0,
|
|
6327
6361
|
class: "loading-overlay"
|
|
6328
|
-
},
|
|
6362
|
+
}, Rl = /* @__PURE__ */ ve({
|
|
6329
6363
|
__name: "DrawingBoard",
|
|
6330
6364
|
props: {
|
|
6331
6365
|
mode: { default: "edit" },
|
|
6332
6366
|
sceneData: { default: null }
|
|
6333
6367
|
},
|
|
6334
6368
|
setup(r) {
|
|
6335
|
-
const e = r, t =
|
|
6369
|
+
const e = r, t = N(!1);
|
|
6336
6370
|
To((g) => {
|
|
6337
6371
|
t.value = g;
|
|
6338
6372
|
});
|
|
@@ -6366,64 +6400,64 @@ const tl = {
|
|
|
6366
6400
|
}, l = (g) => Br(g), A = async (g) => {
|
|
6367
6401
|
try {
|
|
6368
6402
|
await Kr(g);
|
|
6369
|
-
} catch (
|
|
6370
|
-
console.error("导入失败:",
|
|
6403
|
+
} catch (x) {
|
|
6404
|
+
console.error("导入失败:", x), alert("导入失败:" + x.message);
|
|
6371
6405
|
}
|
|
6372
6406
|
}, d = ms([]);
|
|
6373
6407
|
zo((g) => {
|
|
6374
6408
|
d.value = g;
|
|
6375
6409
|
});
|
|
6376
|
-
const
|
|
6410
|
+
const u = () => {
|
|
6377
6411
|
const g = Go();
|
|
6378
6412
|
g && (d.value = g);
|
|
6379
|
-
},
|
|
6413
|
+
}, c = (g) => ds(g), h = (g) => Do(g.uuid), p = (g) => {
|
|
6380
6414
|
Mo(g);
|
|
6381
|
-
},
|
|
6382
|
-
|
|
6415
|
+
}, f = N(null), m = () => {
|
|
6416
|
+
f.value && fo(f.value, e.mode, e.sceneData), u();
|
|
6383
6417
|
};
|
|
6384
6418
|
return Mn(() => {
|
|
6385
|
-
m(),
|
|
6419
|
+
m(), f.value && lo(f.value);
|
|
6386
6420
|
}), wn(() => {
|
|
6387
6421
|
console.log("endset_three_editor destroy"), qo();
|
|
6388
|
-
}), (g,
|
|
6389
|
-
t.value ? (R(), P("div",
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
]))) :
|
|
6393
|
-
g.mode === "edit" ? (R(), nt(
|
|
6422
|
+
}), (g, x) => (R(), P("div", Ml, [
|
|
6423
|
+
t.value ? (R(), P("div", wl, x[0] || (x[0] = [
|
|
6424
|
+
b("div", { class: "loading-spinner" }, null, -1),
|
|
6425
|
+
b("div", { class: "loading-text" }, "加载中...", -1)
|
|
6426
|
+
]))) : X("", !0),
|
|
6427
|
+
g.mode === "edit" ? (R(), nt(xl, {
|
|
6394
6428
|
key: 1,
|
|
6395
6429
|
onAddModel: l,
|
|
6396
6430
|
onImportModel: A
|
|
6397
|
-
})) :
|
|
6398
|
-
|
|
6431
|
+
})) : X("", !0),
|
|
6432
|
+
b("div", {
|
|
6399
6433
|
class: oe(`editor-container editor-container-mode-${g.mode}`)
|
|
6400
6434
|
}, [
|
|
6401
|
-
|
|
6435
|
+
b("div", {
|
|
6402
6436
|
class: oe(`canvas canvas-mode-${g.mode}`),
|
|
6403
6437
|
ref_key: "containerRef",
|
|
6404
|
-
ref:
|
|
6438
|
+
ref: f
|
|
6405
6439
|
}, null, 2),
|
|
6406
|
-
g.mode === "edit" ? (R(), nt(
|
|
6440
|
+
g.mode === "edit" ? (R(), nt(fl, {
|
|
6407
6441
|
key: 0,
|
|
6408
6442
|
transform: s,
|
|
6409
6443
|
"tree-data": d.value,
|
|
6410
6444
|
"selected-object": n.value,
|
|
6411
6445
|
onPropertyChange: a,
|
|
6412
|
-
onTreeSelect:
|
|
6446
|
+
onTreeSelect: c,
|
|
6413
6447
|
onTreeDelete: h,
|
|
6414
|
-
onTransformModeChange:
|
|
6415
|
-
}, null, 8, ["transform", "tree-data", "selected-object"])) :
|
|
6448
|
+
onTransformModeChange: p
|
|
6449
|
+
}, null, 8, ["transform", "tree-data", "selected-object"])) : X("", !0)
|
|
6416
6450
|
], 2),
|
|
6417
|
-
g.mode === "edit" ? (R(), nt(
|
|
6451
|
+
g.mode === "edit" ? (R(), nt(Tl, { key: 2 })) : X("", !0)
|
|
6418
6452
|
]));
|
|
6419
6453
|
}
|
|
6420
|
-
}),
|
|
6454
|
+
}), jl = /* @__PURE__ */ Se(Rl, [["__scopeId", "data-v-b3d90c56"]]);
|
|
6421
6455
|
export {
|
|
6422
|
-
|
|
6456
|
+
Tl as BottomBar,
|
|
6423
6457
|
dt as DataPanel,
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6458
|
+
jl as DrawingBoard,
|
|
6459
|
+
fl as PropertyPanel,
|
|
6460
|
+
xl as TopBar,
|
|
6427
6461
|
Qr as TreeItem,
|
|
6428
6462
|
Fr as addBox,
|
|
6429
6463
|
Gr as addDataPanel,
|
|
@@ -6437,11 +6471,11 @@ export {
|
|
|
6437
6471
|
uo as disposeCSS2DRenderer,
|
|
6438
6472
|
Zo as exportSceneToJSON,
|
|
6439
6473
|
Eo as focusOnObject,
|
|
6440
|
-
|
|
6474
|
+
Ol as getCSS2DRenderer,
|
|
6441
6475
|
Bo as getCamera,
|
|
6442
6476
|
Ft as getDataPanel,
|
|
6443
|
-
|
|
6444
|
-
|
|
6477
|
+
Wl as getRenderer,
|
|
6478
|
+
Dl as getScene,
|
|
6445
6479
|
Go as getSceneObjects,
|
|
6446
6480
|
Ko as getSelectedObject,
|
|
6447
6481
|
Kr as importModelFromFile,
|
|
@@ -6451,7 +6485,7 @@ export {
|
|
|
6451
6485
|
zo as onSceneObjectsChangeCallback,
|
|
6452
6486
|
Lo as registerModelDataPanel,
|
|
6453
6487
|
ao as removeDataPanel,
|
|
6454
|
-
|
|
6488
|
+
No as removeModel,
|
|
6455
6489
|
Do as removeModelById,
|
|
6456
6490
|
Ao as renderCSS2D,
|
|
6457
6491
|
co as resizeCSS2DRenderer,
|
|
@@ -6462,7 +6496,7 @@ export {
|
|
|
6462
6496
|
Uo as setSelectedObjectCallback,
|
|
6463
6497
|
Ho as setTransformChangeCallback,
|
|
6464
6498
|
Mo as setTransformMode,
|
|
6465
|
-
|
|
6466
|
-
|
|
6499
|
+
Nl as updateDataPanelValue,
|
|
6500
|
+
nl as useTreeExpand
|
|
6467
6501
|
};
|
|
6468
6502
|
//# sourceMappingURL=three-editor.es.js.map
|