endset_three_editor 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/three-editor.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Xe, ref as G, inject as xn, computed as Qe, watchEffect as En, resolveComponent as Mn, openBlock as C, createElementBlock as U, createElementVNode as g, normalizeClass as Ue, withModifiers as Lt, unref as vn, toDisplayString as Ee, Fragment as nn, renderList as sn, createBlock as ke, createCommentVNode as ae, watch as on, toRef as Sn, provide as An, reactive as rn, withDirectives as N, vModelText as Q, vShow as ue, shallowRef as Rn, onMounted as Pn } from "vue";
|
|
2
2
|
import * as F from "three";
|
|
3
|
-
import { Controls as an, Vector3 as M, MOUSE as Me, TOUCH as xe, Quaternion as K, Spherical as It, Vector2 as V, Ray as
|
|
4
|
-
import
|
|
5
|
-
const jt = { type: "change" }, Mt = { type: "start" }, gn = { type: "end" },
|
|
3
|
+
import { Controls as an, Vector3 as M, MOUSE as Me, TOUCH as xe, Quaternion as K, Spherical as It, Vector2 as V, Ray as Ln, Plane as In, MathUtils as ln, Raycaster as On, Object3D as ze, MeshBasicMaterial as _e, LineBasicMaterial as je, CylinderGeometry as Y, BoxGeometry as z, BufferGeometry as Ge, Float32BufferAttribute as de, Mesh as T, OctahedronGeometry as qe, Line as re, TorusGeometry as Pe, SphereGeometry as Cn, Euler as Dn, Matrix4 as Se, PlaneGeometry as Nn, DoubleSide as cn, Loader as hn, FileLoader as Et, Color as pe, SRGBColorSpace as Ae, Group as nt, Material as Fe, PointsMaterial as Ce, MeshPhongMaterial as kn, LineSegments as gt, Points as st, TrianglesDrawMode as jn, TriangleFanDrawMode as yt, TriangleStripDrawMode as un, LoaderUtils as He, MeshPhysicalMaterial as se, LinearSRGBColorSpace as le, SpotLight as Fn, PointLight as Hn, DirectionalLight as Un, InstancedMesh as zn, InstancedBufferAttribute as Gn, TextureLoader as Xn, ImageBitmapLoader as Yn, BufferAttribute as rt, InterleavedBuffer as Bn, InterleavedBufferAttribute as Kn, LinearMipmapLinearFilter as dn, NearestMipmapLinearFilter as Vn, LinearMipmapNearestFilter as Zn, NearestMipmapNearestFilter as Qn, LinearFilter as _t, NearestFilter as pn, RepeatWrapping as bt, MirroredRepeatWrapping as qn, ClampToEdgeWrapping as Wn, MeshStandardMaterial as fn, PropertyBinding as $n, SkinnedMesh as Jn, LineLoop as es, PerspectiveCamera as ts, OrthographicCamera as ns, Skeleton as ss, AnimationClip as is, Bone as os, InterpolateDiscrete as rs, InterpolateLinear as mn, Texture as Ot, VectorKeyframeTrack as Ct, NumberKeyframeTrack as Dt, QuaternionKeyframeTrack as Nt, ColorManagement as kt, FrontSide as as, Interpolant as ls, Box3 as cs, Sphere as hs } from "three";
|
|
4
|
+
import us from "@tweenjs/tween.js";
|
|
5
|
+
const jt = { type: "change" }, Mt = { type: "start" }, gn = { type: "end" }, We = new Ln(), Ft = new In(), ds = Math.cos(70 * ln.DEG2RAD), k = new M(), B = 2 * Math.PI, P = {
|
|
6
6
|
NONE: -1,
|
|
7
7
|
ROTATE: 0,
|
|
8
8
|
DOLLY: 1,
|
|
@@ -12,7 +12,7 @@ const jt = { type: "change" }, Mt = { type: "start" }, gn = { type: "end" }, qe
|
|
|
12
12
|
TOUCH_DOLLY_PAN: 5,
|
|
13
13
|
TOUCH_DOLLY_ROTATE: 6
|
|
14
14
|
}, at = 1e-6;
|
|
15
|
-
class
|
|
15
|
+
class ps extends an {
|
|
16
16
|
/**
|
|
17
17
|
* Constructs a new controls instance.
|
|
18
18
|
*
|
|
@@ -20,7 +20,7 @@ class fs extends an {
|
|
|
20
20
|
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
21
21
|
*/
|
|
22
22
|
constructor(e, t = null) {
|
|
23
|
-
super(e, t), this.state = P.NONE, this.target = new M(), this.cursor = new M(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Me.ROTATE, MIDDLE: Me.DOLLY, RIGHT: Me.PAN }, this.touches = { ONE: xe.ROTATE, TWO: xe.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new M(), this._lastQuaternion = new K(), this._lastTargetPosition = new M(), this._quat = new K().setFromUnitVectors(e.up, new M(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new It(), this._sphericalDelta = new It(), this._scale = 1, this._panOffset = new M(), this._rotateStart = new V(), this._rotateEnd = new V(), this._rotateDelta = new V(), this._panStart = new V(), this._panEnd = new V(), this._panDelta = new V(), this._dollyStart = new V(), this._dollyEnd = new V(), this._dollyDelta = new V(), this._dollyDirection = new M(), this._mouse = new V(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove =
|
|
23
|
+
super(e, t), this.state = P.NONE, this.target = new M(), this.cursor = new M(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Me.ROTATE, MIDDLE: Me.DOLLY, RIGHT: Me.PAN }, this.touches = { ONE: xe.ROTATE, TWO: xe.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new M(), this._lastQuaternion = new K(), this._lastTargetPosition = new M(), this._quat = new K().setFromUnitVectors(e.up, new M(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new It(), this._sphericalDelta = new It(), this._scale = 1, this._panOffset = new M(), this._rotateStart = new V(), this._rotateEnd = new V(), this._rotateDelta = new V(), this._panStart = new V(), this._panEnd = new V(), this._panDelta = new V(), this._dollyStart = new V(), this._dollyEnd = new V(), this._dollyDelta = new V(), this._dollyDirection = new M(), this._mouse = new V(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = ms.bind(this), this._onPointerDown = fs.bind(this), this._onPointerUp = gs.bind(this), this._onContextMenu = Es.bind(this), this._onMouseWheel = bs.bind(this), this._onKeyDown = ws.bind(this), this._onTouchStart = Ts.bind(this), this._onTouchMove = xs.bind(this), this._onMouseDown = ys.bind(this), this._onMouseMove = _s.bind(this), this._interceptControlDown = Ms.bind(this), this._interceptControlUp = vs.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Defines the visual representation of the cursor.
|
|
@@ -164,7 +164,7 @@ class fs extends an {
|
|
|
164
164
|
h.unproject(this.object), this.object.position.sub(h).add(a), this.object.updateMatrixWorld(), o = k.length();
|
|
165
165
|
} else
|
|
166
166
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
167
|
-
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (
|
|
167
|
+
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (We.origin.copy(this.object.position), We.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(We.direction)) < ds ? this.object.lookAt(this.target) : (Ft.setFromNormalAndCoplanarPoint(this.object.up, this.target), We.intersectPlane(Ft, this.target))));
|
|
168
168
|
} else if (this.object.isOrthographicCamera) {
|
|
169
169
|
const o = this.object.zoom;
|
|
170
170
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), o !== this.object.zoom && (this.object.updateProjectionMatrix(), i = !0);
|
|
@@ -361,13 +361,13 @@ class fs extends an {
|
|
|
361
361
|
return e.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function fs(r) {
|
|
365
365
|
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(r.pointerId), this.domElement.ownerDocument.addEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(r) && (this._addPointer(r), r.pointerType === "touch" ? this._onTouchStart(r) : this._onMouseDown(r), this._cursorStyle === "grab" && (this.domElement.style.cursor = "grabbing")));
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function ms(r) {
|
|
368
368
|
this.enabled !== !1 && (r.pointerType === "touch" ? this._onTouchMove(r) : this._onMouseMove(r));
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function gs(r) {
|
|
371
371
|
switch (this._removePointer(r), this._pointers.length) {
|
|
372
372
|
case 0:
|
|
373
373
|
this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(gn), this.state = P.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
|
|
@@ -378,7 +378,7 @@ function ys(r) {
|
|
|
378
378
|
break;
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function ys(r) {
|
|
382
382
|
let e;
|
|
383
383
|
switch (r.button) {
|
|
384
384
|
case 0:
|
|
@@ -421,7 +421,7 @@ function _s(r) {
|
|
|
421
421
|
}
|
|
422
422
|
this.state !== P.NONE && this.dispatchEvent(Mt);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function _s(r) {
|
|
425
425
|
switch (this.state) {
|
|
426
426
|
case P.ROTATE:
|
|
427
427
|
if (this.enableRotate === !1) return;
|
|
@@ -437,13 +437,13 @@ function bs(r) {
|
|
|
437
437
|
break;
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function bs(r) {
|
|
441
441
|
this.enabled === !1 || this.enableZoom === !1 || this.state !== P.NONE || (r.preventDefault(), this.dispatchEvent(Mt), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(gn));
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function ws(r) {
|
|
444
444
|
this.enabled !== !1 && this._handleKeyDown(r);
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function Ts(r) {
|
|
447
447
|
switch (this._trackPointer(r), this._pointers.length) {
|
|
448
448
|
case 1:
|
|
449
449
|
switch (this.touches.ONE) {
|
|
@@ -478,7 +478,7 @@ function xs(r) {
|
|
|
478
478
|
}
|
|
479
479
|
this.state !== P.NONE && this.dispatchEvent(Mt);
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function xs(r) {
|
|
482
482
|
switch (this._trackPointer(r), this.state) {
|
|
483
483
|
case P.TOUCH_ROTATE:
|
|
484
484
|
if (this.enableRotate === !1) return;
|
|
@@ -500,21 +500,21 @@ function Es(r) {
|
|
|
500
500
|
this.state = P.NONE;
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function Es(r) {
|
|
504
504
|
this.enabled !== !1 && r.preventDefault();
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Ms(r) {
|
|
507
507
|
r.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function vs(r) {
|
|
510
510
|
r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
511
511
|
}
|
|
512
|
-
const me = new
|
|
512
|
+
const me = new On(), H = new M(), ce = new M(), O = new K(), Ht = {
|
|
513
513
|
X: new M(1, 0, 0),
|
|
514
514
|
Y: new M(0, 1, 0),
|
|
515
515
|
Z: new M(0, 0, 1)
|
|
516
516
|
}, lt = { type: "change" }, Ut = { type: "mouseDown", mode: null }, zt = { type: "mouseUp", mode: null }, Gt = { type: "objectChange" };
|
|
517
|
-
class
|
|
517
|
+
class Ss extends an {
|
|
518
518
|
/**
|
|
519
519
|
* Constructs a new controls instance.
|
|
520
520
|
*
|
|
@@ -523,11 +523,11 @@ class As extends an {
|
|
|
523
523
|
*/
|
|
524
524
|
constructor(e, t = null) {
|
|
525
525
|
super(void 0, t);
|
|
526
|
-
const s = new
|
|
526
|
+
const s = new Os(this);
|
|
527
527
|
this._root = s;
|
|
528
|
-
const n = new
|
|
528
|
+
const n = new Cs();
|
|
529
529
|
this._gizmo = n, s.add(n);
|
|
530
|
-
const i = new
|
|
530
|
+
const i = new Ds();
|
|
531
531
|
this._plane = i, s.add(i);
|
|
532
532
|
const o = this;
|
|
533
533
|
function a(x, S) {
|
|
@@ -543,7 +543,7 @@ class As extends an {
|
|
|
543
543
|
}
|
|
544
544
|
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);
|
|
545
545
|
const l = new M(), h = new M(), u = new K(), c = new K(), p = new M(), m = new K(), b = new M(), f = new M(), y = new M(), d = 0, _ = new M();
|
|
546
|
-
a("worldPosition", l), a("worldPositionStart", h), a("worldQuaternion", u), a("worldQuaternionStart", c), a("cameraPosition", p), a("cameraQuaternion", m), a("pointStart", b), a("pointEnd", f), a("rotationAxis", y), a("rotationAngle", d), a("eye", _), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer =
|
|
546
|
+
a("worldPosition", l), a("worldPositionStart", h), a("worldQuaternion", u), a("worldQuaternionStart", c), a("cameraPosition", p), a("cameraQuaternion", m), a("pointStart", b), a("pointEnd", f), a("rotationAxis", y), a("rotationAngle", d), a("eye", _), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer = As.bind(this), this._onPointerDown = Ps.bind(this), this._onPointerHover = Rs.bind(this), this._onPointerMove = Ls.bind(this), this._onPointerUp = Is.bind(this), t !== null && this.connect(t);
|
|
547
547
|
}
|
|
548
548
|
connect(e) {
|
|
549
549
|
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";
|
|
@@ -585,10 +585,10 @@ class As extends an {
|
|
|
585
585
|
else if (s === "scale") {
|
|
586
586
|
if (t.search("XYZ") !== -1) {
|
|
587
587
|
let a = this.pointEnd.length() / this.pointStart.length();
|
|
588
|
-
this.pointEnd.dot(this.pointStart) < 0 && (a *= -1),
|
|
588
|
+
this.pointEnd.dot(this.pointStart) < 0 && (a *= -1), ce.set(a, a, a);
|
|
589
589
|
} else
|
|
590
|
-
H.copy(this.pointStart),
|
|
591
|
-
n.scale.copy(this._scaleStart).multiply(
|
|
590
|
+
H.copy(this.pointStart), ce.copy(this.pointEnd), H.applyQuaternion(this._worldQuaternionInv), ce.applyQuaternion(this._worldQuaternionInv), ce.divide(H), t.search("X") === -1 && (ce.x = 1), t.search("Y") === -1 && (ce.y = 1), t.search("Z") === -1 && (ce.z = 1);
|
|
591
|
+
n.scale.copy(this._scaleStart).multiply(ce), this.scaleSnap && (t.search("X") !== -1 && (n.scale.x = Math.round(n.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (n.scale.y = Math.round(n.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (n.scale.z = Math.round(n.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
|
|
592
592
|
} else if (s === "rotate") {
|
|
593
593
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
|
594
594
|
const a = 20 / this.worldPosition.distanceTo(H.setFromMatrixPosition(this.camera.matrixWorld));
|
|
@@ -705,7 +705,7 @@ class As extends an {
|
|
|
705
705
|
i.xAxis.color.set(e), i.yAxis.color.set(t), i.zAxis.color.set(s), i.active.color.set(n), i.xAxisTransparent.color.set(e), i.yAxisTransparent.color.set(t), i.zAxisTransparent.color.set(s), i.activeTransparent.color.set(n), i.xAxis._color && i.xAxis._color.set(e), i.yAxis._color && i.yAxis._color.set(t), i.zAxis._color && i.zAxis._color.set(s), i.active._color && i.active._color.set(n), i.xAxisTransparent._color && i.xAxisTransparent._color.set(e), i.yAxisTransparent._color && i.yAxisTransparent._color.set(t), i.zAxisTransparent._color && i.zAxisTransparent._color.set(s), i.activeTransparent._color && i.activeTransparent._color.set(n);
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function As(r) {
|
|
709
709
|
if (this.domElement.ownerDocument.pointerLockElement)
|
|
710
710
|
return {
|
|
711
711
|
x: 0,
|
|
@@ -721,7 +721,7 @@ function Rs(r) {
|
|
|
721
721
|
};
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function Rs(r) {
|
|
725
725
|
if (this.enabled)
|
|
726
726
|
switch (r.pointerType) {
|
|
727
727
|
case "mouse":
|
|
@@ -730,13 +730,13 @@ function Ps(r) {
|
|
|
730
730
|
break;
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function Ps(r) {
|
|
734
734
|
this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(r.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(r)), this.pointerDown(this._getPointer(r)));
|
|
735
735
|
}
|
|
736
|
-
function
|
|
736
|
+
function Ls(r) {
|
|
737
737
|
this.enabled && this.pointerMove(this._getPointer(r));
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function Is(r) {
|
|
740
740
|
this.enabled && (this.domElement.releasePointerCapture(r.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(r)));
|
|
741
741
|
}
|
|
742
742
|
function ct(r, e, t) {
|
|
@@ -746,8 +746,8 @@ function ct(r, e, t) {
|
|
|
746
746
|
return s[n];
|
|
747
747
|
return !1;
|
|
748
748
|
}
|
|
749
|
-
const
|
|
750
|
-
class
|
|
749
|
+
const $e = new Dn(), L = new M(0, 1, 0), Xt = new M(0, 0, 0), Yt = new Se(), Je = new K(), it = new K(), te = new M(), Bt = new Se(), De = new M(1, 0, 0), ye = new M(0, 1, 0), Ne = new M(0, 0, 1), et = new M(), Le = new M(), Ie = new M();
|
|
750
|
+
class Os extends ze {
|
|
751
751
|
constructor(e) {
|
|
752
752
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
753
753
|
}
|
|
@@ -762,7 +762,7 @@ class Cs extends Ue {
|
|
|
762
762
|
});
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
|
-
class
|
|
765
|
+
class Cs extends ze {
|
|
766
766
|
constructor() {
|
|
767
767
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
|
768
768
|
const e = new _e({
|
|
@@ -771,7 +771,7 @@ class Ds extends Ue {
|
|
|
771
771
|
fog: !1,
|
|
772
772
|
toneMapped: !1,
|
|
773
773
|
transparent: !0
|
|
774
|
-
}), t = new
|
|
774
|
+
}), t = new je({
|
|
775
775
|
depthTest: !1,
|
|
776
776
|
depthWrite: !1,
|
|
777
777
|
fog: !1,
|
|
@@ -814,17 +814,17 @@ class Ds extends Ue {
|
|
|
814
814
|
f.translate(0, 0.05, 0);
|
|
815
815
|
const y = new z(0.08, 0.08, 0.08);
|
|
816
816
|
y.translate(0, 0.04, 0);
|
|
817
|
-
const d = new
|
|
818
|
-
d.setAttribute("position", new
|
|
817
|
+
const d = new Ge();
|
|
818
|
+
d.setAttribute("position", new de([0, 0, 0, 1, 0, 0], 3));
|
|
819
819
|
const _ = new Y(75e-4, 75e-4, 0.5, 3);
|
|
820
820
|
_.translate(0, 0.25, 0);
|
|
821
|
-
function x(Z,
|
|
822
|
-
const J = new Pe(Z, 75e-4, 3, 64,
|
|
821
|
+
function x(Z, Be) {
|
|
822
|
+
const J = new Pe(Z, 75e-4, 3, 64, Be * Math.PI * 2);
|
|
823
823
|
return J.rotateY(Math.PI / 2), J.rotateX(Math.PI / 2), J;
|
|
824
824
|
}
|
|
825
825
|
function S() {
|
|
826
|
-
const Z = new
|
|
827
|
-
return Z.setAttribute("position", new
|
|
826
|
+
const Z = new Ge();
|
|
827
|
+
return Z.setAttribute("position", new de([0, 0, 0, 1, 1, 1], 3)), Z;
|
|
828
828
|
}
|
|
829
829
|
const R = {
|
|
830
830
|
X: [
|
|
@@ -843,7 +843,7 @@ class Ds extends Ue {
|
|
|
843
843
|
[new T(_, a), null, [Math.PI / 2, 0, 0]]
|
|
844
844
|
],
|
|
845
845
|
XYZ: [
|
|
846
|
-
[new T(new
|
|
846
|
+
[new T(new qe(0.1, 0), c), [0, 0, 0]]
|
|
847
847
|
],
|
|
848
848
|
XY: [
|
|
849
849
|
[new T(new z(0.15, 0.15, 0.01), u), [0.15, 0.15, 0]]
|
|
@@ -868,7 +868,7 @@ class Ds extends Ue {
|
|
|
868
868
|
[new T(new Y(0.2, 0, 0.6, 4), s), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
|
869
869
|
],
|
|
870
870
|
XYZ: [
|
|
871
|
-
[new T(new
|
|
871
|
+
[new T(new qe(0.2, 0), s)]
|
|
872
872
|
],
|
|
873
873
|
XY: [
|
|
874
874
|
[new T(new z(0.2, 0.2, 0.01), s), [0.15, 0.15, 0]]
|
|
@@ -881,10 +881,10 @@ class Ds extends Ue {
|
|
|
881
881
|
]
|
|
882
882
|
}, I = {
|
|
883
883
|
START: [
|
|
884
|
-
[new T(new
|
|
884
|
+
[new T(new qe(0.01, 2), n), null, null, null, "helper"]
|
|
885
885
|
],
|
|
886
886
|
END: [
|
|
887
|
-
[new T(new
|
|
887
|
+
[new T(new qe(0.01, 2), n), null, null, null, "helper"]
|
|
888
888
|
],
|
|
889
889
|
DELTA: [
|
|
890
890
|
[new re(S(), n), null, null, null, "helper"]
|
|
@@ -920,7 +920,7 @@ class Ds extends Ue {
|
|
|
920
920
|
]
|
|
921
921
|
}, fe = {
|
|
922
922
|
XYZE: [
|
|
923
|
-
[new T(new
|
|
923
|
+
[new T(new Cn(0.25, 10, 8), s)]
|
|
924
924
|
],
|
|
925
925
|
X: [
|
|
926
926
|
[new T(new Pe(0.5, 0.1, 4, 24), s), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
|
|
@@ -999,21 +999,21 @@ class Ds extends Ue {
|
|
|
999
999
|
]
|
|
1000
1000
|
};
|
|
1001
1001
|
function oe(Z) {
|
|
1002
|
-
const
|
|
1002
|
+
const Be = new ze();
|
|
1003
1003
|
for (const J in Z)
|
|
1004
1004
|
for (let Te = Z[J].length; Te--; ) {
|
|
1005
|
-
const X = Z[J][Te][0].clone(),
|
|
1006
|
-
X.name = J, X.tag = Tn,
|
|
1005
|
+
const X = Z[J][Te][0].clone(), Ke = Z[J][Te][1], Ve = Z[J][Te][2], Ze = Z[J][Te][3], Tn = Z[J][Te][4];
|
|
1006
|
+
X.name = J, X.tag = Tn, Ke && X.position.set(Ke[0], Ke[1], Ke[2]), Ve && X.rotation.set(Ve[0], Ve[1], Ve[2]), Ze && X.scale.set(Ze[0], Ze[1], Ze[2]), X.updateMatrix();
|
|
1007
1007
|
const Pt = X.geometry.clone();
|
|
1008
|
-
Pt.applyMatrix4(X.matrix), X.geometry = Pt, X.renderOrder = 1 / 0, X.position.set(0, 0, 0), X.rotation.set(0, 0, 0), X.scale.set(1, 1, 1),
|
|
1008
|
+
Pt.applyMatrix4(X.matrix), X.geometry = Pt, X.renderOrder = 1 / 0, X.position.set(0, 0, 0), X.rotation.set(0, 0, 0), X.scale.set(1, 1, 1), Be.add(X);
|
|
1009
1009
|
}
|
|
1010
|
-
return
|
|
1010
|
+
return Be;
|
|
1011
1011
|
}
|
|
1012
1012
|
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = oe(R)), this.add(this.gizmo.rotate = oe(ie)), this.add(this.gizmo.scale = oe($)), this.add(this.picker.translate = oe(v)), this.add(this.picker.rotate = oe(fe)), this.add(this.picker.scale = oe(E)), this.add(this.helper.translate = oe(I)), this.add(this.helper.rotate = oe(ee)), this.add(this.helper.scale = oe(j)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
1013
1013
|
}
|
|
1014
1014
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
1015
1015
|
updateMatrixWorld(e) {
|
|
1016
|
-
const s = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion :
|
|
1016
|
+
const s = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : it;
|
|
1017
1017
|
this.gizmo.translate.visible = this.mode === "translate", this.gizmo.rotate.visible = this.mode === "rotate", this.gizmo.scale.visible = this.mode === "scale", this.helper.translate.visible = this.mode === "translate", this.helper.rotate.visible = this.mode === "rotate", this.helper.scale.visible = this.mode === "scale";
|
|
1018
1018
|
let n = [];
|
|
1019
1019
|
n = n.concat(this.picker[this.mode].children), n = n.concat(this.gizmo[this.mode].children), n = n.concat(this.helper[this.mode].children);
|
|
@@ -1022,31 +1022,31 @@ class Ds extends Ue {
|
|
|
1022
1022
|
o.visible = !0, o.rotation.set(0, 0, 0), o.position.copy(this.worldPosition);
|
|
1023
1023
|
let a;
|
|
1024
1024
|
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") {
|
|
1025
|
-
o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (O.setFromEuler(
|
|
1025
|
+
o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (O.setFromEuler($e.set(0, 0, 0)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (O.setFromEuler($e.set(0, 0, Math.PI / 2)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (O.setFromEuler($e.set(0, Math.PI / 2, 0)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (O.setFromEuler($e.set(0, Math.PI / 2, 0)), L.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(Yt.lookAt(Xt, L, ye)), o.quaternion.multiply(O), 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), H.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), H.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(H), o.visible = this.dragging) : (o.quaternion.copy(s), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
|
|
1026
1026
|
continue;
|
|
1027
1027
|
}
|
|
1028
|
-
o.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (
|
|
1028
|
+
o.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (Je.copy(s), L.copy(this.eye).applyQuaternion(O.copy(s).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(Yt.lookAt(this.eye, Xt, ye)), o.name === "X" && (O.setFromAxisAngle(De, Math.atan2(-L.y, L.z)), O.multiplyQuaternions(Je, O), o.quaternion.copy(O)), o.name === "Y" && (O.setFromAxisAngle(ye, Math.atan2(L.x, L.z)), O.multiplyQuaternions(Je, O), o.quaternion.copy(O)), o.name === "Z" && (O.setFromAxisAngle(Ne, Math.atan2(L.y, L.x)), O.multiplyQuaternions(Je, O), o.quaternion.copy(O))), 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) {
|
|
1029
1029
|
return o.name === l;
|
|
1030
1030
|
}) && (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1));
|
|
1031
1031
|
}
|
|
1032
1032
|
super.updateMatrixWorld(e);
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
|
-
class
|
|
1035
|
+
class Ds extends T {
|
|
1036
1036
|
constructor() {
|
|
1037
1037
|
super(
|
|
1038
|
-
new
|
|
1038
|
+
new Nn(1e5, 1e5, 2, 2),
|
|
1039
1039
|
new _e({ visible: !1, wireframe: !0, side: cn, transparent: !0, opacity: 0.1, toneMapped: !1 })
|
|
1040
1040
|
), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
|
|
1041
1041
|
}
|
|
1042
1042
|
updateMatrixWorld(e) {
|
|
1043
1043
|
let t = this.space;
|
|
1044
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"),
|
|
1044
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), et.copy(De).applyQuaternion(t === "local" ? this.worldQuaternion : it), Le.copy(ye).applyQuaternion(t === "local" ? this.worldQuaternion : it), Ie.copy(Ne).applyQuaternion(t === "local" ? this.worldQuaternion : it), L.copy(Le), this.mode) {
|
|
1045
1045
|
case "translate":
|
|
1046
1046
|
case "scale":
|
|
1047
1047
|
switch (this.axis) {
|
|
1048
1048
|
case "X":
|
|
1049
|
-
L.copy(this.eye).cross(
|
|
1049
|
+
L.copy(this.eye).cross(et), te.copy(et).cross(L);
|
|
1050
1050
|
break;
|
|
1051
1051
|
case "Y":
|
|
1052
1052
|
L.copy(this.eye).cross(Le), te.copy(Le).cross(L);
|
|
@@ -1058,7 +1058,7 @@ class Ns extends T {
|
|
|
1058
1058
|
te.copy(Ie);
|
|
1059
1059
|
break;
|
|
1060
1060
|
case "YZ":
|
|
1061
|
-
te.copy(
|
|
1061
|
+
te.copy(et);
|
|
1062
1062
|
break;
|
|
1063
1063
|
case "XZ":
|
|
1064
1064
|
L.copy(Ie), te.copy(Le);
|
|
@@ -1095,9 +1095,9 @@ const w = {
|
|
|
1095
1095
|
/** 当前选中的物体 */
|
|
1096
1096
|
selectedObject: null
|
|
1097
1097
|
};
|
|
1098
|
-
let ht = !1, Re = !1, be = null, wt = null,
|
|
1099
|
-
function
|
|
1100
|
-
if (w.container = r, w.mode = e,
|
|
1098
|
+
let ht = !1, Re = !1, be = null, wt = null, ot = null, we = [], ut;
|
|
1099
|
+
function Ns(r, e = "edit", t) {
|
|
1100
|
+
if (w.container = r, w.mode = e, ks(), js(), Hs(), t && (ei(t.scene, e), t != null && t.camera)) {
|
|
1101
1101
|
const s = t.camera;
|
|
1102
1102
|
w.camera.position.set(
|
|
1103
1103
|
s.position[0],
|
|
@@ -1109,25 +1109,25 @@ function ks(r, e = "edit", t) {
|
|
|
1109
1109
|
s.rotation[2]
|
|
1110
1110
|
), w.camera.updateProjectionMatrix(), ut = s.target;
|
|
1111
1111
|
}
|
|
1112
|
-
|
|
1112
|
+
zs(), Us(), ut && w.orbitControls && (w.orbitControls.target.fromArray(ut), w.orbitControls.update()), Qs(), yn(), e === "edit" && r.addEventListener("click", Ys), window.addEventListener("resize", Xs), t || Gs(), e === "edit" && Fs();
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1114
|
+
function ks() {
|
|
1115
1115
|
const r = new F.WebGLRenderer({ antialias: !0, alpha: !0 });
|
|
1116
1116
|
r.setSize(w.container.clientWidth, w.container.clientHeight), r.setPixelRatio(Math.min(window.devicePixelRatio, 2)), w.container.appendChild(r.domElement), w.renderer = r;
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1118
|
+
function js() {
|
|
1119
1119
|
w.scene = new F.Scene(), w.scene.name = "sl_scene";
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function Fs() {
|
|
1122
1122
|
const r = new F.GridHelper(30, 30, 8956671, 3364232);
|
|
1123
1123
|
r.name = "地板", r.userData.type = "initFloor", w.scene.add(r), w.gridHelper = r;
|
|
1124
1124
|
}
|
|
1125
|
-
function
|
|
1125
|
+
function Hs() {
|
|
1126
1126
|
const r = w.container, e = r.clientWidth / r.clientHeight, t = new F.PerspectiveCamera(45, e, 0.1, 1e3);
|
|
1127
1127
|
t.position.set(0, 6, 15), t.lookAt(0, 0, 0), w.camera = t;
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1130
|
-
const r = new
|
|
1129
|
+
function Us() {
|
|
1130
|
+
const r = new ps(w.camera, w.renderer.domElement);
|
|
1131
1131
|
r.minDistance = 0, r.maxDistance = 1 / 0, r.addEventListener("start", () => {
|
|
1132
1132
|
ht = !1;
|
|
1133
1133
|
}), r.addEventListener("change", () => {
|
|
@@ -1138,8 +1138,8 @@ function zs() {
|
|
|
1138
1138
|
}, 200));
|
|
1139
1139
|
}), w.orbitControls = r;
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1142
|
-
const r = new
|
|
1141
|
+
function zs() {
|
|
1142
|
+
const r = new Ss(
|
|
1143
1143
|
w.camera,
|
|
1144
1144
|
w.renderer.domElement
|
|
1145
1145
|
);
|
|
@@ -1151,7 +1151,7 @@ function Gs() {
|
|
|
1151
1151
|
wt && w.selectedObject && wt(w.selectedObject);
|
|
1152
1152
|
}), w.scene.add(r.getHelper()), w.transformControls = r;
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function Gs() {
|
|
1155
1155
|
const r = new F.AmbientLight(16777215, 2);
|
|
1156
1156
|
w.scene.add(r);
|
|
1157
1157
|
const e = new F.DirectionalLight(16777215, 3);
|
|
@@ -1159,9 +1159,9 @@ function Xs() {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
function yn() {
|
|
1161
1161
|
var r, e;
|
|
1162
|
-
requestAnimationFrame(yn),
|
|
1162
|
+
requestAnimationFrame(yn), us.update(), (r = w.orbitControls) == null || r.update(), (e = w.renderer) == null || e.render(w.scene, w.camera);
|
|
1163
1163
|
}
|
|
1164
|
-
function
|
|
1164
|
+
function Xs() {
|
|
1165
1165
|
if (!w.container || !w.camera || !w.renderer) return;
|
|
1166
1166
|
const r = w.container.clientWidth, e = w.container.clientHeight;
|
|
1167
1167
|
r === 0 || e === 0 || (w.camera.aspect = r / e, w.camera.updateProjectionMatrix(), w.renderer.setSize(r, e));
|
|
@@ -1172,7 +1172,7 @@ function vt(r) {
|
|
|
1172
1172
|
function St() {
|
|
1173
1173
|
w.selectedObject && (w.transformControls.detach(), w.selectedObject = null, be == null || be(null));
|
|
1174
1174
|
}
|
|
1175
|
-
function
|
|
1175
|
+
function Ys(r) {
|
|
1176
1176
|
if (Re) {
|
|
1177
1177
|
Re = !1;
|
|
1178
1178
|
return;
|
|
@@ -1190,53 +1190,53 @@ function Bs(r) {
|
|
|
1190
1190
|
i.length > 0 ? vt(i[0].object) : St();
|
|
1191
1191
|
}
|
|
1192
1192
|
function At(r, e = !1) {
|
|
1193
|
-
w.scene.add(r), r.userData.isMovable && (
|
|
1193
|
+
w.scene.add(r), r.userData.isMovable && (Vs(r), Rt()), e && w.mode === "edit" && vt(r);
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1196
|
-
w.selectedObject === r && St(), r.parent ? r.parent.remove(r) : w.scene.remove(r),
|
|
1195
|
+
function Bs(r) {
|
|
1196
|
+
w.selectedObject === r && St(), r.parent ? r.parent.remove(r) : w.scene.remove(r), Zs(r), Rt();
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1198
|
+
function Ks(r) {
|
|
1199
1199
|
const e = w.scene.getObjectByProperty("uuid", r);
|
|
1200
|
-
e &&
|
|
1200
|
+
e && Bs(e);
|
|
1201
1201
|
}
|
|
1202
|
-
function
|
|
1202
|
+
function Vs(r) {
|
|
1203
1203
|
r.userData.isMovable && r.parent === w.scene && (we.includes(r) || we.push(r));
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function Zs(r) {
|
|
1206
1206
|
const e = we.indexOf(r);
|
|
1207
1207
|
e !== -1 && we.splice(e, 1);
|
|
1208
1208
|
}
|
|
1209
|
-
function
|
|
1209
|
+
function Qs() {
|
|
1210
1210
|
const r = [];
|
|
1211
1211
|
w.scene.children.forEach((e) => {
|
|
1212
1212
|
e.userData.isMovable && r.push(e);
|
|
1213
1213
|
}), we = r, Rt();
|
|
1214
1214
|
}
|
|
1215
1215
|
function Rt() {
|
|
1216
|
-
|
|
1216
|
+
ot == null || ot([...we]);
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1218
|
+
function qs(r) {
|
|
1219
1219
|
be = r;
|
|
1220
1220
|
}
|
|
1221
|
-
function
|
|
1221
|
+
function Ws(r) {
|
|
1222
1222
|
wt = r;
|
|
1223
1223
|
}
|
|
1224
|
-
function
|
|
1225
|
-
|
|
1224
|
+
function $s(r) {
|
|
1225
|
+
ot = r;
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function Js() {
|
|
1228
1228
|
return we;
|
|
1229
1229
|
}
|
|
1230
|
-
function
|
|
1230
|
+
function Go() {
|
|
1231
1231
|
return w.scene;
|
|
1232
1232
|
}
|
|
1233
|
-
function
|
|
1233
|
+
function Xo() {
|
|
1234
1234
|
return w.camera;
|
|
1235
1235
|
}
|
|
1236
|
-
function
|
|
1236
|
+
function Yo() {
|
|
1237
1237
|
return w.renderer;
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1239
|
+
function Bo() {
|
|
1240
1240
|
var n, i, o;
|
|
1241
1241
|
St();
|
|
1242
1242
|
const r = w.scene;
|
|
@@ -1252,13 +1252,13 @@ function Ko() {
|
|
|
1252
1252
|
};
|
|
1253
1253
|
return JSON.stringify({ scene: t, camera: s });
|
|
1254
1254
|
}
|
|
1255
|
-
function
|
|
1255
|
+
function ei(r, e = "edit") {
|
|
1256
1256
|
var i;
|
|
1257
1257
|
const t = typeof r == "string" ? JSON.parse(r) : r, n = new F.ObjectLoader().parse(t);
|
|
1258
1258
|
n.type === "Scene" ? w.scene = n : (i = w.scene) == null || i.add(n);
|
|
1259
1259
|
}
|
|
1260
|
-
const
|
|
1261
|
-
function
|
|
1260
|
+
const ti = /^[og]\s*(.+)?/, ni = /^mtllib /, si = /^usemtl /, ii = /^usemap /, Kt = /\s+/, Vt = new M(), dt = new M(), Zt = new M(), Qt = new M(), q = new M(), tt = new pe();
|
|
1261
|
+
function oi() {
|
|
1262
1262
|
const r = {
|
|
1263
1263
|
objects: [],
|
|
1264
1264
|
object: {},
|
|
@@ -1418,7 +1418,7 @@ function ri() {
|
|
|
1418
1418
|
};
|
|
1419
1419
|
return r.startObject("", !1), r;
|
|
1420
1420
|
}
|
|
1421
|
-
class
|
|
1421
|
+
class ri extends hn {
|
|
1422
1422
|
/**
|
|
1423
1423
|
* Constructs a new OBJ loader.
|
|
1424
1424
|
*
|
|
@@ -1462,7 +1462,7 @@ class ai extends hn {
|
|
|
1462
1462
|
* @return {Group} The parsed OBJ.
|
|
1463
1463
|
*/
|
|
1464
1464
|
parse(e) {
|
|
1465
|
-
const t = new
|
|
1465
|
+
const t = new oi();
|
|
1466
1466
|
e.indexOf(`\r
|
|
1467
1467
|
`) !== -1 && (e = e.replace(/\r\n/g, `
|
|
1468
1468
|
`)), e.indexOf(`\\
|
|
@@ -1483,12 +1483,12 @@ class ai extends hn {
|
|
|
1483
1483
|
parseFloat(c[1]),
|
|
1484
1484
|
parseFloat(c[2]),
|
|
1485
1485
|
parseFloat(c[3])
|
|
1486
|
-
), c.length >= 7 ? (
|
|
1486
|
+
), c.length >= 7 ? (tt.setRGB(
|
|
1487
1487
|
parseFloat(c[4]),
|
|
1488
1488
|
parseFloat(c[5]),
|
|
1489
1489
|
parseFloat(c[6]),
|
|
1490
1490
|
Ae
|
|
1491
|
-
), t.colors.push(
|
|
1491
|
+
), t.colors.push(tt.r, tt.g, tt.b)) : t.colors.push(void 0, void 0, void 0);
|
|
1492
1492
|
break;
|
|
1493
1493
|
case "vn":
|
|
1494
1494
|
t.normals.push(
|
|
@@ -1543,14 +1543,14 @@ class ai extends hn {
|
|
|
1543
1543
|
} else if (u === "p") {
|
|
1544
1544
|
const p = h.slice(1).trim().split(" ");
|
|
1545
1545
|
t.addPointGeometry(p);
|
|
1546
|
-
} else if ((n =
|
|
1546
|
+
} else if ((n = ti.exec(h)) !== null) {
|
|
1547
1547
|
const c = (" " + n[0].slice(1).trim()).slice(1);
|
|
1548
1548
|
t.startObject(c);
|
|
1549
|
-
} else if (
|
|
1549
|
+
} else if (si.test(h))
|
|
1550
1550
|
t.object.startMaterial(h.substring(7).trim(), t.materialLibraries);
|
|
1551
|
-
else if (
|
|
1551
|
+
else if (ni.test(h))
|
|
1552
1552
|
t.materialLibraries.push(h.substring(7).trim());
|
|
1553
|
-
else if (
|
|
1553
|
+
else if (ii.test(h))
|
|
1554
1554
|
console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
|
|
1555
1555
|
else if (u === "s") {
|
|
1556
1556
|
if (n = h.split(" "), n.length > 1) {
|
|
@@ -1566,28 +1566,28 @@ class ai extends hn {
|
|
|
1566
1566
|
}
|
|
1567
1567
|
}
|
|
1568
1568
|
t.finalize();
|
|
1569
|
-
const i = new
|
|
1569
|
+
const i = new nt();
|
|
1570
1570
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
|
|
1571
1571
|
for (let a = 0, l = t.objects.length; a < l; a++) {
|
|
1572
1572
|
const h = t.objects[a], u = h.geometry, c = h.materials, p = u.type === "Line", m = u.type === "Points";
|
|
1573
1573
|
let b = !1;
|
|
1574
1574
|
if (u.vertices.length === 0) continue;
|
|
1575
|
-
const f = new
|
|
1576
|
-
f.setAttribute("position", new
|
|
1575
|
+
const f = new Ge();
|
|
1576
|
+
f.setAttribute("position", new de(u.vertices, 3)), u.normals.length > 0 && f.setAttribute("normal", new de(u.normals, 3)), u.colors.length > 0 && (b = !0, f.setAttribute("color", new de(u.colors, 3))), u.hasUVIndices === !0 && f.setAttribute("uv", new de(u.uvs, 2));
|
|
1577
1577
|
const y = [];
|
|
1578
1578
|
for (let _ = 0, x = c.length; _ < x; _++) {
|
|
1579
1579
|
const S = c[_], R = S.name + "_" + S.smooth + "_" + b;
|
|
1580
1580
|
let v = t.materials[R];
|
|
1581
1581
|
if (this.materials !== null) {
|
|
1582
|
-
if (v = this.materials.create(S.name), p && v && !(v instanceof
|
|
1583
|
-
const I = new
|
|
1584
|
-
|
|
1582
|
+
if (v = this.materials.create(S.name), p && v && !(v instanceof je)) {
|
|
1583
|
+
const I = new je();
|
|
1584
|
+
Fe.prototype.copy.call(I, v), I.color.copy(v.color), v = I;
|
|
1585
1585
|
} else if (m && v && !(v instanceof Ce)) {
|
|
1586
1586
|
const I = new Ce({ size: 10, sizeAttenuation: !1 });
|
|
1587
|
-
|
|
1587
|
+
Fe.prototype.copy.call(I, v), I.color.copy(v.color), I.map = v.map, v = I;
|
|
1588
1588
|
}
|
|
1589
1589
|
}
|
|
1590
|
-
v === void 0 && (p ? v = new
|
|
1590
|
+
v === void 0 && (p ? v = new je() : m ? v = new Ce({ size: 1, sizeAttenuation: !1 }) : v = new kn(), v.name = S.name, v.flatShading = !S.smooth, v.vertexColors = b, t.materials[R] = v), y.push(v);
|
|
1591
1591
|
}
|
|
1592
1592
|
let d;
|
|
1593
1593
|
if (y.length > 1) {
|
|
@@ -1595,22 +1595,22 @@ class ai extends hn {
|
|
|
1595
1595
|
const S = c[_];
|
|
1596
1596
|
f.addGroup(S.groupStart, S.groupCount, _);
|
|
1597
1597
|
}
|
|
1598
|
-
p ? d = new gt(f, y) : m ? d = new
|
|
1598
|
+
p ? d = new gt(f, y) : m ? d = new st(f, y) : d = new T(f, y);
|
|
1599
1599
|
} else
|
|
1600
|
-
p ? d = new gt(f, y[0]) : m ? d = new
|
|
1600
|
+
p ? d = new gt(f, y[0]) : m ? d = new st(f, y[0]) : d = new T(f, y[0]);
|
|
1601
1601
|
d.name = h.name, i.add(d);
|
|
1602
1602
|
}
|
|
1603
1603
|
else if (t.vertices.length > 0) {
|
|
1604
|
-
const a = new Ce({ size: 1, sizeAttenuation: !1 }), l = new
|
|
1605
|
-
l.setAttribute("position", new
|
|
1606
|
-
const h = new
|
|
1604
|
+
const a = new Ce({ size: 1, sizeAttenuation: !1 }), l = new Ge();
|
|
1605
|
+
l.setAttribute("position", new de(t.vertices, 3)), t.colors.length > 0 && t.colors[0] !== void 0 && (l.setAttribute("color", new de(t.colors, 3)), a.vertexColors = !0);
|
|
1606
|
+
const h = new st(l, a);
|
|
1607
1607
|
i.add(h);
|
|
1608
1608
|
}
|
|
1609
1609
|
return i;
|
|
1610
1610
|
}
|
|
1611
1611
|
}
|
|
1612
1612
|
function qt(r, e) {
|
|
1613
|
-
if (e ===
|
|
1613
|
+
if (e === jn)
|
|
1614
1614
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), r;
|
|
1615
1615
|
if (e === yt || e === un) {
|
|
1616
1616
|
let t = r.getIndex();
|
|
@@ -1636,7 +1636,7 @@ function qt(r, e) {
|
|
|
1636
1636
|
} else
|
|
1637
1637
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), r;
|
|
1638
1638
|
}
|
|
1639
|
-
function
|
|
1639
|
+
function ai(r) {
|
|
1640
1640
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), s = r.clone();
|
|
1641
1641
|
return _n(r, s, function(n, i) {
|
|
1642
1642
|
e.set(i, n), t.set(n, i);
|
|
@@ -1653,7 +1653,7 @@ function _n(r, e, t) {
|
|
|
1653
1653
|
for (let s = 0; s < r.children.length; s++)
|
|
1654
1654
|
_n(r.children[s], e.children[s], t);
|
|
1655
1655
|
}
|
|
1656
|
-
class
|
|
1656
|
+
class li extends hn {
|
|
1657
1657
|
/**
|
|
1658
1658
|
* Constructs a new glTF loader.
|
|
1659
1659
|
*
|
|
@@ -1661,15 +1661,17 @@ class ci extends hn {
|
|
|
1661
1661
|
*/
|
|
1662
1662
|
constructor(e) {
|
|
1663
1663
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
|
|
1664
|
+
return new pi(t);
|
|
1665
|
+
}), this.register(function(t) {
|
|
1664
1666
|
return new fi(t);
|
|
1665
1667
|
}), this.register(function(t) {
|
|
1666
|
-
return new
|
|
1668
|
+
return new Ei(t);
|
|
1667
1669
|
}), this.register(function(t) {
|
|
1668
1670
|
return new Mi(t);
|
|
1669
1671
|
}), this.register(function(t) {
|
|
1670
1672
|
return new vi(t);
|
|
1671
1673
|
}), this.register(function(t) {
|
|
1672
|
-
return new
|
|
1674
|
+
return new gi(t);
|
|
1673
1675
|
}), this.register(function(t) {
|
|
1674
1676
|
return new yi(t);
|
|
1675
1677
|
}), this.register(function(t) {
|
|
@@ -1677,25 +1679,23 @@ class ci extends hn {
|
|
|
1677
1679
|
}), this.register(function(t) {
|
|
1678
1680
|
return new bi(t);
|
|
1679
1681
|
}), this.register(function(t) {
|
|
1680
|
-
return new
|
|
1681
|
-
}), this.register(function(t) {
|
|
1682
|
-
return new pi(t);
|
|
1682
|
+
return new di(t);
|
|
1683
1683
|
}), this.register(function(t) {
|
|
1684
|
-
return new
|
|
1685
|
-
}), this.register(function(t) {
|
|
1686
|
-
return new gi(t);
|
|
1684
|
+
return new wi(t);
|
|
1687
1685
|
}), this.register(function(t) {
|
|
1688
|
-
return new
|
|
1686
|
+
return new mi(t);
|
|
1689
1687
|
}), this.register(function(t) {
|
|
1690
1688
|
return new xi(t);
|
|
1691
1689
|
}), this.register(function(t) {
|
|
1692
|
-
return new
|
|
1690
|
+
return new Ti(t);
|
|
1691
|
+
}), this.register(function(t) {
|
|
1692
|
+
return new hi(t);
|
|
1693
1693
|
}), this.register(function(t) {
|
|
1694
1694
|
return new Wt(t, A.EXT_MESHOPT_COMPRESSION);
|
|
1695
1695
|
}), this.register(function(t) {
|
|
1696
1696
|
return new Wt(t, A.KHR_MESHOPT_COMPRESSION);
|
|
1697
1697
|
}), this.register(function(t) {
|
|
1698
|
-
return new
|
|
1698
|
+
return new Si(t);
|
|
1699
1699
|
});
|
|
1700
1700
|
}
|
|
1701
1701
|
/**
|
|
@@ -1713,10 +1713,10 @@ class ci extends hn {
|
|
|
1713
1713
|
if (this.resourcePath !== "")
|
|
1714
1714
|
o = this.resourcePath;
|
|
1715
1715
|
else if (this.path !== "") {
|
|
1716
|
-
const h =
|
|
1717
|
-
o =
|
|
1716
|
+
const h = He.extractUrlBase(e);
|
|
1717
|
+
o = He.resolveURL(h, this.path);
|
|
1718
1718
|
} else
|
|
1719
|
-
o =
|
|
1719
|
+
o = He.extractUrlBase(e);
|
|
1720
1720
|
this.manager.itemStart(e);
|
|
1721
1721
|
const a = function(h) {
|
|
1722
1722
|
n ? n(h) : console.error(h), i.manager.itemError(e), i.manager.itemEnd(e);
|
|
@@ -1797,7 +1797,7 @@ class ci extends hn {
|
|
|
1797
1797
|
else if (e instanceof ArrayBuffer)
|
|
1798
1798
|
if (l.decode(new Uint8Array(e, 0, 4)) === bn) {
|
|
1799
1799
|
try {
|
|
1800
|
-
o[A.KHR_BINARY_GLTF] = new
|
|
1800
|
+
o[A.KHR_BINARY_GLTF] = new Ai(e);
|
|
1801
1801
|
} catch (c) {
|
|
1802
1802
|
n && n(c);
|
|
1803
1803
|
return;
|
|
@@ -1811,7 +1811,7 @@ class ci extends hn {
|
|
|
1811
1811
|
n && n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
1812
1812
|
return;
|
|
1813
1813
|
}
|
|
1814
|
-
const h = new
|
|
1814
|
+
const h = new Ui(i, {
|
|
1815
1815
|
path: t || this.resourcePath || "",
|
|
1816
1816
|
crossOrigin: this.crossOrigin,
|
|
1817
1817
|
requestHeader: this.requestHeader,
|
|
@@ -1829,16 +1829,16 @@ class ci extends hn {
|
|
|
1829
1829
|
const c = i.extensionsUsed[u], p = i.extensionsRequired || [];
|
|
1830
1830
|
switch (c) {
|
|
1831
1831
|
case A.KHR_MATERIALS_UNLIT:
|
|
1832
|
-
o[c] = new
|
|
1832
|
+
o[c] = new ui();
|
|
1833
1833
|
break;
|
|
1834
1834
|
case A.KHR_DRACO_MESH_COMPRESSION:
|
|
1835
|
-
o[c] = new
|
|
1835
|
+
o[c] = new Ri(i, this.dracoLoader);
|
|
1836
1836
|
break;
|
|
1837
1837
|
case A.KHR_TEXTURE_TRANSFORM:
|
|
1838
|
-
o[c] = new
|
|
1838
|
+
o[c] = new Pi();
|
|
1839
1839
|
break;
|
|
1840
1840
|
case A.KHR_MESH_QUANTIZATION:
|
|
1841
|
-
o[c] = new
|
|
1841
|
+
o[c] = new Li();
|
|
1842
1842
|
break;
|
|
1843
1843
|
default:
|
|
1844
1844
|
p.indexOf(c) >= 0 && a[c] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + c + '".');
|
|
@@ -1861,7 +1861,7 @@ class ci extends hn {
|
|
|
1861
1861
|
});
|
|
1862
1862
|
}
|
|
1863
1863
|
}
|
|
1864
|
-
function
|
|
1864
|
+
function ci() {
|
|
1865
1865
|
let r = {};
|
|
1866
1866
|
return {
|
|
1867
1867
|
get: function(e) {
|
|
@@ -1878,7 +1878,7 @@ function hi() {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
};
|
|
1880
1880
|
}
|
|
1881
|
-
function
|
|
1881
|
+
function D(r, e, t) {
|
|
1882
1882
|
const s = r.json.materials[e];
|
|
1883
1883
|
return s.extensions && s.extensions[t] ? s.extensions[t] : null;
|
|
1884
1884
|
}
|
|
@@ -1907,7 +1907,7 @@ const A = {
|
|
|
1907
1907
|
KHR_MESHOPT_COMPRESSION: "KHR_meshopt_compression",
|
|
1908
1908
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
1909
1909
|
};
|
|
1910
|
-
class
|
|
1910
|
+
class hi {
|
|
1911
1911
|
constructor(e) {
|
|
1912
1912
|
this.parser = e, this.name = A.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
1913
1913
|
}
|
|
@@ -1925,17 +1925,17 @@ class ui {
|
|
|
1925
1925
|
const i = t.json, l = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
|
|
1926
1926
|
let h;
|
|
1927
1927
|
const u = new pe(16777215);
|
|
1928
|
-
l.color !== void 0 && u.setRGB(l.color[0], l.color[1], l.color[2],
|
|
1928
|
+
l.color !== void 0 && u.setRGB(l.color[0], l.color[1], l.color[2], le);
|
|
1929
1929
|
const c = l.range !== void 0 ? l.range : 0;
|
|
1930
1930
|
switch (l.type) {
|
|
1931
1931
|
case "directional":
|
|
1932
|
-
h = new
|
|
1932
|
+
h = new Un(u), h.target.position.set(0, 0, -1), h.add(h.target);
|
|
1933
1933
|
break;
|
|
1934
1934
|
case "point":
|
|
1935
|
-
h = new
|
|
1935
|
+
h = new Hn(u), h.distance = c;
|
|
1936
1936
|
break;
|
|
1937
1937
|
case "spot":
|
|
1938
|
-
h = new
|
|
1938
|
+
h = new Fn(u), h.distance = c, l.spot = l.spot || {}, l.spot.innerConeAngle = l.spot.innerConeAngle !== void 0 ? l.spot.innerConeAngle : 0, l.spot.outerConeAngle = l.spot.outerConeAngle !== void 0 ? l.spot.outerConeAngle : Math.PI / 4, h.angle = l.spot.outerConeAngle, h.penumbra = 1 - l.spot.innerConeAngle / l.spot.outerConeAngle, h.target.position.set(0, 0, -1), h.add(h.target);
|
|
1939
1939
|
break;
|
|
1940
1940
|
default:
|
|
1941
1941
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + l.type);
|
|
@@ -1953,7 +1953,7 @@ class ui {
|
|
|
1953
1953
|
});
|
|
1954
1954
|
}
|
|
1955
1955
|
}
|
|
1956
|
-
class
|
|
1956
|
+
class ui {
|
|
1957
1957
|
constructor() {
|
|
1958
1958
|
this.name = A.KHR_MATERIALS_UNLIT;
|
|
1959
1959
|
}
|
|
@@ -1967,31 +1967,31 @@ class di {
|
|
|
1967
1967
|
if (i) {
|
|
1968
1968
|
if (Array.isArray(i.baseColorFactor)) {
|
|
1969
1969
|
const o = i.baseColorFactor;
|
|
1970
|
-
e.color.setRGB(o[0], o[1], o[2],
|
|
1970
|
+
e.color.setRGB(o[0], o[1], o[2], le), e.opacity = o[3];
|
|
1971
1971
|
}
|
|
1972
1972
|
i.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", i.baseColorTexture, Ae));
|
|
1973
1973
|
}
|
|
1974
1974
|
return Promise.all(n);
|
|
1975
1975
|
}
|
|
1976
1976
|
}
|
|
1977
|
-
class
|
|
1977
|
+
class di {
|
|
1978
1978
|
constructor(e) {
|
|
1979
1979
|
this.parser = e, this.name = A.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
1980
1980
|
}
|
|
1981
1981
|
extendMaterialParams(e, t) {
|
|
1982
|
-
const s =
|
|
1982
|
+
const s = D(this.parser, e, this.name);
|
|
1983
1983
|
return s === null || s.emissiveStrength !== void 0 && (t.emissiveIntensity = s.emissiveStrength), Promise.resolve();
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
|
-
class
|
|
1986
|
+
class pi {
|
|
1987
1987
|
constructor(e) {
|
|
1988
1988
|
this.parser = e, this.name = A.KHR_MATERIALS_CLEARCOAT;
|
|
1989
1989
|
}
|
|
1990
1990
|
getMaterialType(e) {
|
|
1991
|
-
return
|
|
1991
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
1992
1992
|
}
|
|
1993
1993
|
extendMaterialParams(e, t) {
|
|
1994
|
-
const s =
|
|
1994
|
+
const s = D(this.parser, e, this.name);
|
|
1995
1995
|
if (s === null) return Promise.resolve();
|
|
1996
1996
|
const n = [];
|
|
1997
1997
|
if (s.clearcoatFactor !== void 0 && (t.clearcoat = s.clearcoatFactor), s.clearcoatTexture !== void 0 && n.push(this.parser.assignTexture(t, "clearcoatMap", s.clearcoatTexture)), s.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = s.clearcoatRoughnessFactor), s.clearcoatRoughnessTexture !== void 0 && n.push(this.parser.assignTexture(t, "clearcoatRoughnessMap", s.clearcoatRoughnessTexture)), s.clearcoatNormalTexture !== void 0 && (n.push(this.parser.assignTexture(t, "clearcoatNormalMap", s.clearcoatNormalTexture)), s.clearcoatNormalTexture.scale !== void 0)) {
|
|
@@ -2001,137 +2001,137 @@ class fi {
|
|
|
2001
2001
|
return Promise.all(n);
|
|
2002
2002
|
}
|
|
2003
2003
|
}
|
|
2004
|
-
class
|
|
2004
|
+
class fi {
|
|
2005
2005
|
constructor(e) {
|
|
2006
2006
|
this.parser = e, this.name = A.KHR_MATERIALS_DISPERSION;
|
|
2007
2007
|
}
|
|
2008
2008
|
getMaterialType(e) {
|
|
2009
|
-
return
|
|
2009
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2010
2010
|
}
|
|
2011
2011
|
extendMaterialParams(e, t) {
|
|
2012
|
-
const s =
|
|
2012
|
+
const s = D(this.parser, e, this.name);
|
|
2013
2013
|
return s === null || (t.dispersion = s.dispersion !== void 0 ? s.dispersion : 0), Promise.resolve();
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
2016
|
-
class
|
|
2016
|
+
class mi {
|
|
2017
2017
|
constructor(e) {
|
|
2018
2018
|
this.parser = e, this.name = A.KHR_MATERIALS_IRIDESCENCE;
|
|
2019
2019
|
}
|
|
2020
2020
|
getMaterialType(e) {
|
|
2021
|
-
return
|
|
2021
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2022
2022
|
}
|
|
2023
2023
|
extendMaterialParams(e, t) {
|
|
2024
|
-
const s =
|
|
2024
|
+
const s = D(this.parser, e, this.name);
|
|
2025
2025
|
if (s === null) return Promise.resolve();
|
|
2026
2026
|
const n = [];
|
|
2027
2027
|
return s.iridescenceFactor !== void 0 && (t.iridescence = s.iridescenceFactor), s.iridescenceTexture !== void 0 && n.push(this.parser.assignTexture(t, "iridescenceMap", s.iridescenceTexture)), s.iridescenceIor !== void 0 && (t.iridescenceIOR = s.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), s.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = s.iridescenceThicknessMinimum), s.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = s.iridescenceThicknessMaximum), s.iridescenceThicknessTexture !== void 0 && n.push(this.parser.assignTexture(t, "iridescenceThicknessMap", s.iridescenceThicknessTexture)), Promise.all(n);
|
|
2028
2028
|
}
|
|
2029
2029
|
}
|
|
2030
|
-
class
|
|
2030
|
+
class gi {
|
|
2031
2031
|
constructor(e) {
|
|
2032
2032
|
this.parser = e, this.name = A.KHR_MATERIALS_SHEEN;
|
|
2033
2033
|
}
|
|
2034
2034
|
getMaterialType(e) {
|
|
2035
|
-
return
|
|
2035
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2036
2036
|
}
|
|
2037
2037
|
extendMaterialParams(e, t) {
|
|
2038
|
-
const s =
|
|
2038
|
+
const s = D(this.parser, e, this.name);
|
|
2039
2039
|
if (s === null) return Promise.resolve();
|
|
2040
2040
|
const n = [];
|
|
2041
2041
|
if (t.sheenColor = new pe(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, s.sheenColorFactor !== void 0) {
|
|
2042
2042
|
const i = s.sheenColorFactor;
|
|
2043
|
-
t.sheenColor.setRGB(i[0], i[1], i[2],
|
|
2043
|
+
t.sheenColor.setRGB(i[0], i[1], i[2], le);
|
|
2044
2044
|
}
|
|
2045
2045
|
return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenColorMap", s.sheenColorTexture, Ae)), s.sheenRoughnessTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenRoughnessMap", s.sheenRoughnessTexture)), Promise.all(n);
|
|
2046
2046
|
}
|
|
2047
2047
|
}
|
|
2048
|
-
class
|
|
2048
|
+
class yi {
|
|
2049
2049
|
constructor(e) {
|
|
2050
2050
|
this.parser = e, this.name = A.KHR_MATERIALS_TRANSMISSION;
|
|
2051
2051
|
}
|
|
2052
2052
|
getMaterialType(e) {
|
|
2053
|
-
return
|
|
2053
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2054
2054
|
}
|
|
2055
2055
|
extendMaterialParams(e, t) {
|
|
2056
|
-
const s =
|
|
2056
|
+
const s = D(this.parser, e, this.name);
|
|
2057
2057
|
if (s === null) return Promise.resolve();
|
|
2058
2058
|
const n = [];
|
|
2059
2059
|
return s.transmissionFactor !== void 0 && (t.transmission = s.transmissionFactor), s.transmissionTexture !== void 0 && n.push(this.parser.assignTexture(t, "transmissionMap", s.transmissionTexture)), Promise.all(n);
|
|
2060
2060
|
}
|
|
2061
2061
|
}
|
|
2062
|
-
class
|
|
2062
|
+
class _i {
|
|
2063
2063
|
constructor(e) {
|
|
2064
2064
|
this.parser = e, this.name = A.KHR_MATERIALS_VOLUME;
|
|
2065
2065
|
}
|
|
2066
2066
|
getMaterialType(e) {
|
|
2067
|
-
return
|
|
2067
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2068
2068
|
}
|
|
2069
2069
|
extendMaterialParams(e, t) {
|
|
2070
|
-
const s =
|
|
2070
|
+
const s = D(this.parser, e, this.name);
|
|
2071
2071
|
if (s === null) return Promise.resolve();
|
|
2072
2072
|
const n = [];
|
|
2073
2073
|
t.thickness = s.thicknessFactor !== void 0 ? s.thicknessFactor : 0, s.thicknessTexture !== void 0 && n.push(this.parser.assignTexture(t, "thicknessMap", s.thicknessTexture)), t.attenuationDistance = s.attenuationDistance || 1 / 0;
|
|
2074
2074
|
const i = s.attenuationColor || [1, 1, 1];
|
|
2075
|
-
return t.attenuationColor = new pe().setRGB(i[0], i[1], i[2],
|
|
2075
|
+
return t.attenuationColor = new pe().setRGB(i[0], i[1], i[2], le), Promise.all(n);
|
|
2076
2076
|
}
|
|
2077
2077
|
}
|
|
2078
|
-
class
|
|
2078
|
+
class bi {
|
|
2079
2079
|
constructor(e) {
|
|
2080
2080
|
this.parser = e, this.name = A.KHR_MATERIALS_IOR;
|
|
2081
2081
|
}
|
|
2082
2082
|
getMaterialType(e) {
|
|
2083
|
-
return
|
|
2083
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2084
2084
|
}
|
|
2085
2085
|
extendMaterialParams(e, t) {
|
|
2086
|
-
const s =
|
|
2086
|
+
const s = D(this.parser, e, this.name);
|
|
2087
2087
|
return s === null || (t.ior = s.ior !== void 0 ? s.ior : 1.5, t.ior === 0 && (t.ior = 1e3)), Promise.resolve();
|
|
2088
2088
|
}
|
|
2089
2089
|
}
|
|
2090
|
-
class
|
|
2090
|
+
class wi {
|
|
2091
2091
|
constructor(e) {
|
|
2092
2092
|
this.parser = e, this.name = A.KHR_MATERIALS_SPECULAR;
|
|
2093
2093
|
}
|
|
2094
2094
|
getMaterialType(e) {
|
|
2095
|
-
return
|
|
2095
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2096
2096
|
}
|
|
2097
2097
|
extendMaterialParams(e, t) {
|
|
2098
|
-
const s =
|
|
2098
|
+
const s = D(this.parser, e, this.name);
|
|
2099
2099
|
if (s === null) return Promise.resolve();
|
|
2100
2100
|
const n = [];
|
|
2101
2101
|
t.specularIntensity = s.specularFactor !== void 0 ? s.specularFactor : 1, s.specularTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularIntensityMap", s.specularTexture));
|
|
2102
2102
|
const i = s.specularColorFactor || [1, 1, 1];
|
|
2103
|
-
return t.specularColor = new pe().setRGB(i[0], i[1], i[2],
|
|
2103
|
+
return t.specularColor = new pe().setRGB(i[0], i[1], i[2], le), s.specularColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularColorMap", s.specularColorTexture, Ae)), Promise.all(n);
|
|
2104
2104
|
}
|
|
2105
2105
|
}
|
|
2106
|
-
class
|
|
2106
|
+
class Ti {
|
|
2107
2107
|
constructor(e) {
|
|
2108
2108
|
this.parser = e, this.name = A.EXT_MATERIALS_BUMP;
|
|
2109
2109
|
}
|
|
2110
2110
|
getMaterialType(e) {
|
|
2111
|
-
return
|
|
2111
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2112
2112
|
}
|
|
2113
2113
|
extendMaterialParams(e, t) {
|
|
2114
|
-
const s =
|
|
2114
|
+
const s = D(this.parser, e, this.name);
|
|
2115
2115
|
if (s === null) return Promise.resolve();
|
|
2116
2116
|
const n = [];
|
|
2117
2117
|
return t.bumpScale = s.bumpFactor !== void 0 ? s.bumpFactor : 1, s.bumpTexture !== void 0 && n.push(this.parser.assignTexture(t, "bumpMap", s.bumpTexture)), Promise.all(n);
|
|
2118
2118
|
}
|
|
2119
2119
|
}
|
|
2120
|
-
class
|
|
2120
|
+
class xi {
|
|
2121
2121
|
constructor(e) {
|
|
2122
2122
|
this.parser = e, this.name = A.KHR_MATERIALS_ANISOTROPY;
|
|
2123
2123
|
}
|
|
2124
2124
|
getMaterialType(e) {
|
|
2125
|
-
return
|
|
2125
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2126
2126
|
}
|
|
2127
2127
|
extendMaterialParams(e, t) {
|
|
2128
|
-
const s =
|
|
2128
|
+
const s = D(this.parser, e, this.name);
|
|
2129
2129
|
if (s === null) return Promise.resolve();
|
|
2130
2130
|
const n = [];
|
|
2131
2131
|
return s.anisotropyStrength !== void 0 && (t.anisotropy = s.anisotropyStrength), s.anisotropyRotation !== void 0 && (t.anisotropyRotation = s.anisotropyRotation), s.anisotropyTexture !== void 0 && n.push(this.parser.assignTexture(t, "anisotropyMap", s.anisotropyTexture)), Promise.all(n);
|
|
2132
2132
|
}
|
|
2133
2133
|
}
|
|
2134
|
-
class
|
|
2134
|
+
class Ei {
|
|
2135
2135
|
constructor(e) {
|
|
2136
2136
|
this.parser = e, this.name = A.KHR_TEXTURE_BASISU;
|
|
2137
2137
|
}
|
|
@@ -2148,7 +2148,7 @@ class Mi {
|
|
|
2148
2148
|
return t.loadTextureImage(e, i.source, o);
|
|
2149
2149
|
}
|
|
2150
2150
|
}
|
|
2151
|
-
class
|
|
2151
|
+
class Mi {
|
|
2152
2152
|
constructor(e) {
|
|
2153
2153
|
this.parser = e, this.name = A.EXT_TEXTURE_WEBP;
|
|
2154
2154
|
}
|
|
@@ -2165,7 +2165,7 @@ class vi {
|
|
|
2165
2165
|
return s.loadTextureImage(e, o.source, l);
|
|
2166
2166
|
}
|
|
2167
2167
|
}
|
|
2168
|
-
class
|
|
2168
|
+
class vi {
|
|
2169
2169
|
constructor(e) {
|
|
2170
2170
|
this.parser = e, this.name = A.EXT_TEXTURE_AVIF;
|
|
2171
2171
|
}
|
|
@@ -2208,7 +2208,7 @@ class Wt {
|
|
|
2208
2208
|
return null;
|
|
2209
2209
|
}
|
|
2210
2210
|
}
|
|
2211
|
-
class
|
|
2211
|
+
class Si {
|
|
2212
2212
|
constructor(e) {
|
|
2213
2213
|
this.name = A.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
2214
2214
|
}
|
|
@@ -2226,22 +2226,22 @@ class Ai {
|
|
|
2226
2226
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((h) => {
|
|
2227
2227
|
const u = h.pop(), c = u.isGroup ? u.children : [u], p = h[0].count, m = [];
|
|
2228
2228
|
for (const b of c) {
|
|
2229
|
-
const f = new Se(), y = new M(), d = new K(), _ = new M(1, 1, 1), x = new
|
|
2229
|
+
const f = new Se(), y = new M(), d = new K(), _ = new M(1, 1, 1), x = new zn(b.geometry, b.material, p);
|
|
2230
2230
|
for (let S = 0; S < p; S++)
|
|
2231
2231
|
l.TRANSLATION && y.fromBufferAttribute(l.TRANSLATION, S), l.ROTATION && d.fromBufferAttribute(l.ROTATION, S), l.SCALE && _.fromBufferAttribute(l.SCALE, S), x.setMatrixAt(S, f.compose(y, d, _));
|
|
2232
2232
|
for (const S in l)
|
|
2233
2233
|
if (S === "_COLOR_0") {
|
|
2234
2234
|
const R = l[S];
|
|
2235
|
-
x.instanceColor = new
|
|
2235
|
+
x.instanceColor = new Gn(R.array, R.itemSize, R.normalized);
|
|
2236
2236
|
} else S !== "TRANSLATION" && S !== "ROTATION" && S !== "SCALE" && b.geometry.setAttribute(S, l[S]);
|
|
2237
|
-
|
|
2237
|
+
ze.prototype.copy.call(x, b), this.parser.assignFinalMaterial(x), m.push(x);
|
|
2238
2238
|
}
|
|
2239
2239
|
return u.isGroup ? (u.clear(), u.add(...m), u) : m[0];
|
|
2240
2240
|
}));
|
|
2241
2241
|
}
|
|
2242
2242
|
}
|
|
2243
2243
|
const bn = "glTF", Oe = 12, $t = { JSON: 1313821514, BIN: 5130562 };
|
|
2244
|
-
class
|
|
2244
|
+
class Ai {
|
|
2245
2245
|
constructor(e) {
|
|
2246
2246
|
this.name = A.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
2247
2247
|
const t = new DataView(e, 0, Oe), s = new TextDecoder();
|
|
@@ -2272,7 +2272,7 @@ class Ri {
|
|
|
2272
2272
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
2273
2273
|
}
|
|
2274
2274
|
}
|
|
2275
|
-
class
|
|
2275
|
+
class Ri {
|
|
2276
2276
|
constructor(e, t) {
|
|
2277
2277
|
if (!t)
|
|
2278
2278
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
@@ -2299,12 +2299,12 @@ class Pi {
|
|
|
2299
2299
|
y !== void 0 && (f.normalized = y);
|
|
2300
2300
|
}
|
|
2301
2301
|
c(m);
|
|
2302
|
-
}, a, h,
|
|
2302
|
+
}, a, h, le, p);
|
|
2303
2303
|
});
|
|
2304
2304
|
});
|
|
2305
2305
|
}
|
|
2306
2306
|
}
|
|
2307
|
-
class
|
|
2307
|
+
class Pi {
|
|
2308
2308
|
constructor() {
|
|
2309
2309
|
this.name = A.KHR_TEXTURE_TRANSFORM;
|
|
2310
2310
|
}
|
|
@@ -2312,12 +2312,12 @@ class Li {
|
|
|
2312
2312
|
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;
|
|
2313
2313
|
}
|
|
2314
2314
|
}
|
|
2315
|
-
class
|
|
2315
|
+
class Li {
|
|
2316
2316
|
constructor() {
|
|
2317
2317
|
this.name = A.KHR_MESH_QUANTIZATION;
|
|
2318
2318
|
}
|
|
2319
2319
|
}
|
|
2320
|
-
class wn extends
|
|
2320
|
+
class wn extends ls {
|
|
2321
2321
|
constructor(e, t, s, n) {
|
|
2322
2322
|
super(e, t, s, n);
|
|
2323
2323
|
}
|
|
@@ -2336,11 +2336,11 @@ class wn extends cs {
|
|
|
2336
2336
|
return i;
|
|
2337
2337
|
}
|
|
2338
2338
|
}
|
|
2339
|
-
const
|
|
2340
|
-
class
|
|
2339
|
+
const Ii = new K();
|
|
2340
|
+
class Oi extends wn {
|
|
2341
2341
|
interpolate_(e, t, s, n) {
|
|
2342
2342
|
const i = super.interpolate_(e, t, s, n);
|
|
2343
|
-
return
|
|
2343
|
+
return Ii.fromArray(i).normalize().toArray(i), i;
|
|
2344
2344
|
}
|
|
2345
2345
|
}
|
|
2346
2346
|
const W = {
|
|
@@ -2361,13 +2361,13 @@ const W = {
|
|
|
2361
2361
|
}, Jt = {
|
|
2362
2362
|
9728: pn,
|
|
2363
2363
|
9729: _t,
|
|
2364
|
-
9984:
|
|
2365
|
-
9985:
|
|
2366
|
-
9986:
|
|
2364
|
+
9984: Qn,
|
|
2365
|
+
9985: Zn,
|
|
2366
|
+
9986: Vn,
|
|
2367
2367
|
9987: dn
|
|
2368
2368
|
}, en = {
|
|
2369
|
-
33071:
|
|
2370
|
-
33648:
|
|
2369
|
+
33071: Wn,
|
|
2370
|
+
33648: qn,
|
|
2371
2371
|
10497: bt
|
|
2372
2372
|
}, pt = {
|
|
2373
2373
|
SCALAR: 1,
|
|
@@ -2388,23 +2388,23 @@ const W = {
|
|
|
2388
2388
|
COLOR_0: "color",
|
|
2389
2389
|
WEIGHTS_0: "skinWeight",
|
|
2390
2390
|
JOINTS_0: "skinIndex"
|
|
2391
|
-
},
|
|
2391
|
+
}, he = {
|
|
2392
2392
|
scale: "scale",
|
|
2393
2393
|
translation: "position",
|
|
2394
2394
|
rotation: "quaternion",
|
|
2395
2395
|
weights: "morphTargetInfluences"
|
|
2396
|
-
},
|
|
2396
|
+
}, Ci = {
|
|
2397
2397
|
CUBICSPLINE: void 0,
|
|
2398
2398
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
2399
2399
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
2400
2400
|
LINEAR: mn,
|
|
2401
|
-
STEP:
|
|
2401
|
+
STEP: rs
|
|
2402
2402
|
}, ft = {
|
|
2403
2403
|
OPAQUE: "OPAQUE",
|
|
2404
2404
|
MASK: "MASK",
|
|
2405
2405
|
BLEND: "BLEND"
|
|
2406
2406
|
};
|
|
2407
|
-
function
|
|
2407
|
+
function Di(r) {
|
|
2408
2408
|
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new fn({
|
|
2409
2409
|
color: 16777215,
|
|
2410
2410
|
emissive: 0,
|
|
@@ -2412,7 +2412,7 @@ function Ni(r) {
|
|
|
2412
2412
|
roughness: 1,
|
|
2413
2413
|
transparent: !1,
|
|
2414
2414
|
depthTest: !0,
|
|
2415
|
-
side:
|
|
2415
|
+
side: as
|
|
2416
2416
|
})), r.DefaultMaterial;
|
|
2417
2417
|
}
|
|
2418
2418
|
function ge(r, e, t) {
|
|
@@ -2422,7 +2422,7 @@ function ge(r, e, t) {
|
|
|
2422
2422
|
function ne(r, e) {
|
|
2423
2423
|
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(r.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
2424
2424
|
}
|
|
2425
|
-
function
|
|
2425
|
+
function Ni(r, e, t) {
|
|
2426
2426
|
let s = !1, n = !1, i = !1;
|
|
2427
2427
|
for (let h = 0, u = e.length; h < u; h++) {
|
|
2428
2428
|
const c = e[h];
|
|
@@ -2454,7 +2454,7 @@ function ki(r, e, t) {
|
|
|
2454
2454
|
return s && (r.morphAttributes.position = u), n && (r.morphAttributes.normal = c), i && (r.morphAttributes.color = p), r.morphTargetsRelative = !0, r;
|
|
2455
2455
|
});
|
|
2456
2456
|
}
|
|
2457
|
-
function
|
|
2457
|
+
function ki(r, e) {
|
|
2458
2458
|
if (r.updateMorphTargets(), e.weights !== void 0)
|
|
2459
2459
|
for (let t = 0, s = e.weights.length; t < s; t++)
|
|
2460
2460
|
r.morphTargetInfluences[t] = e.weights[t];
|
|
@@ -2468,7 +2468,7 @@ function ji(r, e) {
|
|
|
2468
2468
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
2469
2469
|
}
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2471
|
+
function ji(r) {
|
|
2472
2472
|
let e;
|
|
2473
2473
|
const t = r.extensions && r.extensions[A.KHR_DRACO_MESH_COMPRESSION];
|
|
2474
2474
|
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + mt(t.attributes) : e = r.indices + ":" + mt(r.attributes) + ":" + r.mode, r.targets !== void 0)
|
|
@@ -2497,13 +2497,13 @@ function xt(r) {
|
|
|
2497
2497
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
2498
2498
|
}
|
|
2499
2499
|
}
|
|
2500
|
-
function
|
|
2500
|
+
function Fi(r) {
|
|
2501
2501
|
return r.search(/\.jpe?g($|\?)/i) > 0 || r.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : r.search(/\.webp($|\?)/i) > 0 || r.search(/^data\:image\/webp/) === 0 ? "image/webp" : r.search(/\.ktx2($|\?)/i) > 0 || r.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
2502
2502
|
}
|
|
2503
|
-
const
|
|
2504
|
-
class
|
|
2503
|
+
const Hi = new Se();
|
|
2504
|
+
class Ui {
|
|
2505
2505
|
constructor(e = {}, t = {}) {
|
|
2506
|
-
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new
|
|
2506
|
+
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new ci(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
2507
2507
|
let s = !1, n = -1, i = !1, o = -1;
|
|
2508
2508
|
if (typeof navigator < "u" && typeof navigator.userAgent < "u") {
|
|
2509
2509
|
const a = navigator.userAgent;
|
|
@@ -2511,7 +2511,7 @@ class zi {
|
|
|
2511
2511
|
const l = a.match(/Version\/(\d+)/);
|
|
2512
2512
|
n = s && l ? parseInt(l[1], 10) : -1, i = a.indexOf("Firefox") > -1, o = i ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
2513
2513
|
}
|
|
2514
|
-
typeof createImageBitmap > "u" || s && n < 17 || i && o < 98 ? this.textureLoader = new
|
|
2514
|
+
typeof createImageBitmap > "u" || s && n < 17 || i && o < 98 ? this.textureLoader = new Xn(this.options.manager) : this.textureLoader = new Yn(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Et(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
2515
2515
|
}
|
|
2516
2516
|
setExtensions(e) {
|
|
2517
2517
|
this.extensions = e;
|
|
@@ -2722,7 +2722,7 @@ class zi {
|
|
|
2722
2722
|
return Promise.resolve(this.extensions[A.KHR_BINARY_GLTF].body);
|
|
2723
2723
|
const n = this.options;
|
|
2724
2724
|
return new Promise(function(i, o) {
|
|
2725
|
-
s.load(
|
|
2725
|
+
s.load(He.resolveURL(t.uri, n.path), i, void 0, function() {
|
|
2726
2726
|
o(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
|
|
2727
2727
|
});
|
|
2728
2728
|
});
|
|
@@ -2761,7 +2761,7 @@ class zi {
|
|
|
2761
2761
|
if (m && m !== c) {
|
|
2762
2762
|
const d = Math.floor(p / m), _ = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + d + ":" + n.count;
|
|
2763
2763
|
let x = t.cache.get(_);
|
|
2764
|
-
x || (f = new h(a, d * m, n.count * m / u), x = new
|
|
2764
|
+
x || (f = new h(a, d * m, n.count * m / u), x = new Bn(f, m / u), t.cache.add(_, x)), y = new Kn(x, l, p % m / u, b);
|
|
2765
2765
|
} else
|
|
2766
2766
|
a === null ? f = new h(n.count * l) : f = new h(a, p, n.count * l), y = new rt(f, l, b);
|
|
2767
2767
|
if (n.sparse !== void 0) {
|
|
@@ -2825,10 +2825,10 @@ class zi {
|
|
|
2825
2825
|
t.isImageBitmapLoader === !0 && (b = function(f) {
|
|
2826
2826
|
const y = new Ot(f);
|
|
2827
2827
|
y.needsUpdate = !0, p(y);
|
|
2828
|
-
}), t.load(
|
|
2828
|
+
}), t.load(He.resolveURL(c, i.path), b, void 0, m);
|
|
2829
2829
|
});
|
|
2830
2830
|
}).then(function(c) {
|
|
2831
|
-
return h === !0 && a.revokeObjectURL(l), ne(c, o), c.userData.mimeType = o.mimeType ||
|
|
2831
|
+
return h === !0 && a.revokeObjectURL(l), ne(c, o), c.userData.mimeType = o.mimeType || Fi(o.uri), c;
|
|
2832
2832
|
}).catch(function(c) {
|
|
2833
2833
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", l), c;
|
|
2834
2834
|
});
|
|
@@ -2875,11 +2875,11 @@ class zi {
|
|
|
2875
2875
|
if (e.isPoints) {
|
|
2876
2876
|
const a = "PointsMaterial:" + s.uuid;
|
|
2877
2877
|
let l = this.cache.get(a);
|
|
2878
|
-
l || (l = new Ce(),
|
|
2878
|
+
l || (l = new Ce(), Fe.prototype.copy.call(l, s), l.color.copy(s.color), l.map = s.map, l.sizeAttenuation = !1, this.cache.add(a, l)), s = l;
|
|
2879
2879
|
} else if (e.isLine) {
|
|
2880
2880
|
const a = "LineBasicMaterial:" + s.uuid;
|
|
2881
2881
|
let l = this.cache.get(a);
|
|
2882
|
-
l || (l = new
|
|
2882
|
+
l || (l = new je(), Fe.prototype.copy.call(l, s), l.color.copy(s.color), l.map = s.map, this.cache.add(a, l)), s = l;
|
|
2883
2883
|
}
|
|
2884
2884
|
if (n || i || o) {
|
|
2885
2885
|
let a = "ClonedMaterial:" + s.uuid + ":";
|
|
@@ -2910,7 +2910,7 @@ class zi {
|
|
|
2910
2910
|
const c = i.pbrMetallicRoughness || {};
|
|
2911
2911
|
if (a.color = new pe(1, 1, 1), a.opacity = 1, Array.isArray(c.baseColorFactor)) {
|
|
2912
2912
|
const p = c.baseColorFactor;
|
|
2913
|
-
a.color.setRGB(p[0], p[1], p[2],
|
|
2913
|
+
a.color.setRGB(p[0], p[1], p[2], le), a.opacity = p[3];
|
|
2914
2914
|
}
|
|
2915
2915
|
c.baseColorTexture !== void 0 && h.push(t.assignTexture(a, "map", c.baseColorTexture, Ae)), a.metalness = c.metallicFactor !== void 0 ? c.metallicFactor : 1, a.roughness = c.roughnessFactor !== void 0 ? c.roughnessFactor : 1, c.metallicRoughnessTexture !== void 0 && (h.push(t.assignTexture(a, "metalnessMap", c.metallicRoughnessTexture)), h.push(t.assignTexture(a, "roughnessMap", c.metallicRoughnessTexture))), o = this._invokeOne(function(p) {
|
|
2916
2916
|
return p.getMaterialType && p.getMaterialType(e);
|
|
@@ -2926,7 +2926,7 @@ class zi {
|
|
|
2926
2926
|
}
|
|
2927
2927
|
if (i.occlusionTexture !== void 0 && o !== _e && (h.push(t.assignTexture(a, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && o !== _e) {
|
|
2928
2928
|
const c = i.emissiveFactor;
|
|
2929
|
-
a.emissive = new pe().setRGB(c[0], c[1], c[2],
|
|
2929
|
+
a.emissive = new pe().setRGB(c[0], c[1], c[2], le);
|
|
2930
2930
|
}
|
|
2931
2931
|
return i.emissiveTexture !== void 0 && o !== _e && h.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, Ae)), Promise.all(h).then(function() {
|
|
2932
2932
|
const c = new o(a);
|
|
@@ -2941,7 +2941,7 @@ class zi {
|
|
|
2941
2941
|
* @return {string}
|
|
2942
2942
|
*/
|
|
2943
2943
|
createUniqueName(e) {
|
|
2944
|
-
const t =
|
|
2944
|
+
const t = $n.sanitizeNodeName(e || "");
|
|
2945
2945
|
return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
|
|
2946
2946
|
}
|
|
2947
2947
|
/**
|
|
@@ -2962,12 +2962,12 @@ class zi {
|
|
|
2962
2962
|
}
|
|
2963
2963
|
const o = [];
|
|
2964
2964
|
for (let a = 0, l = e.length; a < l; a++) {
|
|
2965
|
-
const h = e[a], u =
|
|
2965
|
+
const h = e[a], u = ji(h), c = n[u];
|
|
2966
2966
|
if (c)
|
|
2967
2967
|
o.push(c.promise);
|
|
2968
2968
|
else {
|
|
2969
2969
|
let p;
|
|
2970
|
-
h.extensions && h.extensions[A.KHR_DRACO_MESH_COMPRESSION] ? p = i(h) : p = tn(new
|
|
2970
|
+
h.extensions && h.extensions[A.KHR_DRACO_MESH_COMPRESSION] ? p = i(h) : p = tn(new Ge(), h, t), n[u] = { primitive: h, promise: p }, o.push(p);
|
|
2971
2971
|
}
|
|
2972
2972
|
}
|
|
2973
2973
|
return Promise.all(o);
|
|
@@ -2982,7 +2982,7 @@ class zi {
|
|
|
2982
2982
|
loadMesh(e) {
|
|
2983
2983
|
const t = this, s = this.json, n = this.extensions, i = s.meshes[e], o = i.primitives, a = [];
|
|
2984
2984
|
for (let l = 0, h = o.length; l < h; l++) {
|
|
2985
|
-
const u = o[l].material === void 0 ?
|
|
2985
|
+
const u = o[l].material === void 0 ? Di(this.cache) : this.getDependency("material", o[l].material);
|
|
2986
2986
|
a.push(u);
|
|
2987
2987
|
}
|
|
2988
2988
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
|
|
@@ -2992,18 +2992,18 @@ class zi {
|
|
|
2992
2992
|
let d;
|
|
2993
2993
|
const _ = h[m];
|
|
2994
2994
|
if (y.mode === W.TRIANGLES || y.mode === W.TRIANGLE_STRIP || y.mode === W.TRIANGLE_FAN || y.mode === void 0)
|
|
2995
|
-
d = i.isSkinnedMesh === !0 ? new
|
|
2995
|
+
d = i.isSkinnedMesh === !0 ? new Jn(f, _) : new T(f, _), d.isSkinnedMesh === !0 && d.normalizeSkinWeights(), y.mode === W.TRIANGLE_STRIP ? d.geometry = qt(d.geometry, un) : y.mode === W.TRIANGLE_FAN && (d.geometry = qt(d.geometry, yt));
|
|
2996
2996
|
else if (y.mode === W.LINES)
|
|
2997
2997
|
d = new gt(f, _);
|
|
2998
2998
|
else if (y.mode === W.LINE_STRIP)
|
|
2999
2999
|
d = new re(f, _);
|
|
3000
3000
|
else if (y.mode === W.LINE_LOOP)
|
|
3001
|
-
d = new
|
|
3001
|
+
d = new es(f, _);
|
|
3002
3002
|
else if (y.mode === W.POINTS)
|
|
3003
|
-
d = new
|
|
3003
|
+
d = new st(f, _);
|
|
3004
3004
|
else
|
|
3005
3005
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + y.mode);
|
|
3006
|
-
Object.keys(d.geometry.morphAttributes).length > 0 &&
|
|
3006
|
+
Object.keys(d.geometry.morphAttributes).length > 0 && ki(d, i), d.name = t.createUniqueName(i.name || "mesh_" + e), ne(d, i), y.extensions && ge(n, d, y), t.assignFinalMaterial(d), c.push(d);
|
|
3007
3007
|
}
|
|
3008
3008
|
for (let m = 0, b = c.length; m < b; m++)
|
|
3009
3009
|
t.associations.set(c[m], {
|
|
@@ -3012,7 +3012,7 @@ class zi {
|
|
|
3012
3012
|
});
|
|
3013
3013
|
if (c.length === 1)
|
|
3014
3014
|
return i.extensions && ge(n, c[0], i), c[0];
|
|
3015
|
-
const p = new
|
|
3015
|
+
const p = new nt();
|
|
3016
3016
|
i.extensions && ge(n, p, i), t.associations.set(p, { meshes: e });
|
|
3017
3017
|
for (let m = 0, b = c.length; m < b; m++)
|
|
3018
3018
|
p.add(c[m]);
|
|
@@ -3033,7 +3033,7 @@ class zi {
|
|
|
3033
3033
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
3034
3034
|
return;
|
|
3035
3035
|
}
|
|
3036
|
-
return s.type === "perspective" ? t = new
|
|
3036
|
+
return s.type === "perspective" ? t = new ts(ln.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new ns(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), s.name && (t.name = this.createUniqueName(s.name)), ne(t, s), Promise.resolve(t);
|
|
3037
3037
|
}
|
|
3038
3038
|
/**
|
|
3039
3039
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -3057,7 +3057,7 @@ class zi {
|
|
|
3057
3057
|
} else
|
|
3058
3058
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[h]);
|
|
3059
3059
|
}
|
|
3060
|
-
return new
|
|
3060
|
+
return new ss(a, l);
|
|
3061
3061
|
});
|
|
3062
3062
|
}
|
|
3063
3063
|
/**
|
|
@@ -3090,7 +3090,7 @@ class zi {
|
|
|
3090
3090
|
for (let $ = 0; $ < fe.length; $++)
|
|
3091
3091
|
d.push(fe[$]);
|
|
3092
3092
|
}
|
|
3093
|
-
const _ = new
|
|
3093
|
+
const _ = new is(i, void 0, d);
|
|
3094
3094
|
return ne(_, n), _;
|
|
3095
3095
|
});
|
|
3096
3096
|
}
|
|
@@ -3124,7 +3124,7 @@ class zi {
|
|
|
3124
3124
|
]).then(function(h) {
|
|
3125
3125
|
const u = h[0], c = h[1], p = h[2];
|
|
3126
3126
|
p !== null && u.traverse(function(m) {
|
|
3127
|
-
m.isSkinnedMesh && m.bind(p,
|
|
3127
|
+
m.isSkinnedMesh && m.bind(p, Hi);
|
|
3128
3128
|
});
|
|
3129
3129
|
for (let m = 0, b = c.length; m < b; m++)
|
|
3130
3130
|
u.add(c[m]);
|
|
@@ -3152,7 +3152,7 @@ class zi {
|
|
|
3152
3152
|
a.push(h);
|
|
3153
3153
|
}), this.nodeCache[e] = Promise.all(a).then(function(h) {
|
|
3154
3154
|
let u;
|
|
3155
|
-
if (i.isBone === !0 ? u = new
|
|
3155
|
+
if (i.isBone === !0 ? u = new os() : h.length > 1 ? u = new nt() : h.length === 1 ? u = h[0] : u = new ze(), u !== h[0])
|
|
3156
3156
|
for (let c = 0, p = h.length; c < p; c++)
|
|
3157
3157
|
u.add(h[c]);
|
|
3158
3158
|
if (i.name && (u.userData.name = i.name, u.name = o), ne(u, i), i.extensions && ge(s, u, i), i.matrix !== void 0) {
|
|
@@ -3177,7 +3177,7 @@ class zi {
|
|
|
3177
3177
|
* @return {Promise<Group>}
|
|
3178
3178
|
*/
|
|
3179
3179
|
loadScene(e) {
|
|
3180
|
-
const t = this.extensions, s = this.json.scenes[e], n = this, i = new
|
|
3180
|
+
const t = this.extensions, s = this.json.scenes[e], n = this, i = new nt();
|
|
3181
3181
|
s.name && (i.name = n.createUniqueName(s.name)), ne(i, s), s.extensions && ge(t, i, s);
|
|
3182
3182
|
const o = s.nodes || [], a = [];
|
|
3183
3183
|
for (let l = 0, h = o.length; l < h; l++)
|
|
@@ -3185,12 +3185,12 @@ class zi {
|
|
|
3185
3185
|
return Promise.all(a).then(function(l) {
|
|
3186
3186
|
for (let u = 0, c = l.length; u < c; u++) {
|
|
3187
3187
|
const p = l[u];
|
|
3188
|
-
p.parent !== null ? i.add(
|
|
3188
|
+
p.parent !== null ? i.add(ai(p)) : i.add(p);
|
|
3189
3189
|
}
|
|
3190
3190
|
const h = (u) => {
|
|
3191
3191
|
const c = /* @__PURE__ */ new Map();
|
|
3192
3192
|
for (const [p, m] of n.associations)
|
|
3193
|
-
(p instanceof
|
|
3193
|
+
(p instanceof Fe || p instanceof Ot) && c.set(p, m);
|
|
3194
3194
|
return u.traverse((p) => {
|
|
3195
3195
|
const m = n.associations.get(p);
|
|
3196
3196
|
m != null && c.set(p, m);
|
|
@@ -3204,17 +3204,17 @@ class zi {
|
|
|
3204
3204
|
function h(m) {
|
|
3205
3205
|
m.morphTargetInfluences && l.push(m.name ? m.name : m.uuid);
|
|
3206
3206
|
}
|
|
3207
|
-
|
|
3207
|
+
he[i.path] === he.weights ? (h(e), e.isGroup && e.children.forEach(h)) : l.push(a);
|
|
3208
3208
|
let u;
|
|
3209
|
-
switch (
|
|
3210
|
-
case
|
|
3209
|
+
switch (he[i.path]) {
|
|
3210
|
+
case he.weights:
|
|
3211
3211
|
u = Dt;
|
|
3212
3212
|
break;
|
|
3213
|
-
case
|
|
3213
|
+
case he.rotation:
|
|
3214
3214
|
u = Nt;
|
|
3215
3215
|
break;
|
|
3216
|
-
case
|
|
3217
|
-
case
|
|
3216
|
+
case he.translation:
|
|
3217
|
+
case he.scale:
|
|
3218
3218
|
u = Ct;
|
|
3219
3219
|
break;
|
|
3220
3220
|
default:
|
|
@@ -3230,10 +3230,10 @@ class zi {
|
|
|
3230
3230
|
}
|
|
3231
3231
|
break;
|
|
3232
3232
|
}
|
|
3233
|
-
const c = n.interpolation !== void 0 ?
|
|
3233
|
+
const c = n.interpolation !== void 0 ? Ci[n.interpolation] : mn, p = this._getArrayFromAccessor(s);
|
|
3234
3234
|
for (let m = 0, b = l.length; m < b; m++) {
|
|
3235
3235
|
const f = new u(
|
|
3236
|
-
l[m] + "." +
|
|
3236
|
+
l[m] + "." + he[i.path],
|
|
3237
3237
|
t.array,
|
|
3238
3238
|
p,
|
|
3239
3239
|
c
|
|
@@ -3254,13 +3254,13 @@ class zi {
|
|
|
3254
3254
|
}
|
|
3255
3255
|
_createCubicSplineTrackInterpolant(e) {
|
|
3256
3256
|
e.createInterpolant = function(s) {
|
|
3257
|
-
const n = this instanceof Nt ?
|
|
3257
|
+
const n = this instanceof Nt ? Oi : wn;
|
|
3258
3258
|
return new n(this.times, this.values, this.getValueSize() / 3, s);
|
|
3259
3259
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
3260
3260
|
}
|
|
3261
3261
|
}
|
|
3262
|
-
function
|
|
3263
|
-
const s = e.attributes, n = new
|
|
3262
|
+
function zi(r, e, t) {
|
|
3263
|
+
const s = e.attributes, n = new cs();
|
|
3264
3264
|
if (s.POSITION !== void 0) {
|
|
3265
3265
|
const a = t.json.accessors[s.POSITION], l = a.min, h = a.max;
|
|
3266
3266
|
if (l !== void 0 && h !== void 0) {
|
|
@@ -3297,7 +3297,7 @@ function Gi(r, e, t) {
|
|
|
3297
3297
|
n.expandByVector(a);
|
|
3298
3298
|
}
|
|
3299
3299
|
r.boundingBox = n;
|
|
3300
|
-
const o = new
|
|
3300
|
+
const o = new hs();
|
|
3301
3301
|
n.getCenter(o.center), o.radius = n.min.distanceTo(n.max) / 2, r.boundingSphere = o;
|
|
3302
3302
|
}
|
|
3303
3303
|
function tn(r, e, t) {
|
|
@@ -3317,25 +3317,25 @@ function tn(r, e, t) {
|
|
|
3317
3317
|
});
|
|
3318
3318
|
n.push(o);
|
|
3319
3319
|
}
|
|
3320
|
-
return kt.workingColorSpace !==
|
|
3321
|
-
return e.targets !== void 0 ?
|
|
3320
|
+
return kt.workingColorSpace !== le && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${kt.workingColorSpace}" not supported.`), ne(r, e), zi(r, e, t), Promise.all(n).then(function() {
|
|
3321
|
+
return e.targets !== void 0 ? Ni(r, e.targets, t) : r;
|
|
3322
3322
|
});
|
|
3323
3323
|
}
|
|
3324
|
-
function
|
|
3324
|
+
function Gi() {
|
|
3325
3325
|
const r = new F.BoxGeometry(1, 1, 1), e = new F.MeshStandardMaterial({ color: 43775 }), t = new F.Mesh(r, e);
|
|
3326
3326
|
return t.position.y = 0.5, t.userData.isMovable = !0, t.name = "正方体", At(t, !0), t;
|
|
3327
3327
|
}
|
|
3328
|
-
function
|
|
3328
|
+
function Xi() {
|
|
3329
3329
|
const r = new F.SphereGeometry(0.6, 32, 32), e = new F.MeshStandardMaterial({ color: 16746496 }), t = new F.Mesh(r, e);
|
|
3330
3330
|
return t.position.y = 0.6, t.userData.isMovable = !0, t.name = "球体", At(t, !0), t;
|
|
3331
3331
|
}
|
|
3332
|
-
function
|
|
3332
|
+
function Yi(r) {
|
|
3333
3333
|
return new Promise((e, t) => {
|
|
3334
3334
|
var o;
|
|
3335
3335
|
const s = (o = r.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), n = URL.createObjectURL(r);
|
|
3336
3336
|
let i;
|
|
3337
|
-
if (s === "obj") i = new
|
|
3338
|
-
else if (s === "gltf" || s === "glb") i = new
|
|
3337
|
+
if (s === "obj") i = new ri();
|
|
3338
|
+
else if (s === "gltf" || s === "glb") i = new li();
|
|
3339
3339
|
else {
|
|
3340
3340
|
t(new Error("不支持的文件格式,请使用 .obj, .gltf, .glb"));
|
|
3341
3341
|
return;
|
|
@@ -3356,23 +3356,23 @@ function Bi(r) {
|
|
|
3356
3356
|
);
|
|
3357
3357
|
});
|
|
3358
3358
|
}
|
|
3359
|
-
function
|
|
3359
|
+
function Bi(r) {
|
|
3360
3360
|
switch (r) {
|
|
3361
3361
|
case "box":
|
|
3362
|
-
|
|
3362
|
+
Gi();
|
|
3363
3363
|
break;
|
|
3364
3364
|
case "sphere":
|
|
3365
|
-
|
|
3365
|
+
Xi();
|
|
3366
3366
|
break;
|
|
3367
3367
|
}
|
|
3368
3368
|
}
|
|
3369
|
-
const
|
|
3369
|
+
const Ki = {
|
|
3370
3370
|
key: 1,
|
|
3371
3371
|
class: "toggle-placeholder"
|
|
3372
|
-
},
|
|
3372
|
+
}, Vi = { class: "tree-icon" }, Zi = { class: "tree-name" }, Qi = {
|
|
3373
3373
|
key: 0,
|
|
3374
3374
|
class: "tree-children"
|
|
3375
|
-
},
|
|
3375
|
+
}, qi = /* @__PURE__ */ Xe({
|
|
3376
3376
|
__name: "TreeItem",
|
|
3377
3377
|
props: {
|
|
3378
3378
|
node: {},
|
|
@@ -3381,9 +3381,9 @@ const Vi = {
|
|
|
3381
3381
|
},
|
|
3382
3382
|
emits: ["select", "delete"],
|
|
3383
3383
|
setup(r, { emit: e }) {
|
|
3384
|
-
const t = r, s = e, n = G(null), { expandedSet: i, toggleExpand: o } = xn("treeExpand"), a =
|
|
3384
|
+
const t = r, s = e, n = G(null), { expandedSet: i, toggleExpand: o } = xn("treeExpand"), a = Qe(() => i.value.has(t.node.uuid)), l = Qe(() => (t.version, t.node.children.some((f) => f.userData.isMovable === !0))), h = Qe(() => (t.version, t.node.children.filter(
|
|
3385
3385
|
(f) => f.userData.isMovable === !0
|
|
3386
|
-
))), u =
|
|
3386
|
+
))), u = Qe(
|
|
3387
3387
|
() => {
|
|
3388
3388
|
var f;
|
|
3389
3389
|
return ((f = t.selectedObject) == null ? void 0 : f.uuid) === t.node.uuid;
|
|
@@ -3407,29 +3407,29 @@ const Vi = {
|
|
|
3407
3407
|
}, m = (f) => f.type === "Mesh" || f.type === "Sprite" ? "🟦" : f.type === "Light" ? "💡" : "📦", b = (f) => f.name || `${f.type} (${f.id})`;
|
|
3408
3408
|
return (f, y) => {
|
|
3409
3409
|
const d = Mn("TreeItem", !0);
|
|
3410
|
-
return
|
|
3410
|
+
return C(), U("div", {
|
|
3411
3411
|
class: "tree-node",
|
|
3412
3412
|
ref_key: "nodeRef",
|
|
3413
3413
|
ref: n
|
|
3414
3414
|
}, [
|
|
3415
3415
|
g("div", {
|
|
3416
|
-
class:
|
|
3416
|
+
class: Ue(["tree-item", { selected: u.value }]),
|
|
3417
3417
|
onClick: c
|
|
3418
3418
|
}, [
|
|
3419
|
-
l.value ? (
|
|
3419
|
+
l.value ? (C(), U("span", {
|
|
3420
3420
|
key: 0,
|
|
3421
3421
|
class: "toggle-icon",
|
|
3422
3422
|
onClick: y[0] || (y[0] = Lt((_) => vn(o)(r.node.uuid), ["stop"]))
|
|
3423
|
-
}, Ee(a.value ? "▼" : "▶"), 1)) : (
|
|
3424
|
-
g("span",
|
|
3425
|
-
g("span",
|
|
3423
|
+
}, Ee(a.value ? "▼" : "▶"), 1)) : (C(), U("span", Ki)),
|
|
3424
|
+
g("span", Vi, Ee(m(r.node)), 1),
|
|
3425
|
+
g("span", Zi, Ee(b(r.node)), 1),
|
|
3426
3426
|
g("button", {
|
|
3427
3427
|
class: "tree-delete",
|
|
3428
3428
|
onClick: Lt(p, ["stop"])
|
|
3429
3429
|
}, "×")
|
|
3430
3430
|
], 2),
|
|
3431
|
-
a.value && l.value ? (
|
|
3432
|
-
(
|
|
3431
|
+
a.value && l.value ? (C(), U("div", Qi, [
|
|
3432
|
+
(C(!0), U(nn, null, sn(h.value, (_) => (C(), ke(d, {
|
|
3433
3433
|
key: _.uuid,
|
|
3434
3434
|
node: _,
|
|
3435
3435
|
"selected-object": r.selectedObject,
|
|
@@ -3437,17 +3437,17 @@ const Vi = {
|
|
|
3437
3437
|
onSelect: y[1] || (y[1] = (x) => s("select", x)),
|
|
3438
3438
|
onDelete: y[2] || (y[2] = (x) => s("delete", x))
|
|
3439
3439
|
}, null, 8, ["node", "selected-object", "version"]))), 128))
|
|
3440
|
-
])) :
|
|
3440
|
+
])) : ae("", !0)
|
|
3441
3441
|
], 512);
|
|
3442
3442
|
};
|
|
3443
3443
|
}
|
|
3444
|
-
}),
|
|
3444
|
+
}), Ye = (r, e) => {
|
|
3445
3445
|
const t = r.__vccOpts || r;
|
|
3446
3446
|
for (const [s, n] of e)
|
|
3447
3447
|
t[s] = n;
|
|
3448
3448
|
return t;
|
|
3449
|
-
},
|
|
3450
|
-
function
|
|
3449
|
+
}, Wi = /* @__PURE__ */ Ye(qi, [["__scopeId", "data-v-5ad9c842"]]);
|
|
3450
|
+
function $i(r) {
|
|
3451
3451
|
const e = G(/* @__PURE__ */ new Set()), t = (n) => {
|
|
3452
3452
|
const i = new Set(e.value);
|
|
3453
3453
|
i.has(n) ? i.delete(n) : i.add(n), e.value = i;
|
|
@@ -3467,28 +3467,28 @@ function Ji(r) {
|
|
|
3467
3467
|
{ immediate: !0 }
|
|
3468
3468
|
), { expandedSet: e, toggleExpand: t };
|
|
3469
3469
|
}
|
|
3470
|
-
const
|
|
3470
|
+
const Ji = {
|
|
3471
3471
|
key: 0,
|
|
3472
3472
|
class: "property-panel"
|
|
3473
|
-
},
|
|
3473
|
+
}, eo = { class: "property-group tree-group" }, to = { class: "tree-container" }, no = {
|
|
3474
3474
|
key: 0,
|
|
3475
3475
|
class: "tree-empty"
|
|
3476
|
-
},
|
|
3476
|
+
}, so = {
|
|
3477
3477
|
key: 0,
|
|
3478
3478
|
class: "tabs"
|
|
3479
|
-
},
|
|
3479
|
+
}, io = {
|
|
3480
3480
|
key: 1,
|
|
3481
3481
|
class: "tab-content"
|
|
3482
|
-
},
|
|
3482
|
+
}, oo = { class: "property-group" }, ro = { class: "row" }, ao = { class: "property-group" }, lo = { class: "row" }, co = { class: "property-group" }, ho = { class: "row" }, uo = {
|
|
3483
3483
|
key: 0,
|
|
3484
3484
|
class: "property-group material-group"
|
|
3485
|
-
},
|
|
3485
|
+
}, po = { class: "slider-row" }, fo = { class: "slider-value" }, mo = { class: "slider-row" }, go = { class: "slider-value" }, yo = { class: "slider-row" }, _o = { class: "slider-value" }, bo = {
|
|
3486
3486
|
key: 0,
|
|
3487
3487
|
class: "material-hint"
|
|
3488
|
-
},
|
|
3488
|
+
}, wo = {
|
|
3489
3489
|
key: 1,
|
|
3490
3490
|
class: "property-panel empty"
|
|
3491
|
-
},
|
|
3491
|
+
}, To = /* @__PURE__ */ Xe({
|
|
3492
3492
|
__name: "PropertyPanel",
|
|
3493
3493
|
props: {
|
|
3494
3494
|
transform: {},
|
|
@@ -3497,7 +3497,7 @@ const eo = {
|
|
|
3497
3497
|
},
|
|
3498
3498
|
emits: ["propertyChange", "treeSelect", "treeDelete"],
|
|
3499
3499
|
setup(r, { emit: e }) {
|
|
3500
|
-
const t = r, s = e, n = () => s("propertyChange"), i = G("transform"), o = G(0), a = Sn(t, "selectedObject"), { expandedSet: l, toggleExpand: h } =
|
|
3500
|
+
const t = r, s = e, n = () => s("propertyChange"), i = G("transform"), o = G(0), a = Sn(t, "selectedObject"), { expandedSet: l, toggleExpand: h } = $i(a);
|
|
3501
3501
|
An("treeExpand", { expandedSet: l, toggleExpand: h });
|
|
3502
3502
|
const u = (y) => {
|
|
3503
3503
|
o.value++, s("treeDelete", y);
|
|
@@ -3554,12 +3554,12 @@ const eo = {
|
|
|
3554
3554
|
c.metalness = 0, c.roughness = 0.5, c.opacity = 1, p.value = !1;
|
|
3555
3555
|
},
|
|
3556
3556
|
{ immediate: !0 }
|
|
3557
|
-
), (y, d) => r.transform ? (
|
|
3557
|
+
), (y, d) => r.transform ? (C(), U("div", Ji, [
|
|
3558
3558
|
d[32] || (d[32] = g("h3", null, "属性面板", -1)),
|
|
3559
|
-
g("div",
|
|
3559
|
+
g("div", eo, [
|
|
3560
3560
|
d[15] || (d[15] = g("label", null, "场景物体", -1)),
|
|
3561
|
-
g("div",
|
|
3562
|
-
(
|
|
3561
|
+
g("div", to, [
|
|
3562
|
+
(C(!0), U(nn, null, sn(r.treeData, (_) => (C(), ke(Wi, {
|
|
3563
3563
|
key: _.uuid,
|
|
3564
3564
|
node: _,
|
|
3565
3565
|
"selected-object": r.selectedObject,
|
|
@@ -3567,30 +3567,30 @@ const eo = {
|
|
|
3567
3567
|
onSelect: d[0] || (d[0] = (x) => s("treeSelect", x)),
|
|
3568
3568
|
onDelete: u
|
|
3569
3569
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
3570
|
-
r.treeData.length === 0 ? (
|
|
3570
|
+
r.treeData.length === 0 ? (C(), U("div", no, "暂无物体")) : ae("", !0)
|
|
3571
3571
|
])
|
|
3572
3572
|
]),
|
|
3573
3573
|
d[33] || (d[33] = g("div", { class: "property-group" }, [
|
|
3574
3574
|
g("label", null, "全局属性"),
|
|
3575
3575
|
g("div", { class: "row" })
|
|
3576
3576
|
], -1)),
|
|
3577
|
-
r.selectedObject ? (
|
|
3577
|
+
r.selectedObject ? (C(), U("div", so, [
|
|
3578
3578
|
g("button", {
|
|
3579
|
-
class:
|
|
3579
|
+
class: Ue(["tab-btn", { active: i.value === "transform" }]),
|
|
3580
3580
|
onClick: d[1] || (d[1] = (_) => i.value = "transform")
|
|
3581
3581
|
}, " 🔄 变换 ", 2),
|
|
3582
3582
|
g("button", {
|
|
3583
|
-
class:
|
|
3583
|
+
class: Ue(["tab-btn", { active: i.value === "info" }]),
|
|
3584
3584
|
onClick: d[2] || (d[2] = (_) => i.value = "info")
|
|
3585
3585
|
}, " ℹ️ 信息 ", 2)
|
|
3586
|
-
])) :
|
|
3587
|
-
r.selectedObject ? (
|
|
3588
|
-
|
|
3589
|
-
g("div",
|
|
3586
|
+
])) : ae("", !0),
|
|
3587
|
+
r.selectedObject ? (C(), U("div", io, [
|
|
3588
|
+
N(g("div", null, [
|
|
3589
|
+
g("div", oo, [
|
|
3590
3590
|
d[19] || (d[19] = g("label", null, "位置", -1)),
|
|
3591
|
-
g("div",
|
|
3591
|
+
g("div", ro, [
|
|
3592
3592
|
d[16] || (d[16] = g("span", null, "X:", -1)),
|
|
3593
|
-
|
|
3593
|
+
N(g("input", {
|
|
3594
3594
|
type: "number",
|
|
3595
3595
|
"onUpdate:modelValue": d[3] || (d[3] = (_) => r.transform.position.x = _),
|
|
3596
3596
|
step: "0.01",
|
|
@@ -3604,7 +3604,7 @@ const eo = {
|
|
|
3604
3604
|
]
|
|
3605
3605
|
]),
|
|
3606
3606
|
d[17] || (d[17] = g("span", null, "Y:", -1)),
|
|
3607
|
-
|
|
3607
|
+
N(g("input", {
|
|
3608
3608
|
type: "number",
|
|
3609
3609
|
"onUpdate:modelValue": d[4] || (d[4] = (_) => r.transform.position.y = _),
|
|
3610
3610
|
step: "0.01",
|
|
@@ -3618,7 +3618,7 @@ const eo = {
|
|
|
3618
3618
|
]
|
|
3619
3619
|
]),
|
|
3620
3620
|
d[18] || (d[18] = g("span", null, "Z:", -1)),
|
|
3621
|
-
|
|
3621
|
+
N(g("input", {
|
|
3622
3622
|
type: "number",
|
|
3623
3623
|
"onUpdate:modelValue": d[5] || (d[5] = (_) => r.transform.position.z = _),
|
|
3624
3624
|
step: "0.01",
|
|
@@ -3633,11 +3633,11 @@ const eo = {
|
|
|
3633
3633
|
])
|
|
3634
3634
|
])
|
|
3635
3635
|
]),
|
|
3636
|
-
g("div",
|
|
3636
|
+
g("div", ao, [
|
|
3637
3637
|
d[23] || (d[23] = g("label", null, "旋转 (弧度)", -1)),
|
|
3638
|
-
g("div",
|
|
3638
|
+
g("div", lo, [
|
|
3639
3639
|
d[20] || (d[20] = g("span", null, "X:", -1)),
|
|
3640
|
-
|
|
3640
|
+
N(g("input", {
|
|
3641
3641
|
type: "number",
|
|
3642
3642
|
"onUpdate:modelValue": d[6] || (d[6] = (_) => r.transform.rotation.x = _),
|
|
3643
3643
|
step: "0.01",
|
|
@@ -3651,7 +3651,7 @@ const eo = {
|
|
|
3651
3651
|
]
|
|
3652
3652
|
]),
|
|
3653
3653
|
d[21] || (d[21] = g("span", null, "Y:", -1)),
|
|
3654
|
-
|
|
3654
|
+
N(g("input", {
|
|
3655
3655
|
type: "number",
|
|
3656
3656
|
"onUpdate:modelValue": d[7] || (d[7] = (_) => r.transform.rotation.y = _),
|
|
3657
3657
|
step: "0.01",
|
|
@@ -3665,7 +3665,7 @@ const eo = {
|
|
|
3665
3665
|
]
|
|
3666
3666
|
]),
|
|
3667
3667
|
d[22] || (d[22] = g("span", null, "Z:", -1)),
|
|
3668
|
-
|
|
3668
|
+
N(g("input", {
|
|
3669
3669
|
type: "number",
|
|
3670
3670
|
"onUpdate:modelValue": d[8] || (d[8] = (_) => r.transform.rotation.z = _),
|
|
3671
3671
|
step: "0.01",
|
|
@@ -3680,11 +3680,11 @@ const eo = {
|
|
|
3680
3680
|
])
|
|
3681
3681
|
])
|
|
3682
3682
|
]),
|
|
3683
|
-
g("div",
|
|
3683
|
+
g("div", co, [
|
|
3684
3684
|
d[27] || (d[27] = g("label", null, "缩放", -1)),
|
|
3685
|
-
g("div",
|
|
3685
|
+
g("div", ho, [
|
|
3686
3686
|
d[24] || (d[24] = g("span", null, "X:", -1)),
|
|
3687
|
-
|
|
3687
|
+
N(g("input", {
|
|
3688
3688
|
type: "number",
|
|
3689
3689
|
"onUpdate:modelValue": d[9] || (d[9] = (_) => r.transform.scale.x = _),
|
|
3690
3690
|
step: "0.01",
|
|
@@ -3698,7 +3698,7 @@ const eo = {
|
|
|
3698
3698
|
]
|
|
3699
3699
|
]),
|
|
3700
3700
|
d[25] || (d[25] = g("span", null, "Y:", -1)),
|
|
3701
|
-
|
|
3701
|
+
N(g("input", {
|
|
3702
3702
|
type: "number",
|
|
3703
3703
|
"onUpdate:modelValue": d[10] || (d[10] = (_) => r.transform.scale.y = _),
|
|
3704
3704
|
step: "0.01",
|
|
@@ -3712,7 +3712,7 @@ const eo = {
|
|
|
3712
3712
|
]
|
|
3713
3713
|
]),
|
|
3714
3714
|
d[26] || (d[26] = g("span", null, "Z:", -1)),
|
|
3715
|
-
|
|
3715
|
+
N(g("input", {
|
|
3716
3716
|
type: "number",
|
|
3717
3717
|
"onUpdate:modelValue": d[11] || (d[11] = (_) => r.transform.scale.z = _),
|
|
3718
3718
|
step: "0.01",
|
|
@@ -3727,11 +3727,11 @@ const eo = {
|
|
|
3727
3727
|
])
|
|
3728
3728
|
])
|
|
3729
3729
|
]),
|
|
3730
|
-
r.selectedObject ? (
|
|
3730
|
+
r.selectedObject ? (C(), U("div", uo, [
|
|
3731
3731
|
d[31] || (d[31] = g("label", null, "材质", -1)),
|
|
3732
|
-
g("div",
|
|
3732
|
+
g("div", po, [
|
|
3733
3733
|
d[28] || (d[28] = g("span", { class: "slider-label" }, "金属度", -1)),
|
|
3734
|
-
|
|
3734
|
+
N(g("input", {
|
|
3735
3735
|
type: "range",
|
|
3736
3736
|
min: "0",
|
|
3737
3737
|
max: "1",
|
|
@@ -3746,11 +3746,11 @@ const eo = {
|
|
|
3746
3746
|
{ number: !0 }
|
|
3747
3747
|
]
|
|
3748
3748
|
]),
|
|
3749
|
-
g("span",
|
|
3749
|
+
g("span", fo, Ee(c.metalness.toFixed(2)), 1)
|
|
3750
3750
|
]),
|
|
3751
|
-
g("div",
|
|
3751
|
+
g("div", mo, [
|
|
3752
3752
|
d[29] || (d[29] = g("span", { class: "slider-label" }, "粗糙度", -1)),
|
|
3753
|
-
|
|
3753
|
+
N(g("input", {
|
|
3754
3754
|
type: "range",
|
|
3755
3755
|
min: "0",
|
|
3756
3756
|
max: "1",
|
|
@@ -3765,11 +3765,11 @@ const eo = {
|
|
|
3765
3765
|
{ number: !0 }
|
|
3766
3766
|
]
|
|
3767
3767
|
]),
|
|
3768
|
-
g("span",
|
|
3768
|
+
g("span", go, Ee(c.roughness.toFixed(2)), 1)
|
|
3769
3769
|
]),
|
|
3770
|
-
g("div",
|
|
3770
|
+
g("div", yo, [
|
|
3771
3771
|
d[30] || (d[30] = g("span", { class: "slider-label" }, "透明度", -1)),
|
|
3772
|
-
|
|
3772
|
+
N(g("input", {
|
|
3773
3773
|
type: "range",
|
|
3774
3774
|
min: "0",
|
|
3775
3775
|
max: "1",
|
|
@@ -3784,19 +3784,19 @@ const eo = {
|
|
|
3784
3784
|
{ number: !0 }
|
|
3785
3785
|
]
|
|
3786
3786
|
]),
|
|
3787
|
-
g("span",
|
|
3787
|
+
g("span", _o, Ee(c.opacity.toFixed(2)), 1)
|
|
3788
3788
|
]),
|
|
3789
|
-
p.value ?
|
|
3790
|
-
])) :
|
|
3789
|
+
p.value ? ae("", !0) : (C(), U("div", bo, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
|
|
3790
|
+
])) : ae("", !0)
|
|
3791
3791
|
], 512), [
|
|
3792
|
-
[
|
|
3792
|
+
[ue, i.value === "transform"]
|
|
3793
3793
|
])
|
|
3794
|
-
])) :
|
|
3795
|
-
])) : (
|
|
3794
|
+
])) : ae("", !0)
|
|
3795
|
+
])) : (C(), U("div", wo, [...d[34] || (d[34] = [
|
|
3796
3796
|
g("p", null, "未选中任何模型", -1)
|
|
3797
3797
|
])]));
|
|
3798
3798
|
}
|
|
3799
|
-
}),
|
|
3799
|
+
}), xo = /* @__PURE__ */ Ye(To, [["__scopeId", "data-v-d75c643f"]]), Eo = { class: "top-bar" }, Mo = { class: "left-section" }, vo = { class: "dropdown-menu" }, So = { class: "dropdown-menu sub-menu" }, Ao = { class: "dropdown-menu" }, Ro = { class: "dropdown-menu sub-menu" }, Po = { class: "dropdown-menu" }, Lo = { class: "dropdown-menu" }, Io = { class: "dropdown-menu" }, Oo = /* @__PURE__ */ Xe({
|
|
3800
3800
|
__name: "TopBar",
|
|
3801
3801
|
emits: ["addModel", "importModel"],
|
|
3802
3802
|
setup(r, { emit: e }) {
|
|
@@ -3807,15 +3807,15 @@ const eo = {
|
|
|
3807
3807
|
const E = $.target;
|
|
3808
3808
|
E.files && E.files.length > 0 && (h("importModel", E.files[0]), E.value = "");
|
|
3809
3809
|
}, m = () => console.log("新建项目"), b = () => console.log("保存场景"), f = () => console.log("导出模型"), y = () => console.log("撤销"), d = () => console.log("重做"), _ = () => console.log("复制物体"), x = () => console.log("删除物体"), S = () => console.log("重置相机"), R = () => console.log("切换网格"), v = () => console.log("打开帮助"), I = () => console.log("关于编辑器"), ie = () => console.log("打开项目"), ee = () => console.log("打开模型"), fe = () => console.log("打开场景");
|
|
3810
|
-
return ($, E) => (
|
|
3811
|
-
g("div",
|
|
3810
|
+
return ($, E) => (C(), U("div", Eo, [
|
|
3811
|
+
g("div", Mo, [
|
|
3812
3812
|
g("div", {
|
|
3813
3813
|
class: "dropdown-wrapper",
|
|
3814
3814
|
onMouseenter: E[2] || (E[2] = (j) => t.value = !0),
|
|
3815
3815
|
onMouseleave: E[3] || (E[3] = (j) => t.value = !1)
|
|
3816
3816
|
}, [
|
|
3817
3817
|
E[17] || (E[17] = g("button", { class: "menu-btn" }, "文件", -1)),
|
|
3818
|
-
|
|
3818
|
+
N(g("div", vo, [
|
|
3819
3819
|
g("div", {
|
|
3820
3820
|
class: "menu-item",
|
|
3821
3821
|
onClick: m
|
|
@@ -3826,7 +3826,7 @@ const eo = {
|
|
|
3826
3826
|
onMouseleave: E[1] || (E[1] = (j) => a.value = !1)
|
|
3827
3827
|
}, [
|
|
3828
3828
|
E[16] || (E[16] = g("span", null, "打开", -1)),
|
|
3829
|
-
|
|
3829
|
+
N(g("div", So, [
|
|
3830
3830
|
g("div", {
|
|
3831
3831
|
class: "menu-item",
|
|
3832
3832
|
onClick: ie
|
|
@@ -3840,7 +3840,7 @@ const eo = {
|
|
|
3840
3840
|
onClick: fe
|
|
3841
3841
|
}, "打开场景")
|
|
3842
3842
|
], 512), [
|
|
3843
|
-
[
|
|
3843
|
+
[ue, a.value]
|
|
3844
3844
|
])
|
|
3845
3845
|
], 32),
|
|
3846
3846
|
g("div", {
|
|
@@ -3852,7 +3852,7 @@ const eo = {
|
|
|
3852
3852
|
onClick: f
|
|
3853
3853
|
}, "导出")
|
|
3854
3854
|
], 512), [
|
|
3855
|
-
[
|
|
3855
|
+
[ue, t.value]
|
|
3856
3856
|
])
|
|
3857
3857
|
], 32),
|
|
3858
3858
|
g("div", {
|
|
@@ -3861,7 +3861,7 @@ const eo = {
|
|
|
3861
3861
|
onMouseleave: E[9] || (E[9] = (j) => o.value = !1)
|
|
3862
3862
|
}, [
|
|
3863
3863
|
E[19] || (E[19] = g("button", { class: "menu-btn" }, "添加", -1)),
|
|
3864
|
-
|
|
3864
|
+
N(g("div", Ao, [
|
|
3865
3865
|
g("div", {
|
|
3866
3866
|
class: "menu-item",
|
|
3867
3867
|
onClick: y
|
|
@@ -3872,7 +3872,7 @@ const eo = {
|
|
|
3872
3872
|
onMouseleave: E[7] || (E[7] = (j) => l.value = !1)
|
|
3873
3873
|
}, [
|
|
3874
3874
|
E[18] || (E[18] = g("span", null, "网格", -1)),
|
|
3875
|
-
|
|
3875
|
+
N(g("div", Ro, [
|
|
3876
3876
|
g("div", {
|
|
3877
3877
|
class: "menu-item",
|
|
3878
3878
|
onClick: E[4] || (E[4] = (j) => h("addModel", "box"))
|
|
@@ -3886,7 +3886,7 @@ const eo = {
|
|
|
3886
3886
|
onClick: c
|
|
3887
3887
|
}, "导入")
|
|
3888
3888
|
], 512), [
|
|
3889
|
-
[
|
|
3889
|
+
[ue, l.value]
|
|
3890
3890
|
])
|
|
3891
3891
|
], 32),
|
|
3892
3892
|
g("div", {
|
|
@@ -3898,7 +3898,7 @@ const eo = {
|
|
|
3898
3898
|
onClick: x
|
|
3899
3899
|
}, "摄像机")
|
|
3900
3900
|
], 512), [
|
|
3901
|
-
[
|
|
3901
|
+
[ue, o.value]
|
|
3902
3902
|
])
|
|
3903
3903
|
], 32),
|
|
3904
3904
|
g("div", {
|
|
@@ -3907,7 +3907,7 @@ const eo = {
|
|
|
3907
3907
|
onMouseleave: E[11] || (E[11] = (j) => s.value = !1)
|
|
3908
3908
|
}, [
|
|
3909
3909
|
E[20] || (E[20] = g("button", { class: "menu-btn" }, "编辑", -1)),
|
|
3910
|
-
|
|
3910
|
+
N(g("div", Po, [
|
|
3911
3911
|
g("div", {
|
|
3912
3912
|
class: "menu-item",
|
|
3913
3913
|
onClick: y
|
|
@@ -3925,7 +3925,7 @@ const eo = {
|
|
|
3925
3925
|
onClick: x
|
|
3926
3926
|
}, "删除")
|
|
3927
3927
|
], 512), [
|
|
3928
|
-
[
|
|
3928
|
+
[ue, s.value]
|
|
3929
3929
|
])
|
|
3930
3930
|
], 32),
|
|
3931
3931
|
g("div", {
|
|
@@ -3934,7 +3934,7 @@ const eo = {
|
|
|
3934
3934
|
onMouseleave: E[13] || (E[13] = (j) => n.value = !1)
|
|
3935
3935
|
}, [
|
|
3936
3936
|
E[21] || (E[21] = g("button", { class: "menu-btn" }, "视图", -1)),
|
|
3937
|
-
|
|
3937
|
+
N(g("div", Lo, [
|
|
3938
3938
|
g("div", {
|
|
3939
3939
|
class: "menu-item",
|
|
3940
3940
|
onClick: S
|
|
@@ -3944,7 +3944,7 @@ const eo = {
|
|
|
3944
3944
|
onClick: R
|
|
3945
3945
|
}, "显示网格")
|
|
3946
3946
|
], 512), [
|
|
3947
|
-
[
|
|
3947
|
+
[ue, n.value]
|
|
3948
3948
|
])
|
|
3949
3949
|
], 32),
|
|
3950
3950
|
g("div", {
|
|
@@ -3953,7 +3953,7 @@ const eo = {
|
|
|
3953
3953
|
onMouseleave: E[15] || (E[15] = (j) => i.value = !1)
|
|
3954
3954
|
}, [
|
|
3955
3955
|
E[22] || (E[22] = g("button", { class: "menu-btn" }, "帮助", -1)),
|
|
3956
|
-
|
|
3956
|
+
N(g("div", Io, [
|
|
3957
3957
|
g("div", {
|
|
3958
3958
|
class: "menu-item",
|
|
3959
3959
|
onClick: v
|
|
@@ -3963,7 +3963,7 @@ const eo = {
|
|
|
3963
3963
|
onClick: I
|
|
3964
3964
|
}, "关于")
|
|
3965
3965
|
], 512), [
|
|
3966
|
-
[
|
|
3966
|
+
[ue, i.value]
|
|
3967
3967
|
])
|
|
3968
3968
|
], 32)
|
|
3969
3969
|
]),
|
|
@@ -3980,10 +3980,10 @@ const eo = {
|
|
|
3980
3980
|
}, null, 544)
|
|
3981
3981
|
]));
|
|
3982
3982
|
}
|
|
3983
|
-
}),
|
|
3983
|
+
}), Co = /* @__PURE__ */ Ye(Oo, [["__scopeId", "data-v-6bb4762f"]]), Do = { class: "bottom-bar" }, No = /* @__PURE__ */ Xe({
|
|
3984
3984
|
__name: "BottomBar",
|
|
3985
3985
|
setup(r) {
|
|
3986
|
-
return (e, t) => (
|
|
3986
|
+
return (e, t) => (C(), U("div", Do, [...t[0] || (t[0] = [
|
|
3987
3987
|
g("div", { class: "status-left" }, [
|
|
3988
3988
|
g("span", null, "就绪")
|
|
3989
3989
|
], -1),
|
|
@@ -3992,7 +3992,7 @@ const eo = {
|
|
|
3992
3992
|
], -1)
|
|
3993
3993
|
])]));
|
|
3994
3994
|
}
|
|
3995
|
-
}),
|
|
3995
|
+
}), ko = /* @__PURE__ */ Ye(No, [["__scopeId", "data-v-3427bb27"]]), jo = { class: "app-layout" }, Fo = /* @__PURE__ */ Xe({
|
|
3996
3996
|
__name: "DrawingBoard",
|
|
3997
3997
|
props: {
|
|
3998
3998
|
mode: { default: "edit" },
|
|
@@ -4016,44 +4016,44 @@ const eo = {
|
|
|
4016
4016
|
s.rotation.z
|
|
4017
4017
|
), f.scale.set(s.scale.x, s.scale.y, s.scale.z);
|
|
4018
4018
|
};
|
|
4019
|
-
|
|
4019
|
+
qs((f) => {
|
|
4020
4020
|
t.value = f, f && n(f);
|
|
4021
|
-
}),
|
|
4021
|
+
}), Ws((f) => {
|
|
4022
4022
|
n(f);
|
|
4023
4023
|
});
|
|
4024
4024
|
const o = () => {
|
|
4025
4025
|
t.value && i(t.value);
|
|
4026
|
-
}, a = (f) =>
|
|
4026
|
+
}, a = (f) => Bi(f), l = async (f) => {
|
|
4027
4027
|
try {
|
|
4028
|
-
await
|
|
4028
|
+
await Yi(f);
|
|
4029
4029
|
} catch (y) {
|
|
4030
4030
|
console.error("导入失败:", y), alert("导入失败:" + y.message);
|
|
4031
4031
|
}
|
|
4032
4032
|
}, h = Rn([]);
|
|
4033
|
-
|
|
4033
|
+
$s((f) => {
|
|
4034
4034
|
h.value = f;
|
|
4035
4035
|
});
|
|
4036
4036
|
const u = () => {
|
|
4037
|
-
const f =
|
|
4037
|
+
const f = Js();
|
|
4038
4038
|
f && (h.value = f);
|
|
4039
|
-
}, c = (f) => vt(f), p = (f) =>
|
|
4039
|
+
}, c = (f) => vt(f), p = (f) => Ks(f.uuid), m = G(null);
|
|
4040
4040
|
return Pn(() => {
|
|
4041
|
-
m.value &&
|
|
4042
|
-
}), (f, y) => (
|
|
4043
|
-
r.mode === "edit" ? (
|
|
4041
|
+
m.value && Ns(m.value, e.mode, e.sceneData), u();
|
|
4042
|
+
}), (f, y) => (C(), U("div", jo, [
|
|
4043
|
+
r.mode === "edit" ? (C(), ke(Co, {
|
|
4044
4044
|
key: 0,
|
|
4045
4045
|
onAddModel: a,
|
|
4046
4046
|
onImportModel: l
|
|
4047
|
-
})) :
|
|
4047
|
+
})) : ae("", !0),
|
|
4048
4048
|
g("div", {
|
|
4049
|
-
class:
|
|
4049
|
+
class: Ue(`editor-container editor-container-mode-${r.mode}`)
|
|
4050
4050
|
}, [
|
|
4051
4051
|
g("div", {
|
|
4052
|
-
class:
|
|
4052
|
+
class: Ue(`canvas canvas-mode-${r.mode}`),
|
|
4053
4053
|
ref_key: "containerRef",
|
|
4054
4054
|
ref: m
|
|
4055
4055
|
}, null, 2),
|
|
4056
|
-
r.mode === "edit" ? (
|
|
4056
|
+
r.mode === "edit" ? (C(), ke(xo, {
|
|
4057
4057
|
key: 0,
|
|
4058
4058
|
transform: s,
|
|
4059
4059
|
"tree-data": h.value,
|
|
@@ -4061,36 +4061,36 @@ const eo = {
|
|
|
4061
4061
|
onPropertyChange: o,
|
|
4062
4062
|
onTreeSelect: c,
|
|
4063
4063
|
onTreeDelete: p
|
|
4064
|
-
}, null, 8, ["transform", "tree-data", "selected-object"])) :
|
|
4064
|
+
}, null, 8, ["transform", "tree-data", "selected-object"])) : ae("", !0)
|
|
4065
4065
|
], 2),
|
|
4066
|
-
|
|
4066
|
+
r.mode === "edit" ? (C(), ke(ko, { key: 1 })) : ae("", !0)
|
|
4067
4067
|
]));
|
|
4068
4068
|
}
|
|
4069
|
-
}),
|
|
4069
|
+
}), Ko = /* @__PURE__ */ Ye(Fo, [["__scopeId", "data-v-54071644"]]);
|
|
4070
4070
|
export {
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4071
|
+
ko as BottomBar,
|
|
4072
|
+
Ko as DrawingBoard,
|
|
4073
|
+
xo as PropertyPanel,
|
|
4074
|
+
Co as TopBar,
|
|
4075
|
+
Wi as TreeItem,
|
|
4076
|
+
Gi as addBox,
|
|
4077
4077
|
At as addModel,
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4078
|
+
Bi as addModelByType,
|
|
4079
|
+
Xi as addSphere,
|
|
4080
|
+
Bo as exportSceneToJSON,
|
|
4081
|
+
Xo as getCamera,
|
|
4082
|
+
Yo as getRenderer,
|
|
4083
|
+
Go as getScene,
|
|
4084
|
+
Js as getSceneObjects,
|
|
4085
|
+
Yi as importModelFromFile,
|
|
4086
|
+
Ns as initEditor,
|
|
4087
|
+
ei as loadSceneFromJSON,
|
|
4088
|
+
$s as onSceneObjectsChangeCallback,
|
|
4089
|
+
Bs as removeModel,
|
|
4090
|
+
Ks as removeModelById,
|
|
4091
4091
|
vt as selectObject,
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4092
|
+
qs as setSelectedObjectCallback,
|
|
4093
|
+
Ws as setTransformChangeCallback,
|
|
4094
|
+
$i as useTreeExpand
|
|
4095
4095
|
};
|
|
4096
4096
|
//# sourceMappingURL=three-editor.es.js.map
|