endset_three_editor 0.9.2 → 0.9.3
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.cjs.js +7 -7
- package/dist/three-editor.cjs.js.map +1 -1
- package/dist/three-editor.es.js +1183 -1181
- package/dist/three-editor.es.js.map +1 -1
- package/package.json +1 -1
package/dist/three-editor.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var Ai = Object.defineProperty;
|
|
2
2
|
var mi = (r, e, t) => e in r ? Ai(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var qe = (r, e, t) => mi(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { toRaw as ss, defineComponent as Be, ref as
|
|
4
|
+
import { toRaw as ss, defineComponent as Be, ref as W, inject as gi, computed as ot, watchEffect as yi, resolveComponent as bi, openBlock as L, createElementBlock as U, createElementVNode as b, normalizeClass as ve, withModifiers as bs, unref as xi, toDisplayString as de, Fragment as Oe, renderList as ns, createBlock as bt, createCommentVNode as ce, reactive as xs, watch as Me, withDirectives as F, vModelText as K, createTextVNode as os, withKeys as rt, vModelCheckbox as Ii, toRef as Ci, provide as wi, createVNode as rs, vShow as Ze, shallowRef as Fs, onMounted as Mi, onBeforeUnmount as vi } from "vue";
|
|
5
5
|
import * as P from "three";
|
|
6
|
-
import { Controls as wn, Vector3 as R, MOUSE as ct, TOUCH as at, Quaternion as pe, Spherical as Us, Vector2 as
|
|
6
|
+
import { Controls as wn, Vector3 as R, MOUSE as ct, TOUCH as at, Quaternion as pe, Spherical as Us, Vector2 as le, Ray as Ti, Plane as Mn, MathUtils as Tt, Raycaster as Ei, Object3D as dt, MeshBasicMaterial as Qe, LineBasicMaterial as xt, CylinderGeometry as me, BoxGeometry as fe, BufferGeometry as $e, Float32BufferAttribute as Re, Mesh as S, OctahedronGeometry as Lt, Line as He, TorusGeometry as ht, SphereGeometry as Di, Euler as Pi, Matrix4 as xe, PlaneGeometry as Ri, DoubleSide as Ps, OrthographicCamera as vn, ShaderMaterial as Is, UniformsUtils as Zt, WebGLRenderTarget as Tn, HalfFloatType as En, NoBlending as Oi, Timer as Si, Color as re, RawShaderMaterial as Li, ColorManagement as Qt, SRGBTransfer as Ni, LinearToneMapping as Hi, ReinhardToneMapping as ki, CineonToneMapping as ji, ACESFilmicToneMapping as Fi, AgXToneMapping as Ui, NeutralToneMapping as zi, CustomToneMapping as Gi, BufferAttribute as we, REVISION as Wi, CompressedTexture as as, Source as Bi, NoColorSpace as Xi, RGBAFormat as qi, ImageUtils as Vi, PropertyBinding as Et, InterpolateDiscrete as Dn, Scene as zs, SRGBColorSpace as Se, NearestFilter as Rs, NearestMipmapNearestFilter as Pn, NearestMipmapLinearFilter as Rn, LinearFilter as Jt, LinearMipmapNearestFilter as On, LinearMipmapLinearFilter as Os, ClampToEdgeWrapping as Sn, RepeatWrapping as Je, MirroredRepeatWrapping as Ln, InterpolateLinear as Ss, TrianglesDrawMode as Yi, TriangleFanDrawMode as Cs, TriangleStripDrawMode as Nn, Loader as Ls, LoaderUtils as It, FileLoader as Dt, MeshPhysicalMaterial as Ne, LinearSRGBColorSpace as Le, SpotLight as Ki, PointLight as Zi, DirectionalLight as Qi, InstancedMesh as Ji, InstancedBufferAttribute as _i, TextureLoader as Wt, ImageBitmapLoader as $i, InterleavedBuffer as Hn, InterleavedBufferAttribute as kn, PointsMaterial as mt, Material as Ct, MeshStandardMaterial as jn, SkinnedMesh as eo, LineSegments as ws, LineLoop as to, Points as Bt, Group as Xt, PerspectiveCamera as Fn, Skeleton as so, AnimationClip as no, Bone as io, Texture as Gs, VectorKeyframeTrack as Ws, NumberKeyframeTrack as Bs, QuaternionKeyframeTrack as Xs, FrontSide as Un, Interpolant as oo, Box3 as ro, Sphere as ao, MeshPhongMaterial as lo, Vector4 as qs, UniformsLib as Vs } from "three";
|
|
7
7
|
import Pt from "@tweenjs/tween.js";
|
|
8
|
-
const Ys = { type: "change" }, Ns = { type: "start" }, zn = { type: "end" }, Nt = new Ti(), Ks = new Mn(), co = Math.cos(70 * Tt.DEG2RAD),
|
|
8
|
+
const Ys = { type: "change" }, Ns = { type: "start" }, zn = { type: "end" }, Nt = new Ti(), Ks = new Mn(), co = Math.cos(70 * Tt.DEG2RAD), ae = new R(), ge = 2 * Math.PI, J = {
|
|
9
9
|
NONE: -1,
|
|
10
10
|
ROTATE: 0,
|
|
11
11
|
DOLLY: 1,
|
|
@@ -23,7 +23,7 @@ class uo extends wn {
|
|
|
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 =
|
|
26
|
+
super(e, t), this.state = J.NONE, this.target = new R(), this.cursor = new R(), 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: ct.ROTATE, MIDDLE: ct.DOLLY, RIGHT: ct.PAN }, this.touches = { ONE: at.ROTATE, TWO: at.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 R(), this._lastQuaternion = new pe(), this._lastTargetPosition = new R(), this._quat = new pe().setFromUnitVectors(e.up, new R(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Us(), this._sphericalDelta = new Us(), this._scale = 1, this._panOffset = new R(), this._rotateStart = new le(), this._rotateEnd = new le(), this._rotateDelta = new le(), this._panStart = new le(), this._panEnd = new le(), this._panDelta = new le(), this._dollyStart = new le(), this._dollyEnd = new le(), this._dollyDelta = new le(), this._dollyDirection = new R(), this._mouse = new le(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = fo.bind(this), this._onPointerDown = ho.bind(this), this._onPointerUp = po.bind(this), this._onContextMenu = Io.bind(this), this._onMouseWheel = go.bind(this), this._onKeyDown = yo.bind(this), this._onTouchStart = bo.bind(this), this._onTouchMove = xo.bind(this), this._onMouseDown = Ao.bind(this), this._onMouseMove = mo.bind(this), this._interceptControlDown = Co.bind(this), this._interceptControlUp = wo.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Defines the visual representation of the cursor.
|
|
@@ -96,7 +96,7 @@ class uo extends wn {
|
|
|
96
96
|
* was called, or the initial state.
|
|
97
97
|
*/
|
|
98
98
|
reset() {
|
|
99
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Ys), this.update(), this.state =
|
|
99
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Ys), this.update(), this.state = J.NONE;
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
102
|
* Programmatically pan the camera.
|
|
@@ -141,7 +141,7 @@ class uo extends wn {
|
|
|
141
141
|
}
|
|
142
142
|
update(e = null) {
|
|
143
143
|
const t = this.object.position;
|
|
144
|
-
|
|
144
|
+
ae.copy(t).sub(this.target), ae.applyQuaternion(this._quat), this._spherical.setFromVector3(ae), this.autoRotate && this.state === J.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
146
|
isFinite(n) && isFinite(s) && (n < -Math.PI ? n += ge : n > Math.PI && (n -= ge), s < -Math.PI ? s += ge : s > Math.PI && (s -= ge), 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;
|
|
@@ -151,10 +151,10 @@ class uo extends wn {
|
|
|
151
151
|
const o = this._spherical.radius;
|
|
152
152
|
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), i = o != this._spherical.radius;
|
|
153
153
|
}
|
|
154
|
-
if (
|
|
154
|
+
if (ae.setFromSpherical(this._spherical), ae.applyQuaternion(this._quatInverse), t.copy(this.target).add(ae), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
|
|
155
155
|
let o = null;
|
|
156
156
|
if (this.object.isPerspectiveCamera) {
|
|
157
|
-
const a =
|
|
157
|
+
const a = ae.length();
|
|
158
158
|
o = this._clampDistance(a * this._scale);
|
|
159
159
|
const l = a - o;
|
|
160
160
|
this.object.position.addScaledVector(this._dollyDirection, l), this.object.updateMatrixWorld(), i = !!l;
|
|
@@ -164,7 +164,7 @@ class uo extends wn {
|
|
|
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
166
|
const c = new R(this._mouse.x, this._mouse.y, 0);
|
|
167
|
-
c.unproject(this.object), this.object.position.sub(c).add(a), this.object.updateMatrixWorld(), o =
|
|
167
|
+
c.unproject(this.object), this.object.position.sub(c).add(a), this.object.updateMatrixWorld(), o = ae.length();
|
|
168
168
|
} else
|
|
169
169
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
170
170
|
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Nt.origin.copy(this.object.position), Nt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Nt.direction)) < co ? this.object.lookAt(this.target) : (Ks.setFromNormalAndCoplanarPoint(this.object.up, this.target), Nt.intersectPlane(Ks, this.target))));
|
|
@@ -188,18 +188,18 @@ class uo extends wn {
|
|
|
188
188
|
this._sphericalDelta.phi -= e;
|
|
189
189
|
}
|
|
190
190
|
_panLeft(e, t) {
|
|
191
|
-
|
|
191
|
+
ae.setFromMatrixColumn(t, 0), ae.multiplyScalar(-e), this._panOffset.add(ae);
|
|
192
192
|
}
|
|
193
193
|
_panUp(e, t) {
|
|
194
|
-
this.screenSpacePanning === !0 ?
|
|
194
|
+
this.screenSpacePanning === !0 ? ae.setFromMatrixColumn(t, 1) : (ae.setFromMatrixColumn(t, 0), ae.crossVectors(this.object.up, ae)), ae.multiplyScalar(e), this._panOffset.add(ae);
|
|
195
195
|
}
|
|
196
196
|
// deltaX and deltaY are in pixels; right and down are positive
|
|
197
197
|
_pan(e, t) {
|
|
198
198
|
const n = this.domElement;
|
|
199
199
|
if (this.object.isPerspectiveCamera) {
|
|
200
200
|
const s = this.object.position;
|
|
201
|
-
|
|
202
|
-
let i =
|
|
201
|
+
ae.copy(s).sub(this.target);
|
|
202
|
+
let i = ae.length();
|
|
203
203
|
i *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * i / n.clientHeight, this.object.matrix), this._panUp(2 * t * i / n.clientHeight, this.object.matrix);
|
|
204
204
|
} else this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / n.clientWidth, this.object.matrix), this._panUp(t * (this.object.top - this.object.bottom) / this.object.zoom / n.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
|
|
205
205
|
}
|
|
@@ -340,7 +340,7 @@ class uo extends wn {
|
|
|
340
340
|
}
|
|
341
341
|
_trackPointer(e) {
|
|
342
342
|
let t = this._pointerPositions[e.pointerId];
|
|
343
|
-
t === void 0 && (t = new
|
|
343
|
+
t === void 0 && (t = new le(), this._pointerPositions[e.pointerId] = t), t.set(e.pageX, e.pageY);
|
|
344
344
|
}
|
|
345
345
|
_getSecondPointerPosition(e) {
|
|
346
346
|
const t = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
@@ -373,7 +373,7 @@ function fo(r) {
|
|
|
373
373
|
function po(r) {
|
|
374
374
|
switch (this._removePointer(r), this._pointers.length) {
|
|
375
375
|
case 0:
|
|
376
|
-
this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(zn), this.state =
|
|
376
|
+
this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(zn), this.state = J.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
|
|
377
377
|
break;
|
|
378
378
|
case 1:
|
|
379
379
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
|
@@ -399,49 +399,49 @@ function Ao(r) {
|
|
|
399
399
|
switch (e) {
|
|
400
400
|
case ct.DOLLY:
|
|
401
401
|
if (this.enableZoom === !1) return;
|
|
402
|
-
this._handleMouseDownDolly(r), this.state =
|
|
402
|
+
this._handleMouseDownDolly(r), this.state = J.DOLLY;
|
|
403
403
|
break;
|
|
404
404
|
case ct.ROTATE:
|
|
405
405
|
if (r.ctrlKey || r.metaKey || r.shiftKey) {
|
|
406
406
|
if (this.enablePan === !1) return;
|
|
407
|
-
this._handleMouseDownPan(r), this.state =
|
|
407
|
+
this._handleMouseDownPan(r), this.state = J.PAN;
|
|
408
408
|
} else {
|
|
409
409
|
if (this.enableRotate === !1) return;
|
|
410
|
-
this._handleMouseDownRotate(r), this.state =
|
|
410
|
+
this._handleMouseDownRotate(r), this.state = J.ROTATE;
|
|
411
411
|
}
|
|
412
412
|
break;
|
|
413
413
|
case ct.PAN:
|
|
414
414
|
if (r.ctrlKey || r.metaKey || r.shiftKey) {
|
|
415
415
|
if (this.enableRotate === !1) return;
|
|
416
|
-
this._handleMouseDownRotate(r), this.state =
|
|
416
|
+
this._handleMouseDownRotate(r), this.state = J.ROTATE;
|
|
417
417
|
} else {
|
|
418
418
|
if (this.enablePan === !1) return;
|
|
419
|
-
this._handleMouseDownPan(r), this.state =
|
|
419
|
+
this._handleMouseDownPan(r), this.state = J.PAN;
|
|
420
420
|
}
|
|
421
421
|
break;
|
|
422
422
|
default:
|
|
423
|
-
this.state =
|
|
423
|
+
this.state = J.NONE;
|
|
424
424
|
}
|
|
425
|
-
this.state !==
|
|
425
|
+
this.state !== J.NONE && this.dispatchEvent(Ns);
|
|
426
426
|
}
|
|
427
427
|
function mo(r) {
|
|
428
428
|
switch (this.state) {
|
|
429
|
-
case
|
|
429
|
+
case J.ROTATE:
|
|
430
430
|
if (this.enableRotate === !1) return;
|
|
431
431
|
this._handleMouseMoveRotate(r);
|
|
432
432
|
break;
|
|
433
|
-
case
|
|
433
|
+
case J.DOLLY:
|
|
434
434
|
if (this.enableZoom === !1) return;
|
|
435
435
|
this._handleMouseMoveDolly(r);
|
|
436
436
|
break;
|
|
437
|
-
case
|
|
437
|
+
case J.PAN:
|
|
438
438
|
if (this.enablePan === !1) return;
|
|
439
439
|
this._handleMouseMovePan(r);
|
|
440
440
|
break;
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
function go(r) {
|
|
444
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !==
|
|
444
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== J.NONE || (r.preventDefault(), this.dispatchEvent(Ns), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(zn));
|
|
445
445
|
}
|
|
446
446
|
function yo(r) {
|
|
447
447
|
this.enabled !== !1 && this._handleKeyDown(r);
|
|
@@ -452,55 +452,55 @@ function bo(r) {
|
|
|
452
452
|
switch (this.touches.ONE) {
|
|
453
453
|
case at.ROTATE:
|
|
454
454
|
if (this.enableRotate === !1) return;
|
|
455
|
-
this._handleTouchStartRotate(r), this.state =
|
|
455
|
+
this._handleTouchStartRotate(r), this.state = J.TOUCH_ROTATE;
|
|
456
456
|
break;
|
|
457
457
|
case at.PAN:
|
|
458
458
|
if (this.enablePan === !1) return;
|
|
459
|
-
this._handleTouchStartPan(r), this.state =
|
|
459
|
+
this._handleTouchStartPan(r), this.state = J.TOUCH_PAN;
|
|
460
460
|
break;
|
|
461
461
|
default:
|
|
462
|
-
this.state =
|
|
462
|
+
this.state = J.NONE;
|
|
463
463
|
}
|
|
464
464
|
break;
|
|
465
465
|
case 2:
|
|
466
466
|
switch (this.touches.TWO) {
|
|
467
467
|
case at.DOLLY_PAN:
|
|
468
468
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
469
|
-
this._handleTouchStartDollyPan(r), this.state =
|
|
469
|
+
this._handleTouchStartDollyPan(r), this.state = J.TOUCH_DOLLY_PAN;
|
|
470
470
|
break;
|
|
471
471
|
case at.DOLLY_ROTATE:
|
|
472
472
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
473
|
-
this._handleTouchStartDollyRotate(r), this.state =
|
|
473
|
+
this._handleTouchStartDollyRotate(r), this.state = J.TOUCH_DOLLY_ROTATE;
|
|
474
474
|
break;
|
|
475
475
|
default:
|
|
476
|
-
this.state =
|
|
476
|
+
this.state = J.NONE;
|
|
477
477
|
}
|
|
478
478
|
break;
|
|
479
479
|
default:
|
|
480
|
-
this.state =
|
|
480
|
+
this.state = J.NONE;
|
|
481
481
|
}
|
|
482
|
-
this.state !==
|
|
482
|
+
this.state !== J.NONE && this.dispatchEvent(Ns);
|
|
483
483
|
}
|
|
484
484
|
function xo(r) {
|
|
485
485
|
switch (this._trackPointer(r), this.state) {
|
|
486
|
-
case
|
|
486
|
+
case J.TOUCH_ROTATE:
|
|
487
487
|
if (this.enableRotate === !1) return;
|
|
488
488
|
this._handleTouchMoveRotate(r), this.update();
|
|
489
489
|
break;
|
|
490
|
-
case
|
|
490
|
+
case J.TOUCH_PAN:
|
|
491
491
|
if (this.enablePan === !1) return;
|
|
492
492
|
this._handleTouchMovePan(r), this.update();
|
|
493
493
|
break;
|
|
494
|
-
case
|
|
494
|
+
case J.TOUCH_DOLLY_PAN:
|
|
495
495
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
496
496
|
this._handleTouchMoveDollyPan(r), this.update();
|
|
497
497
|
break;
|
|
498
|
-
case
|
|
498
|
+
case J.TOUCH_DOLLY_ROTATE:
|
|
499
499
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
500
500
|
this._handleTouchMoveDollyRotate(r), this.update();
|
|
501
501
|
break;
|
|
502
502
|
default:
|
|
503
|
-
this.state =
|
|
503
|
+
this.state = J.NONE;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
function Io(r) {
|
|
@@ -512,7 +512,7 @@ function Co(r) {
|
|
|
512
512
|
function wo(r) {
|
|
513
513
|
r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
514
514
|
}
|
|
515
|
-
const Ve = new Ei(),
|
|
515
|
+
const Ve = new Ei(), he = new R(), Ue = new R(), se = new pe(), Zs = {
|
|
516
516
|
X: new R(1, 0, 0),
|
|
517
517
|
Y: new R(0, 1, 0),
|
|
518
518
|
Z: new R(0, 0, 1)
|
|
@@ -533,20 +533,20 @@ class Mo extends wn {
|
|
|
533
533
|
const i = new So();
|
|
534
534
|
this._plane = i, n.add(i);
|
|
535
535
|
const o = this;
|
|
536
|
-
function a(C,
|
|
537
|
-
let w =
|
|
536
|
+
function a(C, f) {
|
|
537
|
+
let w = f;
|
|
538
538
|
Object.defineProperty(o, C, {
|
|
539
539
|
get: function() {
|
|
540
|
-
return w !== void 0 ? w :
|
|
540
|
+
return w !== void 0 ? w : f;
|
|
541
541
|
},
|
|
542
|
-
set: function(
|
|
543
|
-
w !==
|
|
542
|
+
set: function(E) {
|
|
543
|
+
w !== E && (w = E, i[C] = E, s[C] = E, o.dispatchEvent({ type: C + "-changed", value: E }), o.dispatchEvent(cs));
|
|
544
544
|
}
|
|
545
|
-
}), o[C] =
|
|
545
|
+
}), o[C] = f, i[C] = f, s[C] = f;
|
|
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 R(), c = new R(), d = new pe(), u = new pe(), m = new R(),
|
|
549
|
-
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition", m), a("cameraQuaternion",
|
|
548
|
+
const l = new R(), c = new R(), d = new pe(), u = new pe(), m = new R(), A = new pe(), g = new R(), h = new R(), p = new R(), y = 0, M = new R();
|
|
549
|
+
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition", m), a("cameraQuaternion", A), a("pointStart", g), a("pointEnd", h), a("rotationAxis", p), a("rotationAngle", y), a("eye", M), this._offset = new R(), this._startNorm = new R(), this._endNorm = new R(), this._cameraScale = new R(), this._parentPosition = new R(), this._parentQuaternion = new pe(), this._parentQuaternionInv = new pe(), this._parentScale = new R(), this._worldScaleStart = new R(), this._worldQuaternionInv = new pe(), this._worldScale = new R(), this._positionStart = new R(), this._quaternionStart = new pe(), this._scaleStart = new R(), this._getPointer = vo.bind(this), this._onPointerDown = Eo.bind(this), this._onPointerHover = To.bind(this), this._onPointerMove = Do.bind(this), this._onPointerUp = Po.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";
|
|
@@ -584,19 +584,19 @@ class Mo extends wn {
|
|
|
584
584
|
const o = us(this._plane, Ve, !0);
|
|
585
585
|
if (o) {
|
|
586
586
|
if (this.pointEnd.copy(o.point).sub(this.worldPositionStart), n === "translate")
|
|
587
|
-
this._offset.copy(this.pointEnd).sub(this.pointStart), i === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), i === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), s.position.copy(this._offset).add(this._positionStart), this.translationSnap && (i === "local" && (s.position.applyQuaternion(se.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (s.position.x = Math.round(s.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (s.position.y = Math.round(s.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (s.position.z = Math.round(s.position.z / this.translationSnap) * this.translationSnap), s.position.applyQuaternion(this._quaternionStart)), i === "world" && (s.parent && s.position.add(
|
|
587
|
+
this._offset.copy(this.pointEnd).sub(this.pointStart), i === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), i === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), s.position.copy(this._offset).add(this._positionStart), this.translationSnap && (i === "local" && (s.position.applyQuaternion(se.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (s.position.x = Math.round(s.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (s.position.y = Math.round(s.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (s.position.z = Math.round(s.position.z / this.translationSnap) * this.translationSnap), s.position.applyQuaternion(this._quaternionStart)), i === "world" && (s.parent && s.position.add(he.setFromMatrixPosition(s.parent.matrixWorld)), t.search("X") !== -1 && (s.position.x = Math.round(s.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (s.position.y = Math.round(s.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (s.position.z = Math.round(s.position.z / this.translationSnap) * this.translationSnap), s.parent && s.position.sub(he.setFromMatrixPosition(s.parent.matrixWorld)))), s.position.x = Math.max(this.minX, Math.min(this.maxX, s.position.x)), s.position.y = Math.max(this.minY, Math.min(this.maxY, s.position.y)), s.position.z = Math.max(this.minZ, Math.min(this.maxZ, s.position.z));
|
|
588
588
|
else if (n === "scale") {
|
|
589
589
|
if (t.search("XYZ") !== -1) {
|
|
590
590
|
let a = this.pointEnd.length() / this.pointStart.length();
|
|
591
591
|
this.pointEnd.dot(this.pointStart) < 0 && (a *= -1), Ue.set(a, a, a);
|
|
592
592
|
} else
|
|
593
|
-
|
|
593
|
+
he.copy(this.pointStart), Ue.copy(this.pointEnd), he.applyQuaternion(this._worldQuaternionInv), Ue.applyQuaternion(this._worldQuaternionInv), Ue.divide(he), t.search("X") === -1 && (Ue.x = 1), t.search("Y") === -1 && (Ue.y = 1), t.search("Z") === -1 && (Ue.z = 1);
|
|
594
594
|
s.scale.copy(this._scaleStart).multiply(Ue), this.scaleSnap && (t.search("X") !== -1 && (s.scale.x = Math.round(s.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (s.scale.y = Math.round(s.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (s.scale.z = Math.round(s.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
|
|
595
595
|
} else if (n === "rotate") {
|
|
596
596
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
|
597
|
-
const a = 20 / this.worldPosition.distanceTo(
|
|
597
|
+
const a = 20 / this.worldPosition.distanceTo(he.setFromMatrixPosition(this.camera.matrixWorld));
|
|
598
598
|
let l = !1;
|
|
599
|
-
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(
|
|
599
|
+
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(he.copy(this.rotationAxis).cross(this.eye)) * a) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(Zs[t]), he.copy(Zs[t]), i === "local" && he.applyQuaternion(this.worldQuaternion), he.cross(this.eye), he.length() === 0 ? l = !0 : this.rotationAngle = this._offset.dot(he.normalize()) * a), (t === "E" || l) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), i === "local" && t !== "E" && t !== "XYZE" ? (s.quaternion.copy(this._quaternionStart), s.quaternion.multiply(se.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), s.quaternion.copy(se.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), s.quaternion.multiply(this._quaternionStart).normalize());
|
|
600
600
|
}
|
|
601
601
|
this.dispatchEvent(cs), this.dispatchEvent(_s);
|
|
602
602
|
}
|
|
@@ -749,7 +749,7 @@ function us(r, e, t) {
|
|
|
749
749
|
return n[s];
|
|
750
750
|
return !1;
|
|
751
751
|
}
|
|
752
|
-
const Ht = new Pi(),
|
|
752
|
+
const Ht = new Pi(), $ = new R(0, 1, 0), $s = new R(0, 0, 0), en = new xe(), kt = new pe(), qt = new pe(), De = new R(), tn = new xe(), gt = new R(1, 0, 0), Ke = new R(0, 1, 0), yt = new R(0, 0, 1), jt = new R(), ft = new R(), pt = new R();
|
|
753
753
|
class Ro extends dt {
|
|
754
754
|
constructor(e) {
|
|
755
755
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
@@ -800,14 +800,14 @@ class Oo extends dt {
|
|
|
800
800
|
u.opacity = 0.25;
|
|
801
801
|
const m = e.clone();
|
|
802
802
|
m.color.setHex(16776960), m.opacity = 0.25;
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
-
const
|
|
806
|
-
|
|
803
|
+
const A = e.clone();
|
|
804
|
+
A.color.setHex(16776960);
|
|
805
|
+
const g = e.clone();
|
|
806
|
+
g.color.setHex(7895160), this.materialLib = {
|
|
807
807
|
xAxis: i,
|
|
808
808
|
yAxis: o,
|
|
809
809
|
zAxis: a,
|
|
810
|
-
active:
|
|
810
|
+
active: A,
|
|
811
811
|
xAxisTransparent: l,
|
|
812
812
|
yAxisTransparent: c,
|
|
813
813
|
zAxisTransparent: d,
|
|
@@ -815,19 +815,19 @@ class Oo extends dt {
|
|
|
815
815
|
};
|
|
816
816
|
const h = new me(0, 0.04, 0.1, 12);
|
|
817
817
|
h.translate(0, 0.05, 0);
|
|
818
|
-
const
|
|
819
|
-
|
|
820
|
-
const
|
|
821
|
-
|
|
818
|
+
const p = new fe(0.08, 0.08, 0.08);
|
|
819
|
+
p.translate(0, 0.04, 0);
|
|
820
|
+
const y = new $e();
|
|
821
|
+
y.setAttribute("position", new Re([0, 0, 0, 1, 0, 0], 3));
|
|
822
822
|
const M = new me(75e-4, 75e-4, 0.5, 3);
|
|
823
823
|
M.translate(0, 0.25, 0);
|
|
824
|
-
function C(k,
|
|
825
|
-
const te = new ht(k, 75e-4, 3, 64,
|
|
824
|
+
function C(k, ee) {
|
|
825
|
+
const te = new ht(k, 75e-4, 3, 64, ee * Math.PI * 2);
|
|
826
826
|
return te.rotateY(Math.PI / 2), te.rotateX(Math.PI / 2), te;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function f() {
|
|
829
829
|
const k = new $e();
|
|
830
|
-
return k.setAttribute("position", new
|
|
830
|
+
return k.setAttribute("position", new Re([0, 0, 0, 1, 1, 1], 3)), k;
|
|
831
831
|
}
|
|
832
832
|
const w = {
|
|
833
833
|
X: [
|
|
@@ -857,7 +857,7 @@ class Oo extends dt {
|
|
|
857
857
|
XZ: [
|
|
858
858
|
[new S(new fe(0.15, 0.15, 0.01), c), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
859
859
|
]
|
|
860
|
-
},
|
|
860
|
+
}, E = {
|
|
861
861
|
X: [
|
|
862
862
|
[new S(new me(0.2, 0, 0.6, 4), n), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
|
863
863
|
[new S(new me(0.2, 0, 0.6, 4), n), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
|
@@ -882,7 +882,7 @@ class Oo extends dt {
|
|
|
882
882
|
XZ: [
|
|
883
883
|
[new S(new fe(0.2, 0.2, 0.01), n), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
884
884
|
]
|
|
885
|
-
},
|
|
885
|
+
}, D = {
|
|
886
886
|
START: [
|
|
887
887
|
[new S(new Lt(0.01, 2), s), null, null, null, "helper"]
|
|
888
888
|
],
|
|
@@ -890,20 +890,20 @@ class Oo extends dt {
|
|
|
890
890
|
[new S(new Lt(0.01, 2), s), null, null, null, "helper"]
|
|
891
891
|
],
|
|
892
892
|
DELTA: [
|
|
893
|
-
[new
|
|
893
|
+
[new He(f(), s), null, null, null, "helper"]
|
|
894
894
|
],
|
|
895
895
|
X: [
|
|
896
|
-
[new
|
|
896
|
+
[new He(y, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
897
897
|
],
|
|
898
898
|
Y: [
|
|
899
|
-
[new
|
|
899
|
+
[new He(y, s), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
|
|
900
900
|
],
|
|
901
901
|
Z: [
|
|
902
|
-
[new
|
|
902
|
+
[new He(y, s), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
|
903
903
|
]
|
|
904
|
-
},
|
|
904
|
+
}, j = {
|
|
905
905
|
XYZE: [
|
|
906
|
-
[new S(C(0.5, 1),
|
|
906
|
+
[new S(C(0.5, 1), g), null, [0, Math.PI / 2, 0]]
|
|
907
907
|
],
|
|
908
908
|
X: [
|
|
909
909
|
[new S(C(0.5, 0.5), i)]
|
|
@@ -917,11 +917,11 @@ class Oo extends dt {
|
|
|
917
917
|
E: [
|
|
918
918
|
[new S(C(0.75, 1), m), null, [0, Math.PI / 2, 0]]
|
|
919
919
|
]
|
|
920
|
-
},
|
|
920
|
+
}, Z = {
|
|
921
921
|
AXIS: [
|
|
922
|
-
[new
|
|
922
|
+
[new He(y, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
923
923
|
]
|
|
924
|
-
},
|
|
924
|
+
}, N = {
|
|
925
925
|
XYZE: [
|
|
926
926
|
[new S(new Di(0.25, 10, 8), n)]
|
|
927
927
|
],
|
|
@@ -937,21 +937,21 @@ class Oo extends dt {
|
|
|
937
937
|
E: [
|
|
938
938
|
[new S(new ht(0.75, 0.1, 2, 24), n)]
|
|
939
939
|
]
|
|
940
|
-
},
|
|
940
|
+
}, z = {
|
|
941
941
|
X: [
|
|
942
|
-
[new S(
|
|
942
|
+
[new S(p, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
943
943
|
[new S(M, i), [0, 0, 0], [0, 0, -Math.PI / 2]],
|
|
944
|
-
[new S(
|
|
944
|
+
[new S(p, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
|
|
945
945
|
],
|
|
946
946
|
Y: [
|
|
947
|
-
[new S(
|
|
947
|
+
[new S(p, o), [0, 0.5, 0]],
|
|
948
948
|
[new S(M, o)],
|
|
949
|
-
[new S(
|
|
949
|
+
[new S(p, o), [0, -0.5, 0], [0, 0, Math.PI]]
|
|
950
950
|
],
|
|
951
951
|
Z: [
|
|
952
|
-
[new S(
|
|
952
|
+
[new S(p, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
953
953
|
[new S(M, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
|
|
954
|
-
[new S(
|
|
954
|
+
[new S(p, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
|
|
955
955
|
],
|
|
956
956
|
XY: [
|
|
957
957
|
[new S(new fe(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
|
|
@@ -965,7 +965,7 @@ class Oo extends dt {
|
|
|
965
965
|
XYZ: [
|
|
966
966
|
[new S(new fe(0.1, 0.1, 0.1), u)]
|
|
967
967
|
]
|
|
968
|
-
},
|
|
968
|
+
}, q = {
|
|
969
969
|
X: [
|
|
970
970
|
[new S(new me(0.2, 0, 0.6, 4), n), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
|
971
971
|
[new S(new me(0.2, 0, 0.6, 4), n), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
|
@@ -990,29 +990,29 @@ class Oo extends dt {
|
|
|
990
990
|
XYZ: [
|
|
991
991
|
[new S(new fe(0.2, 0.2, 0.2), n), [0, 0, 0]]
|
|
992
992
|
]
|
|
993
|
-
},
|
|
993
|
+
}, ne = {
|
|
994
994
|
X: [
|
|
995
|
-
[new
|
|
995
|
+
[new He(y, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
996
996
|
],
|
|
997
997
|
Y: [
|
|
998
|
-
[new
|
|
998
|
+
[new He(y, s), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
|
|
999
999
|
],
|
|
1000
1000
|
Z: [
|
|
1001
|
-
[new
|
|
1001
|
+
[new He(y, s), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
|
1002
1002
|
]
|
|
1003
1003
|
};
|
|
1004
|
-
function
|
|
1005
|
-
const
|
|
1004
|
+
function _(k) {
|
|
1005
|
+
const ee = new dt();
|
|
1006
1006
|
for (const te in k)
|
|
1007
|
-
for (let
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1010
|
-
const Fe =
|
|
1011
|
-
Fe.applyMatrix4(
|
|
1007
|
+
for (let ue = k[te].length; ue--; ) {
|
|
1008
|
+
const Q = k[te][ue][0].clone(), Te = k[te][ue][1], Ee = k[te][ue][2], je = k[te][ue][3], nt = k[te][ue][4];
|
|
1009
|
+
Q.name = te, Q.tag = nt, Te && Q.position.set(Te[0], Te[1], Te[2]), Ee && Q.rotation.set(Ee[0], Ee[1], Ee[2]), je && Q.scale.set(je[0], je[1], je[2]), Q.updateMatrix();
|
|
1010
|
+
const Fe = Q.geometry.clone();
|
|
1011
|
+
Fe.applyMatrix4(Q.matrix), Q.geometry = Fe, Q.renderOrder = 1 / 0, Q.position.set(0, 0, 0), Q.rotation.set(0, 0, 0), Q.scale.set(1, 1, 1), ee.add(Q);
|
|
1012
1012
|
}
|
|
1013
|
-
return
|
|
1013
|
+
return ee;
|
|
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 = _(w)), this.add(this.gizmo.rotate = _(j)), this.add(this.gizmo.scale = _(z)), this.add(this.picker.translate = _(E)), this.add(this.picker.rotate = _(N)), this.add(this.picker.scale = _(q)), this.add(this.helper.translate = _(D)), this.add(this.helper.rotate = _(Z)), this.add(this.helper.scale = _(ne)), 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) {
|
|
@@ -1025,10 +1025,10 @@ class Oo extends dt {
|
|
|
1025
1025
|
o.visible = !0, o.rotation.set(0, 0, 0), o.position.copy(this.worldPosition);
|
|
1026
1026
|
let a;
|
|
1027
1027
|
if (this.camera.isOrthographicCamera ? a = (this.camera.top - this.camera.bottom) / this.camera.zoom : a = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), o.scale.set(1, 1, 1).multiplyScalar(a * this.size / 4), o.tag === "helper") {
|
|
1028
|
-
o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (se.setFromEuler(Ht.set(0, 0, 0)), o.quaternion.copy(n).multiply(se), Math.abs(
|
|
1028
|
+
o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (se.setFromEuler(Ht.set(0, 0, 0)), o.quaternion.copy(n).multiply(se), Math.abs($.copy(gt).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (se.setFromEuler(Ht.set(0, 0, Math.PI / 2)), o.quaternion.copy(n).multiply(se), Math.abs($.copy(Ke).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (se.setFromEuler(Ht.set(0, Math.PI / 2, 0)), o.quaternion.copy(n).multiply(se), Math.abs($.copy(yt).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (se.setFromEuler(Ht.set(0, Math.PI / 2, 0)), $.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(en.lookAt($s, $, Ke)), o.quaternion.multiply(se), o.visible = this.dragging), this.axis === "E" && (o.visible = !1)) : o.name === "START" ? (o.position.copy(this.worldPositionStart), o.visible = this.dragging) : o.name === "END" ? (o.position.copy(this.worldPosition), o.visible = this.dragging) : o.name === "DELTA" ? (o.position.copy(this.worldPositionStart), o.quaternion.copy(this.worldQuaternionStart), he.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), he.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(he), o.visible = this.dragging) : (o.quaternion.copy(n), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
|
|
1029
1029
|
continue;
|
|
1030
1030
|
}
|
|
1031
|
-
o.quaternion.copy(n), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(
|
|
1031
|
+
o.quaternion.copy(n), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs($.copy(gt).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs($.copy(Ke).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs($.copy(yt).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs($.copy(yt).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs($.copy(gt).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs($.copy(Ke).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (kt.copy(n), $.copy(this.eye).applyQuaternion(se.copy(n).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(en.lookAt(this.eye, $s, Ke)), o.name === "X" && (se.setFromAxisAngle(gt, Math.atan2(-$.y, $.z)), se.multiplyQuaternions(kt, se), o.quaternion.copy(se)), o.name === "Y" && (se.setFromAxisAngle(Ke, Math.atan2($.x, $.z)), se.multiplyQuaternions(kt, se), o.quaternion.copy(se)), o.name === "Z" && (se.setFromAxisAngle(yt, Math.atan2($.y, $.x)), se.multiplyQuaternions(kt, se), o.quaternion.copy(se))), o.visible = o.visible && (o.name.indexOf("X") === -1 || this.showX), o.visible = o.visible && (o.name.indexOf("Y") === -1 || this.showY), o.visible = o.visible && (o.name.indexOf("Z") === -1 || this.showZ), o.visible = o.visible && (o.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), o.visible = o.visible && (o.name.indexOf("XY") === -1 || this.showXY), o.visible = o.visible && (o.name.indexOf("YZ") === -1 || this.showYZ), o.visible = o.visible && (o.name.indexOf("XZ") === -1 || this.showXZ), o.material._color = o.material._color || o.material.color.clone(), o.material._opacity = o.material._opacity || o.material.opacity, o.material.color.copy(o.material._color), o.material.opacity = o.material._opacity, this.enabled && this.axis && (o.name === this.axis ? (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1) : this.axis.split("").some(function(l) {
|
|
1032
1032
|
return o.name === l;
|
|
1033
1033
|
}) && (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1));
|
|
1034
1034
|
}
|
|
@@ -1044,39 +1044,39 @@ class So extends S {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
updateMatrixWorld(e) {
|
|
1046
1046
|
let t = this.space;
|
|
1047
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), jt.copy(gt).applyQuaternion(t === "local" ? this.worldQuaternion : qt), ft.copy(Ke).applyQuaternion(t === "local" ? this.worldQuaternion : qt), pt.copy(yt).applyQuaternion(t === "local" ? this.worldQuaternion : qt),
|
|
1047
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), jt.copy(gt).applyQuaternion(t === "local" ? this.worldQuaternion : qt), ft.copy(Ke).applyQuaternion(t === "local" ? this.worldQuaternion : qt), pt.copy(yt).applyQuaternion(t === "local" ? this.worldQuaternion : qt), $.copy(ft), this.mode) {
|
|
1048
1048
|
case "translate":
|
|
1049
1049
|
case "scale":
|
|
1050
1050
|
switch (this.axis) {
|
|
1051
1051
|
case "X":
|
|
1052
|
-
|
|
1052
|
+
$.copy(this.eye).cross(jt), De.copy(jt).cross($);
|
|
1053
1053
|
break;
|
|
1054
1054
|
case "Y":
|
|
1055
|
-
|
|
1055
|
+
$.copy(this.eye).cross(ft), De.copy(ft).cross($);
|
|
1056
1056
|
break;
|
|
1057
1057
|
case "Z":
|
|
1058
|
-
|
|
1058
|
+
$.copy(this.eye).cross(pt), De.copy(pt).cross($);
|
|
1059
1059
|
break;
|
|
1060
1060
|
case "XY":
|
|
1061
|
-
|
|
1061
|
+
De.copy(pt);
|
|
1062
1062
|
break;
|
|
1063
1063
|
case "YZ":
|
|
1064
|
-
|
|
1064
|
+
De.copy(jt);
|
|
1065
1065
|
break;
|
|
1066
1066
|
case "XZ":
|
|
1067
|
-
|
|
1067
|
+
$.copy(pt), De.copy(ft);
|
|
1068
1068
|
break;
|
|
1069
1069
|
case "XYZ":
|
|
1070
1070
|
case "E":
|
|
1071
|
-
|
|
1071
|
+
De.set(0, 0, 0);
|
|
1072
1072
|
break;
|
|
1073
1073
|
}
|
|
1074
1074
|
break;
|
|
1075
1075
|
case "rotate":
|
|
1076
1076
|
default:
|
|
1077
|
-
|
|
1077
|
+
De.set(0, 0, 0);
|
|
1078
1078
|
}
|
|
1079
|
-
|
|
1079
|
+
De.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (tn.lookAt(he.set(0, 0, 0), De, $), this.quaternion.setFromRotationMatrix(tn)), super.updateMatrixWorld(e);
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
1082
|
const Lo = {
|
|
@@ -1160,7 +1160,7 @@ class Ot {
|
|
|
1160
1160
|
const No = new vn(-1, 1, 1, -1, 0, 1);
|
|
1161
1161
|
class Ho extends $e {
|
|
1162
1162
|
constructor() {
|
|
1163
|
-
super(), this.setAttribute("position", new
|
|
1163
|
+
super(), this.setAttribute("position", new Re([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)), this.setAttribute("uv", new Re([0, 2, 0, 0, 2, 0], 2));
|
|
1164
1164
|
}
|
|
1165
1165
|
}
|
|
1166
1166
|
const ko = new Ho();
|
|
@@ -1301,7 +1301,7 @@ class Uo {
|
|
|
1301
1301
|
*/
|
|
1302
1302
|
constructor(e, t) {
|
|
1303
1303
|
if (this.renderer = e, this._pixelRatio = e.getPixelRatio(), t === void 0) {
|
|
1304
|
-
const n = e.getSize(new
|
|
1304
|
+
const n = e.getSize(new le());
|
|
1305
1305
|
this._width = n.width, this._height = n.height, t = new Tn(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: En }), t.texture.name = "EffectComposer.rt1";
|
|
1306
1306
|
} else
|
|
1307
1307
|
this._width = t.width, this._height = t.height;
|
|
@@ -1385,7 +1385,7 @@ class Uo {
|
|
|
1385
1385
|
*/
|
|
1386
1386
|
reset(e) {
|
|
1387
1387
|
if (e === void 0) {
|
|
1388
|
-
const t = this.renderer.getSize(new
|
|
1388
|
+
const t = this.renderer.getSize(new le());
|
|
1389
1389
|
this._pixelRatio = this.renderer.getPixelRatio(), this._width = t.width, this._height = t.height, e = this.renderTarget1.clone(), e.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
1390
1390
|
}
|
|
1391
1391
|
this.renderTarget1.dispose(), this.renderTarget2.dispose(), this.renderTarget1 = e, this.renderTarget2 = e.clone(), this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2;
|
|
@@ -1433,7 +1433,7 @@ class zo extends Ot {
|
|
|
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 re();
|
|
1437
1437
|
}
|
|
1438
1438
|
/**
|
|
1439
1439
|
* Performs a beauty pass with the configured scene and camera.
|
|
@@ -1580,7 +1580,7 @@ class Wo extends dt {
|
|
|
1580
1580
|
* @param {HTMLElement} [element] - The DOM element.
|
|
1581
1581
|
*/
|
|
1582
1582
|
constructor(e = document.createElement("div")) {
|
|
1583
|
-
super(), this.isCSS2DObject = !0, this.element = e, this.element.style.position = "absolute", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.center = new
|
|
1583
|
+
super(), this.isCSS2DObject = !0, this.element = e, this.element.style.position = "absolute", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.center = new le(0.5, 0.5), this.addEventListener("removed", function() {
|
|
1584
1584
|
this.traverse(function(t) {
|
|
1585
1585
|
t.element && t.element instanceof t.element.ownerDocument.defaultView.Element && t.element.parentNode !== null && t.element.remove();
|
|
1586
1586
|
});
|
|
@@ -1608,51 +1608,51 @@ class Bo {
|
|
|
1608
1608
|
width: n,
|
|
1609
1609
|
height: s
|
|
1610
1610
|
};
|
|
1611
|
-
}, this.render = function(
|
|
1612
|
-
|
|
1613
|
-
}, this.setSize = function(
|
|
1614
|
-
n =
|
|
1611
|
+
}, this.render = function(g, h) {
|
|
1612
|
+
g.matrixWorldAutoUpdate === !0 && g.updateMatrixWorld(), h.parent === null && h.matrixWorldAutoUpdate === !0 && h.updateMatrixWorld(), nn.copy(h.matrixWorldInverse), on.multiplyMatrices(h.projectionMatrix, nn), d(g, g, h), this.sortObjects && A(g);
|
|
1613
|
+
}, this.setSize = function(g, h) {
|
|
1614
|
+
n = g, s = h, i = n / 2, o = s / 2, l.style.width = g + "px", l.style.height = h + "px";
|
|
1615
1615
|
};
|
|
1616
|
-
function c(
|
|
1617
|
-
|
|
1618
|
-
for (let h = 0,
|
|
1619
|
-
c(
|
|
1620
|
-
}
|
|
1621
|
-
function d(
|
|
1622
|
-
if (
|
|
1623
|
-
c(
|
|
1616
|
+
function c(g) {
|
|
1617
|
+
g.isCSS2DObject && (g.element.style.display = "none");
|
|
1618
|
+
for (let h = 0, p = g.children.length; h < p; h++)
|
|
1619
|
+
c(g.children[h]);
|
|
1620
|
+
}
|
|
1621
|
+
function d(g, h, p) {
|
|
1622
|
+
if (g.visible === !1) {
|
|
1623
|
+
c(g);
|
|
1624
1624
|
return;
|
|
1625
1625
|
}
|
|
1626
|
-
if (
|
|
1627
|
-
it.setFromMatrixPosition(
|
|
1628
|
-
const
|
|
1629
|
-
M.style.display =
|
|
1626
|
+
if (g.isCSS2DObject) {
|
|
1627
|
+
it.setFromMatrixPosition(g.matrixWorld), it.applyMatrix4(on);
|
|
1628
|
+
const y = it.z >= -1 && it.z <= 1 && g.layers.test(p.layers) === !0, M = g.element;
|
|
1629
|
+
M.style.display = y === !0 ? "" : "none", y === !0 && (g.onBeforeRender(t, h, p), M.style.transform = "translate(" + -100 * g.center.x + "%," + -100 * g.center.y + "%)translate(" + (it.x * i + i) + "px," + (-it.y * o + o) + "px)", M.parentNode !== l && l.appendChild(M), g.onAfterRender(t, h, p));
|
|
1630
1630
|
const C = {
|
|
1631
|
-
distanceToCameraSquared: u(
|
|
1631
|
+
distanceToCameraSquared: u(p, g)
|
|
1632
1632
|
};
|
|
1633
|
-
a.objects.set(
|
|
1633
|
+
a.objects.set(g, C);
|
|
1634
1634
|
}
|
|
1635
|
-
for (let
|
|
1636
|
-
d(
|
|
1635
|
+
for (let y = 0, M = g.children.length; y < M; y++)
|
|
1636
|
+
d(g.children[y], h, p);
|
|
1637
1637
|
}
|
|
1638
|
-
function u(
|
|
1639
|
-
return rn.setFromMatrixPosition(
|
|
1638
|
+
function u(g, h) {
|
|
1639
|
+
return rn.setFromMatrixPosition(g.matrixWorld), an.setFromMatrixPosition(h.matrixWorld), rn.distanceToSquared(an);
|
|
1640
1640
|
}
|
|
1641
|
-
function m(
|
|
1641
|
+
function m(g) {
|
|
1642
1642
|
const h = [];
|
|
1643
|
-
return
|
|
1644
|
-
|
|
1643
|
+
return g.traverseVisible(function(p) {
|
|
1644
|
+
p.isCSS2DObject && h.push(p);
|
|
1645
1645
|
}), h;
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1648
|
-
const h = m(
|
|
1649
|
-
if (
|
|
1650
|
-
return M.renderOrder -
|
|
1651
|
-
const C = a.objects.get(
|
|
1652
|
-
return C -
|
|
1653
|
-
}),
|
|
1654
|
-
for (let
|
|
1655
|
-
h[
|
|
1647
|
+
function A(g) {
|
|
1648
|
+
const h = m(g).sort(function(y, M) {
|
|
1649
|
+
if (y.renderOrder !== M.renderOrder)
|
|
1650
|
+
return M.renderOrder - y.renderOrder;
|
|
1651
|
+
const C = a.objects.get(y).distanceToCameraSquared, f = a.objects.get(M).distanceToCameraSquared;
|
|
1652
|
+
return C - f;
|
|
1653
|
+
}), p = h.length;
|
|
1654
|
+
for (let y = 0, M = h.length; y < M; y++)
|
|
1655
|
+
h[y].element.style.zIndex = p - y;
|
|
1656
1656
|
}
|
|
1657
1657
|
}
|
|
1658
1658
|
}
|
|
@@ -1924,21 +1924,21 @@ function Bn(r) {
|
|
|
1924
1924
|
const e = ss(r), t = $t.get(e);
|
|
1925
1925
|
t && (t.dispose(), $t.delete(e)), e.userData._hasDataPanel = void 0;
|
|
1926
1926
|
}
|
|
1927
|
-
let
|
|
1927
|
+
let ie = null;
|
|
1928
1928
|
function _o(r) {
|
|
1929
|
-
return
|
|
1929
|
+
return ie ? (ie.domElement.parentNode !== r && r.appendChild(ie.domElement), ie) : (ie = new Bo(), ie.setSize(r.clientWidth, r.clientHeight), ie.domElement.style.position = "absolute", ie.domElement.style.top = "0", ie.domElement.style.left = "0", ie.domElement.style.pointerEvents = "none", r.appendChild(ie.domElement), ie);
|
|
1930
1930
|
}
|
|
1931
1931
|
function hu() {
|
|
1932
|
-
return
|
|
1932
|
+
return ie;
|
|
1933
1933
|
}
|
|
1934
1934
|
function $o(r, e) {
|
|
1935
|
-
|
|
1935
|
+
ie && ie.render(r, e);
|
|
1936
1936
|
}
|
|
1937
1937
|
function er(r, e) {
|
|
1938
|
-
|
|
1938
|
+
ie && ie.setSize(r, e);
|
|
1939
1939
|
}
|
|
1940
1940
|
function tr() {
|
|
1941
|
-
|
|
1941
|
+
ie && (ie.domElement.parentNode && ie.domElement.parentNode.removeChild(ie.domElement), ie = null);
|
|
1942
1942
|
}
|
|
1943
1943
|
function sr() {
|
|
1944
1944
|
const r = new P.Scene();
|
|
@@ -1966,10 +1966,10 @@ function sr() {
|
|
|
1966
1966
|
u.position.set(14.904, 12.198, -1.832), u.scale.set(0.15, 4.265, 6.331), r.add(u);
|
|
1967
1967
|
const m = new P.Mesh(e, l(43));
|
|
1968
1968
|
m.position.set(-0.462, 8.89, 14.52), m.scale.set(4.38, 5.441, 0.088), r.add(m);
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1971
|
-
const
|
|
1972
|
-
return
|
|
1969
|
+
const A = new P.Mesh(e, l(20));
|
|
1970
|
+
A.position.set(3.235, 11.486, -12.541), A.scale.set(2.5, 2, 0.1), r.add(A);
|
|
1971
|
+
const g = new P.Mesh(e, l(100));
|
|
1972
|
+
return g.position.set(0, 20, 0), g.scale.set(1, 0.1, 1), r.add(g), r;
|
|
1973
1973
|
}
|
|
1974
1974
|
function Ms(r) {
|
|
1975
1975
|
try {
|
|
@@ -2108,7 +2108,7 @@ class wt {
|
|
|
2108
2108
|
});
|
|
2109
2109
|
}
|
|
2110
2110
|
}
|
|
2111
|
-
const
|
|
2111
|
+
const X = {
|
|
2112
2112
|
POINTS: 0,
|
|
2113
2113
|
LINES: 1,
|
|
2114
2114
|
LINE_LOOP: 2,
|
|
@@ -2133,22 +2133,22 @@ const W = {
|
|
|
2133
2133
|
MIRRORED_REPEAT: 33648,
|
|
2134
2134
|
REPEAT: 10497
|
|
2135
2135
|
}, ds = "KHR_mesh_quantization", be = {};
|
|
2136
|
-
be[Rs] =
|
|
2137
|
-
be[Pn] =
|
|
2138
|
-
be[Rn] =
|
|
2139
|
-
be[Jt] =
|
|
2140
|
-
be[On] =
|
|
2141
|
-
be[Os] =
|
|
2142
|
-
be[Sn] =
|
|
2143
|
-
be[Je] =
|
|
2144
|
-
be[Ln] =
|
|
2136
|
+
be[Rs] = X.NEAREST;
|
|
2137
|
+
be[Pn] = X.NEAREST_MIPMAP_NEAREST;
|
|
2138
|
+
be[Rn] = X.NEAREST_MIPMAP_LINEAR;
|
|
2139
|
+
be[Jt] = X.LINEAR;
|
|
2140
|
+
be[On] = X.LINEAR_MIPMAP_NEAREST;
|
|
2141
|
+
be[Os] = X.LINEAR_MIPMAP_LINEAR;
|
|
2142
|
+
be[Sn] = X.CLAMP_TO_EDGE;
|
|
2143
|
+
be[Je] = X.REPEAT;
|
|
2144
|
+
be[Ln] = X.MIRRORED_REPEAT;
|
|
2145
2145
|
const cn = {
|
|
2146
2146
|
scale: "scale",
|
|
2147
2147
|
position: "translation",
|
|
2148
2148
|
quaternion: "rotation",
|
|
2149
2149
|
morphTargetInfluences: "weights"
|
|
2150
|
-
}, nr = new
|
|
2151
|
-
function
|
|
2150
|
+
}, nr = new re(), un = 12, ir = 1179937895, or = 2, dn = 8, rr = 1313821514, ar = 5130562;
|
|
2151
|
+
function ke(r, e) {
|
|
2152
2152
|
return r.length === e.length && r.every(function(t, n) {
|
|
2153
2153
|
return t === e[n];
|
|
2154
2154
|
});
|
|
@@ -2157,7 +2157,7 @@ function lr(r) {
|
|
|
2157
2157
|
return new TextEncoder().encode(r).buffer;
|
|
2158
2158
|
}
|
|
2159
2159
|
function cr(r) {
|
|
2160
|
-
return
|
|
2160
|
+
return ke(r.elements, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
2161
2161
|
}
|
|
2162
2162
|
function ur(r, e, t) {
|
|
2163
2163
|
const n = {
|
|
@@ -2243,30 +2243,30 @@ class hr {
|
|
|
2243
2243
|
if (d.length > 0 && (o.extensionsUsed = d), u.length > 0 && (o.extensionsRequired = u), o.buffers && o.buffers.length > 0 && (o.buffers[0].byteLength = c.size), n.binary === !0) {
|
|
2244
2244
|
const m = new FileReader();
|
|
2245
2245
|
m.readAsArrayBuffer(c), m.onloadend = function() {
|
|
2246
|
-
const
|
|
2247
|
-
|
|
2248
|
-
const h = hs(lr(JSON.stringify(o)), 32),
|
|
2249
|
-
|
|
2250
|
-
const
|
|
2246
|
+
const A = hs(m.result), g = new DataView(new ArrayBuffer(dn));
|
|
2247
|
+
g.setUint32(0, A.byteLength, !0), g.setUint32(4, ar, !0);
|
|
2248
|
+
const h = hs(lr(JSON.stringify(o)), 32), p = new DataView(new ArrayBuffer(dn));
|
|
2249
|
+
p.setUint32(0, h.byteLength, !0), p.setUint32(4, rr, !0);
|
|
2250
|
+
const y = new ArrayBuffer(un), M = new DataView(y);
|
|
2251
2251
|
M.setUint32(0, ir, !0), M.setUint32(4, or, !0);
|
|
2252
|
-
const C = un +
|
|
2252
|
+
const C = un + p.byteLength + h.byteLength + g.byteLength + A.byteLength;
|
|
2253
2253
|
M.setUint32(8, C, !0);
|
|
2254
|
-
const
|
|
2255
|
-
f,
|
|
2256
|
-
A,
|
|
2257
|
-
h,
|
|
2254
|
+
const f = new Blob([
|
|
2258
2255
|
y,
|
|
2259
|
-
p
|
|
2256
|
+
p,
|
|
2257
|
+
h,
|
|
2258
|
+
g,
|
|
2259
|
+
A
|
|
2260
2260
|
], { type: "application/octet-stream" }), w = new FileReader();
|
|
2261
|
-
w.readAsArrayBuffer(
|
|
2261
|
+
w.readAsArrayBuffer(f), w.onloadend = function() {
|
|
2262
2262
|
t(w.result);
|
|
2263
2263
|
};
|
|
2264
2264
|
};
|
|
2265
2265
|
} else if (o.buffers && o.buffers.length > 0) {
|
|
2266
2266
|
const m = new FileReader();
|
|
2267
2267
|
m.readAsDataURL(c), m.onloadend = function() {
|
|
2268
|
-
const
|
|
2269
|
-
o.buffers[0].uri =
|
|
2268
|
+
const A = m.result;
|
|
2269
|
+
o.buffers[0].uri = A, t(o);
|
|
2270
2270
|
};
|
|
2271
2271
|
} else
|
|
2272
2272
|
t(o);
|
|
@@ -2349,8 +2349,8 @@ class hr {
|
|
|
2349
2349
|
}
|
|
2350
2350
|
async buildMetalRoughTextureAsync(e, t) {
|
|
2351
2351
|
if (e === t) return e;
|
|
2352
|
-
function n(
|
|
2353
|
-
return
|
|
2352
|
+
function n(A) {
|
|
2353
|
+
return A.colorSpace === Se ? function(h) {
|
|
2354
2354
|
return h < 0.04045 ? h * 0.0773993808 : Math.pow(h * 0.9478672986 + 0.0521327014, 2.4);
|
|
2355
2355
|
} : function(h) {
|
|
2356
2356
|
return h;
|
|
@@ -2366,15 +2366,15 @@ class hr {
|
|
|
2366
2366
|
const d = c.getImageData(0, 0, o, a);
|
|
2367
2367
|
if (s) {
|
|
2368
2368
|
c.drawImage(s, 0, 0, o, a);
|
|
2369
|
-
const
|
|
2370
|
-
for (let h = 2; h <
|
|
2371
|
-
d.data[h] =
|
|
2369
|
+
const A = n(e), g = c.getImageData(0, 0, o, a).data;
|
|
2370
|
+
for (let h = 2; h < g.length; h += 4)
|
|
2371
|
+
d.data[h] = A(g[h] / 256) * 256;
|
|
2372
2372
|
}
|
|
2373
2373
|
if (i) {
|
|
2374
2374
|
c.drawImage(i, 0, 0, o, a);
|
|
2375
|
-
const
|
|
2376
|
-
for (let h = 1; h <
|
|
2377
|
-
d.data[h] =
|
|
2375
|
+
const A = n(t), g = c.getImageData(0, 0, o, a).data;
|
|
2376
|
+
for (let h = 1; h < g.length; h += 4)
|
|
2377
|
+
d.data[h] = A(g[h] / 256) * 256;
|
|
2378
2378
|
}
|
|
2379
2379
|
c.putImageData(d, 0, 0);
|
|
2380
2380
|
const m = (e || t).clone();
|
|
@@ -2408,25 +2408,25 @@ class hr {
|
|
|
2408
2408
|
o.bufferViews || (o.bufferViews = []);
|
|
2409
2409
|
let a;
|
|
2410
2410
|
switch (t) {
|
|
2411
|
-
case
|
|
2412
|
-
case
|
|
2411
|
+
case X.BYTE:
|
|
2412
|
+
case X.UNSIGNED_BYTE:
|
|
2413
2413
|
a = 1;
|
|
2414
2414
|
break;
|
|
2415
|
-
case
|
|
2416
|
-
case
|
|
2415
|
+
case X.SHORT:
|
|
2416
|
+
case X.UNSIGNED_SHORT:
|
|
2417
2417
|
a = 2;
|
|
2418
2418
|
break;
|
|
2419
2419
|
default:
|
|
2420
2420
|
a = 4;
|
|
2421
2421
|
}
|
|
2422
2422
|
let l = e.itemSize * a;
|
|
2423
|
-
i ===
|
|
2423
|
+
i === X.ARRAY_BUFFER && (l = Math.ceil(l / 4) * 4);
|
|
2424
2424
|
const c = Xn(s * l), d = new DataView(new ArrayBuffer(c));
|
|
2425
2425
|
let u = 0;
|
|
2426
|
-
for (let
|
|
2426
|
+
for (let g = n; g < n + s; g++) {
|
|
2427
2427
|
for (let h = 0; h < e.itemSize; h++) {
|
|
2428
|
-
let
|
|
2429
|
-
e.itemSize > 4 ?
|
|
2428
|
+
let p;
|
|
2429
|
+
e.itemSize > 4 ? p = e.array[g * e.itemSize + h] : (h === 0 ? p = e.getX(g) : h === 1 ? p = e.getY(g) : h === 2 ? p = e.getZ(g) : h === 3 && (p = e.getW(g)), e.normalized === !0 && (p = Tt.normalize(p, e.array))), t === X.FLOAT ? d.setFloat32(u, p, !0) : t === X.INT ? d.setInt32(u, p, !0) : t === X.UNSIGNED_INT ? d.setUint32(u, p, !0) : t === X.SHORT ? d.setInt16(u, p, !0) : t === X.UNSIGNED_SHORT ? d.setUint16(u, p, !0) : t === X.BYTE ? d.setInt8(u, p) : t === X.UNSIGNED_BYTE && d.setUint8(u, p), u += a;
|
|
2430
2430
|
}
|
|
2431
2431
|
u % l !== 0 && (u += l - u % l);
|
|
2432
2432
|
}
|
|
@@ -2435,7 +2435,7 @@ class hr {
|
|
|
2435
2435
|
byteOffset: this.byteOffset,
|
|
2436
2436
|
byteLength: c
|
|
2437
2437
|
};
|
|
2438
|
-
return i !== void 0 && (m.target = i), i ===
|
|
2438
|
+
return i !== void 0 && (m.target = i), i === X.ARRAY_BUFFER && (m.byteStride = l), this.byteOffset += c, o.bufferViews.push(m), {
|
|
2439
2439
|
id: o.bufferViews.length - 1,
|
|
2440
2440
|
byteLength: 0
|
|
2441
2441
|
};
|
|
@@ -2478,25 +2478,25 @@ class hr {
|
|
|
2478
2478
|
};
|
|
2479
2479
|
let a;
|
|
2480
2480
|
if (e.array.constructor === Float32Array)
|
|
2481
|
-
a =
|
|
2481
|
+
a = X.FLOAT;
|
|
2482
2482
|
else if (e.array.constructor === Int32Array)
|
|
2483
|
-
a =
|
|
2483
|
+
a = X.INT;
|
|
2484
2484
|
else if (e.array.constructor === Uint32Array)
|
|
2485
|
-
a =
|
|
2485
|
+
a = X.UNSIGNED_INT;
|
|
2486
2486
|
else if (e.array.constructor === Int16Array)
|
|
2487
|
-
a =
|
|
2487
|
+
a = X.SHORT;
|
|
2488
2488
|
else if (e.array.constructor === Uint16Array)
|
|
2489
|
-
a =
|
|
2489
|
+
a = X.UNSIGNED_SHORT;
|
|
2490
2490
|
else if (e.array.constructor === Int8Array)
|
|
2491
|
-
a =
|
|
2491
|
+
a = X.BYTE;
|
|
2492
2492
|
else if (e.array.constructor === Uint8Array)
|
|
2493
|
-
a =
|
|
2493
|
+
a = X.UNSIGNED_BYTE;
|
|
2494
2494
|
else
|
|
2495
2495
|
throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: " + e.array.constructor.name);
|
|
2496
2496
|
if (n === void 0 && (n = 0), (s === void 0 || s === 1 / 0) && (s = e.count), s === 0) return null;
|
|
2497
2497
|
const l = ur(e, n, s);
|
|
2498
2498
|
let c;
|
|
2499
|
-
t !== void 0 && (c = e === t.index ?
|
|
2499
|
+
t !== void 0 && (c = e === t.index ? X.ELEMENT_ARRAY_BUFFER : X.ARRAY_BUFFER);
|
|
2500
2500
|
const d = this.processBufferView(e, a, n, s, c), u = {
|
|
2501
2501
|
bufferView: d.id,
|
|
2502
2502
|
byteOffset: d.byteOffset,
|
|
@@ -2523,26 +2523,26 @@ class hr {
|
|
|
2523
2523
|
const d = o.images.get(e), u = s + ":flipY/" + n.toString();
|
|
2524
2524
|
if (d[u] !== void 0) return d[u];
|
|
2525
2525
|
a.images || (a.images = []);
|
|
2526
|
-
const m = { mimeType: s },
|
|
2527
|
-
|
|
2528
|
-
const
|
|
2526
|
+
const m = { mimeType: s }, A = hn();
|
|
2527
|
+
A.width = Math.min(e.width, l.maxTextureSize), A.height = Math.min(e.height, l.maxTextureSize);
|
|
2528
|
+
const g = A.getContext("2d", {
|
|
2529
2529
|
willReadFrequently: !0
|
|
2530
2530
|
});
|
|
2531
|
-
if (n === !0 && (
|
|
2531
|
+
if (n === !0 && (g.translate(0, A.height), g.scale(1, -1)), e.data !== void 0) {
|
|
2532
2532
|
t !== qi && console.error("GLTFExporter: Only RGBAFormat is supported.", t), (e.width > l.maxTextureSize || e.height > l.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", e);
|
|
2533
|
-
const
|
|
2534
|
-
for (let
|
|
2535
|
-
|
|
2536
|
-
|
|
2533
|
+
const p = new Uint8ClampedArray(e.height * e.width * 4);
|
|
2534
|
+
for (let y = 0; y < p.length; y += 4)
|
|
2535
|
+
p[y + 0] = e.data[y + 0], p[y + 1] = e.data[y + 1], p[y + 2] = e.data[y + 2], p[y + 3] = e.data[y + 3];
|
|
2536
|
+
g.putImageData(new ImageData(p, e.width, e.height), 0, 0);
|
|
2537
2537
|
} else if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap || typeof OffscreenCanvas < "u" && e instanceof OffscreenCanvas)
|
|
2538
|
-
|
|
2538
|
+
g.drawImage(e, 0, 0, A.width, A.height);
|
|
2539
2539
|
else
|
|
2540
2540
|
throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");
|
|
2541
2541
|
l.binary === !0 ? c.push(
|
|
2542
|
-
dr(
|
|
2543
|
-
m.bufferView =
|
|
2542
|
+
dr(A, s).then((p) => i.processBufferViewImage(p)).then((p) => {
|
|
2543
|
+
m.bufferView = p;
|
|
2544
2544
|
})
|
|
2545
|
-
) : m.uri = Vi.getDataURL(
|
|
2545
|
+
) : m.uri = Vi.getDataURL(A, s);
|
|
2546
2546
|
const h = a.images.push(m) - 1;
|
|
2547
2547
|
return d[u] = h, h;
|
|
2548
2548
|
} else
|
|
@@ -2598,7 +2598,7 @@ class hr {
|
|
|
2598
2598
|
const s = { pbrMetallicRoughness: {} };
|
|
2599
2599
|
e.isMeshStandardMaterial !== !0 && e.isMeshBasicMaterial !== !0 && console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");
|
|
2600
2600
|
const i = e.color.toArray().concat([e.opacity]);
|
|
2601
|
-
if (
|
|
2601
|
+
if (ke(i, [1, 1, 1, 1]) || (s.pbrMetallicRoughness.baseColorFactor = i), e.isMeshStandardMaterial ? (s.pbrMetallicRoughness.metallicFactor = e.metalness, s.pbrMetallicRoughness.roughnessFactor = e.roughness) : (s.pbrMetallicRoughness.metallicFactor = 0, s.pbrMetallicRoughness.roughnessFactor = 1), e.metalnessMap || e.roughnessMap) {
|
|
2602
2602
|
const a = await this.buildMetalRoughTextureAsync(e.metalnessMap, e.roughnessMap), l = {
|
|
2603
2603
|
index: await this.processTextureAsync(a),
|
|
2604
2604
|
texCoord: a.channel
|
|
@@ -2650,15 +2650,15 @@ class hr {
|
|
|
2650
2650
|
async processMeshAsync(e) {
|
|
2651
2651
|
const t = this.cache, n = this.json, s = [e.geometry.uuid];
|
|
2652
2652
|
if (Array.isArray(e.material))
|
|
2653
|
-
for (let
|
|
2654
|
-
s.push(e.material[
|
|
2653
|
+
for (let f = 0, w = e.material.length; f < w; f++)
|
|
2654
|
+
s.push(e.material[f].uuid);
|
|
2655
2655
|
else
|
|
2656
2656
|
s.push(e.material.uuid);
|
|
2657
2657
|
const i = s.join(":");
|
|
2658
2658
|
if (t.meshes.has(i)) return t.meshes.get(i);
|
|
2659
2659
|
const o = e.geometry;
|
|
2660
2660
|
let a;
|
|
2661
|
-
e.isLineSegments ? a =
|
|
2661
|
+
e.isLineSegments ? a = X.LINES : e.isLineLoop ? a = X.LINE_LOOP : e.isLine ? a = X.LINE_STRIP : e.isPoints ? a = X.POINTS : a = e.material.wireframe ? X.LINES : X.TRIANGLES;
|
|
2662
2662
|
const l = {}, c = {}, d = [], u = [], m = {
|
|
2663
2663
|
uv: "TEXCOORD_0",
|
|
2664
2664
|
uv1: "TEXCOORD_1",
|
|
@@ -2667,76 +2667,76 @@ class hr {
|
|
|
2667
2667
|
color: "COLOR_0",
|
|
2668
2668
|
skinWeight: "WEIGHTS_0",
|
|
2669
2669
|
skinIndex: "JOINTS_0"
|
|
2670
|
-
},
|
|
2671
|
-
|
|
2672
|
-
let
|
|
2673
|
-
for (let
|
|
2674
|
-
if (
|
|
2675
|
-
const w = o.attributes[
|
|
2676
|
-
if (
|
|
2677
|
-
c[
|
|
2670
|
+
}, A = o.getAttribute("normal");
|
|
2671
|
+
A !== void 0 && !this.isNormalizedNormalAttribute(A) && (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), o.setAttribute("normal", this.createNormalizedNormalAttribute(A)));
|
|
2672
|
+
let g = null;
|
|
2673
|
+
for (let f in o.attributes) {
|
|
2674
|
+
if (f.slice(0, 5) === "morph") continue;
|
|
2675
|
+
const w = o.attributes[f];
|
|
2676
|
+
if (f = m[f] || f.toUpperCase(), !/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(f) && !f.startsWith("_") && (f = "_" + f), t.attributes.has(this.getUID(w))) {
|
|
2677
|
+
c[f] = t.attributes.get(this.getUID(w));
|
|
2678
2678
|
continue;
|
|
2679
2679
|
}
|
|
2680
|
-
|
|
2681
|
-
const
|
|
2682
|
-
|
|
2683
|
-
const
|
|
2684
|
-
|
|
2680
|
+
g = null;
|
|
2681
|
+
const D = w.array;
|
|
2682
|
+
f === "JOINTS_0" && !(D instanceof Uint16Array) && !(D instanceof Uint8Array) ? (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), g = wt.Utils.toTypedBufferAttribute(w, Uint16Array)) : (D instanceof Uint32Array || D instanceof Int32Array) && !f.startsWith("_") && (console.warn(`GLTFExporter: Attribute "${f}" converted to type FLOAT.`), g = wt.Utils.toTypedBufferAttribute(w, Float32Array));
|
|
2683
|
+
const j = this.processAccessor(g || w, o);
|
|
2684
|
+
j !== null && (f.startsWith("_") || this.detectMeshQuantization(f, w), c[f] = j, t.attributes.set(this.getUID(w), j));
|
|
2685
2685
|
}
|
|
2686
|
-
if (
|
|
2686
|
+
if (A !== void 0 && o.setAttribute("normal", A), Object.keys(c).length === 0) return null;
|
|
2687
2687
|
if (e.morphTargetInfluences !== void 0 && e.morphTargetInfluences.length > 0) {
|
|
2688
|
-
const
|
|
2688
|
+
const f = [], w = [], E = {};
|
|
2689
2689
|
if (e.morphTargetDictionary !== void 0)
|
|
2690
|
-
for (const
|
|
2691
|
-
|
|
2692
|
-
for (let
|
|
2693
|
-
const
|
|
2694
|
-
let
|
|
2695
|
-
for (const
|
|
2696
|
-
if (
|
|
2697
|
-
|
|
2690
|
+
for (const D in e.morphTargetDictionary)
|
|
2691
|
+
E[e.morphTargetDictionary[D]] = D;
|
|
2692
|
+
for (let D = 0; D < e.morphTargetInfluences.length; ++D) {
|
|
2693
|
+
const j = {};
|
|
2694
|
+
let Z = !1;
|
|
2695
|
+
for (const N in o.morphAttributes) {
|
|
2696
|
+
if (N !== "position" && N !== "normal") {
|
|
2697
|
+
Z || (console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."), Z = !0);
|
|
2698
2698
|
continue;
|
|
2699
2699
|
}
|
|
2700
|
-
const
|
|
2701
|
-
if (t.attributes.has(this.getUID(
|
|
2702
|
-
|
|
2700
|
+
const z = o.morphAttributes[N][D], q = N.toUpperCase(), ne = o.attributes[N];
|
|
2701
|
+
if (t.attributes.has(this.getUID(z, !0))) {
|
|
2702
|
+
j[q] = t.attributes.get(this.getUID(z, !0));
|
|
2703
2703
|
continue;
|
|
2704
2704
|
}
|
|
2705
|
-
const
|
|
2705
|
+
const _ = z.clone();
|
|
2706
2706
|
if (!o.morphTargetsRelative)
|
|
2707
|
-
for (let k = 0,
|
|
2708
|
-
for (let te = 0; te <
|
|
2709
|
-
te === 0 &&
|
|
2710
|
-
|
|
2707
|
+
for (let k = 0, ee = z.count; k < ee; k++)
|
|
2708
|
+
for (let te = 0; te < z.itemSize; te++)
|
|
2709
|
+
te === 0 && _.setX(k, z.getX(k) - ne.getX(k)), te === 1 && _.setY(k, z.getY(k) - ne.getY(k)), te === 2 && _.setZ(k, z.getZ(k) - ne.getZ(k)), te === 3 && _.setW(k, z.getW(k) - ne.getW(k));
|
|
2710
|
+
j[q] = this.processAccessor(_, o), t.attributes.set(this.getUID(ne, !0), j[q]);
|
|
2711
2711
|
}
|
|
2712
|
-
u.push(
|
|
2712
|
+
u.push(j), f.push(e.morphTargetInfluences[D]), e.morphTargetDictionary !== void 0 && w.push(E[D]);
|
|
2713
2713
|
}
|
|
2714
|
-
l.weights =
|
|
2714
|
+
l.weights = f, w.length > 0 && (l.extras = {}, l.extras.targetNames = w);
|
|
2715
2715
|
}
|
|
2716
2716
|
const h = Array.isArray(e.material);
|
|
2717
2717
|
if (h && o.groups.length === 0) return null;
|
|
2718
|
-
let
|
|
2718
|
+
let p = !1;
|
|
2719
2719
|
if (h && o.index === null) {
|
|
2720
|
-
const
|
|
2721
|
-
for (let w = 0,
|
|
2722
|
-
|
|
2723
|
-
o.setIndex(
|
|
2724
|
-
}
|
|
2725
|
-
const
|
|
2726
|
-
for (let
|
|
2727
|
-
const
|
|
2720
|
+
const f = [];
|
|
2721
|
+
for (let w = 0, E = o.attributes.position.count; w < E; w++)
|
|
2722
|
+
f[w] = w;
|
|
2723
|
+
o.setIndex(f), p = !0;
|
|
2724
|
+
}
|
|
2725
|
+
const y = h ? e.material : [e.material], M = h ? o.groups : [{ materialIndex: 0, start: void 0, count: void 0 }];
|
|
2726
|
+
for (let f = 0, w = M.length; f < w; f++) {
|
|
2727
|
+
const E = {
|
|
2728
2728
|
mode: a,
|
|
2729
2729
|
attributes: c
|
|
2730
2730
|
};
|
|
2731
|
-
if (this.serializeUserData(o,
|
|
2732
|
-
let
|
|
2733
|
-
(M[
|
|
2731
|
+
if (this.serializeUserData(o, E), u.length > 0 && (E.targets = u), o.index !== null) {
|
|
2732
|
+
let j = this.getUID(o.index);
|
|
2733
|
+
(M[f].start !== void 0 || M[f].count !== void 0) && (j += ":" + M[f].start + ":" + M[f].count), t.attributes.has(j) ? E.indices = t.attributes.get(j) : (E.indices = this.processAccessor(o.index, o, M[f].start, M[f].count), t.attributes.set(j, E.indices)), E.indices === null && delete E.indices;
|
|
2734
2734
|
}
|
|
2735
|
-
const
|
|
2736
|
-
|
|
2735
|
+
const D = await this.processMaterialAsync(y[M[f].materialIndex]);
|
|
2736
|
+
D !== null && (E.material = D), d.push(E);
|
|
2737
2737
|
}
|
|
2738
|
-
|
|
2739
|
-
|
|
2738
|
+
p === !0 && o.setIndex(null), l.primitives = d, n.meshes || (n.meshes = []), await this._invokeAllAsync(function(f) {
|
|
2739
|
+
f.writeMesh && f.writeMesh(e, l);
|
|
2740
2740
|
});
|
|
2741
2741
|
const C = n.meshes.push(l) - 1;
|
|
2742
2742
|
return t.meshes.set(i, C), C;
|
|
@@ -2815,24 +2815,24 @@ class hr {
|
|
|
2815
2815
|
for (let c = 0; c < i.length; ++c) {
|
|
2816
2816
|
const d = i[c], u = Et.parseTrackName(d.name);
|
|
2817
2817
|
let m = Et.findNode(t, u.nodeName);
|
|
2818
|
-
const
|
|
2819
|
-
if (u.objectName === "bones" && (m.isSkinnedMesh === !0 ? m = m.skeleton.getBoneByName(u.objectIndex) : m = void 0), !m || !
|
|
2818
|
+
const A = cn[u.propertyName];
|
|
2819
|
+
if (u.objectName === "bones" && (m.isSkinnedMesh === !0 ? m = m.skeleton.getBoneByName(u.objectIndex) : m = void 0), !m || !A) {
|
|
2820
2820
|
console.warn('THREE.GLTFExporter: Could not export animation track "%s".', d.name);
|
|
2821
2821
|
continue;
|
|
2822
2822
|
}
|
|
2823
|
-
const
|
|
2823
|
+
const g = 1;
|
|
2824
2824
|
let h = d.values.length / d.times.length;
|
|
2825
|
-
|
|
2826
|
-
let
|
|
2827
|
-
d.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (
|
|
2828
|
-
input: this.processAccessor(new we(d.times,
|
|
2825
|
+
A === cn.morphTargetInfluences && (h /= m.morphTargetInfluences.length);
|
|
2826
|
+
let p;
|
|
2827
|
+
d.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (p = "CUBICSPLINE", h /= 3) : d.getInterpolation() === Dn ? p = "STEP" : p = "LINEAR", a.push({
|
|
2828
|
+
input: this.processAccessor(new we(d.times, g)),
|
|
2829
2829
|
output: this.processAccessor(new we(d.values, h)),
|
|
2830
|
-
interpolation:
|
|
2830
|
+
interpolation: p
|
|
2831
2831
|
}), o.push({
|
|
2832
2832
|
sampler: a.length - 1,
|
|
2833
2833
|
target: {
|
|
2834
2834
|
node: s.get(m),
|
|
2835
|
-
path:
|
|
2835
|
+
path: A
|
|
2836
2836
|
}
|
|
2837
2837
|
});
|
|
2838
2838
|
}
|
|
@@ -2873,7 +2873,7 @@ class hr {
|
|
|
2873
2873
|
const i = {};
|
|
2874
2874
|
if (n.trs) {
|
|
2875
2875
|
const a = e.quaternion.toArray(), l = e.position.toArray(), c = e.scale.toArray();
|
|
2876
|
-
|
|
2876
|
+
ke(a, [0, 0, 0, 1]) || (i.rotation = a), ke(l, [0, 0, 0]) || (i.translation = l), ke(c, [1, 1, 1]) || (i.scale = c);
|
|
2877
2877
|
} else
|
|
2878
2878
|
e.matrixAutoUpdate && e.updateMatrix(), cr(e.matrix) === !1 && (i.matrix = e.matrix.elements);
|
|
2879
2879
|
if (e.name !== "" && (i.name = String(e.name)), this.serializeUserData(e, i), e.isMesh || e.isLine || e.isPoints) {
|
|
@@ -2908,20 +2908,20 @@ class hr {
|
|
|
2908
2908
|
e.position.y + i.y,
|
|
2909
2909
|
e.position.z + i.z
|
|
2910
2910
|
], c = e.scale.toArray();
|
|
2911
|
-
|
|
2911
|
+
ke(a, [0, 0, 0, 1]) || (o.rotation = a), ke(l, [0, 0, 0]) || (o.translation = l), ke(c, [1, 1, 1]) || (o.scale = c), o.extras = { pivot: i.toArray() }, e.name !== "" && (o.name = String(e.name)), this.serializeUserData(e, o);
|
|
2912
2912
|
const d = t.nodes.push(o) - 1;
|
|
2913
2913
|
s.set(e, d);
|
|
2914
2914
|
const u = {}, m = [-i.x, -i.y, -i.z];
|
|
2915
|
-
if (
|
|
2915
|
+
if (ke(m, [0, 0, 0]) || (u.translation = m), e.isMesh || e.isLine || e.isPoints) {
|
|
2916
2916
|
const h = await this.processMeshAsync(e);
|
|
2917
2917
|
h !== null && (u.mesh = h);
|
|
2918
2918
|
} else e.isCamera && (u.camera = this.processCamera(e));
|
|
2919
2919
|
e.isSkinnedMesh && this.skins.push(e);
|
|
2920
|
-
const
|
|
2920
|
+
const g = [t.nodes.push(u) - 1];
|
|
2921
2921
|
if (e.children.length > 0) {
|
|
2922
2922
|
const h = [];
|
|
2923
|
-
for (let
|
|
2924
|
-
const M = e.children[
|
|
2923
|
+
for (let p = 0, y = e.children.length; p < y; p++) {
|
|
2924
|
+
const M = e.children[p];
|
|
2925
2925
|
if (M.visible || n.onlyVisible === !1) {
|
|
2926
2926
|
const C = await this.processNodeAsync(M);
|
|
2927
2927
|
C !== null && h.push(C);
|
|
@@ -2929,7 +2929,7 @@ class hr {
|
|
|
2929
2929
|
}
|
|
2930
2930
|
h.length > 0 && (u.children = h);
|
|
2931
2931
|
}
|
|
2932
|
-
return o.children =
|
|
2932
|
+
return o.children = g, await this._invokeAllAsync(function(h) {
|
|
2933
2933
|
h.writeNode && h.writeNode(e, o);
|
|
2934
2934
|
}), d;
|
|
2935
2935
|
}
|
|
@@ -3207,8 +3207,8 @@ let pr = class {
|
|
|
3207
3207
|
writeNode(e, t) {
|
|
3208
3208
|
if (!e.isInstancedMesh) return;
|
|
3209
3209
|
const n = this.writer, s = e, i = new Float32Array(s.count * 3), o = new Float32Array(s.count * 4), a = new Float32Array(s.count * 3), l = new xe(), c = new R(), d = new pe(), u = new R();
|
|
3210
|
-
for (let
|
|
3211
|
-
s.getMatrixAt(
|
|
3210
|
+
for (let A = 0; A < s.count; A++)
|
|
3211
|
+
s.getMatrixAt(A, l), l.decompose(c, d, u), c.toArray(i, A * 3), d.toArray(o, A * 4), u.toArray(a, A * 3);
|
|
3212
3212
|
const m = {
|
|
3213
3213
|
TRANSLATION: n.processAccessor(new we(i, 3)),
|
|
3214
3214
|
ROTATION: n.processAccessor(new we(o, 4)),
|
|
@@ -3263,19 +3263,19 @@ wt.Utils = {
|
|
|
3263
3263
|
let u;
|
|
3264
3264
|
if (n[l.uuid] === void 0) {
|
|
3265
3265
|
u = o.clone();
|
|
3266
|
-
const
|
|
3267
|
-
for (let
|
|
3268
|
-
|
|
3269
|
-
u.name = (a.nodeName || "") + ".morphTargetInfluences", u.values =
|
|
3266
|
+
const A = new u.ValueBufferType(c * u.times.length);
|
|
3267
|
+
for (let g = 0; g < u.times.length; g++)
|
|
3268
|
+
A[g * c + d] = u.values[g];
|
|
3269
|
+
u.name = (a.nodeName || "") + ".morphTargetInfluences", u.values = A, n[l.uuid] = u, t.push(u);
|
|
3270
3270
|
continue;
|
|
3271
3271
|
}
|
|
3272
3272
|
const m = o.createInterpolant(new o.ValueBufferType(1));
|
|
3273
3273
|
u = n[l.uuid];
|
|
3274
|
-
for (let
|
|
3275
|
-
u.values[
|
|
3276
|
-
for (let
|
|
3277
|
-
const
|
|
3278
|
-
u.values[
|
|
3274
|
+
for (let A = 0; A < u.times.length; A++)
|
|
3275
|
+
u.values[A * c + d] = m.evaluate(u.times[A]);
|
|
3276
|
+
for (let A = 0; A < o.times.length; A++) {
|
|
3277
|
+
const g = this.insertKeyframe(u, o.times[A]);
|
|
3278
|
+
u.values[g * c + d] = o.values[A];
|
|
3279
3279
|
}
|
|
3280
3280
|
}
|
|
3281
3281
|
return r.tracks = t, r;
|
|
@@ -3372,9 +3372,9 @@ class Vn extends Ls {
|
|
|
3372
3372
|
}), this.register(function(t) {
|
|
3373
3373
|
return new Pr(t);
|
|
3374
3374
|
}), this.register(function(t) {
|
|
3375
|
-
return new pn(t,
|
|
3375
|
+
return new pn(t, B.EXT_MESHOPT_COMPRESSION);
|
|
3376
3376
|
}), this.register(function(t) {
|
|
3377
|
-
return new pn(t,
|
|
3377
|
+
return new pn(t, B.KHR_MESHOPT_COMPRESSION);
|
|
3378
3378
|
}), this.register(function(t) {
|
|
3379
3379
|
return new qr(t);
|
|
3380
3380
|
});
|
|
@@ -3478,12 +3478,12 @@ class Vn extends Ls {
|
|
|
3478
3478
|
else if (e instanceof ArrayBuffer)
|
|
3479
3479
|
if (l.decode(new Uint8Array(e, 0, 4)) === Yn) {
|
|
3480
3480
|
try {
|
|
3481
|
-
o[
|
|
3481
|
+
o[B.KHR_BINARY_GLTF] = new Vr(e);
|
|
3482
3482
|
} catch (u) {
|
|
3483
3483
|
s && s(u);
|
|
3484
3484
|
return;
|
|
3485
3485
|
}
|
|
3486
|
-
i = JSON.parse(o[
|
|
3486
|
+
i = JSON.parse(o[B.KHR_BINARY_GLTF].content);
|
|
3487
3487
|
} else
|
|
3488
3488
|
i = JSON.parse(l.decode(e));
|
|
3489
3489
|
else
|
|
@@ -3509,16 +3509,16 @@ class Vn extends Ls {
|
|
|
3509
3509
|
for (let d = 0; d < i.extensionsUsed.length; ++d) {
|
|
3510
3510
|
const u = i.extensionsUsed[d], m = i.extensionsRequired || [];
|
|
3511
3511
|
switch (u) {
|
|
3512
|
-
case
|
|
3512
|
+
case B.KHR_MATERIALS_UNLIT:
|
|
3513
3513
|
o[u] = new Rr();
|
|
3514
3514
|
break;
|
|
3515
|
-
case
|
|
3515
|
+
case B.KHR_DRACO_MESH_COMPRESSION:
|
|
3516
3516
|
o[u] = new Yr(i, this.dracoLoader);
|
|
3517
3517
|
break;
|
|
3518
|
-
case
|
|
3518
|
+
case B.KHR_TEXTURE_TRANSFORM:
|
|
3519
3519
|
o[u] = new Kr();
|
|
3520
3520
|
break;
|
|
3521
|
-
case
|
|
3521
|
+
case B.KHR_MESH_QUANTIZATION:
|
|
3522
3522
|
o[u] = new Zr();
|
|
3523
3523
|
break;
|
|
3524
3524
|
default:
|
|
@@ -3559,11 +3559,11 @@ function Dr() {
|
|
|
3559
3559
|
}
|
|
3560
3560
|
};
|
|
3561
3561
|
}
|
|
3562
|
-
function
|
|
3562
|
+
function oe(r, e, t) {
|
|
3563
3563
|
const n = r.json.materials[e];
|
|
3564
3564
|
return n.extensions && n.extensions[t] ? n.extensions[t] : null;
|
|
3565
3565
|
}
|
|
3566
|
-
const
|
|
3566
|
+
const B = {
|
|
3567
3567
|
KHR_BINARY_GLTF: "KHR_binary_glTF",
|
|
3568
3568
|
KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
|
|
3569
3569
|
KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
|
|
@@ -3590,7 +3590,7 @@ const G = {
|
|
|
3590
3590
|
};
|
|
3591
3591
|
class Pr {
|
|
3592
3592
|
constructor(e) {
|
|
3593
|
-
this.parser = e, this.name =
|
|
3593
|
+
this.parser = e, this.name = B.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
3594
3594
|
}
|
|
3595
3595
|
_markDefs() {
|
|
3596
3596
|
const e = this.parser, t = this.parser.json.nodes || [];
|
|
@@ -3605,8 +3605,8 @@ class Pr {
|
|
|
3605
3605
|
if (s) return s;
|
|
3606
3606
|
const i = t.json, l = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
|
|
3607
3607
|
let c;
|
|
3608
|
-
const d = new
|
|
3609
|
-
l.color !== void 0 && d.setRGB(l.color[0], l.color[1], l.color[2],
|
|
3608
|
+
const d = new re(16777215);
|
|
3609
|
+
l.color !== void 0 && d.setRGB(l.color[0], l.color[1], l.color[2], Le);
|
|
3610
3610
|
const u = l.range !== void 0 ? l.range : 0;
|
|
3611
3611
|
switch (l.type) {
|
|
3612
3612
|
case "directional":
|
|
@@ -3621,7 +3621,7 @@ class Pr {
|
|
|
3621
3621
|
default:
|
|
3622
3622
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + l.type);
|
|
3623
3623
|
}
|
|
3624
|
-
return c.position.set(0, 0, 0),
|
|
3624
|
+
return c.position.set(0, 0, 0), Pe(c, l), l.intensity !== void 0 && (c.intensity = l.intensity), c.name = t.createUniqueName(l.name || "light_" + e), s = Promise.resolve(c), t.cache.add(n, s), s;
|
|
3625
3625
|
}
|
|
3626
3626
|
getDependency(e, t) {
|
|
3627
3627
|
if (e === "light")
|
|
@@ -3636,73 +3636,73 @@ class Pr {
|
|
|
3636
3636
|
}
|
|
3637
3637
|
class Rr {
|
|
3638
3638
|
constructor() {
|
|
3639
|
-
this.name =
|
|
3639
|
+
this.name = B.KHR_MATERIALS_UNLIT;
|
|
3640
3640
|
}
|
|
3641
3641
|
getMaterialType() {
|
|
3642
3642
|
return Qe;
|
|
3643
3643
|
}
|
|
3644
3644
|
extendParams(e, t, n) {
|
|
3645
3645
|
const s = [];
|
|
3646
|
-
e.color = new
|
|
3646
|
+
e.color = new re(1, 1, 1), e.opacity = 1;
|
|
3647
3647
|
const i = t.pbrMetallicRoughness;
|
|
3648
3648
|
if (i) {
|
|
3649
3649
|
if (Array.isArray(i.baseColorFactor)) {
|
|
3650
3650
|
const o = i.baseColorFactor;
|
|
3651
|
-
e.color.setRGB(o[0], o[1], o[2],
|
|
3651
|
+
e.color.setRGB(o[0], o[1], o[2], Le), e.opacity = o[3];
|
|
3652
3652
|
}
|
|
3653
|
-
i.baseColorTexture !== void 0 && s.push(n.assignTexture(e, "map", i.baseColorTexture,
|
|
3653
|
+
i.baseColorTexture !== void 0 && s.push(n.assignTexture(e, "map", i.baseColorTexture, Se));
|
|
3654
3654
|
}
|
|
3655
3655
|
return Promise.all(s);
|
|
3656
3656
|
}
|
|
3657
3657
|
}
|
|
3658
3658
|
class Or {
|
|
3659
3659
|
constructor(e) {
|
|
3660
|
-
this.parser = e, this.name =
|
|
3660
|
+
this.parser = e, this.name = B.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
3661
3661
|
}
|
|
3662
3662
|
extendMaterialParams(e, t) {
|
|
3663
|
-
const n =
|
|
3663
|
+
const n = oe(this.parser, e, this.name);
|
|
3664
3664
|
return n === null || n.emissiveStrength !== void 0 && (t.emissiveIntensity = n.emissiveStrength), Promise.resolve();
|
|
3665
3665
|
}
|
|
3666
3666
|
}
|
|
3667
3667
|
class Sr {
|
|
3668
3668
|
constructor(e) {
|
|
3669
|
-
this.parser = e, this.name =
|
|
3669
|
+
this.parser = e, this.name = B.KHR_MATERIALS_CLEARCOAT;
|
|
3670
3670
|
}
|
|
3671
3671
|
getMaterialType(e) {
|
|
3672
|
-
return
|
|
3672
|
+
return oe(this.parser, e, this.name) !== null ? Ne : null;
|
|
3673
3673
|
}
|
|
3674
3674
|
extendMaterialParams(e, t) {
|
|
3675
|
-
const n =
|
|
3675
|
+
const n = oe(this.parser, e, this.name);
|
|
3676
3676
|
if (n === null) return Promise.resolve();
|
|
3677
3677
|
const s = [];
|
|
3678
3678
|
if (n.clearcoatFactor !== void 0 && (t.clearcoat = n.clearcoatFactor), n.clearcoatTexture !== void 0 && s.push(this.parser.assignTexture(t, "clearcoatMap", n.clearcoatTexture)), n.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = n.clearcoatRoughnessFactor), n.clearcoatRoughnessTexture !== void 0 && s.push(this.parser.assignTexture(t, "clearcoatRoughnessMap", n.clearcoatRoughnessTexture)), n.clearcoatNormalTexture !== void 0 && (s.push(this.parser.assignTexture(t, "clearcoatNormalMap", n.clearcoatNormalTexture)), n.clearcoatNormalTexture.scale !== void 0)) {
|
|
3679
3679
|
const i = n.clearcoatNormalTexture.scale;
|
|
3680
|
-
t.clearcoatNormalScale = new
|
|
3680
|
+
t.clearcoatNormalScale = new le(i, i);
|
|
3681
3681
|
}
|
|
3682
3682
|
return Promise.all(s);
|
|
3683
3683
|
}
|
|
3684
3684
|
}
|
|
3685
3685
|
class Lr {
|
|
3686
3686
|
constructor(e) {
|
|
3687
|
-
this.parser = e, this.name =
|
|
3687
|
+
this.parser = e, this.name = B.KHR_MATERIALS_DISPERSION;
|
|
3688
3688
|
}
|
|
3689
3689
|
getMaterialType(e) {
|
|
3690
|
-
return
|
|
3690
|
+
return oe(this.parser, e, this.name) !== null ? Ne : null;
|
|
3691
3691
|
}
|
|
3692
3692
|
extendMaterialParams(e, t) {
|
|
3693
|
-
const n =
|
|
3693
|
+
const n = oe(this.parser, e, this.name);
|
|
3694
3694
|
return n === null || (t.dispersion = n.dispersion !== void 0 ? n.dispersion : 0), Promise.resolve();
|
|
3695
3695
|
}
|
|
3696
3696
|
}
|
|
3697
3697
|
class Nr {
|
|
3698
3698
|
constructor(e) {
|
|
3699
|
-
this.parser = e, this.name =
|
|
3699
|
+
this.parser = e, this.name = B.KHR_MATERIALS_IRIDESCENCE;
|
|
3700
3700
|
}
|
|
3701
3701
|
getMaterialType(e) {
|
|
3702
|
-
return
|
|
3702
|
+
return oe(this.parser, e, this.name) !== null ? Ne : null;
|
|
3703
3703
|
}
|
|
3704
3704
|
extendMaterialParams(e, t) {
|
|
3705
|
-
const n =
|
|
3705
|
+
const n = oe(this.parser, e, this.name);
|
|
3706
3706
|
if (n === null) return Promise.resolve();
|
|
3707
3707
|
const s = [];
|
|
3708
3708
|
return n.iridescenceFactor !== void 0 && (t.iridescence = n.iridescenceFactor), n.iridescenceTexture !== void 0 && s.push(this.parser.assignTexture(t, "iridescenceMap", n.iridescenceTexture)), n.iridescenceIor !== void 0 && (t.iridescenceIOR = n.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), n.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = n.iridescenceThicknessMinimum), n.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = n.iridescenceThicknessMaximum), n.iridescenceThicknessTexture !== void 0 && s.push(this.parser.assignTexture(t, "iridescenceThicknessMap", n.iridescenceThicknessTexture)), Promise.all(s);
|
|
@@ -3710,31 +3710,31 @@ class Nr {
|
|
|
3710
3710
|
}
|
|
3711
3711
|
class Hr {
|
|
3712
3712
|
constructor(e) {
|
|
3713
|
-
this.parser = e, this.name =
|
|
3713
|
+
this.parser = e, this.name = B.KHR_MATERIALS_SHEEN;
|
|
3714
3714
|
}
|
|
3715
3715
|
getMaterialType(e) {
|
|
3716
|
-
return
|
|
3716
|
+
return oe(this.parser, e, this.name) !== null ? Ne : null;
|
|
3717
3717
|
}
|
|
3718
3718
|
extendMaterialParams(e, t) {
|
|
3719
|
-
const n =
|
|
3719
|
+
const n = oe(this.parser, e, this.name);
|
|
3720
3720
|
if (n === null) return Promise.resolve();
|
|
3721
3721
|
const s = [];
|
|
3722
|
-
if (t.sheenColor = new
|
|
3722
|
+
if (t.sheenColor = new re(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, n.sheenColorFactor !== void 0) {
|
|
3723
3723
|
const i = n.sheenColorFactor;
|
|
3724
|
-
t.sheenColor.setRGB(i[0], i[1], i[2],
|
|
3724
|
+
t.sheenColor.setRGB(i[0], i[1], i[2], Le);
|
|
3725
3725
|
}
|
|
3726
|
-
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture,
|
|
3726
|
+
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture, Se)), n.sheenRoughnessTexture !== void 0 && s.push(this.parser.assignTexture(t, "sheenRoughnessMap", n.sheenRoughnessTexture)), Promise.all(s);
|
|
3727
3727
|
}
|
|
3728
3728
|
}
|
|
3729
3729
|
class kr {
|
|
3730
3730
|
constructor(e) {
|
|
3731
|
-
this.parser = e, this.name =
|
|
3731
|
+
this.parser = e, this.name = B.KHR_MATERIALS_TRANSMISSION;
|
|
3732
3732
|
}
|
|
3733
3733
|
getMaterialType(e) {
|
|
3734
|
-
return
|
|
3734
|
+
return oe(this.parser, e, this.name) !== null ? Ne : null;
|
|
3735
3735
|
}
|
|
3736
3736
|
extendMaterialParams(e, t) {
|
|
3737
|
-
const n =
|
|
3737
|
+
const n = oe(this.parser, e, this.name);
|
|
3738
3738
|
if (n === null) return Promise.resolve();
|
|
3739
3739
|
const s = [];
|
|
3740
3740
|
return n.transmissionFactor !== void 0 && (t.transmission = n.transmissionFactor), n.transmissionTexture !== void 0 && s.push(this.parser.assignTexture(t, "transmissionMap", n.transmissionTexture)), Promise.all(s);
|
|
@@ -3742,57 +3742,57 @@ class kr {
|
|
|
3742
3742
|
}
|
|
3743
3743
|
class jr {
|
|
3744
3744
|
constructor(e) {
|
|
3745
|
-
this.parser = e, this.name =
|
|
3745
|
+
this.parser = e, this.name = B.KHR_MATERIALS_VOLUME;
|
|
3746
3746
|
}
|
|
3747
3747
|
getMaterialType(e) {
|
|
3748
|
-
return
|
|
3748
|
+
return oe(this.parser, e, this.name) !== null ? Ne : null;
|
|
3749
3749
|
}
|
|
3750
3750
|
extendMaterialParams(e, t) {
|
|
3751
|
-
const n =
|
|
3751
|
+
const n = oe(this.parser, e, this.name);
|
|
3752
3752
|
if (n === null) return Promise.resolve();
|
|
3753
3753
|
const s = [];
|
|
3754
3754
|
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;
|
|
3755
3755
|
const i = n.attenuationColor || [1, 1, 1];
|
|
3756
|
-
return t.attenuationColor = new
|
|
3756
|
+
return t.attenuationColor = new re().setRGB(i[0], i[1], i[2], Le), Promise.all(s);
|
|
3757
3757
|
}
|
|
3758
3758
|
}
|
|
3759
3759
|
class Fr {
|
|
3760
3760
|
constructor(e) {
|
|
3761
|
-
this.parser = e, this.name =
|
|
3761
|
+
this.parser = e, this.name = B.KHR_MATERIALS_IOR;
|
|
3762
3762
|
}
|
|
3763
3763
|
getMaterialType(e) {
|
|
3764
|
-
return
|
|
3764
|
+
return oe(this.parser, e, this.name) !== null ? Ne : null;
|
|
3765
3765
|
}
|
|
3766
3766
|
extendMaterialParams(e, t) {
|
|
3767
|
-
const n =
|
|
3767
|
+
const n = oe(this.parser, e, this.name);
|
|
3768
3768
|
return n === null || (t.ior = n.ior !== void 0 ? n.ior : 1.5, t.ior === 0 && (t.ior = 1e3)), Promise.resolve();
|
|
3769
3769
|
}
|
|
3770
3770
|
}
|
|
3771
3771
|
class Ur {
|
|
3772
3772
|
constructor(e) {
|
|
3773
|
-
this.parser = e, this.name =
|
|
3773
|
+
this.parser = e, this.name = B.KHR_MATERIALS_SPECULAR;
|
|
3774
3774
|
}
|
|
3775
3775
|
getMaterialType(e) {
|
|
3776
|
-
return
|
|
3776
|
+
return oe(this.parser, e, this.name) !== null ? Ne : null;
|
|
3777
3777
|
}
|
|
3778
3778
|
extendMaterialParams(e, t) {
|
|
3779
|
-
const n =
|
|
3779
|
+
const n = oe(this.parser, e, this.name);
|
|
3780
3780
|
if (n === null) return Promise.resolve();
|
|
3781
3781
|
const s = [];
|
|
3782
3782
|
t.specularIntensity = n.specularFactor !== void 0 ? n.specularFactor : 1, n.specularTexture !== void 0 && s.push(this.parser.assignTexture(t, "specularIntensityMap", n.specularTexture));
|
|
3783
3783
|
const i = n.specularColorFactor || [1, 1, 1];
|
|
3784
|
-
return t.specularColor = new
|
|
3784
|
+
return t.specularColor = new re().setRGB(i[0], i[1], i[2], Le), n.specularColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "specularColorMap", n.specularColorTexture, Se)), Promise.all(s);
|
|
3785
3785
|
}
|
|
3786
3786
|
}
|
|
3787
3787
|
class zr {
|
|
3788
3788
|
constructor(e) {
|
|
3789
|
-
this.parser = e, this.name =
|
|
3789
|
+
this.parser = e, this.name = B.EXT_MATERIALS_BUMP;
|
|
3790
3790
|
}
|
|
3791
3791
|
getMaterialType(e) {
|
|
3792
|
-
return
|
|
3792
|
+
return oe(this.parser, e, this.name) !== null ? Ne : null;
|
|
3793
3793
|
}
|
|
3794
3794
|
extendMaterialParams(e, t) {
|
|
3795
|
-
const n =
|
|
3795
|
+
const n = oe(this.parser, e, this.name);
|
|
3796
3796
|
if (n === null) return Promise.resolve();
|
|
3797
3797
|
const s = [];
|
|
3798
3798
|
return t.bumpScale = n.bumpFactor !== void 0 ? n.bumpFactor : 1, n.bumpTexture !== void 0 && s.push(this.parser.assignTexture(t, "bumpMap", n.bumpTexture)), Promise.all(s);
|
|
@@ -3800,13 +3800,13 @@ class zr {
|
|
|
3800
3800
|
}
|
|
3801
3801
|
class Gr {
|
|
3802
3802
|
constructor(e) {
|
|
3803
|
-
this.parser = e, this.name =
|
|
3803
|
+
this.parser = e, this.name = B.KHR_MATERIALS_ANISOTROPY;
|
|
3804
3804
|
}
|
|
3805
3805
|
getMaterialType(e) {
|
|
3806
|
-
return
|
|
3806
|
+
return oe(this.parser, e, this.name) !== null ? Ne : null;
|
|
3807
3807
|
}
|
|
3808
3808
|
extendMaterialParams(e, t) {
|
|
3809
|
-
const n =
|
|
3809
|
+
const n = oe(this.parser, e, this.name);
|
|
3810
3810
|
if (n === null) return Promise.resolve();
|
|
3811
3811
|
const s = [];
|
|
3812
3812
|
return n.anisotropyStrength !== void 0 && (t.anisotropy = n.anisotropyStrength), n.anisotropyRotation !== void 0 && (t.anisotropyRotation = n.anisotropyRotation), n.anisotropyTexture !== void 0 && s.push(this.parser.assignTexture(t, "anisotropyMap", n.anisotropyTexture)), Promise.all(s);
|
|
@@ -3814,7 +3814,7 @@ class Gr {
|
|
|
3814
3814
|
}
|
|
3815
3815
|
class Wr {
|
|
3816
3816
|
constructor(e) {
|
|
3817
|
-
this.parser = e, this.name =
|
|
3817
|
+
this.parser = e, this.name = B.KHR_TEXTURE_BASISU;
|
|
3818
3818
|
}
|
|
3819
3819
|
loadTexture(e) {
|
|
3820
3820
|
const t = this.parser, n = t.json, s = n.textures[e];
|
|
@@ -3831,7 +3831,7 @@ class Wr {
|
|
|
3831
3831
|
}
|
|
3832
3832
|
class Br {
|
|
3833
3833
|
constructor(e) {
|
|
3834
|
-
this.parser = e, this.name =
|
|
3834
|
+
this.parser = e, this.name = B.EXT_TEXTURE_WEBP;
|
|
3835
3835
|
}
|
|
3836
3836
|
loadTexture(e) {
|
|
3837
3837
|
const t = this.name, n = this.parser, s = n.json, i = s.textures[e];
|
|
@@ -3848,7 +3848,7 @@ class Br {
|
|
|
3848
3848
|
}
|
|
3849
3849
|
class Xr {
|
|
3850
3850
|
constructor(e) {
|
|
3851
|
-
this.parser = e, this.name =
|
|
3851
|
+
this.parser = e, this.name = B.EXT_TEXTURE_AVIF;
|
|
3852
3852
|
}
|
|
3853
3853
|
loadTexture(e) {
|
|
3854
3854
|
const t = this.name, n = this.parser, s = n.json, i = s.textures[e];
|
|
@@ -3878,11 +3878,11 @@ class pn {
|
|
|
3878
3878
|
}
|
|
3879
3879
|
return i.then(function(a) {
|
|
3880
3880
|
const l = s.byteOffset || 0, c = s.byteLength || 0, d = s.count, u = s.byteStride, m = new Uint8Array(a, l, c);
|
|
3881
|
-
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u, m, s.mode, s.filter).then(function(
|
|
3882
|
-
return
|
|
3881
|
+
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u, m, s.mode, s.filter).then(function(A) {
|
|
3882
|
+
return A.buffer;
|
|
3883
3883
|
}) : o.ready.then(function() {
|
|
3884
|
-
const
|
|
3885
|
-
return o.decodeGltfBuffer(new Uint8Array(
|
|
3884
|
+
const A = new ArrayBuffer(d * u);
|
|
3885
|
+
return o.decodeGltfBuffer(new Uint8Array(A), d, u, m, s.mode, s.filter), A;
|
|
3886
3886
|
});
|
|
3887
3887
|
});
|
|
3888
3888
|
} else
|
|
@@ -3891,7 +3891,7 @@ class pn {
|
|
|
3891
3891
|
}
|
|
3892
3892
|
class qr {
|
|
3893
3893
|
constructor(e) {
|
|
3894
|
-
this.name =
|
|
3894
|
+
this.name = B.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
3895
3895
|
}
|
|
3896
3896
|
createNodeMesh(e) {
|
|
3897
3897
|
const t = this.parser.json, n = t.nodes[e];
|
|
@@ -3905,26 +3905,26 @@ class qr {
|
|
|
3905
3905
|
for (const c in o)
|
|
3906
3906
|
a.push(this.parser.getDependency("accessor", o[c]).then((d) => (l[c] = d, l[c])));
|
|
3907
3907
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
|
|
3908
|
-
const d = c.pop(), u = d.isGroup ? d.children : [d], m = c[0].count,
|
|
3909
|
-
for (const
|
|
3910
|
-
const h = new xe(),
|
|
3911
|
-
for (let
|
|
3912
|
-
l.TRANSLATION &&
|
|
3913
|
-
for (const
|
|
3914
|
-
if (
|
|
3915
|
-
const w = l[
|
|
3908
|
+
const d = c.pop(), u = d.isGroup ? d.children : [d], m = c[0].count, A = [];
|
|
3909
|
+
for (const g of u) {
|
|
3910
|
+
const h = new xe(), p = new R(), y = new pe(), M = new R(1, 1, 1), C = new Ji(g.geometry, g.material, m);
|
|
3911
|
+
for (let f = 0; f < m; f++)
|
|
3912
|
+
l.TRANSLATION && p.fromBufferAttribute(l.TRANSLATION, f), l.ROTATION && y.fromBufferAttribute(l.ROTATION, f), l.SCALE && M.fromBufferAttribute(l.SCALE, f), C.setMatrixAt(f, h.compose(p, y, M));
|
|
3913
|
+
for (const f in l)
|
|
3914
|
+
if (f === "_COLOR_0") {
|
|
3915
|
+
const w = l[f];
|
|
3916
3916
|
C.instanceColor = new _i(w.array, w.itemSize, w.normalized);
|
|
3917
|
-
} else
|
|
3918
|
-
dt.prototype.copy.call(C,
|
|
3917
|
+
} else f !== "TRANSLATION" && f !== "ROTATION" && f !== "SCALE" && g.geometry.setAttribute(f, l[f]);
|
|
3918
|
+
dt.prototype.copy.call(C, g), this.parser.assignFinalMaterial(C), A.push(C);
|
|
3919
3919
|
}
|
|
3920
|
-
return d.isGroup ? (d.clear(), d.add(...
|
|
3920
|
+
return d.isGroup ? (d.clear(), d.add(...A), d) : A[0];
|
|
3921
3921
|
}));
|
|
3922
3922
|
}
|
|
3923
3923
|
}
|
|
3924
3924
|
const Yn = "glTF", At = 12, An = { JSON: 1313821514, BIN: 5130562 };
|
|
3925
3925
|
class Vr {
|
|
3926
3926
|
constructor(e) {
|
|
3927
|
-
this.name =
|
|
3927
|
+
this.name = B.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
3928
3928
|
const t = new DataView(e, 0, At), n = new TextDecoder();
|
|
3929
3929
|
if (this.header = {
|
|
3930
3930
|
magic: n.decode(new Uint8Array(e.slice(0, 4))),
|
|
@@ -3957,7 +3957,7 @@ class Yr {
|
|
|
3957
3957
|
constructor(e, t) {
|
|
3958
3958
|
if (!t)
|
|
3959
3959
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
3960
|
-
this.name =
|
|
3960
|
+
this.name = B.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
|
|
3961
3961
|
}
|
|
3962
3962
|
decodePrimitive(e, t) {
|
|
3963
3963
|
const n = this.json, s = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, c = {};
|
|
@@ -3968,26 +3968,26 @@ class Yr {
|
|
|
3968
3968
|
for (const d in e.attributes) {
|
|
3969
3969
|
const u = vs[d] || d.toLowerCase();
|
|
3970
3970
|
if (o[d] !== void 0) {
|
|
3971
|
-
const m = n.accessors[e.attributes[d]],
|
|
3972
|
-
c[u] =
|
|
3971
|
+
const m = n.accessors[e.attributes[d]], A = ut[m.componentType];
|
|
3972
|
+
c[u] = A.name, l[u] = m.normalized === !0;
|
|
3973
3973
|
}
|
|
3974
3974
|
}
|
|
3975
3975
|
return t.getDependency("bufferView", i).then(function(d) {
|
|
3976
3976
|
return new Promise(function(u, m) {
|
|
3977
|
-
s.decodeDracoFile(d, function(
|
|
3978
|
-
for (const
|
|
3979
|
-
const h =
|
|
3980
|
-
|
|
3977
|
+
s.decodeDracoFile(d, function(A) {
|
|
3978
|
+
for (const g in A.attributes) {
|
|
3979
|
+
const h = A.attributes[g], p = l[g];
|
|
3980
|
+
p !== void 0 && (h.normalized = p);
|
|
3981
3981
|
}
|
|
3982
|
-
u(
|
|
3983
|
-
}, a, c,
|
|
3982
|
+
u(A);
|
|
3983
|
+
}, a, c, Le, m);
|
|
3984
3984
|
});
|
|
3985
3985
|
});
|
|
3986
3986
|
}
|
|
3987
3987
|
}
|
|
3988
3988
|
class Kr {
|
|
3989
3989
|
constructor() {
|
|
3990
|
-
this.name =
|
|
3990
|
+
this.name = B.KHR_TEXTURE_TRANSFORM;
|
|
3991
3991
|
}
|
|
3992
3992
|
extendTexture(e, t) {
|
|
3993
3993
|
return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e;
|
|
@@ -3995,7 +3995,7 @@ class Kr {
|
|
|
3995
3995
|
}
|
|
3996
3996
|
class Zr {
|
|
3997
3997
|
constructor() {
|
|
3998
|
-
this.name =
|
|
3998
|
+
this.name = B.KHR_MESH_QUANTIZATION;
|
|
3999
3999
|
}
|
|
4000
4000
|
}
|
|
4001
4001
|
class Kn extends oo {
|
|
@@ -4009,10 +4009,10 @@ class Kn extends oo {
|
|
|
4009
4009
|
return t;
|
|
4010
4010
|
}
|
|
4011
4011
|
interpolate_(e, t, n, s) {
|
|
4012
|
-
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, d = s - t, u = (n - t) / d, m = u * u,
|
|
4013
|
-
for (let
|
|
4014
|
-
const w = o[h +
|
|
4015
|
-
i[
|
|
4012
|
+
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, d = s - t, u = (n - t) / d, m = u * u, A = m * u, g = e * c, h = g - c, p = -2 * A + 3 * m, y = A - m, M = 1 - p, C = y - m + u;
|
|
4013
|
+
for (let f = 0; f !== a; f++) {
|
|
4014
|
+
const w = o[h + f + a], E = o[h + f + l] * d, D = o[g + f + a], j = o[g + f] * d;
|
|
4015
|
+
i[f] = M * w + C * E + p * D + y * j;
|
|
4016
4016
|
}
|
|
4017
4017
|
return i;
|
|
4018
4018
|
}
|
|
@@ -4100,7 +4100,7 @@ function Ye(r, e, t) {
|
|
|
4100
4100
|
for (const n in t.extensions)
|
|
4101
4101
|
r[n] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[n] = t.extensions[n]);
|
|
4102
4102
|
}
|
|
4103
|
-
function
|
|
4103
|
+
function Pe(r, e) {
|
|
4104
4104
|
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(r.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
4105
4105
|
}
|
|
4106
4106
|
function ea(r, e, t) {
|
|
@@ -4151,7 +4151,7 @@ function ta(r, e) {
|
|
|
4151
4151
|
}
|
|
4152
4152
|
function sa(r) {
|
|
4153
4153
|
let e;
|
|
4154
|
-
const t = r.extensions && r.extensions[
|
|
4154
|
+
const t = r.extensions && r.extensions[B.KHR_DRACO_MESH_COMPRESSION];
|
|
4155
4155
|
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + As(t.attributes) : e = r.indices + ":" + As(r.attributes) + ":" + r.mode, r.targets !== void 0)
|
|
4156
4156
|
for (let n = 0, s = r.targets.length; n < s; n++)
|
|
4157
4157
|
e += ":" + As(r.targets[n]);
|
|
@@ -4222,7 +4222,7 @@ class oa {
|
|
|
4222
4222
|
parser: n,
|
|
4223
4223
|
userData: {}
|
|
4224
4224
|
};
|
|
4225
|
-
return Ye(i, a, s),
|
|
4225
|
+
return Ye(i, a, s), Pe(a, s), Promise.all(n._invokeAll(function(l) {
|
|
4226
4226
|
return l.afterRoot && l.afterRoot(a);
|
|
4227
4227
|
})).then(function() {
|
|
4228
4228
|
for (const l of a.scenes)
|
|
@@ -4400,7 +4400,7 @@ class oa {
|
|
|
4400
4400
|
if (t.type && t.type !== "arraybuffer")
|
|
4401
4401
|
throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
|
|
4402
4402
|
if (t.uri === void 0 && e === 0)
|
|
4403
|
-
return Promise.resolve(this.extensions[
|
|
4403
|
+
return Promise.resolve(this.extensions[B.KHR_BINARY_GLTF].body);
|
|
4404
4404
|
const s = this.options;
|
|
4405
4405
|
return new Promise(function(i, o) {
|
|
4406
4406
|
n.load(It.resolveURL(t.uri, s.path), i, void 0, function() {
|
|
@@ -4437,24 +4437,24 @@ class oa {
|
|
|
4437
4437
|
}
|
|
4438
4438
|
const i = [];
|
|
4439
4439
|
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) {
|
|
4440
|
-
const a = o[0], l = fs[s.type], c = ut[s.componentType], d = c.BYTES_PER_ELEMENT, u = d * l, m = s.byteOffset || 0,
|
|
4441
|
-
let h,
|
|
4442
|
-
if (
|
|
4443
|
-
const
|
|
4440
|
+
const a = o[0], l = fs[s.type], c = ut[s.componentType], d = c.BYTES_PER_ELEMENT, u = d * l, m = s.byteOffset || 0, A = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, g = s.normalized === !0;
|
|
4441
|
+
let h, p;
|
|
4442
|
+
if (A && A !== u) {
|
|
4443
|
+
const y = Math.floor(m / A), M = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + y + ":" + s.count;
|
|
4444
4444
|
let C = t.cache.get(M);
|
|
4445
|
-
C || (h = new c(a,
|
|
4445
|
+
C || (h = new c(a, y * A, s.count * A / d), C = new Hn(h, A / d), t.cache.add(M, C)), p = new kn(C, l, m % A / d, g);
|
|
4446
4446
|
} else
|
|
4447
|
-
a === null ? h = new c(s.count * l) : h = new c(a, m, s.count * l),
|
|
4447
|
+
a === null ? h = new c(s.count * l) : h = new c(a, m, s.count * l), p = new we(h, l, g);
|
|
4448
4448
|
if (s.sparse !== void 0) {
|
|
4449
|
-
const
|
|
4450
|
-
a !== null && (
|
|
4451
|
-
for (let
|
|
4452
|
-
const
|
|
4453
|
-
if (
|
|
4449
|
+
const y = fs.SCALAR, M = ut[s.sparse.indices.componentType], C = s.sparse.indices.byteOffset || 0, f = s.sparse.values.byteOffset || 0, w = new M(o[1], C, s.sparse.count * y), E = new c(o[2], f, s.sparse.count * l);
|
|
4450
|
+
a !== null && (p = new we(p.array.slice(), p.itemSize, p.normalized)), p.normalized = !1;
|
|
4451
|
+
for (let D = 0, j = w.length; D < j; D++) {
|
|
4452
|
+
const Z = w[D];
|
|
4453
|
+
if (p.setX(Z, E[D * l]), l >= 2 && p.setY(Z, E[D * l + 1]), l >= 3 && p.setZ(Z, E[D * l + 2]), l >= 4 && p.setW(Z, E[D * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
4454
4454
|
}
|
|
4455
|
-
|
|
4455
|
+
p.normalized = g;
|
|
4456
4456
|
}
|
|
4457
|
-
return
|
|
4457
|
+
return p;
|
|
4458
4458
|
});
|
|
4459
4459
|
}
|
|
4460
4460
|
/**
|
|
@@ -4501,15 +4501,15 @@ class oa {
|
|
|
4501
4501
|
else if (o.uri === void 0)
|
|
4502
4502
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
4503
4503
|
const d = Promise.resolve(l).then(function(u) {
|
|
4504
|
-
return new Promise(function(m,
|
|
4505
|
-
let
|
|
4506
|
-
t.isImageBitmapLoader === !0 && (
|
|
4507
|
-
const
|
|
4508
|
-
|
|
4509
|
-
}), t.load(It.resolveURL(u, i.path),
|
|
4504
|
+
return new Promise(function(m, A) {
|
|
4505
|
+
let g = m;
|
|
4506
|
+
t.isImageBitmapLoader === !0 && (g = function(h) {
|
|
4507
|
+
const p = new Gs(h);
|
|
4508
|
+
p.needsUpdate = !0, m(p);
|
|
4509
|
+
}), t.load(It.resolveURL(u, i.path), g, void 0, A);
|
|
4510
4510
|
});
|
|
4511
4511
|
}).then(function(u) {
|
|
4512
|
-
return c === !0 && a.revokeObjectURL(l),
|
|
4512
|
+
return c === !0 && a.revokeObjectURL(l), Pe(u, o), u.userData.mimeType = o.mimeType || na(o.uri), u;
|
|
4513
4513
|
}).catch(function(u) {
|
|
4514
4514
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", l), u;
|
|
4515
4515
|
});
|
|
@@ -4529,11 +4529,11 @@ class oa {
|
|
|
4529
4529
|
const i = this;
|
|
4530
4530
|
return this.getDependency("texture", n.index).then(function(o) {
|
|
4531
4531
|
if (!o) return null;
|
|
4532
|
-
if (n.texCoord !== void 0 && n.texCoord > 0 && (o = o.clone(), o.channel = n.texCoord), i.extensions[
|
|
4533
|
-
const a = n.extensions !== void 0 ? n.extensions[
|
|
4532
|
+
if (n.texCoord !== void 0 && n.texCoord > 0 && (o = o.clone(), o.channel = n.texCoord), i.extensions[B.KHR_TEXTURE_TRANSFORM]) {
|
|
4533
|
+
const a = n.extensions !== void 0 ? n.extensions[B.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
4534
4534
|
if (a) {
|
|
4535
4535
|
const l = i.associations.get(o);
|
|
4536
|
-
o = i.extensions[
|
|
4536
|
+
o = i.extensions[B.KHR_TEXTURE_TRANSFORM].extendTexture(o, a), i.associations.set(o, l);
|
|
4537
4537
|
}
|
|
4538
4538
|
}
|
|
4539
4539
|
return s !== void 0 && (o.colorSpace = s), e[t] = o, o;
|
|
@@ -4584,16 +4584,16 @@ class oa {
|
|
|
4584
4584
|
const t = this, n = this.json, s = this.extensions, i = n.materials[e];
|
|
4585
4585
|
let o;
|
|
4586
4586
|
const a = {}, l = i.extensions || {}, c = [];
|
|
4587
|
-
if (l[
|
|
4588
|
-
const u = s[
|
|
4587
|
+
if (l[B.KHR_MATERIALS_UNLIT]) {
|
|
4588
|
+
const u = s[B.KHR_MATERIALS_UNLIT];
|
|
4589
4589
|
o = u.getMaterialType(), c.push(u.extendParams(a, i, t));
|
|
4590
4590
|
} else {
|
|
4591
4591
|
const u = i.pbrMetallicRoughness || {};
|
|
4592
|
-
if (a.color = new
|
|
4592
|
+
if (a.color = new re(1, 1, 1), a.opacity = 1, Array.isArray(u.baseColorFactor)) {
|
|
4593
4593
|
const m = u.baseColorFactor;
|
|
4594
|
-
a.color.setRGB(m[0], m[1], m[2],
|
|
4594
|
+
a.color.setRGB(m[0], m[1], m[2], Le), a.opacity = m[3];
|
|
4595
4595
|
}
|
|
4596
|
-
u.baseColorTexture !== void 0 && c.push(t.assignTexture(a, "map", u.baseColorTexture,
|
|
4596
|
+
u.baseColorTexture !== void 0 && c.push(t.assignTexture(a, "map", u.baseColorTexture, Se)), a.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, a.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(a, "metalnessMap", u.metallicRoughnessTexture)), c.push(t.assignTexture(a, "roughnessMap", u.metallicRoughnessTexture))), o = this._invokeOne(function(m) {
|
|
4597
4597
|
return m.getMaterialType && m.getMaterialType(e);
|
|
4598
4598
|
}), c.push(Promise.all(this._invokeAll(function(m) {
|
|
4599
4599
|
return m.extendMaterialParams && m.extendMaterialParams(e, a);
|
|
@@ -4601,17 +4601,17 @@ class oa {
|
|
|
4601
4601
|
}
|
|
4602
4602
|
i.doubleSided === !0 && (a.side = Ps);
|
|
4603
4603
|
const d = i.alphaMode || ps.OPAQUE;
|
|
4604
|
-
if (d === ps.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === ps.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== Qe && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new
|
|
4604
|
+
if (d === ps.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === ps.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== Qe && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new le(1, 1), i.normalTexture.scale !== void 0)) {
|
|
4605
4605
|
const u = i.normalTexture.scale;
|
|
4606
4606
|
a.normalScale.set(u, u);
|
|
4607
4607
|
}
|
|
4608
4608
|
if (i.occlusionTexture !== void 0 && o !== Qe && (c.push(t.assignTexture(a, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && o !== Qe) {
|
|
4609
4609
|
const u = i.emissiveFactor;
|
|
4610
|
-
a.emissive = new
|
|
4610
|
+
a.emissive = new re().setRGB(u[0], u[1], u[2], Le);
|
|
4611
4611
|
}
|
|
4612
|
-
return i.emissiveTexture !== void 0 && o !== Qe && c.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture,
|
|
4612
|
+
return i.emissiveTexture !== void 0 && o !== Qe && c.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, Se)), Promise.all(c).then(function() {
|
|
4613
4613
|
const u = new o(a);
|
|
4614
|
-
return i.name && (u.name = i.name),
|
|
4614
|
+
return i.name && (u.name = i.name), Pe(u, i), t.associations.set(u, { materials: e }), i.extensions && Ye(s, u, i), u;
|
|
4615
4615
|
});
|
|
4616
4616
|
}
|
|
4617
4617
|
/**
|
|
@@ -4637,7 +4637,7 @@ class oa {
|
|
|
4637
4637
|
loadGeometries(e) {
|
|
4638
4638
|
const t = this, n = this.extensions, s = this.primitiveCache;
|
|
4639
4639
|
function i(a) {
|
|
4640
|
-
return n[
|
|
4640
|
+
return n[B.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(l) {
|
|
4641
4641
|
return yn(l, a, t);
|
|
4642
4642
|
});
|
|
4643
4643
|
}
|
|
@@ -4648,7 +4648,7 @@ class oa {
|
|
|
4648
4648
|
o.push(u.promise);
|
|
4649
4649
|
else {
|
|
4650
4650
|
let m;
|
|
4651
|
-
c.extensions && c.extensions[
|
|
4651
|
+
c.extensions && c.extensions[B.KHR_DRACO_MESH_COMPRESSION] ? m = i(c) : m = yn(new $e(), c, t), s[d] = { primitive: c, promise: m }, o.push(m);
|
|
4652
4652
|
}
|
|
4653
4653
|
}
|
|
4654
4654
|
return Promise.all(o);
|
|
@@ -4668,35 +4668,35 @@ class oa {
|
|
|
4668
4668
|
}
|
|
4669
4669
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
|
|
4670
4670
|
const c = l.slice(0, l.length - 1), d = l[l.length - 1], u = [];
|
|
4671
|
-
for (let
|
|
4672
|
-
const h = d[
|
|
4673
|
-
let
|
|
4674
|
-
const M = c[
|
|
4675
|
-
if (
|
|
4676
|
-
|
|
4677
|
-
else if (
|
|
4678
|
-
|
|
4679
|
-
else if (
|
|
4680
|
-
|
|
4681
|
-
else if (
|
|
4682
|
-
|
|
4683
|
-
else if (
|
|
4684
|
-
|
|
4671
|
+
for (let A = 0, g = d.length; A < g; A++) {
|
|
4672
|
+
const h = d[A], p = o[A];
|
|
4673
|
+
let y;
|
|
4674
|
+
const M = c[A];
|
|
4675
|
+
if (p.mode === Ce.TRIANGLES || p.mode === Ce.TRIANGLE_STRIP || p.mode === Ce.TRIANGLE_FAN || p.mode === void 0)
|
|
4676
|
+
y = i.isSkinnedMesh === !0 ? new eo(h, M) : new S(h, M), y.isSkinnedMesh === !0 && y.normalizeSkinWeights(), p.mode === Ce.TRIANGLE_STRIP ? y.geometry = fn(y.geometry, Nn) : p.mode === Ce.TRIANGLE_FAN && (y.geometry = fn(y.geometry, Cs));
|
|
4677
|
+
else if (p.mode === Ce.LINES)
|
|
4678
|
+
y = new ws(h, M);
|
|
4679
|
+
else if (p.mode === Ce.LINE_STRIP)
|
|
4680
|
+
y = new He(h, M);
|
|
4681
|
+
else if (p.mode === Ce.LINE_LOOP)
|
|
4682
|
+
y = new to(h, M);
|
|
4683
|
+
else if (p.mode === Ce.POINTS)
|
|
4684
|
+
y = new Bt(h, M);
|
|
4685
4685
|
else
|
|
4686
|
-
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " +
|
|
4687
|
-
Object.keys(
|
|
4686
|
+
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + p.mode);
|
|
4687
|
+
Object.keys(y.geometry.morphAttributes).length > 0 && ta(y, i), y.name = t.createUniqueName(i.name || "mesh_" + e), Pe(y, i), p.extensions && Ye(s, y, p), t.assignFinalMaterial(y), u.push(y);
|
|
4688
4688
|
}
|
|
4689
|
-
for (let
|
|
4690
|
-
t.associations.set(u[
|
|
4689
|
+
for (let A = 0, g = u.length; A < g; A++)
|
|
4690
|
+
t.associations.set(u[A], {
|
|
4691
4691
|
meshes: e,
|
|
4692
|
-
primitives:
|
|
4692
|
+
primitives: A
|
|
4693
4693
|
});
|
|
4694
4694
|
if (u.length === 1)
|
|
4695
4695
|
return i.extensions && Ye(s, u[0], i), u[0];
|
|
4696
4696
|
const m = new Xt();
|
|
4697
4697
|
i.extensions && Ye(s, m, i), t.associations.set(m, { meshes: e });
|
|
4698
|
-
for (let
|
|
4699
|
-
m.add(u[
|
|
4698
|
+
for (let A = 0, g = u.length; A < g; A++)
|
|
4699
|
+
m.add(u[A]);
|
|
4700
4700
|
return m;
|
|
4701
4701
|
});
|
|
4702
4702
|
}
|
|
@@ -4714,7 +4714,7 @@ class oa {
|
|
|
4714
4714
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
4715
4715
|
return;
|
|
4716
4716
|
}
|
|
4717
|
-
return n.type === "perspective" ? t = new Fn(Tt.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : n.type === "orthographic" && (t = new vn(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), n.name && (t.name = this.createUniqueName(n.name)),
|
|
4717
|
+
return n.type === "perspective" ? t = new Fn(Tt.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : n.type === "orthographic" && (t = new vn(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), n.name && (t.name = this.createUniqueName(n.name)), Pe(t, n), Promise.resolve(t);
|
|
4718
4718
|
}
|
|
4719
4719
|
/**
|
|
4720
4720
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -4751,8 +4751,8 @@ class oa {
|
|
|
4751
4751
|
loadAnimation(e) {
|
|
4752
4752
|
const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, o = [], a = [], l = [], c = [], d = [];
|
|
4753
4753
|
for (let u = 0, m = s.channels.length; u < m; u++) {
|
|
4754
|
-
const
|
|
4755
|
-
h.node !== void 0 && (o.push(this.getDependency("node",
|
|
4754
|
+
const A = s.channels[u], g = s.samplers[A.sampler], h = A.target, p = h.node, y = s.parameters !== void 0 ? s.parameters[g.input] : g.input, M = s.parameters !== void 0 ? s.parameters[g.output] : g.output;
|
|
4755
|
+
h.node !== void 0 && (o.push(this.getDependency("node", p)), a.push(this.getDependency("accessor", y)), l.push(this.getDependency("accessor", M)), c.push(g), d.push(h));
|
|
4756
4756
|
}
|
|
4757
4757
|
return Promise.all([
|
|
4758
4758
|
Promise.all(o),
|
|
@@ -4761,18 +4761,18 @@ class oa {
|
|
|
4761
4761
|
Promise.all(c),
|
|
4762
4762
|
Promise.all(d)
|
|
4763
4763
|
]).then(function(u) {
|
|
4764
|
-
const m = u[0],
|
|
4765
|
-
for (let C = 0,
|
|
4766
|
-
const w = m[C],
|
|
4764
|
+
const m = u[0], A = u[1], g = u[2], h = u[3], p = u[4], y = [];
|
|
4765
|
+
for (let C = 0, f = m.length; C < f; C++) {
|
|
4766
|
+
const w = m[C], E = A[C], D = g[C], j = h[C], Z = p[C];
|
|
4767
4767
|
if (w === void 0) continue;
|
|
4768
4768
|
w.updateMatrix && w.updateMatrix();
|
|
4769
|
-
const
|
|
4770
|
-
if (
|
|
4771
|
-
for (let
|
|
4772
|
-
|
|
4769
|
+
const N = n._createAnimationTracks(w, E, D, j, Z);
|
|
4770
|
+
if (N)
|
|
4771
|
+
for (let z = 0; z < N.length; z++)
|
|
4772
|
+
y.push(N[z]);
|
|
4773
4773
|
}
|
|
4774
|
-
const M = new no(i, void 0,
|
|
4775
|
-
return
|
|
4774
|
+
const M = new no(i, void 0, y);
|
|
4775
|
+
return Pe(M, s), M;
|
|
4776
4776
|
});
|
|
4777
4777
|
}
|
|
4778
4778
|
createNodeMesh(e) {
|
|
@@ -4804,14 +4804,14 @@ class oa {
|
|
|
4804
4804
|
l
|
|
4805
4805
|
]).then(function(c) {
|
|
4806
4806
|
const d = c[0], u = c[1], m = c[2];
|
|
4807
|
-
m !== null && d.traverse(function(
|
|
4808
|
-
|
|
4807
|
+
m !== null && d.traverse(function(A) {
|
|
4808
|
+
A.isSkinnedMesh && A.bind(m, ia);
|
|
4809
4809
|
});
|
|
4810
|
-
for (let
|
|
4811
|
-
d.add(u[
|
|
4810
|
+
for (let A = 0, g = u.length; A < g; A++)
|
|
4811
|
+
d.add(u[A]);
|
|
4812
4812
|
if (d.userData.pivot !== void 0 && u.length > 0) {
|
|
4813
|
-
const
|
|
4814
|
-
d.pivot = new R().fromArray(
|
|
4813
|
+
const A = d.userData.pivot, g = u[0];
|
|
4814
|
+
d.pivot = new R().fromArray(A), d.position.x -= A[0], d.position.y -= A[1], d.position.z -= A[2], g.position.set(0, 0, 0), delete d.userData.pivot;
|
|
4815
4815
|
}
|
|
4816
4816
|
return d;
|
|
4817
4817
|
});
|
|
@@ -4836,7 +4836,7 @@ class oa {
|
|
|
4836
4836
|
if (i.isBone === !0 ? d = new io() : c.length > 1 ? d = new Xt() : c.length === 1 ? d = c[0] : d = new dt(), d !== c[0])
|
|
4837
4837
|
for (let u = 0, m = c.length; u < m; u++)
|
|
4838
4838
|
d.add(c[u]);
|
|
4839
|
-
if (i.name && (d.userData.name = i.name, d.name = o),
|
|
4839
|
+
if (i.name && (d.userData.name = i.name, d.name = o), Pe(d, i), i.extensions && Ye(n, d, i), i.matrix !== void 0) {
|
|
4840
4840
|
const u = new xe();
|
|
4841
4841
|
u.fromArray(i.matrix), d.applyMatrix4(u);
|
|
4842
4842
|
} else
|
|
@@ -4859,7 +4859,7 @@ class oa {
|
|
|
4859
4859
|
*/
|
|
4860
4860
|
loadScene(e) {
|
|
4861
4861
|
const t = this.extensions, n = this.json.scenes[e], s = this, i = new Xt();
|
|
4862
|
-
n.name && (i.name = s.createUniqueName(n.name)),
|
|
4862
|
+
n.name && (i.name = s.createUniqueName(n.name)), Pe(i, n), n.extensions && Ye(t, i, n);
|
|
4863
4863
|
const o = n.nodes || [], a = [];
|
|
4864
4864
|
for (let l = 0, c = o.length; l < c; l++)
|
|
4865
4865
|
a.push(s.getDependency("node", o[l]));
|
|
@@ -4870,11 +4870,11 @@ class oa {
|
|
|
4870
4870
|
}
|
|
4871
4871
|
const c = (d) => {
|
|
4872
4872
|
const u = /* @__PURE__ */ new Map();
|
|
4873
|
-
for (const [m,
|
|
4874
|
-
(m instanceof Ct || m instanceof Gs) && u.set(m,
|
|
4873
|
+
for (const [m, A] of s.associations)
|
|
4874
|
+
(m instanceof Ct || m instanceof Gs) && u.set(m, A);
|
|
4875
4875
|
return d.traverse((m) => {
|
|
4876
|
-
const
|
|
4877
|
-
|
|
4876
|
+
const A = s.associations.get(m);
|
|
4877
|
+
A != null && u.set(m, A);
|
|
4878
4878
|
}), u;
|
|
4879
4879
|
};
|
|
4880
4880
|
return s.associations = c(i), i;
|
|
@@ -4882,8 +4882,8 @@ class oa {
|
|
|
4882
4882
|
}
|
|
4883
4883
|
_createAnimationTracks(e, t, n, s, i) {
|
|
4884
4884
|
const o = [], a = e.name ? e.name : e.uuid, l = [];
|
|
4885
|
-
function c(
|
|
4886
|
-
|
|
4885
|
+
function c(A) {
|
|
4886
|
+
A.morphTargetInfluences && l.push(A.name ? A.name : A.uuid);
|
|
4887
4887
|
}
|
|
4888
4888
|
ze[i.path] === ze.weights ? (c(e), e.isGroup && e.children.forEach(c)) : l.push(a);
|
|
4889
4889
|
let d;
|
|
@@ -4912,9 +4912,9 @@ class oa {
|
|
|
4912
4912
|
break;
|
|
4913
4913
|
}
|
|
4914
4914
|
const u = s.interpolation !== void 0 ? _r[s.interpolation] : Ss, m = this._getArrayFromAccessor(n);
|
|
4915
|
-
for (let
|
|
4915
|
+
for (let A = 0, g = l.length; A < g; A++) {
|
|
4916
4916
|
const h = new d(
|
|
4917
|
-
l[
|
|
4917
|
+
l[A] + "." + ze[i.path],
|
|
4918
4918
|
t.array,
|
|
4919
4919
|
m,
|
|
4920
4920
|
u
|
|
@@ -4964,9 +4964,9 @@ function ra(r, e, t) {
|
|
|
4964
4964
|
for (let c = 0, d = i.length; c < d; c++) {
|
|
4965
4965
|
const u = i[c];
|
|
4966
4966
|
if (u.POSITION !== void 0) {
|
|
4967
|
-
const m = t.json.accessors[u.POSITION],
|
|
4968
|
-
if (
|
|
4969
|
-
if (l.setX(Math.max(Math.abs(
|
|
4967
|
+
const m = t.json.accessors[u.POSITION], A = m.min, g = m.max;
|
|
4968
|
+
if (A !== void 0 && g !== void 0) {
|
|
4969
|
+
if (l.setX(Math.max(Math.abs(A[0]), Math.abs(g[0]))), l.setY(Math.max(Math.abs(A[1]), Math.abs(g[1]))), l.setZ(Math.max(Math.abs(A[2]), Math.abs(g[2]))), m.normalized) {
|
|
4970
4970
|
const h = Ts(ut[m.componentType]);
|
|
4971
4971
|
l.multiplyScalar(h);
|
|
4972
4972
|
}
|
|
@@ -4998,7 +4998,7 @@ function yn(r, e, t) {
|
|
|
4998
4998
|
});
|
|
4999
4999
|
s.push(o);
|
|
5000
5000
|
}
|
|
5001
|
-
return Qt.workingColorSpace !==
|
|
5001
|
+
return Qt.workingColorSpace !== Le && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Qt.workingColorSpace}" not supported.`), Pe(r, e), ra(r, e, t), Promise.all(s).then(function() {
|
|
5002
5002
|
return e.targets !== void 0 ? ea(r, e.targets, t) : r;
|
|
5003
5003
|
});
|
|
5004
5004
|
}
|
|
@@ -5379,7 +5379,7 @@ function Du() {
|
|
|
5379
5379
|
return I.renderer;
|
|
5380
5380
|
}
|
|
5381
5381
|
async function Fa() {
|
|
5382
|
-
var y,
|
|
5382
|
+
var p, y, M, C;
|
|
5383
5383
|
ye == null || ye(!0), await new Promise((f) => setTimeout(f, 50)), ks();
|
|
5384
5384
|
const r = I.scene;
|
|
5385
5385
|
if (!r)
|
|
@@ -5392,18 +5392,18 @@ async function Fa() {
|
|
|
5392
5392
|
};
|
|
5393
5393
|
const e = [], t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), s = {}, i = [], o = [];
|
|
5394
5394
|
r.traverse((f) => {
|
|
5395
|
-
var
|
|
5395
|
+
var w, E;
|
|
5396
5396
|
if (f.userData._sourceUuid = f.uuid, f.userData.type === "lightHelper" && e.push(f), f.type === "DirectionalLight" && f.userData.helper && (t.set(f, f.userData.helper), f.userData.helper = void 0), f.userData.isWater && f.type === "Mesh" && f.parent) {
|
|
5397
|
-
const
|
|
5398
|
-
let
|
|
5399
|
-
|
|
5400
|
-
const
|
|
5397
|
+
const D = f, j = D.material;
|
|
5398
|
+
let Z = "#4fc3f7";
|
|
5399
|
+
j.uniforms && j.uniforms.waterColor && (Z = "#" + j.uniforms.waterColor.value.getHexString());
|
|
5400
|
+
const N = D.geometry, z = {
|
|
5401
5401
|
uuid: f.uuid,
|
|
5402
5402
|
name: f.name,
|
|
5403
5403
|
position: f.position.toArray(),
|
|
5404
5404
|
rotation: [f.rotation.x, f.rotation.y, f.rotation.z],
|
|
5405
5405
|
scale: f.scale.toArray(),
|
|
5406
|
-
color:
|
|
5406
|
+
color: Z,
|
|
5407
5407
|
timeScale: f.userData.waterTimeScale ?? 0.05,
|
|
5408
5408
|
geometryType: "box",
|
|
5409
5409
|
boxWidth: void 0,
|
|
@@ -5412,94 +5412,96 @@ async function Fa() {
|
|
|
5412
5412
|
cylinderRadiusBottom: void 0,
|
|
5413
5413
|
cylinderRadialSegments: void 0
|
|
5414
5414
|
};
|
|
5415
|
-
|
|
5415
|
+
N.parameters && N.parameters.radiusTop !== void 0 ? (z.geometryType = "cylinder", z.cylinderRadiusTop = N.parameters.radiusTop, z.cylinderRadiusBottom = N.parameters.radiusBottom, z.cylinderRadialSegments = N.parameters.radialSegments) : (z.geometryType = "box", z.boxWidth = N.parameters.width, z.boxDepth = N.parameters.depth), i.push(z), o.push(f);
|
|
5416
5416
|
}
|
|
5417
5417
|
if (f.name && f.name.startsWith("DataPanel_")) {
|
|
5418
|
-
const
|
|
5419
|
-
if (
|
|
5420
|
-
const
|
|
5418
|
+
const D = f;
|
|
5419
|
+
if (D.element) {
|
|
5420
|
+
const j = D.element.querySelector(
|
|
5421
5421
|
"[data-panel-title]"
|
|
5422
|
-
),
|
|
5423
|
-
if (
|
|
5422
|
+
), Z = [];
|
|
5423
|
+
if (D.element.querySelectorAll(
|
|
5424
5424
|
".sl-css2d-data-panel-item"
|
|
5425
|
-
).forEach((
|
|
5426
|
-
var
|
|
5427
|
-
const q =
|
|
5428
|
-
if (q &&
|
|
5429
|
-
const
|
|
5425
|
+
).forEach((z) => {
|
|
5426
|
+
var _, k, ee;
|
|
5427
|
+
const q = z.querySelector(".item-label"), ne = z.querySelector(".item-value");
|
|
5428
|
+
if (q && ne) {
|
|
5429
|
+
const te = (q.textContent || "").trim(), ue = ((k = (_ = ne.childNodes[0]) == null ? void 0 : _.textContent) == null ? void 0 : k.trim()) || "", Q = ne.querySelector(
|
|
5430
5430
|
"span"
|
|
5431
|
-
),
|
|
5432
|
-
|
|
5431
|
+
), Te = Q ? (Q.textContent || "").trim() : void 0, Ee = ((ee = z.getAttribute("data-item-code")) == null ? void 0 : ee.trim()) || void 0;
|
|
5432
|
+
Z.push({ label: te, value: ue, unit: Te, code: Ee });
|
|
5433
5433
|
}
|
|
5434
5434
|
}), f.parent) {
|
|
5435
|
-
const
|
|
5435
|
+
const z = D.element.style.width || "", q = D.element.style.fontSize || "", ne = St(f.parent), _ = ne ? ne.getOffsetY() : 0.1;
|
|
5436
5436
|
n.set(
|
|
5437
5437
|
f.parent.userData.id ? f.parent.userData.id : f.parent.uuid,
|
|
5438
5438
|
{
|
|
5439
|
-
title: ((
|
|
5440
|
-
items:
|
|
5441
|
-
width:
|
|
5439
|
+
title: ((w = j == null ? void 0 : j.textContent) == null ? void 0 : w.trim()) || "",
|
|
5440
|
+
items: Z,
|
|
5441
|
+
width: z,
|
|
5442
5442
|
fontSize: q,
|
|
5443
|
-
offsetY:
|
|
5444
|
-
offsetX:
|
|
5445
|
-
offsetZ:
|
|
5443
|
+
offsetY: _,
|
|
5444
|
+
offsetX: ne ? ne.getOffsetX() : 0,
|
|
5445
|
+
offsetZ: ne ? ne.getOffsetZ() : 0
|
|
5446
5446
|
}
|
|
5447
5447
|
);
|
|
5448
5448
|
}
|
|
5449
5449
|
}
|
|
5450
5450
|
}
|
|
5451
5451
|
if (f.type === "Mesh") {
|
|
5452
|
-
const
|
|
5453
|
-
for (const
|
|
5454
|
-
if (
|
|
5455
|
-
const
|
|
5456
|
-
if (
|
|
5457
|
-
const
|
|
5458
|
-
|
|
5452
|
+
const D = f, j = Array.isArray(D.material) ? D.material : [D.material];
|
|
5453
|
+
for (const Z of j)
|
|
5454
|
+
if (Z && Z.userData) {
|
|
5455
|
+
const N = Z.userData;
|
|
5456
|
+
if (N._mapDataUrl || N._normalMapDataUrl || N._aoMapDataUrl) {
|
|
5457
|
+
const z = Z.uuid, q = s[z] || {};
|
|
5458
|
+
N._mapDataUrl && (q.mapDataUrl = N._mapDataUrl, q.mapFileName = N._mapFileName), N._normalMapDataUrl && (q.normalMapDataUrl = N._normalMapDataUrl, q.normalMapFileName = N._normalMapFileName, q.normalScale = ((E = Z.normalScale) == null ? void 0 : E.x) ?? 1), N._aoMapDataUrl && (q.aoMapDataUrl = N._aoMapDataUrl, q.aoMapFileName = N._aoMapFileName, q.aoMapIntensity = Z.aoMapIntensity ?? 1), s[z] = q;
|
|
5459
5459
|
}
|
|
5460
5460
|
}
|
|
5461
5461
|
}
|
|
5462
5462
|
}), e.forEach((f) => r.remove(f));
|
|
5463
|
-
const a =
|
|
5463
|
+
const a = (p = I.transformControls) == null ? void 0 : p.getHelper(), l = (a == null ? void 0 : a.parent) ?? null;
|
|
5464
|
+
a && a.parent && a.parent.remove(a);
|
|
5465
|
+
const c = /* @__PURE__ */ new Map();
|
|
5464
5466
|
for (const f of o)
|
|
5465
|
-
|
|
5466
|
-
const
|
|
5467
|
-
|
|
5467
|
+
c.set(f, f.parent), f.parent && f.parent.remove(f);
|
|
5468
|
+
const d = r.clone();
|
|
5469
|
+
d.children = d.children.filter(
|
|
5468
5470
|
(f) => f.userData.type !== "initFloor"
|
|
5469
|
-
),
|
|
5471
|
+
), d.traverse((f) => {
|
|
5470
5472
|
f.name && f.name.startsWith("DataPanel_") && f.parent && f.parent.remove(f);
|
|
5471
5473
|
});
|
|
5472
|
-
const
|
|
5474
|
+
const m = await new wt().parseAsync(d, {
|
|
5473
5475
|
binary: !0,
|
|
5474
5476
|
onlyVisible: !1,
|
|
5475
5477
|
embedImages: !0
|
|
5476
5478
|
});
|
|
5477
5479
|
e.forEach((f) => r.add(f));
|
|
5478
5480
|
for (const f of o) {
|
|
5479
|
-
const
|
|
5480
|
-
|
|
5481
|
+
const w = c.get(f);
|
|
5482
|
+
w ? w.add(f) : r.add(f);
|
|
5481
5483
|
}
|
|
5482
|
-
t.forEach((f,
|
|
5483
|
-
|
|
5484
|
+
t.forEach((f, w) => {
|
|
5485
|
+
w.userData.helper = f;
|
|
5484
5486
|
}), r.traverse((f) => {
|
|
5485
5487
|
delete f.userData._sourceUuid;
|
|
5486
|
-
});
|
|
5487
|
-
const
|
|
5488
|
+
}), a && (l ? l.add(a) : r.add(a));
|
|
5489
|
+
const A = {
|
|
5488
5490
|
position: (y = I.camera) == null ? void 0 : y.position.toArray(),
|
|
5489
|
-
rotation: (
|
|
5490
|
-
target: ((
|
|
5491
|
-
},
|
|
5492
|
-
n.forEach((f,
|
|
5493
|
-
|
|
5491
|
+
rotation: (M = I.camera) == null ? void 0 : M.rotation.toArray(),
|
|
5492
|
+
target: ((C = I.orbitControls) == null ? void 0 : C.target.toArray()) || [0, 0, 0]
|
|
5493
|
+
}, g = {};
|
|
5494
|
+
n.forEach((f, w) => {
|
|
5495
|
+
g[w] = f;
|
|
5494
5496
|
});
|
|
5495
|
-
const
|
|
5496
|
-
scene:
|
|
5497
|
-
camera:
|
|
5498
|
-
dataPanels:
|
|
5497
|
+
const h = {
|
|
5498
|
+
scene: m,
|
|
5499
|
+
camera: A,
|
|
5500
|
+
dataPanels: g,
|
|
5499
5501
|
waters: i,
|
|
5500
5502
|
textures: s
|
|
5501
5503
|
};
|
|
5502
|
-
return ye == null || ye(!1),
|
|
5504
|
+
return ye == null || ye(!1), h;
|
|
5503
5505
|
}
|
|
5504
5506
|
function Ua(r) {
|
|
5505
5507
|
if (r instanceof ArrayBuffer || ArrayBuffer.isView(r)) {
|
|
@@ -5528,90 +5530,90 @@ async function za(r, e = "edit", t, n, s) {
|
|
|
5528
5530
|
var o, a, l, c, d, u, m;
|
|
5529
5531
|
const i = Ua(r);
|
|
5530
5532
|
if (i) {
|
|
5531
|
-
const
|
|
5532
|
-
if (I.scene =
|
|
5533
|
+
const A = await new Vn().parseAsync(i, ""), g = A.scene || ((o = A.scenes) == null ? void 0 : o[0]), h = (a = I.scene) == null ? void 0 : a.environment;
|
|
5534
|
+
if (I.scene = g, g.children.some((p) => p.type === "AmbientLight") || g.add(new P.AmbientLight(16777215, 0.6)), h)
|
|
5533
5535
|
I.scene.environment = h;
|
|
5534
5536
|
else if (I.renderer) {
|
|
5535
|
-
const
|
|
5536
|
-
|
|
5537
|
+
const p = Ms(I.renderer);
|
|
5538
|
+
p && (I.scene.environment = p, I.scene.environmentIntensity = 1);
|
|
5537
5539
|
}
|
|
5538
5540
|
} else {
|
|
5539
|
-
const
|
|
5541
|
+
const A = typeof r == "string" ? JSON.parse(r) : r, h = new P.ObjectLoader().parse(A);
|
|
5540
5542
|
if (h.type === "Scene") {
|
|
5541
|
-
const
|
|
5542
|
-
if (I.scene = h,
|
|
5543
|
-
I.scene.environment =
|
|
5543
|
+
const p = (l = I.scene) == null ? void 0 : l.environment;
|
|
5544
|
+
if (I.scene = h, p)
|
|
5545
|
+
I.scene.environment = p;
|
|
5544
5546
|
else if (I.renderer) {
|
|
5545
|
-
const
|
|
5546
|
-
|
|
5547
|
+
const y = Ms(I.renderer);
|
|
5548
|
+
y && (I.scene.environment = y, I.scene.environmentIntensity = 1);
|
|
5547
5549
|
}
|
|
5548
5550
|
} else
|
|
5549
5551
|
(c = I.scene) == null || c.add(h);
|
|
5550
5552
|
}
|
|
5551
|
-
if (t && ((d = I.scene) == null || d.traverse((
|
|
5552
|
-
const
|
|
5553
|
-
if (h &&
|
|
5554
|
-
Ma(
|
|
5555
|
-
const
|
|
5553
|
+
if (t && ((d = I.scene) == null || d.traverse((A) => {
|
|
5554
|
+
const g = A.userData.id || A.userData._sourceUuid || A.uuid, h = t[g];
|
|
5555
|
+
if (h && A.userData.isMovable) {
|
|
5556
|
+
Ma(A);
|
|
5557
|
+
const p = new _t({
|
|
5556
5558
|
title: h.title,
|
|
5557
5559
|
items: h.items
|
|
5558
5560
|
});
|
|
5559
|
-
|
|
5561
|
+
p.attachTo(A), p.visible = !1, h.width && p.setWidth(h.width), h.fontSize && p.setFontSize(h.fontSize), h.offsetY !== void 0 && p.setOffsetY(h.offsetY), h.offsetX !== void 0 && p.setOffsetX(h.offsetX), h.offsetZ !== void 0 && p.setOffsetZ(h.offsetZ), Wn(A, p);
|
|
5560
5562
|
}
|
|
5561
|
-
})), n && n.length > 0 && Promise.resolve().then(() => Ja).then(({ addWater:
|
|
5563
|
+
})), n && n.length > 0 && Promise.resolve().then(() => Ja).then(({ addWater: A, addWaterCylinder: g }) => {
|
|
5562
5564
|
for (const h of n) {
|
|
5563
|
-
const
|
|
5564
|
-
let
|
|
5565
|
-
|
|
5565
|
+
const p = h.geometryType || "box";
|
|
5566
|
+
let y;
|
|
5567
|
+
p === "cylinder" ? y = g({
|
|
5566
5568
|
radiusTop: h.cylinderRadiusTop ?? 5,
|
|
5567
5569
|
radiusBottom: h.cylinderRadiusBottom ?? 5,
|
|
5568
5570
|
radialSegments: h.cylinderRadialSegments ?? 32,
|
|
5569
5571
|
height: 0.8,
|
|
5570
5572
|
color: h.color,
|
|
5571
5573
|
scale: 4
|
|
5572
|
-
}) :
|
|
5574
|
+
}) : y = A({
|
|
5573
5575
|
width: h.boxWidth ?? 10,
|
|
5574
5576
|
height: h.boxDepth ?? 10,
|
|
5575
5577
|
color: h.color,
|
|
5576
5578
|
scale: 4
|
|
5577
|
-
}),
|
|
5579
|
+
}), y.position.fromArray(h.position), y.rotation.set(h.rotation[0], h.rotation[1], h.rotation[2]), y.scale.fromArray(h.scale), y.name = h.name, y.userData.waterTimeScale = h.timeScale ?? 0.05, y.userData.isWater = !0, y.userData.isMovable = !0, Rt = !0;
|
|
5578
5580
|
}
|
|
5579
5581
|
$n();
|
|
5580
5582
|
}), s) {
|
|
5581
|
-
const
|
|
5582
|
-
(u = I.scene) == null || u.traverse((
|
|
5583
|
-
if (
|
|
5584
|
-
const h =
|
|
5585
|
-
for (const
|
|
5586
|
-
if (
|
|
5587
|
-
const M = s[
|
|
5583
|
+
const A = new P.TextureLoader();
|
|
5584
|
+
(u = I.scene) == null || u.traverse((g) => {
|
|
5585
|
+
if (g.type === "Mesh") {
|
|
5586
|
+
const h = g, p = Array.isArray(h.material) ? h.material : [h.material];
|
|
5587
|
+
for (const y of p)
|
|
5588
|
+
if (y && y.uuid && s[y.uuid]) {
|
|
5589
|
+
const M = s[y.uuid];
|
|
5588
5590
|
if (M.mapDataUrl) {
|
|
5589
|
-
const C =
|
|
5590
|
-
C.wrapS = C.wrapT = P.RepeatWrapping, C.repeat.set(1, 1),
|
|
5591
|
+
const C = A.load(M.mapDataUrl);
|
|
5592
|
+
C.wrapS = C.wrapT = P.RepeatWrapping, C.repeat.set(1, 1), y.map = C, y.userData = y.userData || {}, y.userData._mapDataUrl = M.mapDataUrl, y.userData._mapFileName = M.mapFileName;
|
|
5591
5593
|
}
|
|
5592
5594
|
if (M.normalMapDataUrl) {
|
|
5593
|
-
const C =
|
|
5594
|
-
C.wrapS = C.wrapT = P.RepeatWrapping, C.repeat.set(1, 1),
|
|
5595
|
+
const C = A.load(M.normalMapDataUrl);
|
|
5596
|
+
C.wrapS = C.wrapT = P.RepeatWrapping, C.repeat.set(1, 1), y.normalMap = C, y.normalScale = new P.Vector2(
|
|
5595
5597
|
M.normalScale ?? 1,
|
|
5596
5598
|
M.normalScale ?? 1
|
|
5597
|
-
),
|
|
5599
|
+
), y.userData = y.userData || {}, y.userData._normalMapDataUrl = M.normalMapDataUrl, y.userData._normalMapFileName = M.normalMapFileName;
|
|
5598
5600
|
}
|
|
5599
5601
|
if (M.aoMapDataUrl) {
|
|
5600
|
-
const C =
|
|
5601
|
-
C.wrapS = C.wrapT = P.RepeatWrapping, C.repeat.set(1, 1),
|
|
5602
|
+
const C = A.load(M.aoMapDataUrl);
|
|
5603
|
+
C.wrapS = C.wrapT = P.RepeatWrapping, C.repeat.set(1, 1), y.aoMap = C, y.aoMapIntensity = M.aoMapIntensity ?? 1, y.userData = y.userData || {}, y.userData._aoMapDataUrl = M.aoMapDataUrl, y.userData._aoMapFileName = M.aoMapFileName;
|
|
5602
5604
|
}
|
|
5603
|
-
|
|
5605
|
+
y.needsUpdate = !0;
|
|
5604
5606
|
}
|
|
5605
5607
|
}
|
|
5606
5608
|
});
|
|
5607
5609
|
}
|
|
5608
|
-
e === "edit" && ((m = I.scene) == null || m.traverse((
|
|
5609
|
-
var
|
|
5610
|
-
if (
|
|
5611
|
-
const h =
|
|
5610
|
+
e === "edit" && ((m = I.scene) == null || m.traverse((A) => {
|
|
5611
|
+
var g;
|
|
5612
|
+
if (A.type === "DirectionalLight") {
|
|
5613
|
+
const h = A;
|
|
5612
5614
|
if (!h.userData.helper) {
|
|
5613
|
-
const
|
|
5614
|
-
|
|
5615
|
+
const p = new P.DirectionalLightHelper(h, 1);
|
|
5616
|
+
p.userData.type = "lightHelper", h.userData.helper = p, (g = I.scene) == null || g.add(p);
|
|
5615
5617
|
}
|
|
5616
5618
|
}
|
|
5617
5619
|
}));
|
|
@@ -5631,7 +5633,7 @@ function ei(r) {
|
|
|
5631
5633
|
function Ga() {
|
|
5632
5634
|
Kt !== null && (cancelAnimationFrame(Kt), Kt = null), Mt && I.container && (I.container.removeEventListener("click", Mt), Mt = null), vt && (window.removeEventListener("resize", vt), vt = null), I.orbitControls && (I.orbitControls.dispose(), I.orbitControls = null), I.transformControls && (I.transformControls.dispose(), I.transformControls = null), Ge && (Ge.dispose(), Ge = null), I.scene && (ei(I.scene), I.scene = null), I.renderer && (I.renderer.dispose(), I.renderer.domElement && I.container && I.container.removeChild(I.renderer.domElement), I.renderer = null), tr(), I.camera = null, I.gridHelper = null, I.selectedObject = null, I.container = null, I.mode = "", We = [], tt.clear(), is(), Vt = !1, et = !1;
|
|
5633
5635
|
}
|
|
5634
|
-
const Wa = /^[og]\s*(.+)?/, Ba = /^mtllib /, Xa = /^usemtl /, qa = /^usemap /, bn = /\s+/, xn = new R(), gs = new R(), In = new R(), Cn = new R(), Ie = new R(), Gt = new
|
|
5636
|
+
const Wa = /^[og]\s*(.+)?/, Ba = /^mtllib /, Xa = /^usemtl /, qa = /^usemap /, bn = /\s+/, xn = new R(), gs = new R(), In = new R(), Cn = new R(), Ie = new R(), Gt = new re();
|
|
5635
5637
|
function Va() {
|
|
5636
5638
|
const r = {
|
|
5637
5639
|
objects: [],
|
|
@@ -5761,15 +5763,15 @@ function Va() {
|
|
|
5761
5763
|
},
|
|
5762
5764
|
addFace: function(e, t, n, s, i, o, a, l, c) {
|
|
5763
5765
|
const d = this.vertices.length;
|
|
5764
|
-
let u = this.parseVertexIndex(e, d), m = this.parseVertexIndex(t, d),
|
|
5765
|
-
if (this.addVertex(u, m,
|
|
5766
|
-
const
|
|
5767
|
-
u = this.parseNormalIndex(a,
|
|
5766
|
+
let u = this.parseVertexIndex(e, d), m = this.parseVertexIndex(t, d), A = this.parseVertexIndex(n, d);
|
|
5767
|
+
if (this.addVertex(u, m, A), this.addColor(u, m, A), a !== void 0 && a !== "") {
|
|
5768
|
+
const g = this.normals.length;
|
|
5769
|
+
u = this.parseNormalIndex(a, g), m = this.parseNormalIndex(l, g), A = this.parseNormalIndex(c, g), this.addNormal(u, m, A);
|
|
5768
5770
|
} else
|
|
5769
|
-
this.addFaceNormal(u, m,
|
|
5771
|
+
this.addFaceNormal(u, m, A);
|
|
5770
5772
|
if (s !== void 0 && s !== "") {
|
|
5771
|
-
const
|
|
5772
|
-
u = this.parseUVIndex(s,
|
|
5773
|
+
const g = this.uvs.length;
|
|
5774
|
+
u = this.parseUVIndex(s, g), m = this.parseUVIndex(i, g), A = this.parseUVIndex(o, g), this.addUV(u, m, A), this.object.geometry.hasUVIndices = !0;
|
|
5773
5775
|
} else
|
|
5774
5776
|
this.addDefaultUV();
|
|
5775
5777
|
},
|
|
@@ -5861,7 +5863,7 @@ class Ya extends Ls {
|
|
|
5861
5863
|
parseFloat(u[4]),
|
|
5862
5864
|
parseFloat(u[5]),
|
|
5863
5865
|
parseFloat(u[6]),
|
|
5864
|
-
|
|
5866
|
+
Se
|
|
5865
5867
|
), t.colors.push(Gt.r, Gt.g, Gt.b)) : t.colors.push(void 0, void 0, void 0);
|
|
5866
5868
|
break;
|
|
5867
5869
|
case "vn":
|
|
@@ -5879,41 +5881,41 @@ class Ya extends Ls {
|
|
|
5879
5881
|
break;
|
|
5880
5882
|
}
|
|
5881
5883
|
} else if (d === "f") {
|
|
5882
|
-
const m = c.slice(1).trim().split(bn),
|
|
5883
|
-
for (let h = 0,
|
|
5884
|
-
const
|
|
5885
|
-
if (
|
|
5886
|
-
const M =
|
|
5887
|
-
|
|
5884
|
+
const m = c.slice(1).trim().split(bn), A = [];
|
|
5885
|
+
for (let h = 0, p = m.length; h < p; h++) {
|
|
5886
|
+
const y = m[h];
|
|
5887
|
+
if (y.length > 0) {
|
|
5888
|
+
const M = y.split("/");
|
|
5889
|
+
A.push(M);
|
|
5888
5890
|
}
|
|
5889
5891
|
}
|
|
5890
|
-
const
|
|
5891
|
-
for (let h = 1,
|
|
5892
|
-
const
|
|
5892
|
+
const g = A[0];
|
|
5893
|
+
for (let h = 1, p = A.length - 1; h < p; h++) {
|
|
5894
|
+
const y = A[h], M = A[h + 1];
|
|
5893
5895
|
t.addFace(
|
|
5896
|
+
g[0],
|
|
5894
5897
|
y[0],
|
|
5895
|
-
f[0],
|
|
5896
5898
|
M[0],
|
|
5899
|
+
g[1],
|
|
5897
5900
|
y[1],
|
|
5898
|
-
f[1],
|
|
5899
5901
|
M[1],
|
|
5902
|
+
g[2],
|
|
5900
5903
|
y[2],
|
|
5901
|
-
f[2],
|
|
5902
5904
|
M[2]
|
|
5903
5905
|
);
|
|
5904
5906
|
}
|
|
5905
5907
|
} else if (d === "l") {
|
|
5906
5908
|
const u = c.substring(1).trim().split(" ");
|
|
5907
5909
|
let m = [];
|
|
5908
|
-
const
|
|
5910
|
+
const A = [];
|
|
5909
5911
|
if (c.indexOf("/") === -1)
|
|
5910
5912
|
m = u;
|
|
5911
5913
|
else
|
|
5912
|
-
for (let
|
|
5913
|
-
const
|
|
5914
|
-
|
|
5914
|
+
for (let g = 0, h = u.length; g < h; g++) {
|
|
5915
|
+
const p = u[g].split("/");
|
|
5916
|
+
p[0] !== "" && m.push(p[0]), p[1] !== "" && A.push(p[1]);
|
|
5915
5917
|
}
|
|
5916
|
-
t.addLineGeometry(m,
|
|
5918
|
+
t.addLineGeometry(m, A);
|
|
5917
5919
|
} else if (d === "p") {
|
|
5918
5920
|
const m = c.slice(1).trim().split(" ");
|
|
5919
5921
|
t.addPointGeometry(m);
|
|
@@ -5943,40 +5945,40 @@ class Ya extends Ls {
|
|
|
5943
5945
|
const i = new Xt();
|
|
5944
5946
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
|
|
5945
5947
|
for (let a = 0, l = t.objects.length; a < l; a++) {
|
|
5946
|
-
const c = t.objects[a], d = c.geometry, u = c.materials, m = d.type === "Line",
|
|
5947
|
-
let
|
|
5948
|
+
const c = t.objects[a], d = c.geometry, u = c.materials, m = d.type === "Line", A = d.type === "Points";
|
|
5949
|
+
let g = !1;
|
|
5948
5950
|
if (d.vertices.length === 0) continue;
|
|
5949
5951
|
const h = new $e();
|
|
5950
|
-
h.setAttribute("position", new
|
|
5951
|
-
const
|
|
5952
|
+
h.setAttribute("position", new Re(d.vertices, 3)), d.normals.length > 0 && h.setAttribute("normal", new Re(d.normals, 3)), d.colors.length > 0 && (g = !0, h.setAttribute("color", new Re(d.colors, 3))), d.hasUVIndices === !0 && h.setAttribute("uv", new Re(d.uvs, 2));
|
|
5953
|
+
const p = [];
|
|
5952
5954
|
for (let M = 0, C = u.length; M < C; M++) {
|
|
5953
|
-
const
|
|
5954
|
-
let
|
|
5955
|
+
const f = u[M], w = f.name + "_" + f.smooth + "_" + g;
|
|
5956
|
+
let E = t.materials[w];
|
|
5955
5957
|
if (this.materials !== null) {
|
|
5956
|
-
if (
|
|
5957
|
-
const
|
|
5958
|
-
Ct.prototype.copy.call(
|
|
5959
|
-
} else if (
|
|
5960
|
-
const
|
|
5961
|
-
Ct.prototype.copy.call(
|
|
5958
|
+
if (E = this.materials.create(f.name), m && E && !(E instanceof xt)) {
|
|
5959
|
+
const D = new xt();
|
|
5960
|
+
Ct.prototype.copy.call(D, E), D.color.copy(E.color), E = D;
|
|
5961
|
+
} else if (A && E && !(E instanceof mt)) {
|
|
5962
|
+
const D = new mt({ size: 10, sizeAttenuation: !1 });
|
|
5963
|
+
Ct.prototype.copy.call(D, E), D.color.copy(E.color), D.map = E.map, E = D;
|
|
5962
5964
|
}
|
|
5963
5965
|
}
|
|
5964
|
-
|
|
5966
|
+
E === void 0 && (m ? E = new xt() : A ? E = new mt({ size: 1, sizeAttenuation: !1 }) : E = new lo(), E.name = f.name, E.flatShading = !f.smooth, E.vertexColors = g, t.materials[w] = E), p.push(E);
|
|
5965
5967
|
}
|
|
5966
|
-
let
|
|
5967
|
-
if (
|
|
5968
|
+
let y;
|
|
5969
|
+
if (p.length > 1) {
|
|
5968
5970
|
for (let M = 0, C = u.length; M < C; M++) {
|
|
5969
|
-
const
|
|
5970
|
-
h.addGroup(
|
|
5971
|
+
const f = u[M];
|
|
5972
|
+
h.addGroup(f.groupStart, f.groupCount, M);
|
|
5971
5973
|
}
|
|
5972
|
-
m ?
|
|
5974
|
+
m ? y = new ws(h, p) : A ? y = new Bt(h, p) : y = new S(h, p);
|
|
5973
5975
|
} else
|
|
5974
|
-
m ?
|
|
5975
|
-
|
|
5976
|
+
m ? y = new ws(h, p[0]) : A ? y = new Bt(h, p[0]) : y = new S(h, p[0]);
|
|
5977
|
+
y.name = c.name, i.add(y);
|
|
5976
5978
|
}
|
|
5977
5979
|
else if (t.vertices.length > 0) {
|
|
5978
5980
|
const a = new mt({ size: 1, sizeAttenuation: !1 }), l = new $e();
|
|
5979
|
-
l.setAttribute("position", new
|
|
5981
|
+
l.setAttribute("position", new Re(t.vertices, 3)), t.colors.length > 0 && t.colors[0] !== void 0 && (l.setAttribute("color", new Re(t.colors, 3)), a.vertexColors = !0);
|
|
5980
5982
|
const c = new Bt(l, a);
|
|
5981
5983
|
i.add(c);
|
|
5982
5984
|
}
|
|
@@ -6055,10 +6057,10 @@ class Ka extends Ls {
|
|
|
6055
6057
|
*/
|
|
6056
6058
|
parse(e, t, n = () => {
|
|
6057
6059
|
}) {
|
|
6058
|
-
this.decodeDracoFile(e, t, null, null,
|
|
6060
|
+
this.decodeDracoFile(e, t, null, null, Se, n).catch(n);
|
|
6059
6061
|
}
|
|
6060
6062
|
//
|
|
6061
|
-
decodeDracoFile(e, t, n, s, i =
|
|
6063
|
+
decodeDracoFile(e, t, n, s, i = Le, o = () => {
|
|
6062
6064
|
}) {
|
|
6063
6065
|
const a = {
|
|
6064
6066
|
attributeIDs: n || this.defaultAttributeIDs,
|
|
@@ -6107,10 +6109,10 @@ class Ka extends Ls {
|
|
|
6107
6109
|
return t;
|
|
6108
6110
|
}
|
|
6109
6111
|
_assignVertexColorSpace(e, t) {
|
|
6110
|
-
if (t !==
|
|
6111
|
-
const n = new
|
|
6112
|
+
if (t !== Se) return;
|
|
6113
|
+
const n = new re();
|
|
6112
6114
|
for (let s = 0, i = e.count; s < i; s++)
|
|
6113
|
-
n.fromBufferAttribute(e, s), Qt.colorSpaceToWorking(n,
|
|
6115
|
+
n.fromBufferAttribute(e, s), Qt.colorSpaceToWorking(n, Se), e.setXYZ(s, n.r, n.g, n.b);
|
|
6114
6116
|
}
|
|
6115
6117
|
_loadLibrary(e, t) {
|
|
6116
6118
|
const n = new Dt(this.manager);
|
|
@@ -6192,10 +6194,10 @@ function Za() {
|
|
|
6192
6194
|
e.then((d) => {
|
|
6193
6195
|
const u = d.draco, m = new u.Decoder();
|
|
6194
6196
|
try {
|
|
6195
|
-
const
|
|
6196
|
-
|
|
6197
|
-
} catch (
|
|
6198
|
-
console.error(
|
|
6197
|
+
const A = t(u, m, new Int8Array(l), c), g = A.attributes.map((h) => h.array.buffer);
|
|
6198
|
+
A.index && g.push(A.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: A }, g);
|
|
6199
|
+
} catch (A) {
|
|
6200
|
+
console.error(A), self.postMessage({ type: "error", id: a.id, error: A.message });
|
|
6199
6201
|
} finally {
|
|
6200
6202
|
u.destroy(m);
|
|
6201
6203
|
}
|
|
@@ -6205,59 +6207,59 @@ function Za() {
|
|
|
6205
6207
|
};
|
|
6206
6208
|
function t(o, a, l, c) {
|
|
6207
6209
|
const d = c.attributeIDs, u = c.attributeTypes;
|
|
6208
|
-
let m,
|
|
6209
|
-
const
|
|
6210
|
-
if (
|
|
6211
|
-
m = new o.Mesh(),
|
|
6212
|
-
else if (
|
|
6213
|
-
m = new o.PointCloud(),
|
|
6210
|
+
let m, A;
|
|
6211
|
+
const g = a.GetEncodedGeometryType(l);
|
|
6212
|
+
if (g === o.TRIANGULAR_MESH)
|
|
6213
|
+
m = new o.Mesh(), A = a.DecodeArrayToMesh(l, l.byteLength, m);
|
|
6214
|
+
else if (g === o.POINT_CLOUD)
|
|
6215
|
+
m = new o.PointCloud(), A = a.DecodeArrayToPointCloud(l, l.byteLength, m);
|
|
6214
6216
|
else
|
|
6215
6217
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
6216
|
-
if (!
|
|
6217
|
-
throw new Error("THREE.DRACOLoader: Decoding failed: " +
|
|
6218
|
+
if (!A.ok() || m.ptr === 0)
|
|
6219
|
+
throw new Error("THREE.DRACOLoader: Decoding failed: " + A.error_msg());
|
|
6218
6220
|
const h = { index: null, attributes: [] };
|
|
6219
|
-
for (const
|
|
6220
|
-
const
|
|
6221
|
+
for (const p in d) {
|
|
6222
|
+
const y = self[u[p]];
|
|
6221
6223
|
let M, C;
|
|
6222
6224
|
if (c.useUniqueIDs)
|
|
6223
|
-
C = d[
|
|
6225
|
+
C = d[p], M = a.GetAttributeByUniqueId(m, C);
|
|
6224
6226
|
else {
|
|
6225
|
-
if (C = a.GetAttributeId(m, o[d[
|
|
6227
|
+
if (C = a.GetAttributeId(m, o[d[p]]), C === -1) continue;
|
|
6226
6228
|
M = a.GetAttribute(m, C);
|
|
6227
6229
|
}
|
|
6228
|
-
const
|
|
6229
|
-
|
|
6230
|
+
const f = s(o, a, m, p, y, M);
|
|
6231
|
+
p === "color" && (f.vertexColorSpace = c.vertexColorSpace), h.attributes.push(f);
|
|
6230
6232
|
}
|
|
6231
|
-
return
|
|
6233
|
+
return g === o.TRIANGULAR_MESH && (h.index = n(o, a, m)), o.destroy(m), h;
|
|
6232
6234
|
}
|
|
6233
6235
|
function n(o, a, l) {
|
|
6234
6236
|
const d = l.num_faces() * 3, u = d * 4, m = o._malloc(u);
|
|
6235
6237
|
a.GetTrianglesUInt32Array(l, u, m);
|
|
6236
|
-
const
|
|
6237
|
-
return o._free(m), { array:
|
|
6238
|
+
const A = new Uint32Array(o.HEAPF32.buffer, m, d).slice();
|
|
6239
|
+
return o._free(m), { array: A, itemSize: 1 };
|
|
6238
6240
|
}
|
|
6239
6241
|
function s(o, a, l, c, d, u) {
|
|
6240
|
-
const m = l.num_points(),
|
|
6241
|
-
a.GetAttributeDataArrayForAllPoints(l, u,
|
|
6242
|
-
const w = new d(o.HEAPF32.buffer,
|
|
6243
|
-
let
|
|
6244
|
-
if (h ===
|
|
6245
|
-
|
|
6242
|
+
const m = l.num_points(), A = u.num_components(), g = i(o, d), h = A * d.BYTES_PER_ELEMENT, p = Math.ceil(h / 4) * 4, y = p / d.BYTES_PER_ELEMENT, M = m * h, C = m * p, f = o._malloc(M);
|
|
6243
|
+
a.GetAttributeDataArrayForAllPoints(l, u, g, M, f);
|
|
6244
|
+
const w = new d(o.HEAPF32.buffer, f, M / d.BYTES_PER_ELEMENT);
|
|
6245
|
+
let E;
|
|
6246
|
+
if (h === p)
|
|
6247
|
+
E = w.slice();
|
|
6246
6248
|
else {
|
|
6247
|
-
|
|
6248
|
-
let
|
|
6249
|
-
for (let
|
|
6250
|
-
for (let
|
|
6251
|
-
|
|
6252
|
-
|
|
6249
|
+
E = new d(C / d.BYTES_PER_ELEMENT);
|
|
6250
|
+
let D = 0;
|
|
6251
|
+
for (let j = 0, Z = w.length; j < Z; j++) {
|
|
6252
|
+
for (let N = 0; N < A; N++)
|
|
6253
|
+
E[D + N] = w[j * A + N];
|
|
6254
|
+
D += y;
|
|
6253
6255
|
}
|
|
6254
6256
|
}
|
|
6255
|
-
return o._free(
|
|
6257
|
+
return o._free(f), {
|
|
6256
6258
|
name: c,
|
|
6257
6259
|
count: m,
|
|
6258
|
-
itemSize:
|
|
6259
|
-
array:
|
|
6260
|
-
stride:
|
|
6260
|
+
itemSize: A,
|
|
6261
|
+
array: E,
|
|
6262
|
+
stride: y
|
|
6261
6263
|
};
|
|
6262
6264
|
}
|
|
6263
6265
|
function i(o, a) {
|
|
@@ -6288,7 +6290,7 @@ class Qa extends S {
|
|
|
6288
6290
|
*/
|
|
6289
6291
|
constructor(e, t = {}) {
|
|
6290
6292
|
super(e), this.isWater = !0;
|
|
6291
|
-
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, d = t.sunDirection !== void 0 ? t.sunDirection : new R(0.70707, 0.70707, 0), u = new
|
|
6293
|
+
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, d = t.sunDirection !== void 0 ? t.sunDirection : new R(0.70707, 0.70707, 0), u = new re(t.sunColor !== void 0 ? t.sunColor : 16777215), m = new re(t.waterColor !== void 0 ? t.waterColor : 8355711), A = t.eye !== void 0 ? t.eye : new R(0, 0, 0), g = t.distortionScale !== void 0 ? t.distortionScale : 20, h = t.side !== void 0 ? t.side : Un, p = t.fog !== void 0 ? t.fog : !1, y = new Mn(), M = new R(), C = new R(), f = new R(), w = new xe(), E = new R(0, 0, -1), D = new qs(), j = new R(), Z = new R(), N = new qs(), z = new xe(), q = new Fn(), ne = new Tn(s, i, { type: En }), _ = {
|
|
6292
6294
|
name: "MirrorShader",
|
|
6293
6295
|
uniforms: Zt.merge([
|
|
6294
6296
|
Vs.fog,
|
|
@@ -6301,10 +6303,10 @@ class Qa extends S {
|
|
|
6301
6303
|
size: { value: 1 },
|
|
6302
6304
|
distortionScale: { value: 20 },
|
|
6303
6305
|
textureMatrix: { value: new xe() },
|
|
6304
|
-
sunColor: { value: new
|
|
6306
|
+
sunColor: { value: new re(8355711) },
|
|
6305
6307
|
sunDirection: { value: new R(0.70707, 0.70707, 0) },
|
|
6306
6308
|
eye: { value: new R() },
|
|
6307
|
-
waterColor: { value: new
|
|
6309
|
+
waterColor: { value: new re(5592405) }
|
|
6308
6310
|
}
|
|
6309
6311
|
]),
|
|
6310
6312
|
vertexShader: (
|
|
@@ -6412,17 +6414,17 @@ class Qa extends S {
|
|
|
6412
6414
|
}`
|
|
6413
6415
|
)
|
|
6414
6416
|
}, k = new Is({
|
|
6415
|
-
name:
|
|
6416
|
-
uniforms: Zt.clone(
|
|
6417
|
-
vertexShader:
|
|
6418
|
-
fragmentShader:
|
|
6417
|
+
name: _.name,
|
|
6418
|
+
uniforms: Zt.clone(_.uniforms),
|
|
6419
|
+
vertexShader: _.vertexShader,
|
|
6420
|
+
fragmentShader: _.fragmentShader,
|
|
6419
6421
|
lights: !0,
|
|
6420
6422
|
side: h,
|
|
6421
|
-
fog:
|
|
6423
|
+
fog: p
|
|
6422
6424
|
});
|
|
6423
|
-
k.uniforms.mirrorSampler.value =
|
|
6424
|
-
if (C.setFromMatrixPosition(n.matrixWorld),
|
|
6425
|
-
|
|
6425
|
+
k.uniforms.mirrorSampler.value = ne.texture, k.uniforms.textureMatrix.value = z, k.uniforms.alpha.value = a, k.uniforms.time.value = l, k.uniforms.normalSampler.value = c, k.uniforms.sunColor.value = u, k.uniforms.waterColor.value = m, k.uniforms.sunDirection.value = d, k.uniforms.distortionScale.value = g, k.uniforms.eye.value = A, n.material = k, n.onBeforeRender = function(ee, te, ue) {
|
|
6426
|
+
if (C.setFromMatrixPosition(n.matrixWorld), f.setFromMatrixPosition(ue.matrixWorld), w.extractRotation(n.matrixWorld), M.set(0, 0, 1), M.applyMatrix4(w), j.subVectors(C, f), j.dot(M) > 0) return;
|
|
6427
|
+
j.reflect(M).negate(), j.add(C), w.extractRotation(ue.matrixWorld), E.set(0, 0, -1), E.applyMatrix4(w), E.add(f), Z.subVectors(C, E), Z.reflect(M).negate(), Z.add(C), q.position.copy(j), q.up.set(0, 1, 0), q.up.applyMatrix4(w), q.up.reflect(M), q.lookAt(Z), q.far = ue.far, q.updateMatrixWorld(), q.projectionMatrix.copy(ue.projectionMatrix), z.set(
|
|
6426
6428
|
0.5,
|
|
6427
6429
|
0,
|
|
6428
6430
|
0,
|
|
@@ -6439,13 +6441,13 @@ class Qa extends S {
|
|
|
6439
6441
|
0,
|
|
6440
6442
|
0,
|
|
6441
6443
|
1
|
|
6442
|
-
),
|
|
6443
|
-
const
|
|
6444
|
-
|
|
6445
|
-
const
|
|
6446
|
-
n.visible = !1,
|
|
6447
|
-
const nt =
|
|
6448
|
-
nt !== void 0 &&
|
|
6444
|
+
), z.multiply(q.projectionMatrix), z.multiply(q.matrixWorldInverse), y.setFromNormalAndCoplanarPoint(M, C), y.applyMatrix4(q.matrixWorldInverse), D.set(y.normal.x, y.normal.y, y.normal.z, y.constant);
|
|
6445
|
+
const Q = q.projectionMatrix;
|
|
6446
|
+
N.x = (Math.sign(D.x) + Q.elements[8]) / Q.elements[0], N.y = (Math.sign(D.y) + Q.elements[9]) / Q.elements[5], N.z = -1, N.w = (1 + Q.elements[10]) / Q.elements[14], D.multiplyScalar(2 / D.dot(N)), Q.elements[2] = D.x, Q.elements[6] = D.y, Q.elements[10] = D.z + 1 - o, Q.elements[14] = D.w, A.setFromMatrixPosition(ue.matrixWorld);
|
|
6447
|
+
const Te = ee.getRenderTarget(), Ee = ee.xr.enabled, je = ee.shadowMap.autoUpdate;
|
|
6448
|
+
n.visible = !1, ee.xr.enabled = !1, ee.shadowMap.autoUpdate = !1, ee.setRenderTarget(ne), ee.state.buffers.depth.setMask(!0), ee.autoClear === !1 && ee.clear(), ee.render(te, q), n.visible = !0, ee.xr.enabled = Ee, ee.shadowMap.autoUpdate = je, ee.setRenderTarget(Te);
|
|
6449
|
+
const nt = ue.viewport;
|
|
6450
|
+
nt !== void 0 && ee.state.viewport(nt);
|
|
6449
6451
|
};
|
|
6450
6452
|
}
|
|
6451
6453
|
}
|
|
@@ -6515,19 +6517,19 @@ function li(r) {
|
|
|
6515
6517
|
repeatY: l = 4,
|
|
6516
6518
|
speedX: c = 5e-4,
|
|
6517
6519
|
speedY: d = 5e-4
|
|
6518
|
-
} = r || {}, u = new P.PlaneGeometry(e, t),
|
|
6519
|
-
|
|
6520
|
-
}),
|
|
6520
|
+
} = r || {}, u = new P.PlaneGeometry(e, t), A = new P.TextureLoader().load(ti, (p) => {
|
|
6521
|
+
p.wrapS = p.wrapT = P.RepeatWrapping, p.repeat.set(a, l), p.generateMipmaps = !1, p.minFilter = P.LinearFilter, p.magFilter = P.LinearFilter;
|
|
6522
|
+
}), g = new P.MeshStandardMaterial({
|
|
6521
6523
|
color: n,
|
|
6522
6524
|
roughness: s,
|
|
6523
6525
|
metalness: i,
|
|
6524
|
-
normalMap:
|
|
6526
|
+
normalMap: A,
|
|
6525
6527
|
normalScale: new P.Vector2(o, o),
|
|
6526
6528
|
side: P.DoubleSide,
|
|
6527
6529
|
// 双面渲染,避免从侧面或底部看到黑色
|
|
6528
6530
|
transparent: !0,
|
|
6529
6531
|
opacity: 0.6
|
|
6530
|
-
}), h = new P.Mesh(u,
|
|
6532
|
+
}), h = new P.Mesh(u, g);
|
|
6531
6533
|
h.rotation.x = -Math.PI / 2, h.position.y = 0, h.name = "水面(标准材质)", h.userData.isWater = !0, h.userData.isMovable = !0, h.userData.waterSpeed = { x: c, y: d }, st(h);
|
|
6532
6534
|
}
|
|
6533
6535
|
function ci(r) {
|
|
@@ -6635,7 +6637,7 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6635
6637
|
},
|
|
6636
6638
|
emits: ["select", "delete"],
|
|
6637
6639
|
setup(r, { emit: e }) {
|
|
6638
|
-
const t = r, n = e, s =
|
|
6640
|
+
const t = r, n = e, s = W(null), { expandedSet: i, toggleExpand: o } = gi("treeExpand"), a = ot(() => i.value.has(t.node.uuid)), l = ot(() => (t.version, t.node.children.some((h) => h.userData.isMovable === !0))), c = ot(() => (t.version, t.node.children.filter(
|
|
6639
6641
|
(h) => h.userData.isMovable === !0
|
|
6640
6642
|
))), d = ot(
|
|
6641
6643
|
() => {
|
|
@@ -6658,10 +6660,10 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6658
6660
|
h.stopPropagation(), n("select", t.node);
|
|
6659
6661
|
}, m = (h) => {
|
|
6660
6662
|
h.stopPropagation(), n("delete", t.node);
|
|
6661
|
-
},
|
|
6662
|
-
return (h,
|
|
6663
|
-
const
|
|
6664
|
-
return
|
|
6663
|
+
}, A = (h) => h.type === "Mesh" || h.type === "Sprite" ? "🟦" : h.type === "Light" ? "💡" : "📦", g = (h) => h.name || `${h.type} (${h.id})`;
|
|
6664
|
+
return (h, p) => {
|
|
6665
|
+
const y = bi("TreeItem", !0);
|
|
6666
|
+
return L(), U("div", {
|
|
6665
6667
|
class: "tree-node",
|
|
6666
6668
|
ref_key: "nodeRef",
|
|
6667
6669
|
ref: s
|
|
@@ -6670,28 +6672,28 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6670
6672
|
class: ve(["tree-item", { selected: d.value }]),
|
|
6671
6673
|
onClick: u
|
|
6672
6674
|
}, [
|
|
6673
|
-
l.value ? (
|
|
6675
|
+
l.value ? (L(), U("span", {
|
|
6674
6676
|
key: 0,
|
|
6675
6677
|
class: "toggle-icon",
|
|
6676
|
-
onClick:
|
|
6677
|
-
},
|
|
6678
|
-
b("span", $a,
|
|
6679
|
-
b("span", el,
|
|
6678
|
+
onClick: p[0] || (p[0] = bs((M) => xi(o)(h.node.uuid), ["stop"]))
|
|
6679
|
+
}, de(a.value ? "▼" : "▶"), 1)) : (L(), U("span", _a)),
|
|
6680
|
+
b("span", $a, de(A(h.node)), 1),
|
|
6681
|
+
b("span", el, de(g(h.node)), 1),
|
|
6680
6682
|
b("button", {
|
|
6681
6683
|
class: "tree-delete",
|
|
6682
6684
|
onClick: bs(m, ["stop"])
|
|
6683
6685
|
}, "×")
|
|
6684
6686
|
], 2),
|
|
6685
|
-
a.value && l.value ? (
|
|
6686
|
-
(
|
|
6687
|
+
a.value && l.value ? (L(), U("div", tl, [
|
|
6688
|
+
(L(!0), U(Oe, null, ns(c.value, (M) => (L(), bt(y, {
|
|
6687
6689
|
key: M.uuid,
|
|
6688
6690
|
node: M,
|
|
6689
6691
|
"selected-object": h.selectedObject,
|
|
6690
6692
|
version: h.version,
|
|
6691
|
-
onSelect:
|
|
6692
|
-
onDelete:
|
|
6693
|
+
onSelect: p[1] || (p[1] = (C) => n("select", C)),
|
|
6694
|
+
onDelete: p[2] || (p[2] = (C) => n("delete", C))
|
|
6693
6695
|
}, null, 8, ["node", "selected-object", "version"]))), 128))
|
|
6694
|
-
])) :
|
|
6696
|
+
])) : ce("", !0)
|
|
6695
6697
|
], 512);
|
|
6696
6698
|
};
|
|
6697
6699
|
}
|
|
@@ -6754,224 +6756,224 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6754
6756
|
opacity: 1,
|
|
6755
6757
|
normalScale: 1,
|
|
6756
6758
|
aoIntensity: 1
|
|
6757
|
-
}), o =
|
|
6759
|
+
}), o = W("#ffffff"), a = W(!1), l = W(!1), c = W("");
|
|
6758
6760
|
let d = null;
|
|
6759
|
-
const u =
|
|
6760
|
-
let p = null;
|
|
6761
|
-
const y = z(!1), h = z("");
|
|
6761
|
+
const u = W(!1), m = W("");
|
|
6762
6762
|
let A = null;
|
|
6763
|
-
const
|
|
6763
|
+
const g = W(!1), h = W("");
|
|
6764
|
+
let p = null;
|
|
6765
|
+
const y = xs({
|
|
6764
6766
|
intensity: 1
|
|
6765
6767
|
});
|
|
6766
6768
|
function M() {
|
|
6767
|
-
t.selectedObject && t.selectedObject.type === "DirectionalLight" && (t.selectedObject.intensity =
|
|
6769
|
+
t.selectedObject && t.selectedObject.type === "DirectionalLight" && (t.selectedObject.intensity = y.intensity);
|
|
6768
6770
|
}
|
|
6769
|
-
function C(
|
|
6771
|
+
function C(T) {
|
|
6770
6772
|
let x = null;
|
|
6771
|
-
return
|
|
6773
|
+
return T.traverse((v) => {
|
|
6772
6774
|
if (v.type === "Mesh" && !x) {
|
|
6773
6775
|
const O = v, H = Array.isArray(O.material) ? O.material : [O.material];
|
|
6774
|
-
for (const
|
|
6775
|
-
if (
|
|
6776
|
-
x =
|
|
6776
|
+
for (const Y of H)
|
|
6777
|
+
if (Y && (Y.type === "MeshStandardMaterial" || Y.type === "MeshPhongMaterial" || Y.type === "MeshBasicMaterial" || Y.type === "MeshLambertMaterial" || Y.type === "MeshToonMaterial" || Y.type === "MeshPhysicalMaterial")) {
|
|
6778
|
+
x = Y;
|
|
6777
6779
|
break;
|
|
6778
6780
|
}
|
|
6779
6781
|
}
|
|
6780
6782
|
}), x;
|
|
6781
6783
|
}
|
|
6782
|
-
function
|
|
6784
|
+
function f(T) {
|
|
6783
6785
|
let x = null;
|
|
6784
|
-
return
|
|
6786
|
+
return T.traverse((v) => {
|
|
6785
6787
|
if (v.type === "Mesh" && !x) {
|
|
6786
6788
|
const O = v, H = Array.isArray(O.material) ? O.material : [O.material];
|
|
6787
|
-
for (const
|
|
6788
|
-
if (
|
|
6789
|
-
const
|
|
6789
|
+
for (const Y of H)
|
|
6790
|
+
if (Y && (Y.type === "MeshStandardMaterial" || Y.type === "MeshPhongMaterial" || Y.type === "MeshBasicMaterial" || Y.type === "MeshLambertMaterial" || Y.type === "MeshToonMaterial" || Y.type === "MeshPhysicalMaterial")) {
|
|
6791
|
+
const V = Y;
|
|
6790
6792
|
x = {
|
|
6791
|
-
color:
|
|
6792
|
-
metalness:
|
|
6793
|
-
roughness:
|
|
6794
|
-
opacity:
|
|
6793
|
+
color: V.color ? V.color.getHex() : 16777215,
|
|
6794
|
+
metalness: V.metalness ?? 0,
|
|
6795
|
+
roughness: V.roughness ?? 0.5,
|
|
6796
|
+
opacity: Y.opacity ?? 1
|
|
6795
6797
|
};
|
|
6796
6798
|
break;
|
|
6797
6799
|
}
|
|
6798
6800
|
}
|
|
6799
6801
|
}), x;
|
|
6800
6802
|
}
|
|
6801
|
-
function w(
|
|
6803
|
+
function w(T, x) {
|
|
6802
6804
|
let v = !1;
|
|
6803
|
-
return
|
|
6805
|
+
return T.traverse((O) => {
|
|
6804
6806
|
if (O.type === "Mesh") {
|
|
6805
|
-
const H = O,
|
|
6806
|
-
for (const
|
|
6807
|
-
|
|
6807
|
+
const H = O, Y = Array.isArray(H.material) ? H.material : [H.material];
|
|
6808
|
+
for (const V of Y)
|
|
6809
|
+
V && (V.type === "MeshStandardMaterial" || V.type === "MeshPhongMaterial" || V.type === "MeshBasicMaterial" || V.type === "MeshLambertMaterial" || V.type === "MeshToonMaterial" || V.type === "MeshPhysicalMaterial") && (x.color !== void 0 && (V.color = new re(x.color)), x.metalness !== void 0 && (V.metalness = x.metalness), x.roughness !== void 0 && (V.roughness = x.roughness), x.opacity !== void 0 && (V.opacity = x.opacity, V.transparent = x.opacity < 1), V.needsUpdate = !0, v = !0);
|
|
6808
6810
|
}
|
|
6809
6811
|
}), v;
|
|
6810
6812
|
}
|
|
6811
|
-
function
|
|
6813
|
+
function E() {
|
|
6812
6814
|
if (t.selectedObject) {
|
|
6813
|
-
const
|
|
6815
|
+
const T = w(t.selectedObject, {
|
|
6814
6816
|
metalness: i.metalness,
|
|
6815
6817
|
roughness: i.roughness,
|
|
6816
6818
|
opacity: i.opacity
|
|
6817
6819
|
});
|
|
6818
|
-
a.value =
|
|
6820
|
+
a.value = T;
|
|
6819
6821
|
}
|
|
6820
6822
|
}
|
|
6821
|
-
function
|
|
6822
|
-
const v =
|
|
6823
|
+
function D(T) {
|
|
6824
|
+
const v = T.target.value;
|
|
6823
6825
|
o.value = v;
|
|
6824
|
-
const O = new
|
|
6826
|
+
const O = new re(v);
|
|
6825
6827
|
i.color = O.getHex(), t.selectedObject && w(t.selectedObject, { color: O.getHex() });
|
|
6826
6828
|
}
|
|
6827
|
-
function
|
|
6828
|
-
let v =
|
|
6829
|
+
function j(T) {
|
|
6830
|
+
let v = T.target.value.trim();
|
|
6829
6831
|
if (v.startsWith("#") || (v = "#" + v), /^#[0-9a-fA-F]{6}$/.test(v)) {
|
|
6830
6832
|
o.value = v;
|
|
6831
|
-
const O = new
|
|
6833
|
+
const O = new re(v);
|
|
6832
6834
|
i.color = O.getHex(), t.selectedObject && w(t.selectedObject, { color: O.getHex() });
|
|
6833
6835
|
}
|
|
6834
6836
|
}
|
|
6835
|
-
function
|
|
6837
|
+
function Z(T) {
|
|
6836
6838
|
var v, O;
|
|
6837
|
-
const x = C(
|
|
6839
|
+
const x = C(T);
|
|
6838
6840
|
x && x.normalMap ? (l.value = !0, d = x.normalMap, c.value = ((v = x.userData) == null ? void 0 : v._normalMapFileName) || "法线贴图", i.normalScale = ((O = x.normalScale) == null ? void 0 : O.x) ?? 1) : (l.value = !1, d = null, c.value = "", i.normalScale = 1);
|
|
6839
6841
|
}
|
|
6840
|
-
function
|
|
6842
|
+
function N(T) {
|
|
6841
6843
|
var H;
|
|
6842
|
-
const x =
|
|
6844
|
+
const x = T.target, v = (H = x.files) == null ? void 0 : H[0];
|
|
6843
6845
|
if (!v || !t.selectedObject) return;
|
|
6844
6846
|
const O = new FileReader();
|
|
6845
|
-
O.onload = (
|
|
6847
|
+
O.onload = (Y) => {
|
|
6846
6848
|
var Ae;
|
|
6847
|
-
const
|
|
6848
|
-
|
|
6849
|
+
const V = (Ae = Y.target) == null ? void 0 : Ae.result;
|
|
6850
|
+
z(t.selectedObject, V, v.name);
|
|
6849
6851
|
}, O.readAsDataURL(v), x.value = "";
|
|
6850
6852
|
}
|
|
6851
|
-
function
|
|
6853
|
+
function z(T, x, v) {
|
|
6852
6854
|
const H = new Wt().load(x);
|
|
6853
|
-
H.wrapS = H.wrapT = Je, H.repeat.set(1, 1),
|
|
6854
|
-
if (
|
|
6855
|
-
const
|
|
6856
|
-
for (const
|
|
6857
|
-
|
|
6855
|
+
H.wrapS = H.wrapT = Je, H.repeat.set(1, 1), T.traverse((Y) => {
|
|
6856
|
+
if (Y.type === "Mesh") {
|
|
6857
|
+
const V = Y, Ae = Array.isArray(V.material) ? V.material : [V.material];
|
|
6858
|
+
for (const G of Ae)
|
|
6859
|
+
G && (G.type === "MeshStandardMaterial" || G.type === "MeshPhongMaterial" || G.type === "MeshToonMaterial" || G.type === "MeshPhysicalMaterial") && (G.normalMap = H, G.normalScale = new le(i.normalScale, i.normalScale), G.userData = G.userData || {}, G.userData._normalMapDataUrl = x, G.userData._normalMapFileName = v, G.needsUpdate = !0);
|
|
6858
6860
|
}
|
|
6859
6861
|
}), d = H, l.value = !0, c.value = v;
|
|
6860
6862
|
}
|
|
6861
|
-
function
|
|
6862
|
-
t.selectedObject && (t.selectedObject.traverse((
|
|
6863
|
-
if (
|
|
6864
|
-
const x =
|
|
6863
|
+
function q() {
|
|
6864
|
+
t.selectedObject && (t.selectedObject.traverse((T) => {
|
|
6865
|
+
if (T.type === "Mesh") {
|
|
6866
|
+
const x = T, v = Array.isArray(x.material) ? x.material : [x.material];
|
|
6865
6867
|
for (const O of v)
|
|
6866
6868
|
O.normalMap && (O.normalMap = null, O.userData && (delete O.userData._normalMapDataUrl, delete O.userData._normalMapFileName), O.needsUpdate = !0);
|
|
6867
6869
|
}
|
|
6868
6870
|
}), d && (d.dispose(), d = null), l.value = !1, c.value = "");
|
|
6869
6871
|
}
|
|
6870
|
-
function
|
|
6872
|
+
function ne() {
|
|
6871
6873
|
if (!t.selectedObject) return;
|
|
6872
|
-
const
|
|
6874
|
+
const T = i.normalScale;
|
|
6873
6875
|
t.selectedObject.traverse((x) => {
|
|
6874
6876
|
if (x.type === "Mesh") {
|
|
6875
6877
|
const v = x, O = Array.isArray(v.material) ? v.material : [v.material];
|
|
6876
6878
|
for (const H of O)
|
|
6877
|
-
H.normalMap && (H.normalScale = new
|
|
6879
|
+
H.normalMap && (H.normalScale = new le(T, T), H.needsUpdate = !0);
|
|
6878
6880
|
}
|
|
6879
6881
|
});
|
|
6880
6882
|
}
|
|
6881
|
-
function
|
|
6883
|
+
function _(T) {
|
|
6882
6884
|
var v;
|
|
6883
|
-
const x = C(
|
|
6884
|
-
x && x.map ? (u.value = !0,
|
|
6885
|
+
const x = C(T);
|
|
6886
|
+
x && x.map ? (u.value = !0, A = x.map, m.value = ((v = x.userData) == null ? void 0 : v._mapFileName) || "模型贴图") : (u.value = !1, A = null, m.value = "");
|
|
6885
6887
|
}
|
|
6886
|
-
function k(
|
|
6888
|
+
function k(T) {
|
|
6887
6889
|
var H;
|
|
6888
|
-
const x =
|
|
6890
|
+
const x = T.target, v = (H = x.files) == null ? void 0 : H[0];
|
|
6889
6891
|
if (!v || !t.selectedObject) return;
|
|
6890
6892
|
const O = new FileReader();
|
|
6891
|
-
O.onload = (
|
|
6893
|
+
O.onload = (Y) => {
|
|
6892
6894
|
var Ae;
|
|
6893
|
-
const
|
|
6894
|
-
|
|
6895
|
+
const V = (Ae = Y.target) == null ? void 0 : Ae.result;
|
|
6896
|
+
ee(t.selectedObject, V, v.name);
|
|
6895
6897
|
}, O.readAsDataURL(v), x.value = "";
|
|
6896
6898
|
}
|
|
6897
|
-
function
|
|
6899
|
+
function ee(T, x, v) {
|
|
6898
6900
|
const H = new Wt().load(x);
|
|
6899
|
-
H.wrapS = H.wrapT = Je, H.repeat.set(1, 1),
|
|
6900
|
-
if (
|
|
6901
|
-
const
|
|
6902
|
-
for (const
|
|
6903
|
-
|
|
6901
|
+
H.wrapS = H.wrapT = Je, H.repeat.set(1, 1), T.traverse((Y) => {
|
|
6902
|
+
if (Y.type === "Mesh") {
|
|
6903
|
+
const V = Y, Ae = Array.isArray(V.material) ? V.material : [V.material];
|
|
6904
|
+
for (const G of Ae)
|
|
6905
|
+
G && (G.type === "MeshStandardMaterial" || G.type === "MeshPhongMaterial" || G.type === "MeshBasicMaterial" || G.type === "MeshLambertMaterial" || G.type === "MeshToonMaterial" || G.type === "MeshPhysicalMaterial") && (G.map = H, G.userData = G.userData || {}, G.userData._mapDataUrl = x, G.userData._mapFileName = v, G.needsUpdate = !0);
|
|
6904
6906
|
}
|
|
6905
|
-
}),
|
|
6907
|
+
}), A = H, u.value = !0, m.value = v;
|
|
6906
6908
|
}
|
|
6907
6909
|
function te() {
|
|
6908
|
-
t.selectedObject && (t.selectedObject.traverse((
|
|
6909
|
-
if (
|
|
6910
|
-
const x =
|
|
6910
|
+
t.selectedObject && (t.selectedObject.traverse((T) => {
|
|
6911
|
+
if (T.type === "Mesh") {
|
|
6912
|
+
const x = T, v = Array.isArray(x.material) ? x.material : [x.material];
|
|
6911
6913
|
for (const O of v)
|
|
6912
6914
|
O.map && (O.map = null, O.userData && (delete O.userData._mapDataUrl, delete O.userData._mapFileName), O.needsUpdate = !0);
|
|
6913
6915
|
}
|
|
6914
|
-
}),
|
|
6916
|
+
}), A && (A.dispose(), A = null), u.value = !1, m.value = "");
|
|
6915
6917
|
}
|
|
6916
|
-
function
|
|
6918
|
+
function ue(T) {
|
|
6917
6919
|
var v;
|
|
6918
|
-
const x = C(
|
|
6919
|
-
x && x.aoMap ? (
|
|
6920
|
+
const x = C(T);
|
|
6921
|
+
x && x.aoMap ? (g.value = !0, p = x.aoMap, h.value = ((v = x.userData) == null ? void 0 : v._aoMapFileName) || "AO 贴图", i.aoIntensity = x.aoMapIntensity ?? 1) : (g.value = !1, p = null, h.value = "", i.aoIntensity = 1);
|
|
6920
6922
|
}
|
|
6921
|
-
function
|
|
6923
|
+
function Q(T) {
|
|
6922
6924
|
var H;
|
|
6923
|
-
const x =
|
|
6925
|
+
const x = T.target, v = (H = x.files) == null ? void 0 : H[0];
|
|
6924
6926
|
if (!v || !t.selectedObject) return;
|
|
6925
6927
|
const O = new FileReader();
|
|
6926
|
-
O.onload = (
|
|
6928
|
+
O.onload = (Y) => {
|
|
6927
6929
|
var Ae;
|
|
6928
|
-
const
|
|
6929
|
-
|
|
6930
|
+
const V = (Ae = Y.target) == null ? void 0 : Ae.result;
|
|
6931
|
+
Te(t.selectedObject, V, v.name);
|
|
6930
6932
|
}, O.readAsDataURL(v), x.value = "";
|
|
6931
6933
|
}
|
|
6932
|
-
function
|
|
6934
|
+
function Te(T, x, v) {
|
|
6933
6935
|
const H = new Wt().load(x);
|
|
6934
|
-
H.wrapS = H.wrapT = Je, H.repeat.set(1, 1),
|
|
6935
|
-
if (
|
|
6936
|
-
const
|
|
6937
|
-
for (const
|
|
6938
|
-
|
|
6936
|
+
H.wrapS = H.wrapT = Je, H.repeat.set(1, 1), T.traverse((Y) => {
|
|
6937
|
+
if (Y.type === "Mesh") {
|
|
6938
|
+
const V = Y, Ae = Array.isArray(V.material) ? V.material : [V.material];
|
|
6939
|
+
for (const G of Ae)
|
|
6940
|
+
G && (G.type === "MeshStandardMaterial" || G.type === "MeshPhongMaterial" || G.type === "MeshToonMaterial" || G.type === "MeshPhysicalMaterial") && (G.aoMap = H, G.aoMapIntensity = i.aoIntensity, G.userData = G.userData || {}, G.userData._aoMapDataUrl = x, G.userData._aoMapFileName = v, G.needsUpdate = !0);
|
|
6939
6941
|
}
|
|
6940
|
-
}),
|
|
6942
|
+
}), p = H, g.value = !0, h.value = v;
|
|
6941
6943
|
}
|
|
6942
|
-
function
|
|
6943
|
-
t.selectedObject && (t.selectedObject.traverse((
|
|
6944
|
-
if (
|
|
6945
|
-
const x =
|
|
6944
|
+
function Ee() {
|
|
6945
|
+
t.selectedObject && (t.selectedObject.traverse((T) => {
|
|
6946
|
+
if (T.type === "Mesh") {
|
|
6947
|
+
const x = T, v = Array.isArray(x.material) ? x.material : [x.material];
|
|
6946
6948
|
for (const O of v)
|
|
6947
6949
|
O.aoMap && (O.aoMap = null, O.userData && (delete O.userData._aoMapDataUrl, delete O.userData._aoMapFileName), O.needsUpdate = !0);
|
|
6948
6950
|
}
|
|
6949
|
-
}),
|
|
6951
|
+
}), p && (p.dispose(), p = null), g.value = !1, h.value = "");
|
|
6950
6952
|
}
|
|
6951
6953
|
function je() {
|
|
6952
6954
|
if (!t.selectedObject) return;
|
|
6953
|
-
const
|
|
6955
|
+
const T = i.aoIntensity;
|
|
6954
6956
|
t.selectedObject.traverse((x) => {
|
|
6955
6957
|
if (x.type === "Mesh") {
|
|
6956
6958
|
const v = x, O = Array.isArray(v.material) ? v.material : [v.material];
|
|
6957
6959
|
for (const H of O)
|
|
6958
|
-
H.aoMap && (H.aoMapIntensity =
|
|
6960
|
+
H.aoMap && (H.aoMapIntensity = T, H.needsUpdate = !0);
|
|
6959
6961
|
}
|
|
6960
6962
|
});
|
|
6961
6963
|
}
|
|
6962
6964
|
const nt = ot(() => {
|
|
6963
|
-
const
|
|
6964
|
-
if (!
|
|
6965
|
+
const T = t.selectedObject;
|
|
6966
|
+
if (!T) return !1;
|
|
6965
6967
|
let x = !1;
|
|
6966
|
-
return
|
|
6968
|
+
return T.traverse((v) => {
|
|
6967
6969
|
if (!x && v.type === "Mesh") {
|
|
6968
6970
|
const O = v.material;
|
|
6969
6971
|
O.uniforms && O.uniforms.waterColor && (x = !0);
|
|
6970
6972
|
}
|
|
6971
6973
|
}), x;
|
|
6972
|
-
}), Fe =
|
|
6973
|
-
function hi(
|
|
6974
|
-
|
|
6974
|
+
}), Fe = W("#4fc3f7");
|
|
6975
|
+
function hi(T) {
|
|
6976
|
+
T.traverse((x) => {
|
|
6975
6977
|
if (x.type === "Mesh") {
|
|
6976
6978
|
const v = x.material;
|
|
6977
6979
|
if (v.uniforms && v.uniforms.waterColor) {
|
|
@@ -6981,75 +6983,75 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6981
6983
|
}
|
|
6982
6984
|
});
|
|
6983
6985
|
}
|
|
6984
|
-
function js(
|
|
6985
|
-
const v = new
|
|
6986
|
-
|
|
6986
|
+
function js(T, x) {
|
|
6987
|
+
const v = new re(x);
|
|
6988
|
+
T.traverse((O) => {
|
|
6987
6989
|
if (O.type === "Mesh") {
|
|
6988
6990
|
const H = O.material;
|
|
6989
6991
|
H.uniforms && H.uniforms.waterColor && H.uniforms.waterColor.value.copy(v);
|
|
6990
6992
|
}
|
|
6991
6993
|
});
|
|
6992
6994
|
}
|
|
6993
|
-
function fi(
|
|
6994
|
-
const v =
|
|
6995
|
+
function fi(T) {
|
|
6996
|
+
const v = T.target.value;
|
|
6995
6997
|
Fe.value = v, t.selectedObject && js(t.selectedObject, v);
|
|
6996
6998
|
}
|
|
6997
|
-
function pi(
|
|
6998
|
-
let v =
|
|
6999
|
+
function pi(T) {
|
|
7000
|
+
let v = T.target.value.trim();
|
|
6999
7001
|
v.startsWith("#") || (v = "#" + v), /^#[0-9a-fA-F]{6}$/.test(v) && (Fe.value = v, t.selectedObject && js(t.selectedObject, v));
|
|
7000
7002
|
}
|
|
7001
7003
|
return Me(
|
|
7002
7004
|
() => t.selectedObject,
|
|
7003
|
-
(
|
|
7004
|
-
if (
|
|
7005
|
-
const x =
|
|
7006
|
-
x ? (i.color = x.color, i.metalness = x.metalness, i.roughness = x.roughness, i.opacity = x.opacity, o.value = "#" + new
|
|
7005
|
+
(T) => {
|
|
7006
|
+
if (T) {
|
|
7007
|
+
const x = f(T);
|
|
7008
|
+
x ? (i.color = x.color, i.metalness = x.metalness, i.roughness = x.roughness, i.opacity = x.opacity, o.value = "#" + new re(x.color).getHexString(), a.value = !0) : (i.color = 16777215, i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = "#ffffff", a.value = !1), Z(T), _(T), ue(T), T.type === "DirectionalLight" && (y.intensity = T.intensity ?? 1), hi(T);
|
|
7007
7009
|
} else
|
|
7008
|
-
i.color = 16777215, i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = "#ffffff", a.value = !1, l.value = !1, c.value = "", u.value = !1, m.value = "",
|
|
7010
|
+
i.color = 16777215, i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = "#ffffff", a.value = !1, l.value = !1, c.value = "", u.value = !1, m.value = "", g.value = !1, h.value = "";
|
|
7009
7011
|
},
|
|
7010
7012
|
{ immediate: !0 }
|
|
7011
|
-
), (
|
|
7013
|
+
), (T, x) => (L(), U("div", null, [
|
|
7012
7014
|
b("div", il, [
|
|
7013
7015
|
x[19] || (x[19] = b("label", null, "位置", -1)),
|
|
7014
7016
|
b("div", ol, [
|
|
7015
7017
|
x[16] || (x[16] = b("span", null, "X:", -1)),
|
|
7016
|
-
|
|
7018
|
+
F(b("input", {
|
|
7017
7019
|
type: "number",
|
|
7018
|
-
"onUpdate:modelValue": x[0] || (x[0] = (v) =>
|
|
7020
|
+
"onUpdate:modelValue": x[0] || (x[0] = (v) => T.transform.position.x = v),
|
|
7019
7021
|
step: "0.01",
|
|
7020
7022
|
onInput: s
|
|
7021
7023
|
}, null, 544), [
|
|
7022
7024
|
[
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
+
K,
|
|
7026
|
+
T.transform.position.x,
|
|
7025
7027
|
void 0,
|
|
7026
7028
|
{ number: !0 }
|
|
7027
7029
|
]
|
|
7028
7030
|
]),
|
|
7029
7031
|
x[17] || (x[17] = b("span", null, "Y:", -1)),
|
|
7030
|
-
|
|
7032
|
+
F(b("input", {
|
|
7031
7033
|
type: "number",
|
|
7032
|
-
"onUpdate:modelValue": x[1] || (x[1] = (v) =>
|
|
7034
|
+
"onUpdate:modelValue": x[1] || (x[1] = (v) => T.transform.position.y = v),
|
|
7033
7035
|
step: "0.01",
|
|
7034
7036
|
onInput: s
|
|
7035
7037
|
}, null, 544), [
|
|
7036
7038
|
[
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
+
K,
|
|
7040
|
+
T.transform.position.y,
|
|
7039
7041
|
void 0,
|
|
7040
7042
|
{ number: !0 }
|
|
7041
7043
|
]
|
|
7042
7044
|
]),
|
|
7043
7045
|
x[18] || (x[18] = b("span", null, "Z:", -1)),
|
|
7044
|
-
|
|
7046
|
+
F(b("input", {
|
|
7045
7047
|
type: "number",
|
|
7046
|
-
"onUpdate:modelValue": x[2] || (x[2] = (v) =>
|
|
7048
|
+
"onUpdate:modelValue": x[2] || (x[2] = (v) => T.transform.position.z = v),
|
|
7047
7049
|
step: "0.01",
|
|
7048
7050
|
onInput: s
|
|
7049
7051
|
}, null, 544), [
|
|
7050
7052
|
[
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
+
K,
|
|
7054
|
+
T.transform.position.z,
|
|
7053
7055
|
void 0,
|
|
7054
7056
|
{ number: !0 }
|
|
7055
7057
|
]
|
|
@@ -7060,43 +7062,43 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7060
7062
|
x[23] || (x[23] = b("label", null, "旋转 (弧度)", -1)),
|
|
7061
7063
|
b("div", al, [
|
|
7062
7064
|
x[20] || (x[20] = b("span", null, "X:", -1)),
|
|
7063
|
-
|
|
7065
|
+
F(b("input", {
|
|
7064
7066
|
type: "number",
|
|
7065
|
-
"onUpdate:modelValue": x[3] || (x[3] = (v) =>
|
|
7067
|
+
"onUpdate:modelValue": x[3] || (x[3] = (v) => T.transform.rotation.x = v),
|
|
7066
7068
|
step: "0.01",
|
|
7067
7069
|
onInput: s
|
|
7068
7070
|
}, null, 544), [
|
|
7069
7071
|
[
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
+
K,
|
|
7073
|
+
T.transform.rotation.x,
|
|
7072
7074
|
void 0,
|
|
7073
7075
|
{ number: !0 }
|
|
7074
7076
|
]
|
|
7075
7077
|
]),
|
|
7076
7078
|
x[21] || (x[21] = b("span", null, "Y:", -1)),
|
|
7077
|
-
|
|
7079
|
+
F(b("input", {
|
|
7078
7080
|
type: "number",
|
|
7079
|
-
"onUpdate:modelValue": x[4] || (x[4] = (v) =>
|
|
7081
|
+
"onUpdate:modelValue": x[4] || (x[4] = (v) => T.transform.rotation.y = v),
|
|
7080
7082
|
step: "0.01",
|
|
7081
7083
|
onInput: s
|
|
7082
7084
|
}, null, 544), [
|
|
7083
7085
|
[
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
+
K,
|
|
7087
|
+
T.transform.rotation.y,
|
|
7086
7088
|
void 0,
|
|
7087
7089
|
{ number: !0 }
|
|
7088
7090
|
]
|
|
7089
7091
|
]),
|
|
7090
7092
|
x[22] || (x[22] = b("span", null, "Z:", -1)),
|
|
7091
|
-
|
|
7093
|
+
F(b("input", {
|
|
7092
7094
|
type: "number",
|
|
7093
|
-
"onUpdate:modelValue": x[5] || (x[5] = (v) =>
|
|
7095
|
+
"onUpdate:modelValue": x[5] || (x[5] = (v) => T.transform.rotation.z = v),
|
|
7094
7096
|
step: "0.01",
|
|
7095
7097
|
onInput: s
|
|
7096
7098
|
}, null, 544), [
|
|
7097
7099
|
[
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
+
K,
|
|
7101
|
+
T.transform.rotation.z,
|
|
7100
7102
|
void 0,
|
|
7101
7103
|
{ number: !0 }
|
|
7102
7104
|
]
|
|
@@ -7107,243 +7109,243 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7107
7109
|
x[27] || (x[27] = b("label", null, "缩放", -1)),
|
|
7108
7110
|
b("div", cl, [
|
|
7109
7111
|
x[24] || (x[24] = b("span", null, "X:", -1)),
|
|
7110
|
-
|
|
7112
|
+
F(b("input", {
|
|
7111
7113
|
type: "number",
|
|
7112
|
-
"onUpdate:modelValue": x[6] || (x[6] = (v) =>
|
|
7114
|
+
"onUpdate:modelValue": x[6] || (x[6] = (v) => T.transform.scale.x = v),
|
|
7113
7115
|
step: "0.01",
|
|
7114
7116
|
onInput: s
|
|
7115
7117
|
}, null, 544), [
|
|
7116
7118
|
[
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
+
K,
|
|
7120
|
+
T.transform.scale.x,
|
|
7119
7121
|
void 0,
|
|
7120
7122
|
{ number: !0 }
|
|
7121
7123
|
]
|
|
7122
7124
|
]),
|
|
7123
7125
|
x[25] || (x[25] = b("span", null, "Y:", -1)),
|
|
7124
|
-
|
|
7126
|
+
F(b("input", {
|
|
7125
7127
|
type: "number",
|
|
7126
|
-
"onUpdate:modelValue": x[7] || (x[7] = (v) =>
|
|
7128
|
+
"onUpdate:modelValue": x[7] || (x[7] = (v) => T.transform.scale.y = v),
|
|
7127
7129
|
step: "0.01",
|
|
7128
7130
|
onInput: s
|
|
7129
7131
|
}, null, 544), [
|
|
7130
7132
|
[
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
+
K,
|
|
7134
|
+
T.transform.scale.y,
|
|
7133
7135
|
void 0,
|
|
7134
7136
|
{ number: !0 }
|
|
7135
7137
|
]
|
|
7136
7138
|
]),
|
|
7137
7139
|
x[26] || (x[26] = b("span", null, "Z:", -1)),
|
|
7138
|
-
|
|
7140
|
+
F(b("input", {
|
|
7139
7141
|
type: "number",
|
|
7140
|
-
"onUpdate:modelValue": x[8] || (x[8] = (v) =>
|
|
7142
|
+
"onUpdate:modelValue": x[8] || (x[8] = (v) => T.transform.scale.z = v),
|
|
7141
7143
|
step: "0.01",
|
|
7142
7144
|
onInput: s
|
|
7143
7145
|
}, null, 544), [
|
|
7144
7146
|
[
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
+
K,
|
|
7148
|
+
T.transform.scale.z,
|
|
7147
7149
|
void 0,
|
|
7148
7150
|
{ number: !0 }
|
|
7149
7151
|
]
|
|
7150
7152
|
])
|
|
7151
7153
|
])
|
|
7152
7154
|
]),
|
|
7153
|
-
|
|
7155
|
+
T.selectedObject && T.selectedObject.type === "DirectionalLight" ? (L(), U("div", ul, [
|
|
7154
7156
|
x[29] || (x[29] = b("label", null, "光源属性", -1)),
|
|
7155
7157
|
b("div", dl, [
|
|
7156
7158
|
x[28] || (x[28] = b("span", { class: "slider-label" }, "强度", -1)),
|
|
7157
|
-
|
|
7159
|
+
F(b("input", {
|
|
7158
7160
|
type: "range",
|
|
7159
7161
|
min: "0",
|
|
7160
7162
|
max: "10",
|
|
7161
7163
|
step: "0.1",
|
|
7162
|
-
"onUpdate:modelValue": x[9] || (x[9] = (v) =>
|
|
7164
|
+
"onUpdate:modelValue": x[9] || (x[9] = (v) => y.intensity = v),
|
|
7163
7165
|
onInput: M
|
|
7164
7166
|
}, null, 544), [
|
|
7165
7167
|
[
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
+
K,
|
|
7169
|
+
y.intensity,
|
|
7168
7170
|
void 0,
|
|
7169
7171
|
{ number: !0 }
|
|
7170
7172
|
]
|
|
7171
7173
|
]),
|
|
7172
|
-
|
|
7174
|
+
F(b("input", {
|
|
7173
7175
|
type: "number",
|
|
7174
7176
|
min: "0",
|
|
7175
7177
|
max: "100",
|
|
7176
7178
|
step: "0.1",
|
|
7177
|
-
"onUpdate:modelValue": x[10] || (x[10] = (v) =>
|
|
7179
|
+
"onUpdate:modelValue": x[10] || (x[10] = (v) => y.intensity = v),
|
|
7178
7180
|
class: "intensity-input",
|
|
7179
7181
|
onInput: M
|
|
7180
7182
|
}, null, 544), [
|
|
7181
7183
|
[
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
+
K,
|
|
7185
|
+
y.intensity,
|
|
7184
7186
|
void 0,
|
|
7185
7187
|
{ number: !0 }
|
|
7186
7188
|
]
|
|
7187
7189
|
])
|
|
7188
7190
|
])
|
|
7189
|
-
])) :
|
|
7190
|
-
|
|
7191
|
+
])) : ce("", !0),
|
|
7192
|
+
T.selectedObject ? (L(), U("div", hl, [
|
|
7191
7193
|
x[45] || (x[45] = b("label", null, "材质", -1)),
|
|
7192
7194
|
b("div", fl, [
|
|
7193
7195
|
x[30] || (x[30] = b("span", { class: "slider-label" }, "颜色", -1)),
|
|
7194
7196
|
b("input", {
|
|
7195
7197
|
type: "color",
|
|
7196
7198
|
value: o.value,
|
|
7197
|
-
onInput:
|
|
7199
|
+
onInput: D,
|
|
7198
7200
|
class: "color-picker"
|
|
7199
7201
|
}, null, 40, pl),
|
|
7200
7202
|
b("input", {
|
|
7201
7203
|
type: "text",
|
|
7202
7204
|
value: o.value,
|
|
7203
|
-
onInput:
|
|
7205
|
+
onInput: j,
|
|
7204
7206
|
class: "color-text-input",
|
|
7205
7207
|
placeholder: "#ffffff"
|
|
7206
7208
|
}, null, 40, Al)
|
|
7207
7209
|
]),
|
|
7208
7210
|
b("div", ml, [
|
|
7209
7211
|
x[31] || (x[31] = b("span", { class: "slider-label" }, "金属度", -1)),
|
|
7210
|
-
|
|
7212
|
+
F(b("input", {
|
|
7211
7213
|
type: "range",
|
|
7212
7214
|
min: "0",
|
|
7213
7215
|
max: "1",
|
|
7214
7216
|
step: "0.01",
|
|
7215
7217
|
"onUpdate:modelValue": x[11] || (x[11] = (v) => i.metalness = v),
|
|
7216
|
-
onInput:
|
|
7218
|
+
onInput: E
|
|
7217
7219
|
}, null, 544), [
|
|
7218
7220
|
[
|
|
7219
|
-
|
|
7221
|
+
K,
|
|
7220
7222
|
i.metalness,
|
|
7221
7223
|
void 0,
|
|
7222
7224
|
{ number: !0 }
|
|
7223
7225
|
]
|
|
7224
7226
|
]),
|
|
7225
|
-
b("span", gl,
|
|
7227
|
+
b("span", gl, de(i.metalness.toFixed(2)), 1)
|
|
7226
7228
|
]),
|
|
7227
7229
|
b("div", yl, [
|
|
7228
7230
|
x[32] || (x[32] = b("span", { class: "slider-label" }, "粗糙度", -1)),
|
|
7229
|
-
|
|
7231
|
+
F(b("input", {
|
|
7230
7232
|
type: "range",
|
|
7231
7233
|
min: "0",
|
|
7232
7234
|
max: "1",
|
|
7233
7235
|
step: "0.01",
|
|
7234
7236
|
"onUpdate:modelValue": x[12] || (x[12] = (v) => i.roughness = v),
|
|
7235
|
-
onInput:
|
|
7237
|
+
onInput: E
|
|
7236
7238
|
}, null, 544), [
|
|
7237
7239
|
[
|
|
7238
|
-
|
|
7240
|
+
K,
|
|
7239
7241
|
i.roughness,
|
|
7240
7242
|
void 0,
|
|
7241
7243
|
{ number: !0 }
|
|
7242
7244
|
]
|
|
7243
7245
|
]),
|
|
7244
|
-
b("span", bl,
|
|
7246
|
+
b("span", bl, de(i.roughness.toFixed(2)), 1)
|
|
7245
7247
|
]),
|
|
7246
7248
|
b("div", xl, [
|
|
7247
7249
|
x[33] || (x[33] = b("span", { class: "slider-label" }, "透明度", -1)),
|
|
7248
|
-
|
|
7250
|
+
F(b("input", {
|
|
7249
7251
|
type: "range",
|
|
7250
7252
|
min: "0",
|
|
7251
7253
|
max: "1",
|
|
7252
7254
|
step: "0.01",
|
|
7253
7255
|
"onUpdate:modelValue": x[13] || (x[13] = (v) => i.opacity = v),
|
|
7254
|
-
onInput:
|
|
7256
|
+
onInput: E
|
|
7255
7257
|
}, null, 544), [
|
|
7256
7258
|
[
|
|
7257
|
-
|
|
7259
|
+
K,
|
|
7258
7260
|
i.opacity,
|
|
7259
7261
|
void 0,
|
|
7260
7262
|
{ number: !0 }
|
|
7261
7263
|
]
|
|
7262
7264
|
]),
|
|
7263
|
-
b("span", Il,
|
|
7265
|
+
b("span", Il, de(i.opacity.toFixed(2)), 1)
|
|
7264
7266
|
]),
|
|
7265
7267
|
b("div", Cl, [
|
|
7266
7268
|
x[36] || (x[36] = b("span", { class: "slider-label" }, "法线贴图", -1)),
|
|
7267
7269
|
b("div", wl, [
|
|
7268
|
-
l.value ? (
|
|
7270
|
+
l.value ? (L(), U(Oe, { key: 1 }, [
|
|
7269
7271
|
b("label", vl, [
|
|
7270
7272
|
b("input", {
|
|
7271
7273
|
type: "file",
|
|
7272
7274
|
accept: "image/*",
|
|
7273
|
-
onChange:
|
|
7275
|
+
onChange: N,
|
|
7274
7276
|
class: "texture-file-input"
|
|
7275
7277
|
}, null, 32),
|
|
7276
|
-
b("span", Tl,
|
|
7278
|
+
b("span", Tl, de(c.value), 1),
|
|
7277
7279
|
x[35] || (x[35] = b("span", { class: "modify-hint" }, "修改", -1))
|
|
7278
7280
|
]),
|
|
7279
7281
|
b("button", {
|
|
7280
7282
|
class: "texture-remove-btn",
|
|
7281
7283
|
title: "移除法线贴图",
|
|
7282
|
-
onClick:
|
|
7284
|
+
onClick: q
|
|
7283
7285
|
}, " ✕ ")
|
|
7284
|
-
], 64)) : (
|
|
7286
|
+
], 64)) : (L(), U("label", Ml, [
|
|
7285
7287
|
b("input", {
|
|
7286
7288
|
type: "file",
|
|
7287
7289
|
accept: "image/*",
|
|
7288
|
-
onChange:
|
|
7290
|
+
onChange: N,
|
|
7289
7291
|
class: "texture-file-input"
|
|
7290
7292
|
}, null, 32),
|
|
7291
7293
|
x[34] || (x[34] = os(" + 选择 "))
|
|
7292
7294
|
]))
|
|
7293
7295
|
])
|
|
7294
7296
|
]),
|
|
7295
|
-
l.value ? (
|
|
7297
|
+
l.value ? (L(), U("div", El, [
|
|
7296
7298
|
x[37] || (x[37] = b("span", { class: "slider-label" }, "法线强度", -1)),
|
|
7297
|
-
|
|
7299
|
+
F(b("input", {
|
|
7298
7300
|
type: "range",
|
|
7299
7301
|
min: "0",
|
|
7300
7302
|
max: "5",
|
|
7301
7303
|
step: "0.01",
|
|
7302
7304
|
"onUpdate:modelValue": x[14] || (x[14] = (v) => i.normalScale = v),
|
|
7303
|
-
onInput:
|
|
7305
|
+
onInput: ne
|
|
7304
7306
|
}, null, 544), [
|
|
7305
7307
|
[
|
|
7306
|
-
|
|
7308
|
+
K,
|
|
7307
7309
|
i.normalScale,
|
|
7308
7310
|
void 0,
|
|
7309
7311
|
{ number: !0 }
|
|
7310
7312
|
]
|
|
7311
7313
|
]),
|
|
7312
|
-
b("span", Dl,
|
|
7313
|
-
])) :
|
|
7314
|
+
b("span", Dl, de(i.normalScale.toFixed(2)), 1)
|
|
7315
|
+
])) : ce("", !0),
|
|
7314
7316
|
b("div", Pl, [
|
|
7315
7317
|
x[40] || (x[40] = b("span", { class: "slider-label" }, "AO 贴图", -1)),
|
|
7316
7318
|
b("div", Rl, [
|
|
7317
|
-
|
|
7319
|
+
g.value ? (L(), U(Oe, { key: 1 }, [
|
|
7318
7320
|
b("label", Sl, [
|
|
7319
7321
|
b("input", {
|
|
7320
7322
|
type: "file",
|
|
7321
7323
|
accept: "image/*",
|
|
7322
|
-
onChange:
|
|
7324
|
+
onChange: Q,
|
|
7323
7325
|
class: "texture-file-input"
|
|
7324
7326
|
}, null, 32),
|
|
7325
|
-
b("span", Ll,
|
|
7327
|
+
b("span", Ll, de(h.value), 1),
|
|
7326
7328
|
x[39] || (x[39] = b("span", { class: "modify-hint" }, "修改", -1))
|
|
7327
7329
|
]),
|
|
7328
7330
|
b("button", {
|
|
7329
7331
|
class: "texture-remove-btn",
|
|
7330
7332
|
title: "移除 AO 贴图",
|
|
7331
|
-
onClick:
|
|
7333
|
+
onClick: Ee
|
|
7332
7334
|
}, " ✕ ")
|
|
7333
|
-
], 64)) : (
|
|
7335
|
+
], 64)) : (L(), U("label", Ol, [
|
|
7334
7336
|
b("input", {
|
|
7335
7337
|
type: "file",
|
|
7336
7338
|
accept: "image/*",
|
|
7337
|
-
onChange:
|
|
7339
|
+
onChange: Q,
|
|
7338
7340
|
class: "texture-file-input"
|
|
7339
7341
|
}, null, 32),
|
|
7340
7342
|
x[38] || (x[38] = os(" + 选择 "))
|
|
7341
7343
|
]))
|
|
7342
7344
|
])
|
|
7343
7345
|
]),
|
|
7344
|
-
|
|
7346
|
+
g.value ? (L(), U("div", Nl, [
|
|
7345
7347
|
x[41] || (x[41] = b("span", { class: "slider-label" }, "AO 强度", -1)),
|
|
7346
|
-
|
|
7348
|
+
F(b("input", {
|
|
7347
7349
|
type: "range",
|
|
7348
7350
|
min: "0",
|
|
7349
7351
|
max: "1",
|
|
@@ -7352,18 +7354,18 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7352
7354
|
onInput: je
|
|
7353
7355
|
}, null, 544), [
|
|
7354
7356
|
[
|
|
7355
|
-
|
|
7357
|
+
K,
|
|
7356
7358
|
i.aoIntensity,
|
|
7357
7359
|
void 0,
|
|
7358
7360
|
{ number: !0 }
|
|
7359
7361
|
]
|
|
7360
7362
|
]),
|
|
7361
|
-
b("span", Hl,
|
|
7362
|
-
])) :
|
|
7363
|
+
b("span", Hl, de(i.aoIntensity.toFixed(2)), 1)
|
|
7364
|
+
])) : ce("", !0),
|
|
7363
7365
|
b("div", kl, [
|
|
7364
7366
|
x[44] || (x[44] = b("span", { class: "slider-label" }, "模型贴图", -1)),
|
|
7365
7367
|
b("div", jl, [
|
|
7366
|
-
u.value ? (
|
|
7368
|
+
u.value ? (L(), U(Oe, { key: 1 }, [
|
|
7367
7369
|
b("label", Ul, [
|
|
7368
7370
|
b("input", {
|
|
7369
7371
|
type: "file",
|
|
@@ -7371,7 +7373,7 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7371
7373
|
onChange: k,
|
|
7372
7374
|
class: "texture-file-input"
|
|
7373
7375
|
}, null, 32),
|
|
7374
|
-
b("span", zl,
|
|
7376
|
+
b("span", zl, de(m.value), 1),
|
|
7375
7377
|
x[43] || (x[43] = b("span", { class: "modify-hint" }, "修改", -1))
|
|
7376
7378
|
]),
|
|
7377
7379
|
b("button", {
|
|
@@ -7379,7 +7381,7 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7379
7381
|
title: "移除模型贴图",
|
|
7380
7382
|
onClick: te
|
|
7381
7383
|
}, " ✕ ")
|
|
7382
|
-
], 64)) : (
|
|
7384
|
+
], 64)) : (L(), U("label", Fl, [
|
|
7383
7385
|
b("input", {
|
|
7384
7386
|
type: "file",
|
|
7385
7387
|
accept: "image/*",
|
|
@@ -7390,9 +7392,9 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7390
7392
|
]))
|
|
7391
7393
|
])
|
|
7392
7394
|
]),
|
|
7393
|
-
a.value ?
|
|
7394
|
-
])) :
|
|
7395
|
-
nt.value ? (
|
|
7395
|
+
a.value ? ce("", !0) : (L(), U("div", Gl, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
|
|
7396
|
+
])) : ce("", !0),
|
|
7397
|
+
nt.value ? (L(), U("div", Wl, [
|
|
7396
7398
|
x[47] || (x[47] = b("label", null, "水体属性", -1)),
|
|
7397
7399
|
b("div", Bl, [
|
|
7398
7400
|
x[46] || (x[46] = b("span", { class: "slider-label" }, "水体颜色", -1)),
|
|
@@ -7410,7 +7412,7 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7410
7412
|
placeholder: "#4fc3f7"
|
|
7411
7413
|
}, null, 40, ql)
|
|
7412
7414
|
])
|
|
7413
|
-
])) :
|
|
7415
|
+
])) : ce("", !0)
|
|
7414
7416
|
]));
|
|
7415
7417
|
}
|
|
7416
7418
|
}), Yl = /* @__PURE__ */ Xe(Vl, [["__scopeId", "data-v-a0505cb0"]]), Kl = { class: "userdata-tab" }, Zl = { class: "property-group userdata-group" }, Ql = { class: "userdata-add-row" }, Jl = ["onKeyup"], _l = {
|
|
@@ -7432,40 +7434,40 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7432
7434
|
selectedObject: {}
|
|
7433
7435
|
},
|
|
7434
7436
|
setup(r) {
|
|
7435
|
-
const e = r, t =
|
|
7437
|
+
const e = r, t = W(""), n = W(""), s = W(null), i = W(""), o = W(null), a = W([]);
|
|
7436
7438
|
function l(C) {
|
|
7437
7439
|
if (C === null) return "null";
|
|
7438
7440
|
if (C === void 0) return "undefined";
|
|
7439
7441
|
if (Array.isArray(C)) return "array";
|
|
7440
|
-
const
|
|
7441
|
-
return
|
|
7442
|
+
const f = typeof C;
|
|
7443
|
+
return f === "object" ? "object" : f === "number" ? "number" : f === "boolean" ? "boolean" : "string";
|
|
7442
7444
|
}
|
|
7443
7445
|
function c(C) {
|
|
7444
|
-
const
|
|
7446
|
+
const f = [];
|
|
7445
7447
|
if (C.userData)
|
|
7446
|
-
for (const [w,
|
|
7447
|
-
typeof w == "string" && !w.startsWith("_") &&
|
|
7448
|
+
for (const [w, E] of Object.entries(C.userData))
|
|
7449
|
+
typeof w == "string" && !w.startsWith("_") && f.push({
|
|
7448
7450
|
key: w,
|
|
7449
|
-
value: typeof
|
|
7450
|
-
rawType: l(
|
|
7451
|
+
value: typeof E == "object" ? JSON.stringify(E) : String(E),
|
|
7452
|
+
rawType: l(E)
|
|
7451
7453
|
});
|
|
7452
|
-
a.value =
|
|
7454
|
+
a.value = f;
|
|
7453
7455
|
}
|
|
7454
7456
|
function d(C) {
|
|
7455
|
-
const
|
|
7456
|
-
if (
|
|
7457
|
-
if (
|
|
7458
|
-
if (
|
|
7459
|
-
if (
|
|
7460
|
-
const w = Number(
|
|
7461
|
-
if (
|
|
7462
|
-
return String(w) !==
|
|
7463
|
-
if (
|
|
7457
|
+
const f = C.trim();
|
|
7458
|
+
if (f === "true") return !0;
|
|
7459
|
+
if (f === "false") return !1;
|
|
7460
|
+
if (f === "null") return null;
|
|
7461
|
+
if (f === "undefined") return;
|
|
7462
|
+
const w = Number(f);
|
|
7463
|
+
if (f !== "" && !isNaN(w))
|
|
7464
|
+
return String(w) !== f ? f : w;
|
|
7465
|
+
if (f.startsWith("{") && f.endsWith("}") || f.startsWith("[") && f.endsWith("]"))
|
|
7464
7466
|
try {
|
|
7465
|
-
return JSON.parse(
|
|
7467
|
+
return JSON.parse(f);
|
|
7466
7468
|
} catch {
|
|
7467
7469
|
}
|
|
7468
|
-
return
|
|
7470
|
+
return f;
|
|
7469
7471
|
}
|
|
7470
7472
|
function u() {
|
|
7471
7473
|
if (!e.selectedObject || !t.value.trim()) return;
|
|
@@ -7474,20 +7476,20 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7474
7476
|
t.value = "";
|
|
7475
7477
|
return;
|
|
7476
7478
|
}
|
|
7477
|
-
const
|
|
7478
|
-
e.selectedObject.userData[C] =
|
|
7479
|
+
const f = d(n.value);
|
|
7480
|
+
e.selectedObject.userData[C] = f, c(e.selectedObject), t.value = "", n.value = "";
|
|
7479
7481
|
}
|
|
7480
|
-
function m(C,
|
|
7482
|
+
function m(C, f) {
|
|
7481
7483
|
e.selectedObject && (delete e.selectedObject.userData[C], c(e.selectedObject));
|
|
7482
7484
|
}
|
|
7483
|
-
function
|
|
7485
|
+
function A(C) {
|
|
7484
7486
|
return C.length <= 28 ? C : C.substring(0, 28) + "…";
|
|
7485
7487
|
}
|
|
7486
|
-
function
|
|
7488
|
+
function g(C) {
|
|
7487
7489
|
s.value = C;
|
|
7488
|
-
const
|
|
7489
|
-
if (!
|
|
7490
|
-
const w =
|
|
7490
|
+
const f = e.selectedObject;
|
|
7491
|
+
if (!f) return;
|
|
7492
|
+
const w = f.userData[C];
|
|
7491
7493
|
try {
|
|
7492
7494
|
i.value = JSON.stringify(w, null, 2);
|
|
7493
7495
|
} catch {
|
|
@@ -7507,32 +7509,32 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7507
7509
|
}
|
|
7508
7510
|
try {
|
|
7509
7511
|
JSON.parse(C), o.value = null;
|
|
7510
|
-
} catch (
|
|
7511
|
-
o.value = "JSON 格式错误:" +
|
|
7512
|
+
} catch (f) {
|
|
7513
|
+
o.value = "JSON 格式错误:" + f.message;
|
|
7512
7514
|
}
|
|
7513
7515
|
}
|
|
7514
|
-
function
|
|
7515
|
-
const
|
|
7516
|
-
if (!
|
|
7516
|
+
function p(C) {
|
|
7517
|
+
const f = e.selectedObject;
|
|
7518
|
+
if (!f) return;
|
|
7517
7519
|
const w = i.value.trim();
|
|
7518
7520
|
try {
|
|
7519
|
-
const
|
|
7520
|
-
|
|
7521
|
+
const E = JSON.parse(w);
|
|
7522
|
+
f.userData[C] = E, c(f), s.value = null, i.value = "";
|
|
7521
7523
|
} catch {
|
|
7522
|
-
|
|
7524
|
+
f.userData[C] = w, c(f), s.value = null, i.value = "";
|
|
7523
7525
|
}
|
|
7524
7526
|
}
|
|
7525
|
-
function
|
|
7527
|
+
function y() {
|
|
7526
7528
|
s.value = null, i.value = "";
|
|
7527
7529
|
}
|
|
7528
7530
|
function M() {
|
|
7529
7531
|
const C = e.selectedObject;
|
|
7530
7532
|
if (!C) return;
|
|
7531
|
-
const
|
|
7532
|
-
|
|
7533
|
-
x:
|
|
7534
|
-
y:
|
|
7535
|
-
z:
|
|
7533
|
+
const f = ja();
|
|
7534
|
+
f && (C.userData.closeUpView = {
|
|
7535
|
+
x: f.position.x,
|
|
7536
|
+
y: f.position.y,
|
|
7537
|
+
z: f.position.z
|
|
7536
7538
|
}, c(C));
|
|
7537
7539
|
}
|
|
7538
7540
|
return Me(
|
|
@@ -7541,26 +7543,26 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7541
7543
|
C ? c(C) : a.value = [], s.value = null, i.value = "";
|
|
7542
7544
|
},
|
|
7543
7545
|
{ immediate: !0 }
|
|
7544
|
-
), (C,
|
|
7546
|
+
), (C, f) => (L(), U("div", Kl, [
|
|
7545
7547
|
b("div", Zl, [
|
|
7546
|
-
|
|
7548
|
+
f[3] || (f[3] = b("label", null, "userData 属性", -1)),
|
|
7547
7549
|
b("div", Ql, [
|
|
7548
|
-
|
|
7550
|
+
F(b("input", {
|
|
7549
7551
|
type: "text",
|
|
7550
|
-
"onUpdate:modelValue":
|
|
7552
|
+
"onUpdate:modelValue": f[0] || (f[0] = (w) => t.value = w),
|
|
7551
7553
|
placeholder: "属性名",
|
|
7552
7554
|
class: "ud-input",
|
|
7553
7555
|
onKeyup: rt(u, ["enter"])
|
|
7554
7556
|
}, null, 544), [
|
|
7555
|
-
[
|
|
7557
|
+
[K, t.value]
|
|
7556
7558
|
]),
|
|
7557
|
-
|
|
7558
|
-
"onUpdate:modelValue":
|
|
7559
|
+
F(b("textarea", {
|
|
7560
|
+
"onUpdate:modelValue": f[1] || (f[1] = (w) => n.value = w),
|
|
7559
7561
|
placeholder: "值",
|
|
7560
7562
|
class: "ud-input ud-textarea",
|
|
7561
7563
|
onKeyup: rt(bs(u, ["prevent"]), ["enter"])
|
|
7562
7564
|
}, null, 40, Jl), [
|
|
7563
|
-
[
|
|
7565
|
+
[K, n.value]
|
|
7564
7566
|
]),
|
|
7565
7567
|
b("button", {
|
|
7566
7568
|
class: "ud-btn add-btn",
|
|
@@ -7568,55 +7570,55 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7568
7570
|
onClick: u
|
|
7569
7571
|
}, " + ")
|
|
7570
7572
|
]),
|
|
7571
|
-
a.value.length > 0 ? (
|
|
7572
|
-
(
|
|
7573
|
+
a.value.length > 0 ? (L(), U("div", _l, [
|
|
7574
|
+
(L(!0), U(Oe, null, ns(a.value, (w, E) => (L(), U("div", {
|
|
7573
7575
|
key: w.key,
|
|
7574
7576
|
class: ve(["userdata-item", {
|
|
7575
7577
|
readonly: w.key === "isMovable",
|
|
7576
7578
|
"editing-json": s.value === w.key
|
|
7577
7579
|
}])
|
|
7578
7580
|
}, [
|
|
7579
|
-
b("span", $l,
|
|
7580
|
-
w.key === "isMovable" ? (
|
|
7581
|
-
s.value !== w.key ? (
|
|
7582
|
-
b("span", tc,
|
|
7581
|
+
b("span", $l, de(w.key), 1),
|
|
7582
|
+
w.key === "isMovable" ? (L(), U("span", ec, de(String(w.value)) + " 🔒 ", 1)) : w.key !== "isMovable" ? (L(), U(Oe, { key: 1 }, [
|
|
7583
|
+
s.value !== w.key ? (L(), U(Oe, { key: 0 }, [
|
|
7584
|
+
b("span", tc, de(A(w.value)), 1),
|
|
7583
7585
|
b("button", {
|
|
7584
7586
|
class: "ud-btn edit-json-btn",
|
|
7585
7587
|
title: "编辑对象",
|
|
7586
|
-
onClick: (
|
|
7588
|
+
onClick: (D) => g(w.key)
|
|
7587
7589
|
}, " ✎ ", 8, sc)
|
|
7588
|
-
], 64)) : (
|
|
7589
|
-
o.value ? (
|
|
7590
|
-
|
|
7591
|
-
"onUpdate:modelValue":
|
|
7590
|
+
], 64)) : (L(), U(Oe, { key: 1 }, [
|
|
7591
|
+
o.value ? (L(), U("div", nc, " ⚠ " + de(o.value), 1)) : ce("", !0),
|
|
7592
|
+
F(b("textarea", {
|
|
7593
|
+
"onUpdate:modelValue": f[2] || (f[2] = (D) => i.value = D),
|
|
7592
7594
|
class: ve(["ud-json-textarea", { "has-error": o.value }]),
|
|
7593
7595
|
rows: "3",
|
|
7594
7596
|
onInput: h
|
|
7595
7597
|
}, null, 34), [
|
|
7596
|
-
[
|
|
7598
|
+
[K, i.value]
|
|
7597
7599
|
]),
|
|
7598
7600
|
b("div", ic, [
|
|
7599
7601
|
b("button", {
|
|
7600
7602
|
class: "ud-btn apply-btn",
|
|
7601
7603
|
title: "应用修改",
|
|
7602
|
-
onClick: (
|
|
7604
|
+
onClick: (D) => p(w.key)
|
|
7603
7605
|
}, " ✓ ", 8, oc),
|
|
7604
7606
|
b("button", {
|
|
7605
7607
|
class: "ud-btn cancel-btn",
|
|
7606
7608
|
title: "取消编辑",
|
|
7607
|
-
onClick:
|
|
7609
|
+
onClick: y
|
|
7608
7610
|
}, " ✕ ")
|
|
7609
7611
|
])
|
|
7610
7612
|
], 64)),
|
|
7611
|
-
s.value !== w.key ? (
|
|
7613
|
+
s.value !== w.key ? (L(), U("button", {
|
|
7612
7614
|
key: 2,
|
|
7613
7615
|
class: "ud-btn del-btn",
|
|
7614
7616
|
title: "删除",
|
|
7615
|
-
onClick: (
|
|
7616
|
-
}, " ✕ ", 8, rc)) :
|
|
7617
|
-
], 64)) :
|
|
7617
|
+
onClick: (D) => m(w.key)
|
|
7618
|
+
}, " ✕ ", 8, rc)) : ce("", !0)
|
|
7619
|
+
], 64)) : ce("", !0)
|
|
7618
7620
|
], 2))), 128))
|
|
7619
|
-
])) : (
|
|
7621
|
+
])) : (L(), U("div", ac, "暂无自定义数据")),
|
|
7620
7622
|
b("button", {
|
|
7621
7623
|
class: "get-camera-btn",
|
|
7622
7624
|
onClick: M
|
|
@@ -7630,29 +7632,29 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7630
7632
|
selectedObject: {}
|
|
7631
7633
|
},
|
|
7632
7634
|
setup(r) {
|
|
7633
|
-
const e = r, t =
|
|
7634
|
-
let
|
|
7635
|
+
const e = r, t = W(""), n = W([]), s = W(!0), i = W(0.1), o = W(0), a = W(0), l = W(20), c = W(""), d = W(""), u = W(""), m = W("");
|
|
7636
|
+
let A = h(), g = !1;
|
|
7635
7637
|
function h() {
|
|
7636
7638
|
const C = e.selectedObject;
|
|
7637
7639
|
return C ? St(ss(C)) : null;
|
|
7638
7640
|
}
|
|
7639
7641
|
Me(s, (C) => {
|
|
7640
|
-
|
|
7642
|
+
g || !A || (A.visible = C);
|
|
7641
7643
|
}), Me(l, (C) => {
|
|
7642
|
-
|
|
7644
|
+
g || !A || A.setWidth(`${C}em`);
|
|
7643
7645
|
}), Me(o, (C) => {
|
|
7644
|
-
|
|
7646
|
+
g || !A || A.setOffsetX(C);
|
|
7645
7647
|
}), Me(i, (C) => {
|
|
7646
|
-
|
|
7648
|
+
g || !A || A.setOffsetY(C);
|
|
7647
7649
|
}), Me(a, (C) => {
|
|
7648
|
-
|
|
7650
|
+
g || !A || A.setOffsetZ(C);
|
|
7649
7651
|
});
|
|
7650
|
-
function
|
|
7651
|
-
|
|
7652
|
+
function p() {
|
|
7653
|
+
g || !A || (A.setTitle(t.value), A.setItems([...n.value]));
|
|
7652
7654
|
}
|
|
7653
|
-
Me(t, () =>
|
|
7654
|
-
function
|
|
7655
|
-
n.value = n.value.filter((
|
|
7655
|
+
Me(t, () => p()), Me(n, () => p(), { deep: !0 });
|
|
7656
|
+
function y(C) {
|
|
7657
|
+
n.value = n.value.filter((f, w) => w !== C), p();
|
|
7656
7658
|
}
|
|
7657
7659
|
function M() {
|
|
7658
7660
|
!c.value.trim() || !d.value.trim() || (n.value = [
|
|
@@ -7663,96 +7665,96 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7663
7665
|
unit: u.value.trim() || void 0,
|
|
7664
7666
|
code: m.value.trim() || void 0
|
|
7665
7667
|
}
|
|
7666
|
-
],
|
|
7668
|
+
], p(), c.value = "", d.value = "", u.value = "", m.value = "");
|
|
7667
7669
|
}
|
|
7668
7670
|
return Me(
|
|
7669
7671
|
() => e.selectedObject,
|
|
7670
7672
|
() => {
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
+
g = !0, A = h(), A ? (t.value = A.getTitle(), n.value = A.getItems(), s.value = A.visible, i.value = A.getOffsetY(), o.value = A.getOffsetX(), a.value = A.getOffsetZ(), l.value = parseFloat(A.getWidth()) || 20) : (t.value = "", n.value = [], s.value = !0, i.value = 0.1, o.value = 0, a.value = 0, l.value = 20), c.value = "", d.value = "", u.value = "", m.value = "", setTimeout(() => {
|
|
7674
|
+
g = !1;
|
|
7673
7675
|
}, 0);
|
|
7674
7676
|
},
|
|
7675
7677
|
{ immediate: !0 }
|
|
7676
|
-
), (C,
|
|
7678
|
+
), (C, f) => (L(), U("div", uc, [
|
|
7677
7679
|
b("div", dc, [
|
|
7678
|
-
|
|
7680
|
+
f[29] || (f[29] = b("label", null, "📊 数据面板", -1)),
|
|
7679
7681
|
b("div", hc, [
|
|
7680
|
-
|
|
7682
|
+
f[14] || (f[14] = b("span", { class: "dp-label-sm" }, "可见性", -1)),
|
|
7681
7683
|
b("div", fc, [
|
|
7682
7684
|
b("label", pc, [
|
|
7683
|
-
|
|
7685
|
+
F(b("input", {
|
|
7684
7686
|
type: "checkbox",
|
|
7685
|
-
"onUpdate:modelValue":
|
|
7687
|
+
"onUpdate:modelValue": f[0] || (f[0] = (w) => s.value = w)
|
|
7686
7688
|
}, null, 512), [
|
|
7687
7689
|
[Ii, s.value]
|
|
7688
7690
|
]),
|
|
7689
|
-
|
|
7691
|
+
f[13] || (f[13] = b("span", { class: "dp-toggle-slider" }, null, -1))
|
|
7690
7692
|
]),
|
|
7691
|
-
b("span", Ac,
|
|
7693
|
+
b("span", Ac, de(s.value ? "显示中" : "已隐藏"), 1)
|
|
7692
7694
|
])
|
|
7693
7695
|
]),
|
|
7694
7696
|
b("div", mc, [
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
+
f[15] || (f[15] = b("span", { class: "dp-label-sm" }, "标题", -1)),
|
|
7698
|
+
F(b("input", {
|
|
7697
7699
|
type: "text",
|
|
7698
7700
|
class: "dp-input",
|
|
7699
|
-
"onUpdate:modelValue":
|
|
7701
|
+
"onUpdate:modelValue": f[1] || (f[1] = (w) => t.value = w),
|
|
7700
7702
|
placeholder: "面板标题"
|
|
7701
7703
|
}, null, 512), [
|
|
7702
|
-
[
|
|
7704
|
+
[K, t.value]
|
|
7703
7705
|
])
|
|
7704
7706
|
]),
|
|
7705
7707
|
b("div", gc, [
|
|
7706
|
-
|
|
7708
|
+
f[18] || (f[18] = b("span", { class: "dp-label-sm" }, "面板宽度", -1)),
|
|
7707
7709
|
b("div", yc, [
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
+
f[16] || (f[16] = b("span", { class: "dp-range-label" }, "窄", -1)),
|
|
7711
|
+
F(b("input", {
|
|
7710
7712
|
type: "range",
|
|
7711
7713
|
class: "dp-range",
|
|
7712
7714
|
min: "10",
|
|
7713
7715
|
max: "40",
|
|
7714
7716
|
step: "1",
|
|
7715
|
-
"onUpdate:modelValue":
|
|
7717
|
+
"onUpdate:modelValue": f[2] || (f[2] = (w) => l.value = w)
|
|
7716
7718
|
}, null, 512), [
|
|
7717
7719
|
[
|
|
7718
|
-
|
|
7720
|
+
K,
|
|
7719
7721
|
l.value,
|
|
7720
7722
|
void 0,
|
|
7721
7723
|
{ number: !0 }
|
|
7722
7724
|
]
|
|
7723
7725
|
]),
|
|
7724
|
-
|
|
7725
|
-
b("span", bc,
|
|
7726
|
+
f[17] || (f[17] = b("span", { class: "dp-range-label" }, "宽", -1)),
|
|
7727
|
+
b("span", bc, de(l.value) + "em", 1)
|
|
7726
7728
|
])
|
|
7727
7729
|
]),
|
|
7728
7730
|
b("div", xc, [
|
|
7729
|
-
|
|
7731
|
+
f[21] || (f[21] = b("span", { class: "dp-label-sm" }, "面板左右位置", -1)),
|
|
7730
7732
|
b("div", Ic, [
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
+
f[19] || (f[19] = b("span", { class: "dp-range-label" }, "偏左", -1)),
|
|
7734
|
+
F(b("input", {
|
|
7733
7735
|
type: "range",
|
|
7734
7736
|
class: "dp-range",
|
|
7735
7737
|
min: "-5",
|
|
7736
7738
|
max: "5",
|
|
7737
7739
|
step: "0.01",
|
|
7738
|
-
"onUpdate:modelValue":
|
|
7740
|
+
"onUpdate:modelValue": f[3] || (f[3] = (w) => o.value = w)
|
|
7739
7741
|
}, null, 512), [
|
|
7740
7742
|
[
|
|
7741
|
-
|
|
7743
|
+
K,
|
|
7742
7744
|
o.value,
|
|
7743
7745
|
void 0,
|
|
7744
7746
|
{ number: !0 }
|
|
7745
7747
|
]
|
|
7746
7748
|
]),
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
+
f[20] || (f[20] = b("span", { class: "dp-range-label" }, "偏右", -1)),
|
|
7750
|
+
F(b("input", {
|
|
7749
7751
|
type: "number",
|
|
7750
7752
|
class: "dp-input dp-input-number",
|
|
7751
|
-
"onUpdate:modelValue":
|
|
7753
|
+
"onUpdate:modelValue": f[4] || (f[4] = (w) => o.value = w),
|
|
7752
7754
|
step: "0.01"
|
|
7753
7755
|
}, null, 512), [
|
|
7754
7756
|
[
|
|
7755
|
-
|
|
7757
|
+
K,
|
|
7756
7758
|
o.value,
|
|
7757
7759
|
void 0,
|
|
7758
7760
|
{ number: !0 }
|
|
@@ -7761,33 +7763,33 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7761
7763
|
])
|
|
7762
7764
|
]),
|
|
7763
7765
|
b("div", Cc, [
|
|
7764
|
-
|
|
7766
|
+
f[24] || (f[24] = b("span", { class: "dp-label-sm" }, "面板上下位置", -1)),
|
|
7765
7767
|
b("div", wc, [
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
+
f[22] || (f[22] = b("span", { class: "dp-range-label" }, "偏下", -1)),
|
|
7769
|
+
F(b("input", {
|
|
7768
7770
|
type: "range",
|
|
7769
7771
|
class: "dp-range",
|
|
7770
7772
|
min: "-5",
|
|
7771
7773
|
max: "5",
|
|
7772
7774
|
step: "0.01",
|
|
7773
|
-
"onUpdate:modelValue":
|
|
7775
|
+
"onUpdate:modelValue": f[5] || (f[5] = (w) => i.value = w)
|
|
7774
7776
|
}, null, 512), [
|
|
7775
7777
|
[
|
|
7776
|
-
|
|
7778
|
+
K,
|
|
7777
7779
|
i.value,
|
|
7778
7780
|
void 0,
|
|
7779
7781
|
{ number: !0 }
|
|
7780
7782
|
]
|
|
7781
7783
|
]),
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
+
f[23] || (f[23] = b("span", { class: "dp-range-label" }, "偏上", -1)),
|
|
7785
|
+
F(b("input", {
|
|
7784
7786
|
type: "number",
|
|
7785
7787
|
class: "dp-input dp-input-number",
|
|
7786
|
-
"onUpdate:modelValue":
|
|
7788
|
+
"onUpdate:modelValue": f[6] || (f[6] = (w) => i.value = w),
|
|
7787
7789
|
step: "0.01"
|
|
7788
7790
|
}, null, 512), [
|
|
7789
7791
|
[
|
|
7790
|
-
|
|
7792
|
+
K,
|
|
7791
7793
|
i.value,
|
|
7792
7794
|
void 0,
|
|
7793
7795
|
{ number: !0 }
|
|
@@ -7796,33 +7798,33 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7796
7798
|
])
|
|
7797
7799
|
]),
|
|
7798
7800
|
b("div", Mc, [
|
|
7799
|
-
|
|
7801
|
+
f[27] || (f[27] = b("span", { class: "dp-label-sm" }, "面板前后位置", -1)),
|
|
7800
7802
|
b("div", vc, [
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
+
f[25] || (f[25] = b("span", { class: "dp-range-label" }, "近", -1)),
|
|
7804
|
+
F(b("input", {
|
|
7803
7805
|
type: "range",
|
|
7804
7806
|
class: "dp-range",
|
|
7805
7807
|
min: "-5",
|
|
7806
7808
|
max: "5",
|
|
7807
7809
|
step: "0.01",
|
|
7808
|
-
"onUpdate:modelValue":
|
|
7810
|
+
"onUpdate:modelValue": f[7] || (f[7] = (w) => a.value = w)
|
|
7809
7811
|
}, null, 512), [
|
|
7810
7812
|
[
|
|
7811
|
-
|
|
7813
|
+
K,
|
|
7812
7814
|
a.value,
|
|
7813
7815
|
void 0,
|
|
7814
7816
|
{ number: !0 }
|
|
7815
7817
|
]
|
|
7816
7818
|
]),
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
+
f[26] || (f[26] = b("span", { class: "dp-range-label" }, "远", -1)),
|
|
7820
|
+
F(b("input", {
|
|
7819
7821
|
type: "number",
|
|
7820
7822
|
class: "dp-input dp-input-number",
|
|
7821
|
-
"onUpdate:modelValue":
|
|
7823
|
+
"onUpdate:modelValue": f[8] || (f[8] = (w) => a.value = w),
|
|
7822
7824
|
step: "0.01"
|
|
7823
7825
|
}, null, 512), [
|
|
7824
7826
|
[
|
|
7825
|
-
|
|
7827
|
+
K,
|
|
7826
7828
|
a.value,
|
|
7827
7829
|
void 0,
|
|
7828
7830
|
{ number: !0 }
|
|
@@ -7831,87 +7833,87 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7831
7833
|
])
|
|
7832
7834
|
]),
|
|
7833
7835
|
b("div", Tc, [
|
|
7834
|
-
|
|
7836
|
+
f[28] || (f[28] = b("span", { class: "dp-label-sm" }, "数据项", -1)),
|
|
7835
7837
|
b("div", Ec, [
|
|
7836
|
-
(
|
|
7837
|
-
key:
|
|
7838
|
+
(L(!0), U(Oe, null, ns(n.value, (w, E) => (L(), U("div", {
|
|
7839
|
+
key: E,
|
|
7838
7840
|
class: "dp-item"
|
|
7839
7841
|
}, [
|
|
7840
|
-
|
|
7842
|
+
F(b("input", {
|
|
7841
7843
|
type: "text",
|
|
7842
7844
|
class: "dp-input dp-input-sm",
|
|
7843
|
-
"onUpdate:modelValue": (
|
|
7845
|
+
"onUpdate:modelValue": (D) => w.label = D,
|
|
7844
7846
|
placeholder: "标签"
|
|
7845
7847
|
}, null, 8, Dc), [
|
|
7846
|
-
[
|
|
7848
|
+
[K, w.label]
|
|
7847
7849
|
]),
|
|
7848
|
-
|
|
7850
|
+
F(b("input", {
|
|
7849
7851
|
type: "text",
|
|
7850
7852
|
class: "dp-input dp-input-sm",
|
|
7851
|
-
"onUpdate:modelValue": (
|
|
7853
|
+
"onUpdate:modelValue": (D) => w.value = D,
|
|
7852
7854
|
placeholder: "值"
|
|
7853
7855
|
}, null, 8, Pc), [
|
|
7854
|
-
[
|
|
7856
|
+
[K, w.value]
|
|
7855
7857
|
]),
|
|
7856
|
-
|
|
7858
|
+
F(b("input", {
|
|
7857
7859
|
type: "text",
|
|
7858
7860
|
class: "dp-input dp-input-xs",
|
|
7859
|
-
"onUpdate:modelValue": (
|
|
7861
|
+
"onUpdate:modelValue": (D) => w.unit = D,
|
|
7860
7862
|
placeholder: "单位"
|
|
7861
7863
|
}, null, 8, Rc), [
|
|
7862
|
-
[
|
|
7864
|
+
[K, w.unit]
|
|
7863
7865
|
]),
|
|
7864
|
-
|
|
7866
|
+
F(b("input", {
|
|
7865
7867
|
type: "text",
|
|
7866
7868
|
class: "dp-input dp-input-xs",
|
|
7867
|
-
"onUpdate:modelValue": (
|
|
7869
|
+
"onUpdate:modelValue": (D) => w.code = D,
|
|
7868
7870
|
placeholder: "编码"
|
|
7869
7871
|
}, null, 8, Oc), [
|
|
7870
|
-
[
|
|
7872
|
+
[K, w.code]
|
|
7871
7873
|
]),
|
|
7872
7874
|
b("button", {
|
|
7873
7875
|
class: "dp-btn dp-btn-del",
|
|
7874
|
-
onClick: (
|
|
7876
|
+
onClick: (D) => y(E),
|
|
7875
7877
|
title: "删除此项"
|
|
7876
7878
|
}, "✕", 8, Sc)
|
|
7877
7879
|
]))), 128))
|
|
7878
7880
|
]),
|
|
7879
7881
|
b("div", Lc, [
|
|
7880
|
-
|
|
7882
|
+
F(b("input", {
|
|
7881
7883
|
type: "text",
|
|
7882
7884
|
class: "dp-input dp-input-sm",
|
|
7883
|
-
"onUpdate:modelValue":
|
|
7885
|
+
"onUpdate:modelValue": f[9] || (f[9] = (w) => c.value = w),
|
|
7884
7886
|
placeholder: "标签",
|
|
7885
7887
|
onKeyup: rt(M, ["enter"])
|
|
7886
7888
|
}, null, 544), [
|
|
7887
|
-
[
|
|
7889
|
+
[K, c.value]
|
|
7888
7890
|
]),
|
|
7889
|
-
|
|
7891
|
+
F(b("input", {
|
|
7890
7892
|
type: "text",
|
|
7891
7893
|
class: "dp-input dp-input-sm",
|
|
7892
|
-
"onUpdate:modelValue":
|
|
7894
|
+
"onUpdate:modelValue": f[10] || (f[10] = (w) => d.value = w),
|
|
7893
7895
|
placeholder: "值",
|
|
7894
7896
|
onKeyup: rt(M, ["enter"])
|
|
7895
7897
|
}, null, 544), [
|
|
7896
|
-
[
|
|
7898
|
+
[K, d.value]
|
|
7897
7899
|
]),
|
|
7898
|
-
|
|
7900
|
+
F(b("input", {
|
|
7899
7901
|
type: "text",
|
|
7900
7902
|
class: "dp-input dp-input-xs",
|
|
7901
|
-
"onUpdate:modelValue":
|
|
7903
|
+
"onUpdate:modelValue": f[11] || (f[11] = (w) => u.value = w),
|
|
7902
7904
|
placeholder: "单位",
|
|
7903
7905
|
onKeyup: rt(M, ["enter"])
|
|
7904
7906
|
}, null, 544), [
|
|
7905
|
-
[
|
|
7907
|
+
[K, u.value]
|
|
7906
7908
|
]),
|
|
7907
|
-
|
|
7909
|
+
F(b("input", {
|
|
7908
7910
|
type: "text",
|
|
7909
7911
|
class: "dp-input dp-input-xs",
|
|
7910
|
-
"onUpdate:modelValue":
|
|
7912
|
+
"onUpdate:modelValue": f[12] || (f[12] = (w) => m.value = w),
|
|
7911
7913
|
placeholder: "编码",
|
|
7912
7914
|
onKeyup: rt(M, ["enter"])
|
|
7913
7915
|
}, null, 544), [
|
|
7914
|
-
[
|
|
7916
|
+
[K, m.value]
|
|
7915
7917
|
]),
|
|
7916
7918
|
b("button", {
|
|
7917
7919
|
class: "dp-btn dp-btn-add",
|
|
@@ -7925,7 +7927,7 @@ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7925
7927
|
}
|
|
7926
7928
|
}), Hc = /* @__PURE__ */ Xe(Nc, [["__scopeId", "data-v-b4c7c7dc"]]);
|
|
7927
7929
|
function kc(r) {
|
|
7928
|
-
const e =
|
|
7930
|
+
const e = W(/* @__PURE__ */ new Set()), t = (s) => {
|
|
7929
7931
|
const i = new Set(e.value);
|
|
7930
7932
|
i.has(s) ? i.delete(s) : i.add(s), e.value = i;
|
|
7931
7933
|
}, n = (s) => {
|
|
@@ -7968,31 +7970,31 @@ const jc = {
|
|
|
7968
7970
|
},
|
|
7969
7971
|
emits: ["propertyChange", "treeSelect", "treeDelete", "transformModeChange"],
|
|
7970
7972
|
setup(r, { emit: e }) {
|
|
7971
|
-
const t = r, n = e, s =
|
|
7972
|
-
function i(
|
|
7973
|
-
s.value =
|
|
7974
|
-
}
|
|
7975
|
-
const o = () => n("propertyChange"), a =
|
|
7976
|
-
var
|
|
7977
|
-
return !!(t.selectedObject && ((
|
|
7978
|
-
}), c =
|
|
7973
|
+
const t = r, n = e, s = W("translate");
|
|
7974
|
+
function i(g) {
|
|
7975
|
+
s.value = g, n("transformModeChange", g);
|
|
7976
|
+
}
|
|
7977
|
+
const o = () => n("propertyChange"), a = W("transform"), l = ot(() => {
|
|
7978
|
+
var g;
|
|
7979
|
+
return !!(t.selectedObject && ((g = t.selectedObject.userData) != null && g._hasDataPanel));
|
|
7980
|
+
}), c = W(0), d = Ci(t, "selectedObject"), { expandedSet: u, toggleExpand: m } = kc(d);
|
|
7979
7981
|
wi("treeExpand", { expandedSet: u, toggleExpand: m });
|
|
7980
|
-
const
|
|
7981
|
-
c.value++, n("treeDelete",
|
|
7982
|
+
const A = (g) => {
|
|
7983
|
+
c.value++, n("treeDelete", g);
|
|
7982
7984
|
};
|
|
7983
|
-
return (
|
|
7985
|
+
return (g, h) => g.transform ? (L(), U("div", jc, [
|
|
7984
7986
|
b("div", Fc, [
|
|
7985
7987
|
h[7] || (h[7] = b("label", null, "场景物体", -1)),
|
|
7986
7988
|
b("div", Uc, [
|
|
7987
|
-
(
|
|
7988
|
-
key:
|
|
7989
|
-
node:
|
|
7990
|
-
"selected-object":
|
|
7989
|
+
(L(!0), U(Oe, null, ns(g.treeData, (p) => (L(), bt(nl, {
|
|
7990
|
+
key: p.uuid,
|
|
7991
|
+
node: p,
|
|
7992
|
+
"selected-object": g.selectedObject,
|
|
7991
7993
|
version: c.value,
|
|
7992
|
-
onSelect: h[0] || (h[0] = (
|
|
7993
|
-
onDelete:
|
|
7994
|
+
onSelect: h[0] || (h[0] = (y) => n("treeSelect", y)),
|
|
7995
|
+
onDelete: A
|
|
7994
7996
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
7995
|
-
|
|
7997
|
+
g.treeData.length === 0 ? (L(), U("div", zc, "暂无物体")) : ce("", !0)
|
|
7996
7998
|
])
|
|
7997
7999
|
]),
|
|
7998
8000
|
b("div", Gc, [
|
|
@@ -8001,51 +8003,51 @@ const jc = {
|
|
|
8001
8003
|
b("button", {
|
|
8002
8004
|
class: ve(["mode-btn", { active: s.value === "translate" }]),
|
|
8003
8005
|
title: "移动 (W)",
|
|
8004
|
-
onClick: h[1] || (h[1] = (
|
|
8006
|
+
onClick: h[1] || (h[1] = (p) => i("translate"))
|
|
8005
8007
|
}, " ↕ 移动 ", 2),
|
|
8006
8008
|
b("button", {
|
|
8007
8009
|
class: ve(["mode-btn", { active: s.value === "rotate" }]),
|
|
8008
8010
|
title: "旋转 (E)",
|
|
8009
|
-
onClick: h[2] || (h[2] = (
|
|
8011
|
+
onClick: h[2] || (h[2] = (p) => i("rotate"))
|
|
8010
8012
|
}, " ↻ 旋转 ", 2),
|
|
8011
8013
|
b("button", {
|
|
8012
8014
|
class: ve(["mode-btn", { active: s.value === "scale" }]),
|
|
8013
8015
|
title: "缩放 (R)",
|
|
8014
|
-
onClick: h[3] || (h[3] = (
|
|
8016
|
+
onClick: h[3] || (h[3] = (p) => i("scale"))
|
|
8015
8017
|
}, " ⤡ 缩放 ", 2)
|
|
8016
8018
|
])
|
|
8017
8019
|
]),
|
|
8018
|
-
|
|
8020
|
+
g.selectedObject ? (L(), U("div", Bc, [
|
|
8019
8021
|
b("button", {
|
|
8020
8022
|
class: ve(["tab-btn", { active: a.value === "transform" }]),
|
|
8021
|
-
onClick: h[4] || (h[4] = (
|
|
8023
|
+
onClick: h[4] || (h[4] = (p) => a.value = "transform")
|
|
8022
8024
|
}, " 🔄 变换 ", 2),
|
|
8023
8025
|
b("button", {
|
|
8024
8026
|
class: ve(["tab-btn", { active: a.value === "userdata" }]),
|
|
8025
|
-
onClick: h[5] || (h[5] = (
|
|
8027
|
+
onClick: h[5] || (h[5] = (p) => a.value = "userdata")
|
|
8026
8028
|
}, " 📋 自定义数据 ", 2),
|
|
8027
|
-
l.value ? (
|
|
8029
|
+
l.value ? (L(), U("button", {
|
|
8028
8030
|
key: 0,
|
|
8029
8031
|
class: ve(["tab-btn", { active: a.value === "datapanel" }]),
|
|
8030
|
-
onClick: h[6] || (h[6] = (
|
|
8031
|
-
}, " 📊 数据面板 ", 2)) :
|
|
8032
|
-
])) :
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
transform:
|
|
8036
|
-
"selected-object":
|
|
8032
|
+
onClick: h[6] || (h[6] = (p) => a.value = "datapanel")
|
|
8033
|
+
}, " 📊 数据面板 ", 2)) : ce("", !0)
|
|
8034
|
+
])) : ce("", !0),
|
|
8035
|
+
g.selectedObject ? (L(), U("div", Xc, [
|
|
8036
|
+
F(rs(Yl, {
|
|
8037
|
+
transform: g.transform,
|
|
8038
|
+
"selected-object": g.selectedObject,
|
|
8037
8039
|
onPropertyChange: o
|
|
8038
8040
|
}, null, 8, ["transform", "selected-object"]), [
|
|
8039
8041
|
[Ze, a.value === "transform"]
|
|
8040
8042
|
]),
|
|
8041
|
-
|
|
8043
|
+
F(rs(cc, { "selected-object": g.selectedObject }, null, 8, ["selected-object"]), [
|
|
8042
8044
|
[Ze, a.value === "userdata"]
|
|
8043
8045
|
]),
|
|
8044
|
-
|
|
8046
|
+
F(rs(Hc, { "selected-object": g.selectedObject }, null, 8, ["selected-object"]), [
|
|
8045
8047
|
[Ze, a.value === "datapanel"]
|
|
8046
8048
|
])
|
|
8047
|
-
])) :
|
|
8048
|
-
])) : (
|
|
8049
|
+
])) : ce("", !0)
|
|
8050
|
+
])) : (L(), U("div", qc, h[9] || (h[9] = [
|
|
8049
8051
|
b("p", null, "未选中任何模型", -1)
|
|
8050
8052
|
])));
|
|
8051
8053
|
}
|
|
@@ -8053,58 +8055,58 @@ const jc = {
|
|
|
8053
8055
|
__name: "TopBar",
|
|
8054
8056
|
emits: ["addModel", "importModel"],
|
|
8055
8057
|
setup(r, { emit: e }) {
|
|
8056
|
-
const t =
|
|
8058
|
+
const t = W(!1), n = W(!1), s = W(!1), i = W(!1), o = e, a = W(null), l = () => {
|
|
8057
8059
|
var h;
|
|
8058
8060
|
return (h = a.value) == null ? void 0 : h.click();
|
|
8059
8061
|
}, c = (h) => {
|
|
8060
|
-
const
|
|
8061
|
-
|
|
8062
|
+
const p = h.target;
|
|
8063
|
+
p.files && p.files.length > 0 && (o("importModel", p.files[0]), p.value = "");
|
|
8062
8064
|
}, d = () => console.log("撤销"), u = () => console.log("删除物体"), m = async () => {
|
|
8063
8065
|
const h = await Fa();
|
|
8064
8066
|
console.log("scene GLB 字节数:", h.scene.byteLength), console.log("camera:", h.camera), console.log("dataPanels:", h.dataPanels), console.log("waters:", h.waters), console.log("textures:", h.textures);
|
|
8065
|
-
},
|
|
8067
|
+
}, A = () => {
|
|
8066
8068
|
if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
|
|
8067
8069
|
_n(localStorage.getItem("test_id"));
|
|
8068
|
-
},
|
|
8069
|
-
return (h,
|
|
8070
|
+
}, g = () => Zn();
|
|
8071
|
+
return (h, p) => (L(), U("div", Kc, [
|
|
8070
8072
|
b("div", Zc, [
|
|
8071
8073
|
b("div", {
|
|
8072
8074
|
class: "dropdown-wrapper",
|
|
8073
|
-
onMouseenter:
|
|
8074
|
-
onMouseleave:
|
|
8075
|
+
onMouseenter: p[11] || (p[11] = (y) => n.value = !0),
|
|
8076
|
+
onMouseleave: p[12] || (p[12] = (y) => n.value = !1)
|
|
8075
8077
|
}, [
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
+
p[17] || (p[17] = b("button", { class: "menu-btn" }, "添加", -1)),
|
|
8079
|
+
F(b("div", Qc, [
|
|
8078
8080
|
b("div", {
|
|
8079
8081
|
class: "menu-item",
|
|
8080
8082
|
onClick: d
|
|
8081
8083
|
}, "组"),
|
|
8082
8084
|
b("div", {
|
|
8083
8085
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
8084
|
-
onMouseenter:
|
|
8085
|
-
onMouseleave:
|
|
8086
|
+
onMouseenter: p[5] || (p[5] = (y) => s.value = !0),
|
|
8087
|
+
onMouseleave: p[6] || (p[6] = (y) => s.value = !1)
|
|
8086
8088
|
}, [
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
+
p[15] || (p[15] = b("span", null, "网格", -1)),
|
|
8090
|
+
F(b("div", Jc, [
|
|
8089
8091
|
b("div", {
|
|
8090
8092
|
class: "menu-item",
|
|
8091
|
-
onClick:
|
|
8093
|
+
onClick: p[0] || (p[0] = (y) => o("addModel", "box"))
|
|
8092
8094
|
}, " 正方体 "),
|
|
8093
8095
|
b("div", {
|
|
8094
8096
|
class: "menu-item",
|
|
8095
|
-
onClick:
|
|
8097
|
+
onClick: p[1] || (p[1] = (y) => o("addModel", "sphere"))
|
|
8096
8098
|
}, " 球体 "),
|
|
8097
8099
|
b("div", {
|
|
8098
8100
|
class: "menu-item",
|
|
8099
|
-
onClick:
|
|
8101
|
+
onClick: p[2] || (p[2] = (y) => o("addModel", "water"))
|
|
8100
8102
|
}, " 水体(Water.js) "),
|
|
8101
8103
|
b("div", {
|
|
8102
8104
|
class: "menu-item",
|
|
8103
|
-
onClick:
|
|
8105
|
+
onClick: p[3] || (p[3] = (y) => o("addModel", "waterCylinder"))
|
|
8104
8106
|
}, " 水体(圆柱) "),
|
|
8105
8107
|
b("div", {
|
|
8106
8108
|
class: "menu-item",
|
|
8107
|
-
onClick:
|
|
8109
|
+
onClick: p[4] || (p[4] = (y) => o("addModel", "waterPlane"))
|
|
8108
8110
|
}, " 水面(标准材质) "),
|
|
8109
8111
|
b("div", {
|
|
8110
8112
|
class: "menu-item",
|
|
@@ -8116,14 +8118,14 @@ const jc = {
|
|
|
8116
8118
|
], 32),
|
|
8117
8119
|
b("div", {
|
|
8118
8120
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
8119
|
-
onMouseenter:
|
|
8120
|
-
onMouseleave:
|
|
8121
|
+
onMouseenter: p[8] || (p[8] = (y) => i.value = !0),
|
|
8122
|
+
onMouseleave: p[9] || (p[9] = (y) => i.value = !1)
|
|
8121
8123
|
}, [
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
+
p[16] || (p[16] = b("span", null, "光源", -1)),
|
|
8125
|
+
F(b("div", _c, [
|
|
8124
8126
|
b("div", {
|
|
8125
8127
|
class: "menu-item",
|
|
8126
|
-
onClick:
|
|
8128
|
+
onClick: p[7] || (p[7] = (y) => o("addModel", "directionalLight"))
|
|
8127
8129
|
}, " 平行光 ")
|
|
8128
8130
|
], 512), [
|
|
8129
8131
|
[Ze, i.value]
|
|
@@ -8135,7 +8137,7 @@ const jc = {
|
|
|
8135
8137
|
}, "摄像机"),
|
|
8136
8138
|
b("div", {
|
|
8137
8139
|
class: "menu-item",
|
|
8138
|
-
onClick:
|
|
8140
|
+
onClick: p[10] || (p[10] = (y) => o("addModel", "dataPanel"))
|
|
8139
8141
|
}, " 数据面板 ")
|
|
8140
8142
|
], 512), [
|
|
8141
8143
|
[Ze, n.value]
|
|
@@ -8143,30 +8145,30 @@ const jc = {
|
|
|
8143
8145
|
], 32),
|
|
8144
8146
|
b("div", {
|
|
8145
8147
|
class: "dropdown-wrapper",
|
|
8146
|
-
onMouseenter:
|
|
8147
|
-
onMouseleave:
|
|
8148
|
+
onMouseenter: p[13] || (p[13] = (y) => t.value = !0),
|
|
8149
|
+
onMouseleave: p[14] || (p[14] = (y) => t.value = !1)
|
|
8148
8150
|
}, [
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
+
p[19] || (p[19] = b("button", { class: "menu-btn" }, "帮助", -1)),
|
|
8152
|
+
F(b("div", $c, [
|
|
8151
8153
|
b("div", {
|
|
8152
8154
|
class: "menu-item",
|
|
8153
8155
|
onClick: m
|
|
8154
8156
|
}, "获取场景"),
|
|
8155
8157
|
b("div", {
|
|
8156
8158
|
class: "menu-item",
|
|
8157
|
-
onClick:
|
|
8159
|
+
onClick: A
|
|
8158
8160
|
}, "镜头拉近"),
|
|
8159
8161
|
b("div", {
|
|
8160
8162
|
class: "menu-item",
|
|
8161
|
-
onClick:
|
|
8163
|
+
onClick: g
|
|
8162
8164
|
}, " 重置相机位置 "),
|
|
8163
|
-
|
|
8165
|
+
p[18] || (p[18] = b("div", { class: "menu-divider" }, null, -1))
|
|
8164
8166
|
], 512), [
|
|
8165
8167
|
[Ze, t.value]
|
|
8166
8168
|
])
|
|
8167
8169
|
], 32)
|
|
8168
8170
|
]),
|
|
8169
|
-
|
|
8171
|
+
p[20] || (p[20] = b("div", { class: "right-section" }, [
|
|
8170
8172
|
b("span", { class: "app-title" }, "3D 模型编辑器")
|
|
8171
8173
|
], -1)),
|
|
8172
8174
|
b("input", {
|
|
@@ -8182,7 +8184,7 @@ const jc = {
|
|
|
8182
8184
|
}), tu = /* @__PURE__ */ Xe(eu, [["__scopeId", "data-v-a9ed5f3e"]]), su = { class: "bottom-bar" }, nu = /* @__PURE__ */ Be({
|
|
8183
8185
|
__name: "BottomBar",
|
|
8184
8186
|
setup(r) {
|
|
8185
|
-
return (e, t) => (
|
|
8187
|
+
return (e, t) => (L(), U("div", su, t[0] || (t[0] = [
|
|
8186
8188
|
b("div", { class: "status-left" }, [
|
|
8187
8189
|
b("span", null, "就绪")
|
|
8188
8190
|
], -1),
|
|
@@ -8201,89 +8203,89 @@ const jc = {
|
|
|
8201
8203
|
sceneData: { default: null }
|
|
8202
8204
|
},
|
|
8203
8205
|
setup(r) {
|
|
8204
|
-
const e = r, t =
|
|
8205
|
-
ba((
|
|
8206
|
-
t.value =
|
|
8206
|
+
const e = r, t = W(!1);
|
|
8207
|
+
ba((y) => {
|
|
8208
|
+
t.value = y;
|
|
8207
8209
|
});
|
|
8208
8210
|
const n = Fs(null), s = xs({
|
|
8209
8211
|
position: { x: 0, y: 0, z: 0 },
|
|
8210
8212
|
rotation: { x: 0, y: 0, z: 0 },
|
|
8211
8213
|
scale: { x: 1, y: 1, z: 1 }
|
|
8212
|
-
}), i = (
|
|
8213
|
-
s.position.x = Number(
|
|
8214
|
-
}, o = (
|
|
8215
|
-
|
|
8214
|
+
}), i = (y) => {
|
|
8215
|
+
s.position.x = Number(y.position.x.toFixed(3)), s.position.y = Number(y.position.y.toFixed(3)), s.position.z = Number(y.position.z.toFixed(3)), s.rotation.x = Number(y.rotation.x.toFixed(3)), s.rotation.y = Number(y.rotation.y.toFixed(3)), s.rotation.z = Number(y.rotation.z.toFixed(3)), s.scale.x = Number(y.scale.x.toFixed(3)), s.scale.y = Number(y.scale.y.toFixed(3)), s.scale.z = Number(y.scale.z.toFixed(3));
|
|
8216
|
+
}, o = (y) => {
|
|
8217
|
+
y.position.set(
|
|
8216
8218
|
s.position.x,
|
|
8217
8219
|
s.position.y,
|
|
8218
8220
|
s.position.z
|
|
8219
|
-
),
|
|
8221
|
+
), y.rotation.set(
|
|
8220
8222
|
s.rotation.x,
|
|
8221
8223
|
s.rotation.y,
|
|
8222
8224
|
s.rotation.z
|
|
8223
|
-
),
|
|
8225
|
+
), y.scale.set(s.scale.x, s.scale.y, s.scale.z);
|
|
8224
8226
|
};
|
|
8225
|
-
Sa((
|
|
8226
|
-
n.value =
|
|
8227
|
-
}), La((
|
|
8228
|
-
i(
|
|
8227
|
+
Sa((y) => {
|
|
8228
|
+
n.value = y, y && i(y);
|
|
8229
|
+
}), La((y) => {
|
|
8230
|
+
i(y);
|
|
8229
8231
|
});
|
|
8230
8232
|
const a = () => {
|
|
8231
8233
|
if (n.value && (o(n.value), n.value.type === "DirectionalLight")) {
|
|
8232
|
-
const
|
|
8233
|
-
|
|
8234
|
+
const y = n.value.userData.helper;
|
|
8235
|
+
y && typeof y.update == "function" && y.update();
|
|
8234
8236
|
}
|
|
8235
|
-
}, l = (
|
|
8237
|
+
}, l = (y) => di(y), c = async (y) => {
|
|
8236
8238
|
try {
|
|
8237
|
-
await ui(
|
|
8239
|
+
await ui(y);
|
|
8238
8240
|
} catch (M) {
|
|
8239
8241
|
console.error("导入失败:", M), alert("导入失败:" + M.message);
|
|
8240
8242
|
}
|
|
8241
8243
|
}, d = Fs([]);
|
|
8242
|
-
Na((
|
|
8243
|
-
d.value =
|
|
8244
|
+
Na((y) => {
|
|
8245
|
+
d.value = y;
|
|
8244
8246
|
});
|
|
8245
8247
|
const u = () => {
|
|
8246
|
-
const
|
|
8247
|
-
|
|
8248
|
-
}, m = (
|
|
8249
|
-
xa(
|
|
8250
|
-
}, h =
|
|
8248
|
+
const y = Ha();
|
|
8249
|
+
y && (d.value = y);
|
|
8250
|
+
}, m = (y) => Hs(y), A = (y) => Pa(y.uuid), g = (y) => {
|
|
8251
|
+
xa(y);
|
|
8252
|
+
}, h = W(null), p = async () => {
|
|
8251
8253
|
h.value && await la(h.value, e.mode, e.sceneData), u();
|
|
8252
8254
|
};
|
|
8253
8255
|
return Mi(() => {
|
|
8254
|
-
|
|
8256
|
+
p(), h.value && _o(h.value);
|
|
8255
8257
|
}), vi(() => {
|
|
8256
8258
|
console.log("endset_three_editor destroy"), Ga();
|
|
8257
|
-
}), (
|
|
8258
|
-
t.value ? (
|
|
8259
|
+
}), (y, M) => (L(), U("div", ou, [
|
|
8260
|
+
t.value ? (L(), U("div", ru, M[0] || (M[0] = [
|
|
8259
8261
|
b("div", { class: "loading-spinner" }, null, -1),
|
|
8260
8262
|
b("div", { class: "loading-text" }, "加载中...", -1)
|
|
8261
|
-
]))) :
|
|
8262
|
-
|
|
8263
|
+
]))) : ce("", !0),
|
|
8264
|
+
y.mode === "edit" ? (L(), bt(tu, {
|
|
8263
8265
|
key: 1,
|
|
8264
8266
|
onAddModel: l,
|
|
8265
8267
|
onImportModel: c
|
|
8266
|
-
})) :
|
|
8268
|
+
})) : ce("", !0),
|
|
8267
8269
|
b("div", {
|
|
8268
|
-
class: ve(`editor-container editor-container-mode-${
|
|
8270
|
+
class: ve(`editor-container editor-container-mode-${y.mode}`)
|
|
8269
8271
|
}, [
|
|
8270
8272
|
b("div", {
|
|
8271
|
-
class: ve(`canvas canvas-mode-${
|
|
8273
|
+
class: ve(`canvas canvas-mode-${y.mode}`),
|
|
8272
8274
|
ref_key: "containerRef",
|
|
8273
8275
|
ref: h
|
|
8274
8276
|
}, null, 2),
|
|
8275
|
-
|
|
8277
|
+
y.mode === "edit" ? (L(), bt(Yc, {
|
|
8276
8278
|
key: 0,
|
|
8277
8279
|
transform: s,
|
|
8278
8280
|
"tree-data": d.value,
|
|
8279
8281
|
"selected-object": n.value,
|
|
8280
8282
|
onPropertyChange: a,
|
|
8281
8283
|
onTreeSelect: m,
|
|
8282
|
-
onTreeDelete:
|
|
8283
|
-
onTransformModeChange:
|
|
8284
|
-
}, null, 8, ["transform", "tree-data", "selected-object"])) :
|
|
8284
|
+
onTreeDelete: A,
|
|
8285
|
+
onTransformModeChange: g
|
|
8286
|
+
}, null, 8, ["transform", "tree-data", "selected-object"])) : ce("", !0)
|
|
8285
8287
|
], 2),
|
|
8286
|
-
|
|
8288
|
+
y.mode === "edit" ? (L(), bt(iu, { key: 2 })) : ce("", !0)
|
|
8287
8289
|
]));
|
|
8288
8290
|
}
|
|
8289
8291
|
}), Pu = /* @__PURE__ */ Xe(au, [["__scopeId", "data-v-1be6406e"]]);
|