endset_three_editor 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/three-editor.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as Ge, ref as G, inject as
|
|
1
|
+
import { defineComponent as Ge, ref as G, inject as xn, computed as Ze, watchEffect as En, resolveComponent as Mn, openBlock as N, createElementBlock as U, createElementVNode as g, normalizeClass as He, withModifiers as Lt, unref as vn, toDisplayString as Ee, Fragment as nn, renderList as sn, createBlock as ot, createCommentVNode as de, watch as on, toRef as Sn, provide as An, reactive as rn, withDirectives as D, vModelText as Q, vShow as he, shallowRef as Rn, onMounted as Pn, createVNode as Ln } from "vue";
|
|
2
2
|
import * as F from "three";
|
|
3
|
-
import { Controls as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
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 In, Plane as On, MathUtils as ln, Raycaster as Cn, Object3D as Ue, MeshBasicMaterial as _e, LineBasicMaterial as ke, CylinderGeometry as Y, BoxGeometry as z, BufferGeometry as ze, Float32BufferAttribute as ue, Mesh as T, OctahedronGeometry as Qe, Line as re, TorusGeometry as Pe, SphereGeometry as Dn, Euler as Nn, Matrix4 as Se, PlaneGeometry as kn, DoubleSide as cn, Loader as hn, FileLoader as Et, Color as pe, SRGBColorSpace as Ae, Group as tt, Material as je, PointsMaterial as Ce, MeshPhongMaterial as jn, LineSegments as gt, Points as nt, TrianglesDrawMode as Fn, TriangleFanDrawMode as yt, TriangleStripDrawMode as un, LoaderUtils as Fe, MeshPhysicalMaterial as se, LinearSRGBColorSpace as ae, SpotLight as Hn, PointLight as Un, DirectionalLight as zn, InstancedMesh as Gn, InstancedBufferAttribute as Xn, TextureLoader as Yn, ImageBitmapLoader as Bn, BufferAttribute as rt, InterleavedBuffer as Kn, InterleavedBufferAttribute as Vn, LinearMipmapLinearFilter as dn, NearestMipmapLinearFilter as Zn, LinearMipmapNearestFilter as Qn, NearestMipmapNearestFilter as qn, LinearFilter as _t, NearestFilter as pn, RepeatWrapping as bt, MirroredRepeatWrapping as Wn, ClampToEdgeWrapping as $n, MeshStandardMaterial as fn, PropertyBinding as Jn, SkinnedMesh as es, LineLoop as ts, PerspectiveCamera as ns, OrthographicCamera as ss, Skeleton as is, AnimationClip as os, Bone as rs, InterpolateDiscrete as as, InterpolateLinear as mn, Texture as Ot, VectorKeyframeTrack as Ct, NumberKeyframeTrack as Dt, QuaternionKeyframeTrack as Nt, ColorManagement as kt, FrontSide as ls, Interpolant as cs, Box3 as hs, Sphere as us } from "three";
|
|
4
|
+
import ds from "@tweenjs/tween.js";
|
|
5
|
+
const jt = { type: "change" }, Mt = { type: "start" }, gn = { type: "end" }, qe = new In(), Ft = new On(), ps = 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 Nt = { type: "change" }, Et = { type: "start" }, fn = { type: "end" }, qe
|
|
|
12
12
|
TOUCH_DOLLY_PAN: 5,
|
|
13
13
|
TOUCH_DOLLY_ROTATE: 6
|
|
14
14
|
}, at = 1e-6;
|
|
15
|
-
class
|
|
15
|
+
class fs extends an {
|
|
16
16
|
/**
|
|
17
17
|
* Constructs a new controls instance.
|
|
18
18
|
*
|
|
@@ -20,7 +20,7 @@ class ps extends on {
|
|
|
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
|
|
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 = gs.bind(this), this._onPointerDown = ms.bind(this), this._onPointerUp = ys.bind(this), this._onContextMenu = Ms.bind(this), this._onMouseWheel = ws.bind(this), this._onKeyDown = Ts.bind(this), this._onTouchStart = xs.bind(this), this._onTouchMove = Es.bind(this), this._onMouseDown = _s.bind(this), this._onMouseMove = bs.bind(this), this._interceptControlDown = vs.bind(this), this._interceptControlUp = Ss.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Defines the visual representation of the cursor.
|
|
@@ -93,7 +93,7 @@ class ps extends on {
|
|
|
93
93
|
* was called, or the initial state.
|
|
94
94
|
*/
|
|
95
95
|
reset() {
|
|
96
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
96
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(jt), this.update(), this.state = P.NONE;
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* Programmatically pan the camera.
|
|
@@ -164,12 +164,12 @@ class ps extends on {
|
|
|
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) : (qe.origin.copy(this.object.position), qe.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(qe.direction)) <
|
|
167
|
+
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (qe.origin.copy(this.object.position), qe.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(qe.direction)) < ps ? this.object.lookAt(this.target) : (Ft.setFromNormalAndCoplanarPoint(this.object.up, this.target), qe.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);
|
|
171
171
|
}
|
|
172
|
-
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > at || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > at || this._lastTargetPosition.distanceToSquared(this.target) > at ? (this.dispatchEvent(
|
|
172
|
+
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > at || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > at || this._lastTargetPosition.distanceToSquared(this.target) > at ? (this.dispatchEvent(jt), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
173
173
|
}
|
|
174
174
|
_getAutoRotationAngle(e) {
|
|
175
175
|
return e !== null ? B / 60 * this.autoRotateSpeed * e : B / 60 / 60 * this.autoRotateSpeed;
|
|
@@ -361,16 +361,16 @@ class ps extends on {
|
|
|
361
361
|
return e.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function ms(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 gs(r) {
|
|
368
368
|
this.enabled !== !1 && (r.pointerType === "touch" ? this._onTouchMove(r) : this._onMouseMove(r));
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function ys(r) {
|
|
371
371
|
switch (this._removePointer(r), this._pointers.length) {
|
|
372
372
|
case 0:
|
|
373
|
-
this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
|
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");
|
|
374
374
|
break;
|
|
375
375
|
case 1:
|
|
376
376
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
|
@@ -378,7 +378,7 @@ function gs(r) {
|
|
|
378
378
|
break;
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function _s(r) {
|
|
382
382
|
let e;
|
|
383
383
|
switch (r.button) {
|
|
384
384
|
case 0:
|
|
@@ -419,9 +419,9 @@ function ys(r) {
|
|
|
419
419
|
default:
|
|
420
420
|
this.state = P.NONE;
|
|
421
421
|
}
|
|
422
|
-
this.state !== P.NONE && this.dispatchEvent(
|
|
422
|
+
this.state !== P.NONE && this.dispatchEvent(Mt);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function bs(r) {
|
|
425
425
|
switch (this.state) {
|
|
426
426
|
case P.ROTATE:
|
|
427
427
|
if (this.enableRotate === !1) return;
|
|
@@ -437,13 +437,13 @@ function _s(r) {
|
|
|
437
437
|
break;
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
function bs(r) {
|
|
441
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== P.NONE || (r.preventDefault(), this.dispatchEvent(Et), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(fn));
|
|
442
|
-
}
|
|
443
440
|
function ws(r) {
|
|
444
|
-
this.enabled
|
|
441
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== P.NONE || (r.preventDefault(), this.dispatchEvent(Mt), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(gn));
|
|
445
442
|
}
|
|
446
443
|
function Ts(r) {
|
|
444
|
+
this.enabled !== !1 && this._handleKeyDown(r);
|
|
445
|
+
}
|
|
446
|
+
function xs(r) {
|
|
447
447
|
switch (this._trackPointer(r), this._pointers.length) {
|
|
448
448
|
case 1:
|
|
449
449
|
switch (this.touches.ONE) {
|
|
@@ -476,9 +476,9 @@ function Ts(r) {
|
|
|
476
476
|
default:
|
|
477
477
|
this.state = P.NONE;
|
|
478
478
|
}
|
|
479
|
-
this.state !== P.NONE && this.dispatchEvent(
|
|
479
|
+
this.state !== P.NONE && this.dispatchEvent(Mt);
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function Es(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 xs(r) {
|
|
|
500
500
|
this.state = P.NONE;
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function Ms(r) {
|
|
504
504
|
this.enabled !== !1 && r.preventDefault();
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function vs(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 Ss(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 Cn(), H = new M(), le = 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
|
-
}, lt = { type: "change" },
|
|
517
|
-
class
|
|
516
|
+
}, lt = { type: "change" }, Ut = { type: "mouseDown", mode: null }, zt = { type: "mouseUp", mode: null }, Gt = { type: "objectChange" };
|
|
517
|
+
class As extends an {
|
|
518
518
|
/**
|
|
519
519
|
* Constructs a new controls instance.
|
|
520
520
|
*
|
|
@@ -523,11 +523,11 @@ class Ss extends on {
|
|
|
523
523
|
*/
|
|
524
524
|
constructor(e, t = null) {
|
|
525
525
|
super(void 0, t);
|
|
526
|
-
const s = new
|
|
526
|
+
const s = new Cs(this);
|
|
527
527
|
this._root = s;
|
|
528
|
-
const n = new
|
|
528
|
+
const n = new Ds();
|
|
529
529
|
this._gizmo = n, s.add(n);
|
|
530
|
-
const i = new
|
|
530
|
+
const i = new Ns();
|
|
531
531
|
this._plane = i, s.add(i);
|
|
532
532
|
const o = this;
|
|
533
533
|
function a(x, S) {
|
|
@@ -543,7 +543,7 @@ class Ss extends on {
|
|
|
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 = Rs.bind(this), this._onPointerDown = Ls.bind(this), this._onPointerHover = Ps.bind(this), this._onPointerMove = Is.bind(this), this._onPointerUp = Os.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";
|
|
@@ -570,7 +570,7 @@ class Ss extends on {
|
|
|
570
570
|
if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
|
|
571
571
|
e !== null && me.setFromCamera(e, this.camera);
|
|
572
572
|
const t = ct(this._plane, me, !0);
|
|
573
|
-
t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0,
|
|
573
|
+
t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, Ut.mode = this.mode, this.dispatchEvent(Ut);
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
pointerMove(e) {
|
|
@@ -593,13 +593,13 @@ class Ss extends on {
|
|
|
593
593
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
|
594
594
|
const a = 20 / this.worldPosition.distanceTo(H.setFromMatrixPosition(this.camera.matrixWorld));
|
|
595
595
|
let l = !1;
|
|
596
|
-
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(H.copy(this.rotationAxis).cross(this.eye)) * a) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(
|
|
596
|
+
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(H.copy(this.rotationAxis).cross(this.eye)) * a) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(Ht[t]), H.copy(Ht[t]), i === "local" && H.applyQuaternion(this.worldQuaternion), H.cross(this.eye), H.length() === 0 ? l = !0 : this.rotationAngle = this._offset.dot(H.normalize()) * a), (t === "E" || l) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), i === "local" && t !== "E" && t !== "XYZE" ? (n.quaternion.copy(this._quaternionStart), n.quaternion.multiply(O.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(O.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
|
|
597
597
|
}
|
|
598
|
-
this.dispatchEvent(lt), this.dispatchEvent(
|
|
598
|
+
this.dispatchEvent(lt), this.dispatchEvent(Gt);
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
pointerUp(e) {
|
|
602
|
-
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (
|
|
602
|
+
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (zt.mode = this.mode, this.dispatchEvent(zt)), this.dragging = !1, this.axis = null);
|
|
603
603
|
}
|
|
604
604
|
dispose() {
|
|
605
605
|
this.disconnect(), this._root.dispose();
|
|
@@ -625,7 +625,7 @@ class Ss extends on {
|
|
|
625
625
|
* Resets the object's position, rotation and scale to when the current transform began.
|
|
626
626
|
*/
|
|
627
627
|
reset() {
|
|
628
|
-
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(lt), this.dispatchEvent(
|
|
628
|
+
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(lt), this.dispatchEvent(Gt), this.pointStart.copy(this.pointEnd));
|
|
629
629
|
}
|
|
630
630
|
/**
|
|
631
631
|
* Returns the raycaster that is used for user interaction. This object is shared between all
|
|
@@ -705,7 +705,7 @@ class Ss extends on {
|
|
|
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 Rs(r) {
|
|
709
709
|
if (this.domElement.ownerDocument.pointerLockElement)
|
|
710
710
|
return {
|
|
711
711
|
x: 0,
|
|
@@ -721,7 +721,7 @@ function As(r) {
|
|
|
721
721
|
};
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function Ps(r) {
|
|
725
725
|
if (this.enabled)
|
|
726
726
|
switch (r.pointerType) {
|
|
727
727
|
case "mouse":
|
|
@@ -730,13 +730,13 @@ function Rs(r) {
|
|
|
730
730
|
break;
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function Ls(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 Is(r) {
|
|
737
737
|
this.enabled && this.pointerMove(this._getPointer(r));
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function Os(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 We = new
|
|
750
|
-
class
|
|
749
|
+
const We = new Nn(), L = new M(0, 1, 0), Xt = new M(0, 0, 0), Yt = new Se(), $e = new K(), st = 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), Je = new M(), Le = new M(), Ie = new M();
|
|
750
|
+
class Cs extends Ue {
|
|
751
751
|
constructor(e) {
|
|
752
752
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
753
753
|
}
|
|
@@ -762,7 +762,7 @@ class Os extends Ue {
|
|
|
762
762
|
});
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
|
-
class
|
|
765
|
+
class Ds extends Ue {
|
|
766
766
|
constructor() {
|
|
767
767
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
|
768
768
|
const e = new _e({
|
|
@@ -920,7 +920,7 @@ class Cs extends Ue {
|
|
|
920
920
|
]
|
|
921
921
|
}, fe = {
|
|
922
922
|
XYZE: [
|
|
923
|
-
[new T(new
|
|
923
|
+
[new T(new Dn(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]]
|
|
@@ -1002,10 +1002,10 @@ class Cs extends Ue {
|
|
|
1002
1002
|
const Ye = new Ue();
|
|
1003
1003
|
for (const J in Z)
|
|
1004
1004
|
for (let Te = Z[J].length; Te--; ) {
|
|
1005
|
-
const X = Z[J][Te][0].clone(), Be = Z[J][Te][1], Ke = Z[J][Te][2], Ve = Z[J][Te][3],
|
|
1006
|
-
X.name = J, X.tag =
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1005
|
+
const X = Z[J][Te][0].clone(), Be = Z[J][Te][1], Ke = Z[J][Te][2], Ve = Z[J][Te][3], Tn = Z[J][Te][4];
|
|
1006
|
+
X.name = J, X.tag = Tn, Be && X.position.set(Be[0], Be[1], Be[2]), Ke && X.rotation.set(Ke[0], Ke[1], Ke[2]), Ve && X.scale.set(Ve[0], Ve[1], Ve[2]), X.updateMatrix();
|
|
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), Ye.add(X);
|
|
1009
1009
|
}
|
|
1010
1010
|
return Ye;
|
|
1011
1011
|
}
|
|
@@ -1022,21 +1022,21 @@ class Cs 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(We.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(We.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(We.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(We.set(0, Math.PI / 2, 0)), L.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(
|
|
1025
|
+
o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (O.setFromEuler(We.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(We.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(We.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(We.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" && ($e.copy(s), L.copy(this.eye).applyQuaternion(O.copy(s).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(
|
|
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" && ($e.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($e, O), o.quaternion.copy(O)), o.name === "Y" && (O.setFromAxisAngle(ye, Math.atan2(L.x, L.z)), O.multiplyQuaternions($e, O), o.quaternion.copy(O)), o.name === "Z" && (O.setFromAxisAngle(Ne, Math.atan2(L.y, L.x)), O.multiplyQuaternions($e, 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 Ns extends T {
|
|
1036
1036
|
constructor() {
|
|
1037
1037
|
super(
|
|
1038
|
-
new
|
|
1039
|
-
new _e({ visible: !1, wireframe: !0, side:
|
|
1038
|
+
new kn(1e5, 1e5, 2, 2),
|
|
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) {
|
|
@@ -1073,7 +1073,7 @@ class Ds extends T {
|
|
|
1073
1073
|
default:
|
|
1074
1074
|
te.set(0, 0, 0);
|
|
1075
1075
|
}
|
|
1076
|
-
te.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (
|
|
1076
|
+
te.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Bt.lookAt(H.set(0, 0, 0), te, L), this.quaternion.setFromRotationMatrix(Bt)), super.updateMatrixWorld(e);
|
|
1077
1077
|
}
|
|
1078
1078
|
}
|
|
1079
1079
|
const w = {
|
|
@@ -1095,32 +1095,39 @@ const w = {
|
|
|
1095
1095
|
/** 当前选中的物体 */
|
|
1096
1096
|
selectedObject: null
|
|
1097
1097
|
};
|
|
1098
|
-
let ht = !1, Re = !1, be = null,
|
|
1099
|
-
function
|
|
1100
|
-
if (w.container = r, w.mode = e,
|
|
1101
|
-
ei(t.scene, e);
|
|
1098
|
+
let ht = !1, Re = !1, be = null, wt = null, it = null, we = [], ut;
|
|
1099
|
+
function ks(r, e = "edit", t) {
|
|
1100
|
+
if (w.container = r, w.mode = e, js(), Fs(), Us(), t && (ti(t.scene, e), t != null && t.camera)) {
|
|
1102
1101
|
const s = t.camera;
|
|
1103
|
-
w.camera.position.
|
|
1104
|
-
|
|
1105
|
-
|
|
1102
|
+
w.camera.position.set(
|
|
1103
|
+
s.position[0],
|
|
1104
|
+
s.position[1],
|
|
1105
|
+
s.position[2]
|
|
1106
|
+
), w.camera.rotation.set(
|
|
1107
|
+
s.rotation[0],
|
|
1108
|
+
s.rotation[1],
|
|
1109
|
+
s.rotation[2]
|
|
1110
|
+
), w.camera.updateProjectionMatrix(), ut = s.target;
|
|
1111
|
+
}
|
|
1112
|
+
Gs(), zs(), ut && w.orbitControls && (w.orbitControls.target.fromArray(ut), w.orbitControls.update()), qs(), yn(), e === "edit" && r.addEventListener("click", Bs), window.addEventListener("resize", Ys), t || Xs(), e === "edit" && Hs();
|
|
1106
1113
|
}
|
|
1107
|
-
function
|
|
1114
|
+
function js() {
|
|
1108
1115
|
const r = new F.WebGLRenderer({ antialias: !0, alpha: !0 });
|
|
1109
1116
|
r.setSize(w.container.clientWidth, w.container.clientHeight), r.setPixelRatio(Math.min(window.devicePixelRatio, 2)), w.container.appendChild(r.domElement), w.renderer = r;
|
|
1110
1117
|
}
|
|
1111
|
-
function
|
|
1118
|
+
function Fs() {
|
|
1112
1119
|
w.scene = new F.Scene(), w.scene.name = "sl_scene";
|
|
1113
1120
|
}
|
|
1114
|
-
function
|
|
1121
|
+
function Hs() {
|
|
1115
1122
|
const r = new F.GridHelper(30, 30, 8956671, 3364232);
|
|
1116
1123
|
r.name = "地板", r.userData.type = "initFloor", w.scene.add(r), w.gridHelper = r;
|
|
1117
1124
|
}
|
|
1118
|
-
function
|
|
1125
|
+
function Us() {
|
|
1119
1126
|
const r = w.container, e = r.clientWidth / r.clientHeight, t = new F.PerspectiveCamera(45, e, 0.1, 1e3);
|
|
1120
1127
|
t.position.set(0, 6, 15), t.lookAt(0, 0, 0), w.camera = t;
|
|
1121
1128
|
}
|
|
1122
|
-
function
|
|
1123
|
-
const r = new
|
|
1129
|
+
function zs() {
|
|
1130
|
+
const r = new fs(w.camera, w.renderer.domElement);
|
|
1124
1131
|
r.minDistance = 0, r.maxDistance = 1 / 0, r.addEventListener("start", () => {
|
|
1125
1132
|
ht = !1;
|
|
1126
1133
|
}), r.addEventListener("change", () => {
|
|
@@ -1131,8 +1138,8 @@ function Us() {
|
|
|
1131
1138
|
}, 200));
|
|
1132
1139
|
}), w.orbitControls = r;
|
|
1133
1140
|
}
|
|
1134
|
-
function
|
|
1135
|
-
const r = new
|
|
1141
|
+
function Gs() {
|
|
1142
|
+
const r = new As(
|
|
1136
1143
|
w.camera,
|
|
1137
1144
|
w.renderer.domElement
|
|
1138
1145
|
);
|
|
@@ -1141,31 +1148,31 @@ function zs() {
|
|
|
1141
1148
|
Re = !1;
|
|
1142
1149
|
}, 200));
|
|
1143
1150
|
}), r.addEventListener("objectChange", () => {
|
|
1144
|
-
|
|
1151
|
+
wt && w.selectedObject && wt(w.selectedObject);
|
|
1145
1152
|
}), w.scene.add(r.getHelper()), w.transformControls = r;
|
|
1146
1153
|
}
|
|
1147
|
-
function
|
|
1154
|
+
function Xs() {
|
|
1148
1155
|
const r = new F.AmbientLight(16777215, 2);
|
|
1149
1156
|
w.scene.add(r);
|
|
1150
1157
|
const e = new F.DirectionalLight(16777215, 3);
|
|
1151
1158
|
e.position.set(48, 104, 138), w.scene.add(e);
|
|
1152
1159
|
}
|
|
1153
|
-
function
|
|
1160
|
+
function yn() {
|
|
1154
1161
|
var r, e;
|
|
1155
|
-
requestAnimationFrame(
|
|
1162
|
+
requestAnimationFrame(yn), ds.update(), (r = w.orbitControls) == null || r.update(), (e = w.renderer) == null || e.render(w.scene, w.camera);
|
|
1156
1163
|
}
|
|
1157
|
-
function
|
|
1164
|
+
function Ys() {
|
|
1158
1165
|
if (!w.container || !w.camera || !w.renderer) return;
|
|
1159
1166
|
const r = w.container.clientWidth, e = w.container.clientHeight;
|
|
1160
1167
|
r === 0 || e === 0 || (w.camera.aspect = r / e, w.camera.updateProjectionMatrix(), w.renderer.setSize(r, e));
|
|
1161
1168
|
}
|
|
1162
|
-
function
|
|
1169
|
+
function vt(r) {
|
|
1163
1170
|
w.selectedObject !== r && (w.selectedObject && w.transformControls.detach(), w.selectedObject = r, w.transformControls.attach(r), w.transformControls.setMode("translate"), w.transformControls.showX = !0, w.transformControls.showY = !0, w.transformControls.showZ = !0, be == null || be(r));
|
|
1164
1171
|
}
|
|
1165
|
-
function
|
|
1172
|
+
function St() {
|
|
1166
1173
|
w.selectedObject && (w.transformControls.detach(), w.selectedObject = null, be == null || be(null));
|
|
1167
1174
|
}
|
|
1168
|
-
function
|
|
1175
|
+
function Bs(r) {
|
|
1169
1176
|
if (Re) {
|
|
1170
1177
|
Re = !1;
|
|
1171
1178
|
return;
|
|
@@ -1180,76 +1187,78 @@ function Ys(r) {
|
|
|
1180
1187
|
o.type === "Mesh" && o.userData.isMovable && n.push(o);
|
|
1181
1188
|
});
|
|
1182
1189
|
const i = s.intersectObjects(n);
|
|
1183
|
-
i.length > 0 ?
|
|
1190
|
+
i.length > 0 ? vt(i[0].object) : St();
|
|
1184
1191
|
}
|
|
1185
|
-
function
|
|
1186
|
-
w.scene.add(r), r.userData.isMovable && (
|
|
1187
|
-
}
|
|
1188
|
-
function Bs(r) {
|
|
1189
|
-
w.selectedObject === r && gn(), r.parent ? r.parent.remove(r) : w.scene.remove(r), Zs(r), St();
|
|
1192
|
+
function At(r, e = !1) {
|
|
1193
|
+
w.scene.add(r), r.userData.isMovable && (Zs(r), Rt()), e && w.mode === "edit" && vt(r);
|
|
1190
1194
|
}
|
|
1191
1195
|
function Ks(r) {
|
|
1192
|
-
|
|
1193
|
-
e && Bs(e);
|
|
1196
|
+
w.selectedObject === r && St(), r.parent ? r.parent.remove(r) : w.scene.remove(r), Qs(r), Rt();
|
|
1194
1197
|
}
|
|
1195
1198
|
function Vs(r) {
|
|
1196
|
-
|
|
1199
|
+
const e = w.scene.getObjectByProperty("uuid", r);
|
|
1200
|
+
e && Ks(e);
|
|
1197
1201
|
}
|
|
1198
1202
|
function Zs(r) {
|
|
1203
|
+
r.userData.isMovable && r.parent === w.scene && (we.includes(r) || we.push(r));
|
|
1204
|
+
}
|
|
1205
|
+
function Qs(r) {
|
|
1199
1206
|
const e = we.indexOf(r);
|
|
1200
1207
|
e !== -1 && we.splice(e, 1);
|
|
1201
1208
|
}
|
|
1202
|
-
function
|
|
1209
|
+
function qs() {
|
|
1203
1210
|
const r = [];
|
|
1204
1211
|
w.scene.children.forEach((e) => {
|
|
1205
1212
|
e.userData.isMovable && r.push(e);
|
|
1206
|
-
}), we = r,
|
|
1213
|
+
}), we = r, Rt();
|
|
1207
1214
|
}
|
|
1208
|
-
function
|
|
1215
|
+
function Rt() {
|
|
1209
1216
|
it == null || it([...we]);
|
|
1210
1217
|
}
|
|
1211
|
-
function qs(r) {
|
|
1212
|
-
be = r;
|
|
1213
|
-
}
|
|
1214
1218
|
function Ws(r) {
|
|
1215
|
-
|
|
1219
|
+
be = r;
|
|
1216
1220
|
}
|
|
1217
1221
|
function $s(r) {
|
|
1222
|
+
wt = r;
|
|
1223
|
+
}
|
|
1224
|
+
function Js(r) {
|
|
1218
1225
|
it = r;
|
|
1219
1226
|
}
|
|
1220
|
-
function
|
|
1227
|
+
function ei() {
|
|
1221
1228
|
return we;
|
|
1222
1229
|
}
|
|
1223
|
-
function
|
|
1230
|
+
function Xo() {
|
|
1224
1231
|
return w.scene;
|
|
1225
1232
|
}
|
|
1226
|
-
function
|
|
1233
|
+
function Yo() {
|
|
1227
1234
|
return w.camera;
|
|
1228
1235
|
}
|
|
1229
|
-
function
|
|
1236
|
+
function Bo() {
|
|
1230
1237
|
return w.renderer;
|
|
1231
1238
|
}
|
|
1232
|
-
function
|
|
1233
|
-
var n, i;
|
|
1239
|
+
function Ko() {
|
|
1240
|
+
var n, i, o;
|
|
1241
|
+
St();
|
|
1234
1242
|
const r = w.scene;
|
|
1235
1243
|
if (!r) return "{}";
|
|
1236
1244
|
let e = r;
|
|
1237
1245
|
e = r.clone(), e.children = e.children.filter(
|
|
1238
|
-
(
|
|
1246
|
+
(a) => a.userData.type !== "initFloor"
|
|
1239
1247
|
);
|
|
1240
1248
|
const t = e.toJSON(), s = {
|
|
1241
|
-
position: (n = w.camera) == null ? void 0 : n.position,
|
|
1242
|
-
rotation: (i = w.camera) == null ? void 0 : i.rotation
|
|
1249
|
+
position: (n = w.camera) == null ? void 0 : n.position.toArray(),
|
|
1250
|
+
rotation: (i = w.camera) == null ? void 0 : i.rotation.toArray(),
|
|
1251
|
+
target: ((o = w.orbitControls) == null ? void 0 : o.target.toArray()) || [0, 0, 0]
|
|
1243
1252
|
};
|
|
1244
1253
|
return JSON.stringify({ scene: t, camera: s });
|
|
1245
1254
|
}
|
|
1246
|
-
function
|
|
1255
|
+
function ti(r, e = "edit") {
|
|
1247
1256
|
var i;
|
|
1248
1257
|
const t = typeof r == "string" ? JSON.parse(r) : r, n = new F.ObjectLoader().parse(t);
|
|
1249
1258
|
n.type === "Scene" ? w.scene = n : (i = w.scene) == null || i.add(n);
|
|
1250
1259
|
}
|
|
1251
|
-
const
|
|
1252
|
-
function
|
|
1260
|
+
const ni = /^[og]\s*(.+)?/, si = /^mtllib /, ii = /^usemtl /, oi = /^usemap /, Kt = /\s+/, Vt = new M(), dt = new M(), Zt = new M(), Qt = new M(), q = new M(), et = new pe();
|
|
1261
|
+
function ri() {
|
|
1253
1262
|
const r = {
|
|
1254
1263
|
objects: [],
|
|
1255
1264
|
object: {},
|
|
@@ -1358,7 +1367,7 @@ function oi() {
|
|
|
1358
1367
|
},
|
|
1359
1368
|
addFaceNormal: function(e, t, s) {
|
|
1360
1369
|
const n = this.vertices, i = this.object.geometry.normals;
|
|
1361
|
-
|
|
1370
|
+
Vt.fromArray(n, e), dt.fromArray(n, t), Zt.fromArray(n, s), q.subVectors(Zt, dt), Qt.subVectors(Vt, dt), q.cross(Qt), q.normalize(), i.push(q.x, q.y, q.z), i.push(q.x, q.y, q.z), i.push(q.x, q.y, q.z);
|
|
1362
1371
|
},
|
|
1363
1372
|
addColor: function(e, t, s) {
|
|
1364
1373
|
const n = this.colors, i = this.object.geometry.colors;
|
|
@@ -1409,7 +1418,7 @@ function oi() {
|
|
|
1409
1418
|
};
|
|
1410
1419
|
return r.startObject("", !1), r;
|
|
1411
1420
|
}
|
|
1412
|
-
class
|
|
1421
|
+
class ai extends hn {
|
|
1413
1422
|
/**
|
|
1414
1423
|
* Constructs a new OBJ loader.
|
|
1415
1424
|
*
|
|
@@ -1428,7 +1437,7 @@ class ri extends ln {
|
|
|
1428
1437
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
1429
1438
|
*/
|
|
1430
1439
|
load(e, t, s, n) {
|
|
1431
|
-
const i = this, o = new
|
|
1440
|
+
const i = this, o = new Et(this.manager);
|
|
1432
1441
|
o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, function(a) {
|
|
1433
1442
|
try {
|
|
1434
1443
|
t(i.parse(a));
|
|
@@ -1453,7 +1462,7 @@ class ri extends ln {
|
|
|
1453
1462
|
* @return {Group} The parsed OBJ.
|
|
1454
1463
|
*/
|
|
1455
1464
|
parse(e) {
|
|
1456
|
-
const t = new
|
|
1465
|
+
const t = new ri();
|
|
1457
1466
|
e.indexOf(`\r
|
|
1458
1467
|
`) !== -1 && (e = e.replace(/\r\n/g, `
|
|
1459
1468
|
`)), e.indexOf(`\\
|
|
@@ -1467,7 +1476,7 @@ class ri extends ln {
|
|
|
1467
1476
|
const u = h.charAt(0);
|
|
1468
1477
|
if (u !== "#")
|
|
1469
1478
|
if (u === "v") {
|
|
1470
|
-
const c = h.split(
|
|
1479
|
+
const c = h.split(Kt);
|
|
1471
1480
|
switch (c[0]) {
|
|
1472
1481
|
case "v":
|
|
1473
1482
|
t.vertices.push(
|
|
@@ -1496,7 +1505,7 @@ class ri extends ln {
|
|
|
1496
1505
|
break;
|
|
1497
1506
|
}
|
|
1498
1507
|
} else if (u === "f") {
|
|
1499
|
-
const p = h.slice(1).trim().split(
|
|
1508
|
+
const p = h.slice(1).trim().split(Kt), m = [];
|
|
1500
1509
|
for (let f = 0, y = p.length; f < y; f++) {
|
|
1501
1510
|
const d = p[f];
|
|
1502
1511
|
if (d.length > 0) {
|
|
@@ -1534,14 +1543,14 @@ class ri extends ln {
|
|
|
1534
1543
|
} else if (u === "p") {
|
|
1535
1544
|
const p = h.slice(1).trim().split(" ");
|
|
1536
1545
|
t.addPointGeometry(p);
|
|
1537
|
-
} else if ((n =
|
|
1546
|
+
} else if ((n = ni.exec(h)) !== null) {
|
|
1538
1547
|
const c = (" " + n[0].slice(1).trim()).slice(1);
|
|
1539
1548
|
t.startObject(c);
|
|
1540
|
-
} else if (
|
|
1549
|
+
} else if (ii.test(h))
|
|
1541
1550
|
t.object.startMaterial(h.substring(7).trim(), t.materialLibraries);
|
|
1542
|
-
else if (
|
|
1551
|
+
else if (si.test(h))
|
|
1543
1552
|
t.materialLibraries.push(h.substring(7).trim());
|
|
1544
|
-
else if (
|
|
1553
|
+
else if (oi.test(h))
|
|
1545
1554
|
console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
|
|
1546
1555
|
else if (u === "s") {
|
|
1547
1556
|
if (n = h.split(" "), n.length > 1) {
|
|
@@ -1578,7 +1587,7 @@ class ri extends ln {
|
|
|
1578
1587
|
je.prototype.copy.call(I, v), I.color.copy(v.color), I.map = v.map, v = I;
|
|
1579
1588
|
}
|
|
1580
1589
|
}
|
|
1581
|
-
v === void 0 && (p ? v = new ke() : m ? v = new Ce({ size: 1, sizeAttenuation: !1 }) : v = new
|
|
1590
|
+
v === void 0 && (p ? v = new ke() : m ? v = new Ce({ size: 1, sizeAttenuation: !1 }) : v = new jn(), v.name = S.name, v.flatShading = !S.smooth, v.vertexColors = b, t.materials[R] = v), y.push(v);
|
|
1582
1591
|
}
|
|
1583
1592
|
let d;
|
|
1584
1593
|
if (y.length > 1) {
|
|
@@ -1586,9 +1595,9 @@ class ri extends ln {
|
|
|
1586
1595
|
const S = c[_];
|
|
1587
1596
|
f.addGroup(S.groupStart, S.groupCount, _);
|
|
1588
1597
|
}
|
|
1589
|
-
p ? d = new
|
|
1598
|
+
p ? d = new gt(f, y) : m ? d = new nt(f, y) : d = new T(f, y);
|
|
1590
1599
|
} else
|
|
1591
|
-
p ? d = new
|
|
1600
|
+
p ? d = new gt(f, y[0]) : m ? d = new nt(f, y[0]) : d = new T(f, y[0]);
|
|
1592
1601
|
d.name = h.name, i.add(d);
|
|
1593
1602
|
}
|
|
1594
1603
|
else if (t.vertices.length > 0) {
|
|
@@ -1600,10 +1609,10 @@ class ri extends ln {
|
|
|
1600
1609
|
return i;
|
|
1601
1610
|
}
|
|
1602
1611
|
}
|
|
1603
|
-
function
|
|
1604
|
-
if (e ===
|
|
1612
|
+
function qt(r, e) {
|
|
1613
|
+
if (e === Fn)
|
|
1605
1614
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), r;
|
|
1606
|
-
if (e ===
|
|
1615
|
+
if (e === yt || e === un) {
|
|
1607
1616
|
let t = r.getIndex();
|
|
1608
1617
|
if (t === null) {
|
|
1609
1618
|
const o = [], a = r.getAttribute("position");
|
|
@@ -1615,7 +1624,7 @@ function Zt(r, e) {
|
|
|
1615
1624
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), r;
|
|
1616
1625
|
}
|
|
1617
1626
|
const s = t.count - 2, n = [];
|
|
1618
|
-
if (e ===
|
|
1627
|
+
if (e === yt)
|
|
1619
1628
|
for (let o = 1; o <= s; o++)
|
|
1620
1629
|
n.push(t.getX(0)), n.push(t.getX(o)), n.push(t.getX(o + 1));
|
|
1621
1630
|
else
|
|
@@ -1627,9 +1636,9 @@ function Zt(r, e) {
|
|
|
1627
1636
|
} else
|
|
1628
1637
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), r;
|
|
1629
1638
|
}
|
|
1630
|
-
function
|
|
1639
|
+
function li(r) {
|
|
1631
1640
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), s = r.clone();
|
|
1632
|
-
return
|
|
1641
|
+
return _n(r, s, function(n, i) {
|
|
1633
1642
|
e.set(i, n), t.set(n, i);
|
|
1634
1643
|
}), s.traverse(function(n) {
|
|
1635
1644
|
if (!n.isSkinnedMesh) return;
|
|
@@ -1639,12 +1648,12 @@ function ai(r) {
|
|
|
1639
1648
|
}), i.bind(i.skeleton, i.bindMatrix);
|
|
1640
1649
|
}), s;
|
|
1641
1650
|
}
|
|
1642
|
-
function
|
|
1651
|
+
function _n(r, e, t) {
|
|
1643
1652
|
t(r, e);
|
|
1644
1653
|
for (let s = 0; s < r.children.length; s++)
|
|
1645
|
-
|
|
1654
|
+
_n(r.children[s], e.children[s], t);
|
|
1646
1655
|
}
|
|
1647
|
-
class
|
|
1656
|
+
class ci extends hn {
|
|
1648
1657
|
/**
|
|
1649
1658
|
* Constructs a new glTF loader.
|
|
1650
1659
|
*
|
|
@@ -1652,41 +1661,41 @@ class li extends ln {
|
|
|
1652
1661
|
*/
|
|
1653
1662
|
constructor(e) {
|
|
1654
1663
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
|
|
1655
|
-
return new pi(t);
|
|
1656
|
-
}), this.register(function(t) {
|
|
1657
1664
|
return new fi(t);
|
|
1658
1665
|
}), this.register(function(t) {
|
|
1659
|
-
return new
|
|
1666
|
+
return new mi(t);
|
|
1660
1667
|
}), this.register(function(t) {
|
|
1661
1668
|
return new Mi(t);
|
|
1662
1669
|
}), this.register(function(t) {
|
|
1663
1670
|
return new vi(t);
|
|
1664
1671
|
}), this.register(function(t) {
|
|
1665
|
-
return new
|
|
1672
|
+
return new Si(t);
|
|
1666
1673
|
}), this.register(function(t) {
|
|
1667
1674
|
return new yi(t);
|
|
1668
1675
|
}), this.register(function(t) {
|
|
1669
1676
|
return new _i(t);
|
|
1670
1677
|
}), this.register(function(t) {
|
|
1671
1678
|
return new bi(t);
|
|
1672
|
-
}), this.register(function(t) {
|
|
1673
|
-
return new di(t);
|
|
1674
1679
|
}), this.register(function(t) {
|
|
1675
1680
|
return new wi(t);
|
|
1676
1681
|
}), this.register(function(t) {
|
|
1677
|
-
return new
|
|
1678
|
-
}), this.register(function(t) {
|
|
1679
|
-
return new xi(t);
|
|
1682
|
+
return new pi(t);
|
|
1680
1683
|
}), this.register(function(t) {
|
|
1681
1684
|
return new Ti(t);
|
|
1682
1685
|
}), this.register(function(t) {
|
|
1683
|
-
return new
|
|
1686
|
+
return new gi(t);
|
|
1687
|
+
}), this.register(function(t) {
|
|
1688
|
+
return new Ei(t);
|
|
1684
1689
|
}), this.register(function(t) {
|
|
1685
|
-
return new
|
|
1690
|
+
return new xi(t);
|
|
1686
1691
|
}), this.register(function(t) {
|
|
1687
|
-
return new
|
|
1692
|
+
return new ui(t);
|
|
1688
1693
|
}), this.register(function(t) {
|
|
1689
|
-
return new
|
|
1694
|
+
return new Wt(t, A.EXT_MESHOPT_COMPRESSION);
|
|
1695
|
+
}), this.register(function(t) {
|
|
1696
|
+
return new Wt(t, A.KHR_MESHOPT_COMPRESSION);
|
|
1697
|
+
}), this.register(function(t) {
|
|
1698
|
+
return new Ai(t);
|
|
1690
1699
|
});
|
|
1691
1700
|
}
|
|
1692
1701
|
/**
|
|
@@ -1711,7 +1720,7 @@ class li extends ln {
|
|
|
1711
1720
|
this.manager.itemStart(e);
|
|
1712
1721
|
const a = function(h) {
|
|
1713
1722
|
n ? n(h) : console.error(h), i.manager.itemError(e), i.manager.itemEnd(e);
|
|
1714
|
-
}, l = new
|
|
1723
|
+
}, l = new Et(this.manager);
|
|
1715
1724
|
l.setPath(this.path), l.setResponseType("arraybuffer"), l.setRequestHeader(this.requestHeader), l.setWithCredentials(this.withCredentials), l.load(e, function(h) {
|
|
1716
1725
|
try {
|
|
1717
1726
|
i.parse(h, o, function(u) {
|
|
@@ -1786,9 +1795,9 @@ class li extends ln {
|
|
|
1786
1795
|
if (typeof e == "string")
|
|
1787
1796
|
i = JSON.parse(e);
|
|
1788
1797
|
else if (e instanceof ArrayBuffer)
|
|
1789
|
-
if (l.decode(new Uint8Array(e, 0, 4)) ===
|
|
1798
|
+
if (l.decode(new Uint8Array(e, 0, 4)) === bn) {
|
|
1790
1799
|
try {
|
|
1791
|
-
o[A.KHR_BINARY_GLTF] = new
|
|
1800
|
+
o[A.KHR_BINARY_GLTF] = new Ri(e);
|
|
1792
1801
|
} catch (c) {
|
|
1793
1802
|
n && n(c);
|
|
1794
1803
|
return;
|
|
@@ -1802,7 +1811,7 @@ class li extends ln {
|
|
|
1802
1811
|
n && n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
1803
1812
|
return;
|
|
1804
1813
|
}
|
|
1805
|
-
const h = new
|
|
1814
|
+
const h = new zi(i, {
|
|
1806
1815
|
path: t || this.resourcePath || "",
|
|
1807
1816
|
crossOrigin: this.crossOrigin,
|
|
1808
1817
|
requestHeader: this.requestHeader,
|
|
@@ -1820,16 +1829,16 @@ class li extends ln {
|
|
|
1820
1829
|
const c = i.extensionsUsed[u], p = i.extensionsRequired || [];
|
|
1821
1830
|
switch (c) {
|
|
1822
1831
|
case A.KHR_MATERIALS_UNLIT:
|
|
1823
|
-
o[c] = new
|
|
1832
|
+
o[c] = new di();
|
|
1824
1833
|
break;
|
|
1825
1834
|
case A.KHR_DRACO_MESH_COMPRESSION:
|
|
1826
|
-
o[c] = new
|
|
1835
|
+
o[c] = new Pi(i, this.dracoLoader);
|
|
1827
1836
|
break;
|
|
1828
1837
|
case A.KHR_TEXTURE_TRANSFORM:
|
|
1829
|
-
o[c] = new
|
|
1838
|
+
o[c] = new Li();
|
|
1830
1839
|
break;
|
|
1831
1840
|
case A.KHR_MESH_QUANTIZATION:
|
|
1832
|
-
o[c] = new
|
|
1841
|
+
o[c] = new Ii();
|
|
1833
1842
|
break;
|
|
1834
1843
|
default:
|
|
1835
1844
|
p.indexOf(c) >= 0 && a[c] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + c + '".');
|
|
@@ -1852,7 +1861,7 @@ class li extends ln {
|
|
|
1852
1861
|
});
|
|
1853
1862
|
}
|
|
1854
1863
|
}
|
|
1855
|
-
function
|
|
1864
|
+
function hi() {
|
|
1856
1865
|
let r = {};
|
|
1857
1866
|
return {
|
|
1858
1867
|
get: function(e) {
|
|
@@ -1898,7 +1907,7 @@ const A = {
|
|
|
1898
1907
|
KHR_MESHOPT_COMPRESSION: "KHR_meshopt_compression",
|
|
1899
1908
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
1900
1909
|
};
|
|
1901
|
-
class
|
|
1910
|
+
class ui {
|
|
1902
1911
|
constructor(e) {
|
|
1903
1912
|
this.parser = e, this.name = A.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
1904
1913
|
}
|
|
@@ -1920,13 +1929,13 @@ class hi {
|
|
|
1920
1929
|
const c = l.range !== void 0 ? l.range : 0;
|
|
1921
1930
|
switch (l.type) {
|
|
1922
1931
|
case "directional":
|
|
1923
|
-
h = new
|
|
1932
|
+
h = new zn(u), h.target.position.set(0, 0, -1), h.add(h.target);
|
|
1924
1933
|
break;
|
|
1925
1934
|
case "point":
|
|
1926
|
-
h = new
|
|
1935
|
+
h = new Un(u), h.distance = c;
|
|
1927
1936
|
break;
|
|
1928
1937
|
case "spot":
|
|
1929
|
-
h = new
|
|
1938
|
+
h = new Hn(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);
|
|
1930
1939
|
break;
|
|
1931
1940
|
default:
|
|
1932
1941
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + l.type);
|
|
@@ -1944,7 +1953,7 @@ class hi {
|
|
|
1944
1953
|
});
|
|
1945
1954
|
}
|
|
1946
1955
|
}
|
|
1947
|
-
class
|
|
1956
|
+
class di {
|
|
1948
1957
|
constructor() {
|
|
1949
1958
|
this.name = A.KHR_MATERIALS_UNLIT;
|
|
1950
1959
|
}
|
|
@@ -1965,7 +1974,7 @@ class ui {
|
|
|
1965
1974
|
return Promise.all(n);
|
|
1966
1975
|
}
|
|
1967
1976
|
}
|
|
1968
|
-
class
|
|
1977
|
+
class pi {
|
|
1969
1978
|
constructor(e) {
|
|
1970
1979
|
this.parser = e, this.name = A.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
1971
1980
|
}
|
|
@@ -1974,7 +1983,7 @@ class di {
|
|
|
1974
1983
|
return s === null || s.emissiveStrength !== void 0 && (t.emissiveIntensity = s.emissiveStrength), Promise.resolve();
|
|
1975
1984
|
}
|
|
1976
1985
|
}
|
|
1977
|
-
class
|
|
1986
|
+
class fi {
|
|
1978
1987
|
constructor(e) {
|
|
1979
1988
|
this.parser = e, this.name = A.KHR_MATERIALS_CLEARCOAT;
|
|
1980
1989
|
}
|
|
@@ -1992,7 +2001,7 @@ class pi {
|
|
|
1992
2001
|
return Promise.all(n);
|
|
1993
2002
|
}
|
|
1994
2003
|
}
|
|
1995
|
-
class
|
|
2004
|
+
class mi {
|
|
1996
2005
|
constructor(e) {
|
|
1997
2006
|
this.parser = e, this.name = A.KHR_MATERIALS_DISPERSION;
|
|
1998
2007
|
}
|
|
@@ -2004,7 +2013,7 @@ class fi {
|
|
|
2004
2013
|
return s === null || (t.dispersion = s.dispersion !== void 0 ? s.dispersion : 0), Promise.resolve();
|
|
2005
2014
|
}
|
|
2006
2015
|
}
|
|
2007
|
-
class
|
|
2016
|
+
class gi {
|
|
2008
2017
|
constructor(e) {
|
|
2009
2018
|
this.parser = e, this.name = A.KHR_MATERIALS_IRIDESCENCE;
|
|
2010
2019
|
}
|
|
@@ -2018,7 +2027,7 @@ class mi {
|
|
|
2018
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);
|
|
2019
2028
|
}
|
|
2020
2029
|
}
|
|
2021
|
-
class
|
|
2030
|
+
class yi {
|
|
2022
2031
|
constructor(e) {
|
|
2023
2032
|
this.parser = e, this.name = A.KHR_MATERIALS_SHEEN;
|
|
2024
2033
|
}
|
|
@@ -2036,7 +2045,7 @@ class gi {
|
|
|
2036
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);
|
|
2037
2046
|
}
|
|
2038
2047
|
}
|
|
2039
|
-
class
|
|
2048
|
+
class _i {
|
|
2040
2049
|
constructor(e) {
|
|
2041
2050
|
this.parser = e, this.name = A.KHR_MATERIALS_TRANSMISSION;
|
|
2042
2051
|
}
|
|
@@ -2050,7 +2059,7 @@ class yi {
|
|
|
2050
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);
|
|
2051
2060
|
}
|
|
2052
2061
|
}
|
|
2053
|
-
class
|
|
2062
|
+
class bi {
|
|
2054
2063
|
constructor(e) {
|
|
2055
2064
|
this.parser = e, this.name = A.KHR_MATERIALS_VOLUME;
|
|
2056
2065
|
}
|
|
@@ -2066,7 +2075,7 @@ class _i {
|
|
|
2066
2075
|
return t.attenuationColor = new pe().setRGB(i[0], i[1], i[2], ae), Promise.all(n);
|
|
2067
2076
|
}
|
|
2068
2077
|
}
|
|
2069
|
-
class
|
|
2078
|
+
class wi {
|
|
2070
2079
|
constructor(e) {
|
|
2071
2080
|
this.parser = e, this.name = A.KHR_MATERIALS_IOR;
|
|
2072
2081
|
}
|
|
@@ -2078,7 +2087,7 @@ class bi {
|
|
|
2078
2087
|
return s === null || (t.ior = s.ior !== void 0 ? s.ior : 1.5, t.ior === 0 && (t.ior = 1e3)), Promise.resolve();
|
|
2079
2088
|
}
|
|
2080
2089
|
}
|
|
2081
|
-
class
|
|
2090
|
+
class Ti {
|
|
2082
2091
|
constructor(e) {
|
|
2083
2092
|
this.parser = e, this.name = A.KHR_MATERIALS_SPECULAR;
|
|
2084
2093
|
}
|
|
@@ -2094,7 +2103,7 @@ class wi {
|
|
|
2094
2103
|
return t.specularColor = new pe().setRGB(i[0], i[1], i[2], ae), s.specularColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularColorMap", s.specularColorTexture, Ae)), Promise.all(n);
|
|
2095
2104
|
}
|
|
2096
2105
|
}
|
|
2097
|
-
class
|
|
2106
|
+
class xi {
|
|
2098
2107
|
constructor(e) {
|
|
2099
2108
|
this.parser = e, this.name = A.EXT_MATERIALS_BUMP;
|
|
2100
2109
|
}
|
|
@@ -2108,7 +2117,7 @@ class Ti {
|
|
|
2108
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);
|
|
2109
2118
|
}
|
|
2110
2119
|
}
|
|
2111
|
-
class
|
|
2120
|
+
class Ei {
|
|
2112
2121
|
constructor(e) {
|
|
2113
2122
|
this.parser = e, this.name = A.KHR_MATERIALS_ANISOTROPY;
|
|
2114
2123
|
}
|
|
@@ -2122,7 +2131,7 @@ class xi {
|
|
|
2122
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);
|
|
2123
2132
|
}
|
|
2124
2133
|
}
|
|
2125
|
-
class
|
|
2134
|
+
class Mi {
|
|
2126
2135
|
constructor(e) {
|
|
2127
2136
|
this.parser = e, this.name = A.KHR_TEXTURE_BASISU;
|
|
2128
2137
|
}
|
|
@@ -2139,7 +2148,7 @@ class Ei {
|
|
|
2139
2148
|
return t.loadTextureImage(e, i.source, o);
|
|
2140
2149
|
}
|
|
2141
2150
|
}
|
|
2142
|
-
class
|
|
2151
|
+
class vi {
|
|
2143
2152
|
constructor(e) {
|
|
2144
2153
|
this.parser = e, this.name = A.EXT_TEXTURE_WEBP;
|
|
2145
2154
|
}
|
|
@@ -2156,7 +2165,7 @@ class Mi {
|
|
|
2156
2165
|
return s.loadTextureImage(e, o.source, l);
|
|
2157
2166
|
}
|
|
2158
2167
|
}
|
|
2159
|
-
class
|
|
2168
|
+
class Si {
|
|
2160
2169
|
constructor(e) {
|
|
2161
2170
|
this.parser = e, this.name = A.EXT_TEXTURE_AVIF;
|
|
2162
2171
|
}
|
|
@@ -2173,7 +2182,7 @@ class vi {
|
|
|
2173
2182
|
return s.loadTextureImage(e, o.source, l);
|
|
2174
2183
|
}
|
|
2175
2184
|
}
|
|
2176
|
-
class
|
|
2185
|
+
class Wt {
|
|
2177
2186
|
constructor(e, t) {
|
|
2178
2187
|
this.name = t, this.parser = e;
|
|
2179
2188
|
}
|
|
@@ -2199,7 +2208,7 @@ class Qt {
|
|
|
2199
2208
|
return null;
|
|
2200
2209
|
}
|
|
2201
2210
|
}
|
|
2202
|
-
class
|
|
2211
|
+
class Ai {
|
|
2203
2212
|
constructor(e) {
|
|
2204
2213
|
this.name = A.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
2205
2214
|
}
|
|
@@ -2217,13 +2226,13 @@ class Si {
|
|
|
2217
2226
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((h) => {
|
|
2218
2227
|
const u = h.pop(), c = u.isGroup ? u.children : [u], p = h[0].count, m = [];
|
|
2219
2228
|
for (const b of c) {
|
|
2220
|
-
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 Gn(b.geometry, b.material, p);
|
|
2221
2230
|
for (let S = 0; S < p; S++)
|
|
2222
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, _));
|
|
2223
2232
|
for (const S in l)
|
|
2224
2233
|
if (S === "_COLOR_0") {
|
|
2225
2234
|
const R = l[S];
|
|
2226
|
-
x.instanceColor = new
|
|
2235
|
+
x.instanceColor = new Xn(R.array, R.itemSize, R.normalized);
|
|
2227
2236
|
} else S !== "TRANSLATION" && S !== "ROTATION" && S !== "SCALE" && b.geometry.setAttribute(S, l[S]);
|
|
2228
2237
|
Ue.prototype.copy.call(x, b), this.parser.assignFinalMaterial(x), m.push(x);
|
|
2229
2238
|
}
|
|
@@ -2231,8 +2240,8 @@ class Si {
|
|
|
2231
2240
|
}));
|
|
2232
2241
|
}
|
|
2233
2242
|
}
|
|
2234
|
-
const
|
|
2235
|
-
class
|
|
2243
|
+
const bn = "glTF", Oe = 12, $t = { JSON: 1313821514, BIN: 5130562 };
|
|
2244
|
+
class Ri {
|
|
2236
2245
|
constructor(e) {
|
|
2237
2246
|
this.name = A.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
2238
2247
|
const t = new DataView(e, 0, Oe), s = new TextDecoder();
|
|
@@ -2240,7 +2249,7 @@ class Ai {
|
|
|
2240
2249
|
magic: s.decode(new Uint8Array(e.slice(0, 4))),
|
|
2241
2250
|
version: t.getUint32(4, !0),
|
|
2242
2251
|
length: t.getUint32(8, !0)
|
|
2243
|
-
}, this.header.magic !==
|
|
2252
|
+
}, this.header.magic !== bn)
|
|
2244
2253
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
2245
2254
|
if (this.header.version < 2)
|
|
2246
2255
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
@@ -2250,10 +2259,10 @@ class Ai {
|
|
|
2250
2259
|
const a = i.getUint32(o, !0);
|
|
2251
2260
|
o += 4;
|
|
2252
2261
|
const l = i.getUint32(o, !0);
|
|
2253
|
-
if (o += 4, l ===
|
|
2262
|
+
if (o += 4, l === $t.JSON) {
|
|
2254
2263
|
const h = new Uint8Array(e, Oe + o, a);
|
|
2255
2264
|
this.content = s.decode(h);
|
|
2256
|
-
} else if (l ===
|
|
2265
|
+
} else if (l === $t.BIN) {
|
|
2257
2266
|
const h = Oe + o;
|
|
2258
2267
|
this.body = e.slice(h, h + a);
|
|
2259
2268
|
}
|
|
@@ -2263,7 +2272,7 @@ class Ai {
|
|
|
2263
2272
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
2264
2273
|
}
|
|
2265
2274
|
}
|
|
2266
|
-
class
|
|
2275
|
+
class Pi {
|
|
2267
2276
|
constructor(e, t) {
|
|
2268
2277
|
if (!t)
|
|
2269
2278
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
@@ -2272,11 +2281,11 @@ class Ri {
|
|
|
2272
2281
|
decodePrimitive(e, t) {
|
|
2273
2282
|
const s = this.json, n = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, h = {};
|
|
2274
2283
|
for (const u in o) {
|
|
2275
|
-
const c =
|
|
2284
|
+
const c = Tt[u] || u.toLowerCase();
|
|
2276
2285
|
a[c] = o[u];
|
|
2277
2286
|
}
|
|
2278
2287
|
for (const u in e.attributes) {
|
|
2279
|
-
const c =
|
|
2288
|
+
const c = Tt[u] || u.toLowerCase();
|
|
2280
2289
|
if (o[u] !== void 0) {
|
|
2281
2290
|
const p = s.accessors[e.attributes[u]], m = ve[p.componentType];
|
|
2282
2291
|
h[c] = m.name, l[c] = p.normalized === !0;
|
|
@@ -2295,7 +2304,7 @@ class Ri {
|
|
|
2295
2304
|
});
|
|
2296
2305
|
}
|
|
2297
2306
|
}
|
|
2298
|
-
class
|
|
2307
|
+
class Li {
|
|
2299
2308
|
constructor() {
|
|
2300
2309
|
this.name = A.KHR_TEXTURE_TRANSFORM;
|
|
2301
2310
|
}
|
|
@@ -2303,12 +2312,12 @@ class Pi {
|
|
|
2303
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;
|
|
2304
2313
|
}
|
|
2305
2314
|
}
|
|
2306
|
-
class
|
|
2315
|
+
class Ii {
|
|
2307
2316
|
constructor() {
|
|
2308
2317
|
this.name = A.KHR_MESH_QUANTIZATION;
|
|
2309
2318
|
}
|
|
2310
2319
|
}
|
|
2311
|
-
class
|
|
2320
|
+
class wn extends cs {
|
|
2312
2321
|
constructor(e, t, s, n) {
|
|
2313
2322
|
super(e, t, s, n);
|
|
2314
2323
|
}
|
|
@@ -2327,11 +2336,11 @@ class bn extends ls {
|
|
|
2327
2336
|
return i;
|
|
2328
2337
|
}
|
|
2329
2338
|
}
|
|
2330
|
-
const
|
|
2331
|
-
class
|
|
2339
|
+
const Oi = new K();
|
|
2340
|
+
class Ci extends wn {
|
|
2332
2341
|
interpolate_(e, t, s, n) {
|
|
2333
2342
|
const i = super.interpolate_(e, t, s, n);
|
|
2334
|
-
return
|
|
2343
|
+
return Oi.fromArray(i).normalize().toArray(i), i;
|
|
2335
2344
|
}
|
|
2336
2345
|
}
|
|
2337
2346
|
const W = {
|
|
@@ -2349,18 +2358,18 @@ const W = {
|
|
|
2349
2358
|
5123: Uint16Array,
|
|
2350
2359
|
5125: Uint32Array,
|
|
2351
2360
|
5126: Float32Array
|
|
2352
|
-
},
|
|
2353
|
-
9728:
|
|
2354
|
-
9729:
|
|
2355
|
-
9984:
|
|
2356
|
-
9985:
|
|
2357
|
-
9986:
|
|
2358
|
-
9987:
|
|
2359
|
-
},
|
|
2360
|
-
33071:
|
|
2361
|
-
33648:
|
|
2362
|
-
10497:
|
|
2363
|
-
},
|
|
2361
|
+
}, Jt = {
|
|
2362
|
+
9728: pn,
|
|
2363
|
+
9729: _t,
|
|
2364
|
+
9984: qn,
|
|
2365
|
+
9985: Qn,
|
|
2366
|
+
9986: Zn,
|
|
2367
|
+
9987: dn
|
|
2368
|
+
}, en = {
|
|
2369
|
+
33071: $n,
|
|
2370
|
+
33648: Wn,
|
|
2371
|
+
10497: bt
|
|
2372
|
+
}, pt = {
|
|
2364
2373
|
SCALAR: 1,
|
|
2365
2374
|
VEC2: 2,
|
|
2366
2375
|
VEC3: 3,
|
|
@@ -2368,7 +2377,7 @@ const W = {
|
|
|
2368
2377
|
MAT2: 4,
|
|
2369
2378
|
MAT3: 9,
|
|
2370
2379
|
MAT4: 16
|
|
2371
|
-
},
|
|
2380
|
+
}, Tt = {
|
|
2372
2381
|
POSITION: "position",
|
|
2373
2382
|
NORMAL: "normal",
|
|
2374
2383
|
TANGENT: "tangent",
|
|
@@ -2384,26 +2393,26 @@ const W = {
|
|
|
2384
2393
|
translation: "position",
|
|
2385
2394
|
rotation: "quaternion",
|
|
2386
2395
|
weights: "morphTargetInfluences"
|
|
2387
|
-
},
|
|
2396
|
+
}, Di = {
|
|
2388
2397
|
CUBICSPLINE: void 0,
|
|
2389
2398
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
2390
2399
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
2391
|
-
LINEAR:
|
|
2392
|
-
STEP:
|
|
2393
|
-
},
|
|
2400
|
+
LINEAR: mn,
|
|
2401
|
+
STEP: as
|
|
2402
|
+
}, ft = {
|
|
2394
2403
|
OPAQUE: "OPAQUE",
|
|
2395
2404
|
MASK: "MASK",
|
|
2396
2405
|
BLEND: "BLEND"
|
|
2397
2406
|
};
|
|
2398
|
-
function
|
|
2399
|
-
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new
|
|
2407
|
+
function Ni(r) {
|
|
2408
|
+
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new fn({
|
|
2400
2409
|
color: 16777215,
|
|
2401
2410
|
emissive: 0,
|
|
2402
2411
|
metalness: 1,
|
|
2403
2412
|
roughness: 1,
|
|
2404
2413
|
transparent: !1,
|
|
2405
2414
|
depthTest: !0,
|
|
2406
|
-
side:
|
|
2415
|
+
side: ls
|
|
2407
2416
|
})), r.DefaultMaterial;
|
|
2408
2417
|
}
|
|
2409
2418
|
function ge(r, e, t) {
|
|
@@ -2413,7 +2422,7 @@ function ge(r, e, t) {
|
|
|
2413
2422
|
function ne(r, e) {
|
|
2414
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));
|
|
2415
2424
|
}
|
|
2416
|
-
function
|
|
2425
|
+
function ki(r, e, t) {
|
|
2417
2426
|
let s = !1, n = !1, i = !1;
|
|
2418
2427
|
for (let h = 0, u = e.length; h < u; h++) {
|
|
2419
2428
|
const c = e[h];
|
|
@@ -2445,7 +2454,7 @@ function Ni(r, e, t) {
|
|
|
2445
2454
|
return s && (r.morphAttributes.position = u), n && (r.morphAttributes.normal = c), i && (r.morphAttributes.color = p), r.morphTargetsRelative = !0, r;
|
|
2446
2455
|
});
|
|
2447
2456
|
}
|
|
2448
|
-
function
|
|
2457
|
+
function ji(r, e) {
|
|
2449
2458
|
if (r.updateMorphTargets(), e.weights !== void 0)
|
|
2450
2459
|
for (let t = 0, s = e.weights.length; t < s; t++)
|
|
2451
2460
|
r.morphTargetInfluences[t] = e.weights[t];
|
|
@@ -2459,22 +2468,22 @@ function ki(r, e) {
|
|
|
2459
2468
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
2460
2469
|
}
|
|
2461
2470
|
}
|
|
2462
|
-
function
|
|
2471
|
+
function Fi(r) {
|
|
2463
2472
|
let e;
|
|
2464
2473
|
const t = r.extensions && r.extensions[A.KHR_DRACO_MESH_COMPRESSION];
|
|
2465
|
-
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" +
|
|
2474
|
+
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + mt(t.attributes) : e = r.indices + ":" + mt(r.attributes) + ":" + r.mode, r.targets !== void 0)
|
|
2466
2475
|
for (let s = 0, n = r.targets.length; s < n; s++)
|
|
2467
|
-
e += ":" +
|
|
2476
|
+
e += ":" + mt(r.targets[s]);
|
|
2468
2477
|
return e;
|
|
2469
2478
|
}
|
|
2470
|
-
function
|
|
2479
|
+
function mt(r) {
|
|
2471
2480
|
let e = "";
|
|
2472
2481
|
const t = Object.keys(r).sort();
|
|
2473
2482
|
for (let s = 0, n = t.length; s < n; s++)
|
|
2474
2483
|
e += t[s] + ":" + r[t[s]] + ";";
|
|
2475
2484
|
return e;
|
|
2476
2485
|
}
|
|
2477
|
-
function
|
|
2486
|
+
function xt(r) {
|
|
2478
2487
|
switch (r) {
|
|
2479
2488
|
case Int8Array:
|
|
2480
2489
|
return 1 / 127;
|
|
@@ -2488,13 +2497,13 @@ function Tt(r) {
|
|
|
2488
2497
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
2489
2498
|
}
|
|
2490
2499
|
}
|
|
2491
|
-
function
|
|
2500
|
+
function Hi(r) {
|
|
2492
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";
|
|
2493
2502
|
}
|
|
2494
|
-
const
|
|
2495
|
-
class
|
|
2503
|
+
const Ui = new Se();
|
|
2504
|
+
class zi {
|
|
2496
2505
|
constructor(e = {}, t = {}) {
|
|
2497
|
-
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 hi(), 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 = {};
|
|
2498
2507
|
let s = !1, n = -1, i = !1, o = -1;
|
|
2499
2508
|
if (typeof navigator < "u" && typeof navigator.userAgent < "u") {
|
|
2500
2509
|
const a = navigator.userAgent;
|
|
@@ -2502,7 +2511,7 @@ class Ui {
|
|
|
2502
2511
|
const l = a.match(/Version\/(\d+)/);
|
|
2503
2512
|
n = s && l ? parseInt(l[1], 10) : -1, i = a.indexOf("Firefox") > -1, o = i ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
2504
2513
|
}
|
|
2505
|
-
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 Yn(this.options.manager) : this.textureLoader = new Bn(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);
|
|
2506
2515
|
}
|
|
2507
2516
|
setExtensions(e) {
|
|
2508
2517
|
this.extensions = e;
|
|
@@ -2742,21 +2751,21 @@ class Ui {
|
|
|
2742
2751
|
loadAccessor(e) {
|
|
2743
2752
|
const t = this, s = this.json, n = this.json.accessors[e];
|
|
2744
2753
|
if (n.bufferView === void 0 && n.sparse === void 0) {
|
|
2745
|
-
const o =
|
|
2754
|
+
const o = pt[n.type], a = ve[n.componentType], l = n.normalized === !0, h = new a(n.count * o);
|
|
2746
2755
|
return Promise.resolve(new rt(h, o, l));
|
|
2747
2756
|
}
|
|
2748
2757
|
const i = [];
|
|
2749
2758
|
return n.bufferView !== void 0 ? i.push(this.getDependency("bufferView", n.bufferView)) : i.push(null), n.sparse !== void 0 && (i.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(i).then(function(o) {
|
|
2750
|
-
const a = o[0], l =
|
|
2759
|
+
const a = o[0], l = pt[n.type], h = ve[n.componentType], u = h.BYTES_PER_ELEMENT, c = u * l, p = n.byteOffset || 0, m = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, b = n.normalized === !0;
|
|
2751
2760
|
let f, y;
|
|
2752
2761
|
if (m && m !== c) {
|
|
2753
2762
|
const d = Math.floor(p / m), _ = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + d + ":" + n.count;
|
|
2754
2763
|
let x = t.cache.get(_);
|
|
2755
|
-
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 Kn(f, m / u), t.cache.add(_, x)), y = new Vn(x, l, p % m / u, b);
|
|
2756
2765
|
} else
|
|
2757
2766
|
a === null ? f = new h(n.count * l) : f = new h(a, p, n.count * l), y = new rt(f, l, b);
|
|
2758
2767
|
if (n.sparse !== void 0) {
|
|
2759
|
-
const d =
|
|
2768
|
+
const d = pt.SCALAR, _ = ve[n.sparse.indices.componentType], x = n.sparse.indices.byteOffset || 0, S = n.sparse.values.byteOffset || 0, R = new _(o[1], x, n.sparse.count * d), v = new h(o[2], S, n.sparse.count * l);
|
|
2760
2769
|
a !== null && (y = new rt(y.array.slice(), y.itemSize, y.normalized)), y.normalized = !1;
|
|
2761
2770
|
for (let I = 0, ie = R.length; I < ie; I++) {
|
|
2762
2771
|
const ee = R[I];
|
|
@@ -2790,7 +2799,7 @@ class Ui {
|
|
|
2790
2799
|
const h = this.loadImageSource(t, s).then(function(u) {
|
|
2791
2800
|
u.flipY = !1, u.name = o.name || a.name || "", u.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (u.name = a.uri);
|
|
2792
2801
|
const p = (i.samplers || {})[o.sampler] || {};
|
|
2793
|
-
return u.magFilter =
|
|
2802
|
+
return u.magFilter = Jt[p.magFilter] || _t, u.minFilter = Jt[p.minFilter] || dn, u.wrapS = en[p.wrapS] || bt, u.wrapT = en[p.wrapT] || bt, u.generateMipmaps = !u.isCompressedTexture && u.minFilter !== pn && u.minFilter !== _t, n.associations.set(u, { textures: e }), u;
|
|
2794
2803
|
}).catch(function() {
|
|
2795
2804
|
return null;
|
|
2796
2805
|
});
|
|
@@ -2814,12 +2823,12 @@ class Ui {
|
|
|
2814
2823
|
return new Promise(function(p, m) {
|
|
2815
2824
|
let b = p;
|
|
2816
2825
|
t.isImageBitmapLoader === !0 && (b = function(f) {
|
|
2817
|
-
const y = new
|
|
2826
|
+
const y = new Ot(f);
|
|
2818
2827
|
y.needsUpdate = !0, p(y);
|
|
2819
2828
|
}), t.load(Fe.resolveURL(c, i.path), b, void 0, m);
|
|
2820
2829
|
});
|
|
2821
2830
|
}).then(function(c) {
|
|
2822
|
-
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 || Hi(o.uri), c;
|
|
2823
2832
|
}).catch(function(c) {
|
|
2824
2833
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", l), c;
|
|
2825
2834
|
});
|
|
@@ -2881,7 +2890,7 @@ class Ui {
|
|
|
2881
2890
|
e.material = s;
|
|
2882
2891
|
}
|
|
2883
2892
|
getMaterialType() {
|
|
2884
|
-
return
|
|
2893
|
+
return fn;
|
|
2885
2894
|
}
|
|
2886
2895
|
/**
|
|
2887
2896
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -2909,9 +2918,9 @@ class Ui {
|
|
|
2909
2918
|
return p.extendMaterialParams && p.extendMaterialParams(e, a);
|
|
2910
2919
|
})));
|
|
2911
2920
|
}
|
|
2912
|
-
i.doubleSided === !0 && (a.side =
|
|
2913
|
-
const u = i.alphaMode ||
|
|
2914
|
-
if (u ===
|
|
2921
|
+
i.doubleSided === !0 && (a.side = cn);
|
|
2922
|
+
const u = i.alphaMode || ft.OPAQUE;
|
|
2923
|
+
if (u === ft.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, u === ft.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== _e && (h.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new V(1, 1), i.normalTexture.scale !== void 0)) {
|
|
2915
2924
|
const c = i.normalTexture.scale;
|
|
2916
2925
|
a.normalScale.set(c, c);
|
|
2917
2926
|
}
|
|
@@ -2932,7 +2941,7 @@ class Ui {
|
|
|
2932
2941
|
* @return {string}
|
|
2933
2942
|
*/
|
|
2934
2943
|
createUniqueName(e) {
|
|
2935
|
-
const t =
|
|
2944
|
+
const t = Jn.sanitizeNodeName(e || "");
|
|
2936
2945
|
return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
|
|
2937
2946
|
}
|
|
2938
2947
|
/**
|
|
@@ -2948,17 +2957,17 @@ class Ui {
|
|
|
2948
2957
|
const t = this, s = this.extensions, n = this.primitiveCache;
|
|
2949
2958
|
function i(a) {
|
|
2950
2959
|
return s[A.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(l) {
|
|
2951
|
-
return
|
|
2960
|
+
return tn(l, a, t);
|
|
2952
2961
|
});
|
|
2953
2962
|
}
|
|
2954
2963
|
const o = [];
|
|
2955
2964
|
for (let a = 0, l = e.length; a < l; a++) {
|
|
2956
|
-
const h = e[a], u =
|
|
2965
|
+
const h = e[a], u = Fi(h), c = n[u];
|
|
2957
2966
|
if (c)
|
|
2958
2967
|
o.push(c.promise);
|
|
2959
2968
|
else {
|
|
2960
2969
|
let p;
|
|
2961
|
-
h.extensions && h.extensions[A.KHR_DRACO_MESH_COMPRESSION] ? p = i(h) : p =
|
|
2970
|
+
h.extensions && h.extensions[A.KHR_DRACO_MESH_COMPRESSION] ? p = i(h) : p = tn(new ze(), h, t), n[u] = { primitive: h, promise: p }, o.push(p);
|
|
2962
2971
|
}
|
|
2963
2972
|
}
|
|
2964
2973
|
return Promise.all(o);
|
|
@@ -2973,7 +2982,7 @@ class Ui {
|
|
|
2973
2982
|
loadMesh(e) {
|
|
2974
2983
|
const t = this, s = this.json, n = this.extensions, i = s.meshes[e], o = i.primitives, a = [];
|
|
2975
2984
|
for (let l = 0, h = o.length; l < h; l++) {
|
|
2976
|
-
const u = o[l].material === void 0 ?
|
|
2985
|
+
const u = o[l].material === void 0 ? Ni(this.cache) : this.getDependency("material", o[l].material);
|
|
2977
2986
|
a.push(u);
|
|
2978
2987
|
}
|
|
2979
2988
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
|
|
@@ -2983,18 +2992,18 @@ class Ui {
|
|
|
2983
2992
|
let d;
|
|
2984
2993
|
const _ = h[m];
|
|
2985
2994
|
if (y.mode === W.TRIANGLES || y.mode === W.TRIANGLE_STRIP || y.mode === W.TRIANGLE_FAN || y.mode === void 0)
|
|
2986
|
-
d = i.isSkinnedMesh === !0 ? new
|
|
2995
|
+
d = i.isSkinnedMesh === !0 ? new es(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));
|
|
2987
2996
|
else if (y.mode === W.LINES)
|
|
2988
|
-
d = new
|
|
2997
|
+
d = new gt(f, _);
|
|
2989
2998
|
else if (y.mode === W.LINE_STRIP)
|
|
2990
2999
|
d = new re(f, _);
|
|
2991
3000
|
else if (y.mode === W.LINE_LOOP)
|
|
2992
|
-
d = new
|
|
3001
|
+
d = new ts(f, _);
|
|
2993
3002
|
else if (y.mode === W.POINTS)
|
|
2994
3003
|
d = new nt(f, _);
|
|
2995
3004
|
else
|
|
2996
3005
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + y.mode);
|
|
2997
|
-
Object.keys(d.geometry.morphAttributes).length > 0 &&
|
|
3006
|
+
Object.keys(d.geometry.morphAttributes).length > 0 && ji(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);
|
|
2998
3007
|
}
|
|
2999
3008
|
for (let m = 0, b = c.length; m < b; m++)
|
|
3000
3009
|
t.associations.set(c[m], {
|
|
@@ -3024,7 +3033,7 @@ class Ui {
|
|
|
3024
3033
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
3025
3034
|
return;
|
|
3026
3035
|
}
|
|
3027
|
-
return s.type === "perspective" ? t = new
|
|
3036
|
+
return s.type === "perspective" ? t = new ns(ln.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new ss(-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);
|
|
3028
3037
|
}
|
|
3029
3038
|
/**
|
|
3030
3039
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -3048,7 +3057,7 @@ class Ui {
|
|
|
3048
3057
|
} else
|
|
3049
3058
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[h]);
|
|
3050
3059
|
}
|
|
3051
|
-
return new
|
|
3060
|
+
return new is(a, l);
|
|
3052
3061
|
});
|
|
3053
3062
|
}
|
|
3054
3063
|
/**
|
|
@@ -3081,7 +3090,7 @@ class Ui {
|
|
|
3081
3090
|
for (let $ = 0; $ < fe.length; $++)
|
|
3082
3091
|
d.push(fe[$]);
|
|
3083
3092
|
}
|
|
3084
|
-
const _ = new
|
|
3093
|
+
const _ = new os(i, void 0, d);
|
|
3085
3094
|
return ne(_, n), _;
|
|
3086
3095
|
});
|
|
3087
3096
|
}
|
|
@@ -3115,7 +3124,7 @@ class Ui {
|
|
|
3115
3124
|
]).then(function(h) {
|
|
3116
3125
|
const u = h[0], c = h[1], p = h[2];
|
|
3117
3126
|
p !== null && u.traverse(function(m) {
|
|
3118
|
-
m.isSkinnedMesh && m.bind(p,
|
|
3127
|
+
m.isSkinnedMesh && m.bind(p, Ui);
|
|
3119
3128
|
});
|
|
3120
3129
|
for (let m = 0, b = c.length; m < b; m++)
|
|
3121
3130
|
u.add(c[m]);
|
|
@@ -3143,7 +3152,7 @@ class Ui {
|
|
|
3143
3152
|
a.push(h);
|
|
3144
3153
|
}), this.nodeCache[e] = Promise.all(a).then(function(h) {
|
|
3145
3154
|
let u;
|
|
3146
|
-
if (i.isBone === !0 ? u = new
|
|
3155
|
+
if (i.isBone === !0 ? u = new rs() : h.length > 1 ? u = new tt() : h.length === 1 ? u = h[0] : u = new Ue(), u !== h[0])
|
|
3147
3156
|
for (let c = 0, p = h.length; c < p; c++)
|
|
3148
3157
|
u.add(h[c]);
|
|
3149
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) {
|
|
@@ -3176,12 +3185,12 @@ class Ui {
|
|
|
3176
3185
|
return Promise.all(a).then(function(l) {
|
|
3177
3186
|
for (let u = 0, c = l.length; u < c; u++) {
|
|
3178
3187
|
const p = l[u];
|
|
3179
|
-
p.parent !== null ? i.add(
|
|
3188
|
+
p.parent !== null ? i.add(li(p)) : i.add(p);
|
|
3180
3189
|
}
|
|
3181
3190
|
const h = (u) => {
|
|
3182
3191
|
const c = /* @__PURE__ */ new Map();
|
|
3183
3192
|
for (const [p, m] of n.associations)
|
|
3184
|
-
(p instanceof je || p instanceof
|
|
3193
|
+
(p instanceof je || p instanceof Ot) && c.set(p, m);
|
|
3185
3194
|
return u.traverse((p) => {
|
|
3186
3195
|
const m = n.associations.get(p);
|
|
3187
3196
|
m != null && c.set(p, m);
|
|
@@ -3199,29 +3208,29 @@ class Ui {
|
|
|
3199
3208
|
let u;
|
|
3200
3209
|
switch (ce[i.path]) {
|
|
3201
3210
|
case ce.weights:
|
|
3202
|
-
u =
|
|
3211
|
+
u = Dt;
|
|
3203
3212
|
break;
|
|
3204
3213
|
case ce.rotation:
|
|
3205
|
-
u =
|
|
3214
|
+
u = Nt;
|
|
3206
3215
|
break;
|
|
3207
3216
|
case ce.translation:
|
|
3208
3217
|
case ce.scale:
|
|
3209
|
-
u =
|
|
3218
|
+
u = Ct;
|
|
3210
3219
|
break;
|
|
3211
3220
|
default:
|
|
3212
3221
|
switch (s.itemSize) {
|
|
3213
3222
|
case 1:
|
|
3214
|
-
u =
|
|
3223
|
+
u = Dt;
|
|
3215
3224
|
break;
|
|
3216
3225
|
case 2:
|
|
3217
3226
|
case 3:
|
|
3218
3227
|
default:
|
|
3219
|
-
u =
|
|
3228
|
+
u = Ct;
|
|
3220
3229
|
break;
|
|
3221
3230
|
}
|
|
3222
3231
|
break;
|
|
3223
3232
|
}
|
|
3224
|
-
const c = n.interpolation !== void 0 ?
|
|
3233
|
+
const c = n.interpolation !== void 0 ? Di[n.interpolation] : mn, p = this._getArrayFromAccessor(s);
|
|
3225
3234
|
for (let m = 0, b = l.length; m < b; m++) {
|
|
3226
3235
|
const f = new u(
|
|
3227
3236
|
l[m] + "." + ce[i.path],
|
|
@@ -3236,7 +3245,7 @@ class Ui {
|
|
|
3236
3245
|
_getArrayFromAccessor(e) {
|
|
3237
3246
|
let t = e.array;
|
|
3238
3247
|
if (e.normalized) {
|
|
3239
|
-
const s =
|
|
3248
|
+
const s = xt(t.constructor), n = new Float32Array(t.length);
|
|
3240
3249
|
for (let i = 0, o = t.length; i < o; i++)
|
|
3241
3250
|
n[i] = t[i] * s;
|
|
3242
3251
|
t = n;
|
|
@@ -3245,13 +3254,13 @@ class Ui {
|
|
|
3245
3254
|
}
|
|
3246
3255
|
_createCubicSplineTrackInterpolant(e) {
|
|
3247
3256
|
e.createInterpolant = function(s) {
|
|
3248
|
-
const n = this instanceof
|
|
3257
|
+
const n = this instanceof Nt ? Ci : wn;
|
|
3249
3258
|
return new n(this.times, this.values, this.getValueSize() / 3, s);
|
|
3250
3259
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
3251
3260
|
}
|
|
3252
3261
|
}
|
|
3253
|
-
function
|
|
3254
|
-
const s = e.attributes, n = new
|
|
3262
|
+
function Gi(r, e, t) {
|
|
3263
|
+
const s = e.attributes, n = new hs();
|
|
3255
3264
|
if (s.POSITION !== void 0) {
|
|
3256
3265
|
const a = t.json.accessors[s.POSITION], l = a.min, h = a.max;
|
|
3257
3266
|
if (l !== void 0 && h !== void 0) {
|
|
@@ -3259,7 +3268,7 @@ function zi(r, e, t) {
|
|
|
3259
3268
|
new M(l[0], l[1], l[2]),
|
|
3260
3269
|
new M(h[0], h[1], h[2])
|
|
3261
3270
|
), a.normalized) {
|
|
3262
|
-
const u =
|
|
3271
|
+
const u = xt(ve[a.componentType]);
|
|
3263
3272
|
n.min.multiplyScalar(u), n.max.multiplyScalar(u);
|
|
3264
3273
|
}
|
|
3265
3274
|
} else {
|
|
@@ -3277,7 +3286,7 @@ function zi(r, e, t) {
|
|
|
3277
3286
|
const p = t.json.accessors[c.POSITION], m = p.min, b = p.max;
|
|
3278
3287
|
if (m !== void 0 && b !== void 0) {
|
|
3279
3288
|
if (l.setX(Math.max(Math.abs(m[0]), Math.abs(b[0]))), l.setY(Math.max(Math.abs(m[1]), Math.abs(b[1]))), l.setZ(Math.max(Math.abs(m[2]), Math.abs(b[2]))), p.normalized) {
|
|
3280
|
-
const f =
|
|
3289
|
+
const f = xt(ve[p.componentType]);
|
|
3281
3290
|
l.multiplyScalar(f);
|
|
3282
3291
|
}
|
|
3283
3292
|
a.max(l);
|
|
@@ -3288,10 +3297,10 @@ function zi(r, e, t) {
|
|
|
3288
3297
|
n.expandByVector(a);
|
|
3289
3298
|
}
|
|
3290
3299
|
r.boundingBox = n;
|
|
3291
|
-
const o = new
|
|
3300
|
+
const o = new us();
|
|
3292
3301
|
n.getCenter(o.center), o.radius = n.min.distanceTo(n.max) / 2, r.boundingSphere = o;
|
|
3293
3302
|
}
|
|
3294
|
-
function
|
|
3303
|
+
function tn(r, e, t) {
|
|
3295
3304
|
const s = e.attributes, n = [];
|
|
3296
3305
|
function i(o, a) {
|
|
3297
3306
|
return t.getDependency("accessor", o).then(function(l) {
|
|
@@ -3299,7 +3308,7 @@ function Jt(r, e, t) {
|
|
|
3299
3308
|
});
|
|
3300
3309
|
}
|
|
3301
3310
|
for (const o in s) {
|
|
3302
|
-
const a =
|
|
3311
|
+
const a = Tt[o] || o.toLowerCase();
|
|
3303
3312
|
a in r.attributes || n.push(i(s[o], a));
|
|
3304
3313
|
}
|
|
3305
3314
|
if (e.indices !== void 0 && !r.index) {
|
|
@@ -3308,25 +3317,25 @@ function Jt(r, e, t) {
|
|
|
3308
3317
|
});
|
|
3309
3318
|
n.push(o);
|
|
3310
3319
|
}
|
|
3311
|
-
return
|
|
3312
|
-
return e.targets !== void 0 ?
|
|
3320
|
+
return kt.workingColorSpace !== ae && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${kt.workingColorSpace}" not supported.`), ne(r, e), Gi(r, e, t), Promise.all(n).then(function() {
|
|
3321
|
+
return e.targets !== void 0 ? ki(r, e.targets, t) : r;
|
|
3313
3322
|
});
|
|
3314
3323
|
}
|
|
3315
|
-
function
|
|
3324
|
+
function Xi() {
|
|
3316
3325
|
const r = new F.BoxGeometry(1, 1, 1), e = new F.MeshStandardMaterial({ color: 43775 }), t = new F.Mesh(r, e);
|
|
3317
|
-
return t.position.y = 0.5, t.userData.isMovable = !0, t.name = "正方体",
|
|
3326
|
+
return t.position.y = 0.5, t.userData.isMovable = !0, t.name = "正方体", At(t, !0), t;
|
|
3318
3327
|
}
|
|
3319
|
-
function
|
|
3328
|
+
function Yi() {
|
|
3320
3329
|
const r = new F.SphereGeometry(0.6, 32, 32), e = new F.MeshStandardMaterial({ color: 16746496 }), t = new F.Mesh(r, e);
|
|
3321
|
-
return t.position.y = 0.6, t.userData.isMovable = !0, t.name = "球体",
|
|
3330
|
+
return t.position.y = 0.6, t.userData.isMovable = !0, t.name = "球体", At(t, !0), t;
|
|
3322
3331
|
}
|
|
3323
|
-
function
|
|
3332
|
+
function Bi(r) {
|
|
3324
3333
|
return new Promise((e, t) => {
|
|
3325
3334
|
var o;
|
|
3326
3335
|
const s = (o = r.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), n = URL.createObjectURL(r);
|
|
3327
3336
|
let i;
|
|
3328
|
-
if (s === "obj") i = new
|
|
3329
|
-
else if (s === "gltf" || s === "glb") i = new
|
|
3337
|
+
if (s === "obj") i = new ai();
|
|
3338
|
+
else if (s === "gltf" || s === "glb") i = new ci();
|
|
3330
3339
|
else {
|
|
3331
3340
|
t(new Error("不支持的文件格式,请使用 .obj, .gltf, .glb"));
|
|
3332
3341
|
return;
|
|
@@ -3340,30 +3349,30 @@ function Yi(r) {
|
|
|
3340
3349
|
c.userData.isMovable = !0, c.name || (c.name = c.type), c.type === "Mesh" && (c.frustumCulled = !0, (p = c.geometry) == null || p.computeVertexNormals());
|
|
3341
3350
|
});
|
|
3342
3351
|
const u = new F.Box3().setFromObject(l).getCenter(new F.Vector3());
|
|
3343
|
-
l.position.sub(u),
|
|
3352
|
+
l.position.sub(u), At(l, !0), e(l);
|
|
3344
3353
|
},
|
|
3345
3354
|
void 0,
|
|
3346
3355
|
(a) => t(a)
|
|
3347
3356
|
);
|
|
3348
3357
|
});
|
|
3349
3358
|
}
|
|
3350
|
-
function
|
|
3359
|
+
function Ki(r) {
|
|
3351
3360
|
switch (r) {
|
|
3352
3361
|
case "box":
|
|
3353
|
-
|
|
3362
|
+
Xi();
|
|
3354
3363
|
break;
|
|
3355
3364
|
case "sphere":
|
|
3356
|
-
|
|
3365
|
+
Yi();
|
|
3357
3366
|
break;
|
|
3358
3367
|
}
|
|
3359
3368
|
}
|
|
3360
|
-
const
|
|
3369
|
+
const Vi = {
|
|
3361
3370
|
key: 1,
|
|
3362
3371
|
class: "toggle-placeholder"
|
|
3363
|
-
},
|
|
3372
|
+
}, Zi = { class: "tree-icon" }, Qi = { class: "tree-name" }, qi = {
|
|
3364
3373
|
key: 0,
|
|
3365
3374
|
class: "tree-children"
|
|
3366
|
-
},
|
|
3375
|
+
}, Wi = /* @__PURE__ */ Ge({
|
|
3367
3376
|
__name: "TreeItem",
|
|
3368
3377
|
props: {
|
|
3369
3378
|
node: {},
|
|
@@ -3372,7 +3381,7 @@ const Ki = {
|
|
|
3372
3381
|
},
|
|
3373
3382
|
emits: ["select", "delete"],
|
|
3374
3383
|
setup(r, { emit: e }) {
|
|
3375
|
-
const t = r, s = e, n = G(null), { expandedSet: i, toggleExpand: o } =
|
|
3384
|
+
const t = r, s = e, n = G(null), { expandedSet: i, toggleExpand: o } = xn("treeExpand"), a = Ze(() => i.value.has(t.node.uuid)), l = Ze(() => (t.version, t.node.children.some((f) => f.userData.isMovable === !0))), h = Ze(() => (t.version, t.node.children.filter(
|
|
3376
3385
|
(f) => f.userData.isMovable === !0
|
|
3377
3386
|
))), u = Ze(
|
|
3378
3387
|
() => {
|
|
@@ -3380,7 +3389,7 @@ const Ki = {
|
|
|
3380
3389
|
return ((f = t.selectedObject) == null ? void 0 : f.uuid) === t.node.uuid;
|
|
3381
3390
|
}
|
|
3382
3391
|
);
|
|
3383
|
-
|
|
3392
|
+
En(
|
|
3384
3393
|
() => {
|
|
3385
3394
|
u.value && n.value && n.value.scrollIntoView({
|
|
3386
3395
|
block: "nearest",
|
|
@@ -3397,7 +3406,7 @@ const Ki = {
|
|
|
3397
3406
|
f.stopPropagation(), s("delete", t.node);
|
|
3398
3407
|
}, m = (f) => f.type === "Mesh" || f.type === "Sprite" ? "🟦" : f.type === "Light" ? "💡" : "📦", b = (f) => f.name || `${f.type} (${f.id})`;
|
|
3399
3408
|
return (f, y) => {
|
|
3400
|
-
const d =
|
|
3409
|
+
const d = Mn("TreeItem", !0);
|
|
3401
3410
|
return N(), U("div", {
|
|
3402
3411
|
class: "tree-node",
|
|
3403
3412
|
ref_key: "nodeRef",
|
|
@@ -3410,17 +3419,17 @@ const Ki = {
|
|
|
3410
3419
|
l.value ? (N(), U("span", {
|
|
3411
3420
|
key: 0,
|
|
3412
3421
|
class: "toggle-icon",
|
|
3413
|
-
onClick: y[0] || (y[0] =
|
|
3414
|
-
}, Ee(a.value ? "▼" : "▶"), 1)) : (N(), U("span",
|
|
3415
|
-
g("span",
|
|
3416
|
-
g("span",
|
|
3422
|
+
onClick: y[0] || (y[0] = Lt((_) => vn(o)(r.node.uuid), ["stop"]))
|
|
3423
|
+
}, Ee(a.value ? "▼" : "▶"), 1)) : (N(), U("span", Vi)),
|
|
3424
|
+
g("span", Zi, Ee(m(r.node)), 1),
|
|
3425
|
+
g("span", Qi, Ee(b(r.node)), 1),
|
|
3417
3426
|
g("button", {
|
|
3418
3427
|
class: "tree-delete",
|
|
3419
|
-
onClick:
|
|
3428
|
+
onClick: Lt(p, ["stop"])
|
|
3420
3429
|
}, "×")
|
|
3421
3430
|
], 2),
|
|
3422
|
-
a.value && l.value ? (N(), U("div",
|
|
3423
|
-
(N(!0), U(
|
|
3431
|
+
a.value && l.value ? (N(), U("div", qi, [
|
|
3432
|
+
(N(!0), U(nn, null, sn(h.value, (_) => (N(), ot(d, {
|
|
3424
3433
|
key: _.uuid,
|
|
3425
3434
|
node: _,
|
|
3426
3435
|
"selected-object": r.selectedObject,
|
|
@@ -3437,8 +3446,8 @@ const Ki = {
|
|
|
3437
3446
|
for (const [s, n] of e)
|
|
3438
3447
|
t[s] = n;
|
|
3439
3448
|
return t;
|
|
3440
|
-
},
|
|
3441
|
-
function
|
|
3449
|
+
}, $i = /* @__PURE__ */ Xe(Wi, [["__scopeId", "data-v-5ad9c842"]]);
|
|
3450
|
+
function Ji(r) {
|
|
3442
3451
|
const e = G(/* @__PURE__ */ new Set()), t = (n) => {
|
|
3443
3452
|
const i = new Set(e.value);
|
|
3444
3453
|
i.has(n) ? i.delete(n) : i.add(n), e.value = i;
|
|
@@ -3450,7 +3459,7 @@ function $i(r) {
|
|
|
3450
3459
|
i.add(o.uuid), o = o.parent;
|
|
3451
3460
|
e.value = i;
|
|
3452
3461
|
};
|
|
3453
|
-
return
|
|
3462
|
+
return on(
|
|
3454
3463
|
r,
|
|
3455
3464
|
(n) => {
|
|
3456
3465
|
n && s(n);
|
|
@@ -3458,28 +3467,28 @@ function $i(r) {
|
|
|
3458
3467
|
{ immediate: !0 }
|
|
3459
3468
|
), { expandedSet: e, toggleExpand: t };
|
|
3460
3469
|
}
|
|
3461
|
-
const
|
|
3470
|
+
const eo = {
|
|
3462
3471
|
key: 0,
|
|
3463
3472
|
class: "property-panel"
|
|
3464
|
-
},
|
|
3473
|
+
}, to = { class: "property-group tree-group" }, no = { class: "tree-container" }, so = {
|
|
3465
3474
|
key: 0,
|
|
3466
3475
|
class: "tree-empty"
|
|
3467
|
-
},
|
|
3476
|
+
}, io = {
|
|
3468
3477
|
key: 0,
|
|
3469
3478
|
class: "tabs"
|
|
3470
|
-
},
|
|
3479
|
+
}, oo = {
|
|
3471
3480
|
key: 1,
|
|
3472
3481
|
class: "tab-content"
|
|
3473
|
-
},
|
|
3482
|
+
}, ro = { class: "property-group" }, ao = { class: "row" }, lo = { class: "property-group" }, co = { class: "row" }, ho = { class: "property-group" }, uo = { class: "row" }, po = {
|
|
3474
3483
|
key: 0,
|
|
3475
3484
|
class: "property-group material-group"
|
|
3476
|
-
},
|
|
3485
|
+
}, fo = { class: "slider-row" }, mo = { class: "slider-value" }, go = { class: "slider-row" }, yo = { class: "slider-value" }, _o = { class: "slider-row" }, bo = { class: "slider-value" }, wo = {
|
|
3477
3486
|
key: 0,
|
|
3478
3487
|
class: "material-hint"
|
|
3479
|
-
},
|
|
3488
|
+
}, To = {
|
|
3480
3489
|
key: 1,
|
|
3481
3490
|
class: "property-panel empty"
|
|
3482
|
-
},
|
|
3491
|
+
}, xo = /* @__PURE__ */ Ge({
|
|
3483
3492
|
__name: "PropertyPanel",
|
|
3484
3493
|
props: {
|
|
3485
3494
|
transform: {},
|
|
@@ -3488,11 +3497,11 @@ const Ji = {
|
|
|
3488
3497
|
},
|
|
3489
3498
|
emits: ["propertyChange", "treeSelect", "treeDelete"],
|
|
3490
3499
|
setup(r, { emit: e }) {
|
|
3491
|
-
const t = r, s = e, n = () => s("propertyChange"), i = G("transform"), o = G(0), a =
|
|
3492
|
-
|
|
3500
|
+
const t = r, s = e, n = () => s("propertyChange"), i = G("transform"), o = G(0), a = Sn(t, "selectedObject"), { expandedSet: l, toggleExpand: h } = Ji(a);
|
|
3501
|
+
An("treeExpand", { expandedSet: l, toggleExpand: h });
|
|
3493
3502
|
const u = (y) => {
|
|
3494
3503
|
o.value++, s("treeDelete", y);
|
|
3495
|
-
}, c =
|
|
3504
|
+
}, c = rn({
|
|
3496
3505
|
metalness: 0,
|
|
3497
3506
|
roughness: 0.5,
|
|
3498
3507
|
opacity: 1
|
|
@@ -3535,7 +3544,7 @@ const Ji = {
|
|
|
3535
3544
|
p.value = y;
|
|
3536
3545
|
}
|
|
3537
3546
|
}
|
|
3538
|
-
return
|
|
3547
|
+
return on(
|
|
3539
3548
|
() => t.selectedObject,
|
|
3540
3549
|
(y) => {
|
|
3541
3550
|
if (y) {
|
|
@@ -3545,12 +3554,12 @@ const Ji = {
|
|
|
3545
3554
|
c.metalness = 0, c.roughness = 0.5, c.opacity = 1, p.value = !1;
|
|
3546
3555
|
},
|
|
3547
3556
|
{ immediate: !0 }
|
|
3548
|
-
), (y, d) => r.transform ? (N(), U("div",
|
|
3557
|
+
), (y, d) => r.transform ? (N(), U("div", eo, [
|
|
3549
3558
|
d[32] || (d[32] = g("h3", null, "属性面板", -1)),
|
|
3550
|
-
g("div",
|
|
3559
|
+
g("div", to, [
|
|
3551
3560
|
d[15] || (d[15] = g("label", null, "场景物体", -1)),
|
|
3552
|
-
g("div",
|
|
3553
|
-
(N(!0), U(
|
|
3561
|
+
g("div", no, [
|
|
3562
|
+
(N(!0), U(nn, null, sn(r.treeData, (_) => (N(), ot($i, {
|
|
3554
3563
|
key: _.uuid,
|
|
3555
3564
|
node: _,
|
|
3556
3565
|
"selected-object": r.selectedObject,
|
|
@@ -3558,14 +3567,14 @@ const Ji = {
|
|
|
3558
3567
|
onSelect: d[0] || (d[0] = (x) => s("treeSelect", x)),
|
|
3559
3568
|
onDelete: u
|
|
3560
3569
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
3561
|
-
r.treeData.length === 0 ? (N(), U("div",
|
|
3570
|
+
r.treeData.length === 0 ? (N(), U("div", so, "暂无物体")) : de("", !0)
|
|
3562
3571
|
])
|
|
3563
3572
|
]),
|
|
3564
3573
|
d[33] || (d[33] = g("div", { class: "property-group" }, [
|
|
3565
3574
|
g("label", null, "全局属性"),
|
|
3566
3575
|
g("div", { class: "row" })
|
|
3567
3576
|
], -1)),
|
|
3568
|
-
r.selectedObject ? (N(), U("div",
|
|
3577
|
+
r.selectedObject ? (N(), U("div", io, [
|
|
3569
3578
|
g("button", {
|
|
3570
3579
|
class: He(["tab-btn", { active: i.value === "transform" }]),
|
|
3571
3580
|
onClick: d[1] || (d[1] = (_) => i.value = "transform")
|
|
@@ -3575,11 +3584,11 @@ const Ji = {
|
|
|
3575
3584
|
onClick: d[2] || (d[2] = (_) => i.value = "info")
|
|
3576
3585
|
}, " ℹ️ 信息 ", 2)
|
|
3577
3586
|
])) : de("", !0),
|
|
3578
|
-
r.selectedObject ? (N(), U("div",
|
|
3587
|
+
r.selectedObject ? (N(), U("div", oo, [
|
|
3579
3588
|
D(g("div", null, [
|
|
3580
|
-
g("div",
|
|
3589
|
+
g("div", ro, [
|
|
3581
3590
|
d[19] || (d[19] = g("label", null, "位置", -1)),
|
|
3582
|
-
g("div",
|
|
3591
|
+
g("div", ao, [
|
|
3583
3592
|
d[16] || (d[16] = g("span", null, "X:", -1)),
|
|
3584
3593
|
D(g("input", {
|
|
3585
3594
|
type: "number",
|
|
@@ -3624,9 +3633,9 @@ const Ji = {
|
|
|
3624
3633
|
])
|
|
3625
3634
|
])
|
|
3626
3635
|
]),
|
|
3627
|
-
g("div",
|
|
3636
|
+
g("div", lo, [
|
|
3628
3637
|
d[23] || (d[23] = g("label", null, "旋转 (弧度)", -1)),
|
|
3629
|
-
g("div",
|
|
3638
|
+
g("div", co, [
|
|
3630
3639
|
d[20] || (d[20] = g("span", null, "X:", -1)),
|
|
3631
3640
|
D(g("input", {
|
|
3632
3641
|
type: "number",
|
|
@@ -3671,9 +3680,9 @@ const Ji = {
|
|
|
3671
3680
|
])
|
|
3672
3681
|
])
|
|
3673
3682
|
]),
|
|
3674
|
-
g("div",
|
|
3683
|
+
g("div", ho, [
|
|
3675
3684
|
d[27] || (d[27] = g("label", null, "缩放", -1)),
|
|
3676
|
-
g("div",
|
|
3685
|
+
g("div", uo, [
|
|
3677
3686
|
d[24] || (d[24] = g("span", null, "X:", -1)),
|
|
3678
3687
|
D(g("input", {
|
|
3679
3688
|
type: "number",
|
|
@@ -3718,9 +3727,9 @@ const Ji = {
|
|
|
3718
3727
|
])
|
|
3719
3728
|
])
|
|
3720
3729
|
]),
|
|
3721
|
-
r.selectedObject ? (N(), U("div",
|
|
3730
|
+
r.selectedObject ? (N(), U("div", po, [
|
|
3722
3731
|
d[31] || (d[31] = g("label", null, "材质", -1)),
|
|
3723
|
-
g("div",
|
|
3732
|
+
g("div", fo, [
|
|
3724
3733
|
d[28] || (d[28] = g("span", { class: "slider-label" }, "金属度", -1)),
|
|
3725
3734
|
D(g("input", {
|
|
3726
3735
|
type: "range",
|
|
@@ -3737,9 +3746,9 @@ const Ji = {
|
|
|
3737
3746
|
{ number: !0 }
|
|
3738
3747
|
]
|
|
3739
3748
|
]),
|
|
3740
|
-
g("span",
|
|
3749
|
+
g("span", mo, Ee(c.metalness.toFixed(2)), 1)
|
|
3741
3750
|
]),
|
|
3742
|
-
g("div",
|
|
3751
|
+
g("div", go, [
|
|
3743
3752
|
d[29] || (d[29] = g("span", { class: "slider-label" }, "粗糙度", -1)),
|
|
3744
3753
|
D(g("input", {
|
|
3745
3754
|
type: "range",
|
|
@@ -3756,9 +3765,9 @@ const Ji = {
|
|
|
3756
3765
|
{ number: !0 }
|
|
3757
3766
|
]
|
|
3758
3767
|
]),
|
|
3759
|
-
g("span",
|
|
3768
|
+
g("span", yo, Ee(c.roughness.toFixed(2)), 1)
|
|
3760
3769
|
]),
|
|
3761
|
-
g("div",
|
|
3770
|
+
g("div", _o, [
|
|
3762
3771
|
d[30] || (d[30] = g("span", { class: "slider-label" }, "透明度", -1)),
|
|
3763
3772
|
D(g("input", {
|
|
3764
3773
|
type: "range",
|
|
@@ -3775,19 +3784,19 @@ const Ji = {
|
|
|
3775
3784
|
{ number: !0 }
|
|
3776
3785
|
]
|
|
3777
3786
|
]),
|
|
3778
|
-
g("span",
|
|
3787
|
+
g("span", bo, Ee(c.opacity.toFixed(2)), 1)
|
|
3779
3788
|
]),
|
|
3780
|
-
p.value ? de("", !0) : (N(), U("div",
|
|
3789
|
+
p.value ? de("", !0) : (N(), U("div", wo, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
|
|
3781
3790
|
])) : de("", !0)
|
|
3782
3791
|
], 512), [
|
|
3783
3792
|
[he, i.value === "transform"]
|
|
3784
3793
|
])
|
|
3785
3794
|
])) : de("", !0)
|
|
3786
|
-
])) : (N(), U("div",
|
|
3795
|
+
])) : (N(), U("div", To, [...d[34] || (d[34] = [
|
|
3787
3796
|
g("p", null, "未选中任何模型", -1)
|
|
3788
3797
|
])]));
|
|
3789
3798
|
}
|
|
3790
|
-
}),
|
|
3799
|
+
}), Eo = /* @__PURE__ */ Xe(xo, [["__scopeId", "data-v-d75c643f"]]), Mo = { class: "top-bar" }, vo = { class: "left-section" }, So = { class: "dropdown-menu" }, Ao = { class: "dropdown-menu sub-menu" }, Ro = { class: "dropdown-menu" }, Po = { class: "dropdown-menu sub-menu" }, Lo = { class: "dropdown-menu" }, Io = { class: "dropdown-menu" }, Oo = { class: "dropdown-menu" }, Co = /* @__PURE__ */ Ge({
|
|
3791
3800
|
__name: "TopBar",
|
|
3792
3801
|
emits: ["addModel", "importModel"],
|
|
3793
3802
|
setup(r, { emit: e }) {
|
|
@@ -3798,15 +3807,15 @@ const Ji = {
|
|
|
3798
3807
|
const E = $.target;
|
|
3799
3808
|
E.files && E.files.length > 0 && (h("importModel", E.files[0]), E.value = "");
|
|
3800
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("打开场景");
|
|
3801
|
-
return ($, E) => (N(), U("div",
|
|
3802
|
-
g("div",
|
|
3810
|
+
return ($, E) => (N(), U("div", Mo, [
|
|
3811
|
+
g("div", vo, [
|
|
3803
3812
|
g("div", {
|
|
3804
3813
|
class: "dropdown-wrapper",
|
|
3805
3814
|
onMouseenter: E[2] || (E[2] = (j) => t.value = !0),
|
|
3806
3815
|
onMouseleave: E[3] || (E[3] = (j) => t.value = !1)
|
|
3807
3816
|
}, [
|
|
3808
3817
|
E[17] || (E[17] = g("button", { class: "menu-btn" }, "文件", -1)),
|
|
3809
|
-
D(g("div",
|
|
3818
|
+
D(g("div", So, [
|
|
3810
3819
|
g("div", {
|
|
3811
3820
|
class: "menu-item",
|
|
3812
3821
|
onClick: m
|
|
@@ -3817,7 +3826,7 @@ const Ji = {
|
|
|
3817
3826
|
onMouseleave: E[1] || (E[1] = (j) => a.value = !1)
|
|
3818
3827
|
}, [
|
|
3819
3828
|
E[16] || (E[16] = g("span", null, "打开", -1)),
|
|
3820
|
-
D(g("div",
|
|
3829
|
+
D(g("div", Ao, [
|
|
3821
3830
|
g("div", {
|
|
3822
3831
|
class: "menu-item",
|
|
3823
3832
|
onClick: ie
|
|
@@ -3852,7 +3861,7 @@ const Ji = {
|
|
|
3852
3861
|
onMouseleave: E[9] || (E[9] = (j) => o.value = !1)
|
|
3853
3862
|
}, [
|
|
3854
3863
|
E[19] || (E[19] = g("button", { class: "menu-btn" }, "添加", -1)),
|
|
3855
|
-
D(g("div",
|
|
3864
|
+
D(g("div", Ro, [
|
|
3856
3865
|
g("div", {
|
|
3857
3866
|
class: "menu-item",
|
|
3858
3867
|
onClick: y
|
|
@@ -3863,7 +3872,7 @@ const Ji = {
|
|
|
3863
3872
|
onMouseleave: E[7] || (E[7] = (j) => l.value = !1)
|
|
3864
3873
|
}, [
|
|
3865
3874
|
E[18] || (E[18] = g("span", null, "网格", -1)),
|
|
3866
|
-
D(g("div",
|
|
3875
|
+
D(g("div", Po, [
|
|
3867
3876
|
g("div", {
|
|
3868
3877
|
class: "menu-item",
|
|
3869
3878
|
onClick: E[4] || (E[4] = (j) => h("addModel", "box"))
|
|
@@ -3898,7 +3907,7 @@ const Ji = {
|
|
|
3898
3907
|
onMouseleave: E[11] || (E[11] = (j) => s.value = !1)
|
|
3899
3908
|
}, [
|
|
3900
3909
|
E[20] || (E[20] = g("button", { class: "menu-btn" }, "编辑", -1)),
|
|
3901
|
-
D(g("div",
|
|
3910
|
+
D(g("div", Lo, [
|
|
3902
3911
|
g("div", {
|
|
3903
3912
|
class: "menu-item",
|
|
3904
3913
|
onClick: y
|
|
@@ -3925,7 +3934,7 @@ const Ji = {
|
|
|
3925
3934
|
onMouseleave: E[13] || (E[13] = (j) => n.value = !1)
|
|
3926
3935
|
}, [
|
|
3927
3936
|
E[21] || (E[21] = g("button", { class: "menu-btn" }, "视图", -1)),
|
|
3928
|
-
D(g("div",
|
|
3937
|
+
D(g("div", Io, [
|
|
3929
3938
|
g("div", {
|
|
3930
3939
|
class: "menu-item",
|
|
3931
3940
|
onClick: S
|
|
@@ -3944,7 +3953,7 @@ const Ji = {
|
|
|
3944
3953
|
onMouseleave: E[15] || (E[15] = (j) => i.value = !1)
|
|
3945
3954
|
}, [
|
|
3946
3955
|
E[22] || (E[22] = g("button", { class: "menu-btn" }, "帮助", -1)),
|
|
3947
|
-
D(g("div",
|
|
3956
|
+
D(g("div", Oo, [
|
|
3948
3957
|
g("div", {
|
|
3949
3958
|
class: "menu-item",
|
|
3950
3959
|
onClick: v
|
|
@@ -3971,10 +3980,10 @@ const Ji = {
|
|
|
3971
3980
|
}, null, 544)
|
|
3972
3981
|
]));
|
|
3973
3982
|
}
|
|
3974
|
-
}),
|
|
3983
|
+
}), Do = /* @__PURE__ */ Xe(Co, [["__scopeId", "data-v-6bb4762f"]]), No = { class: "bottom-bar" }, ko = /* @__PURE__ */ Ge({
|
|
3975
3984
|
__name: "BottomBar",
|
|
3976
3985
|
setup(r) {
|
|
3977
|
-
return (e, t) => (N(), U("div",
|
|
3986
|
+
return (e, t) => (N(), U("div", No, [...t[0] || (t[0] = [
|
|
3978
3987
|
g("div", { class: "status-left" }, [
|
|
3979
3988
|
g("span", null, "就绪")
|
|
3980
3989
|
], -1),
|
|
@@ -3983,14 +3992,14 @@ const Ji = {
|
|
|
3983
3992
|
], -1)
|
|
3984
3993
|
])]));
|
|
3985
3994
|
}
|
|
3986
|
-
}),
|
|
3995
|
+
}), jo = /* @__PURE__ */ Xe(ko, [["__scopeId", "data-v-3427bb27"]]), Fo = { class: "app-layout" }, Ho = /* @__PURE__ */ Ge({
|
|
3987
3996
|
__name: "DrawingBoard",
|
|
3988
3997
|
props: {
|
|
3989
3998
|
mode: { default: "edit" },
|
|
3990
3999
|
sceneData: { default: null }
|
|
3991
4000
|
},
|
|
3992
4001
|
setup(r) {
|
|
3993
|
-
const e = r, t = G(null), s =
|
|
4002
|
+
const e = r, t = G(null), s = rn({
|
|
3994
4003
|
position: { x: 0, y: 0, z: 0 },
|
|
3995
4004
|
rotation: { x: 0, y: 0, z: 0 },
|
|
3996
4005
|
scale: { x: 1, y: 1, z: 1 }
|
|
@@ -4007,31 +4016,31 @@ const Ji = {
|
|
|
4007
4016
|
s.rotation.z
|
|
4008
4017
|
), f.scale.set(s.scale.x, s.scale.y, s.scale.z);
|
|
4009
4018
|
};
|
|
4010
|
-
|
|
4019
|
+
Ws((f) => {
|
|
4011
4020
|
t.value = f, f && n(f);
|
|
4012
|
-
}),
|
|
4021
|
+
}), $s((f) => {
|
|
4013
4022
|
n(f);
|
|
4014
4023
|
});
|
|
4015
4024
|
const o = () => {
|
|
4016
4025
|
t.value && i(t.value);
|
|
4017
|
-
}, a = (f) =>
|
|
4026
|
+
}, a = (f) => Ki(f), l = async (f) => {
|
|
4018
4027
|
try {
|
|
4019
|
-
await
|
|
4028
|
+
await Bi(f);
|
|
4020
4029
|
} catch (y) {
|
|
4021
4030
|
console.error("导入失败:", y), alert("导入失败:" + y.message);
|
|
4022
4031
|
}
|
|
4023
|
-
}, h =
|
|
4024
|
-
|
|
4032
|
+
}, h = Rn([]);
|
|
4033
|
+
Js((f) => {
|
|
4025
4034
|
h.value = f;
|
|
4026
4035
|
});
|
|
4027
4036
|
const u = () => {
|
|
4028
|
-
const f =
|
|
4037
|
+
const f = ei();
|
|
4029
4038
|
f && (h.value = f);
|
|
4030
|
-
}, c = (f) =>
|
|
4031
|
-
return
|
|
4032
|
-
m.value &&
|
|
4033
|
-
}), (f, y) => (N(), U("div",
|
|
4034
|
-
r.mode === "edit" ? (N(), ot(
|
|
4039
|
+
}, c = (f) => vt(f), p = (f) => Vs(f.uuid), m = G(null);
|
|
4040
|
+
return Pn(() => {
|
|
4041
|
+
m.value && ks(m.value, e.mode, e.sceneData), u();
|
|
4042
|
+
}), (f, y) => (N(), U("div", Fo, [
|
|
4043
|
+
r.mode === "edit" ? (N(), ot(Do, {
|
|
4035
4044
|
key: 0,
|
|
4036
4045
|
onAddModel: a,
|
|
4037
4046
|
onImportModel: l
|
|
@@ -4044,7 +4053,7 @@ const Ji = {
|
|
|
4044
4053
|
ref_key: "containerRef",
|
|
4045
4054
|
ref: m
|
|
4046
4055
|
}, null, 2),
|
|
4047
|
-
r.mode === "edit" ? (N(), ot(
|
|
4056
|
+
r.mode === "edit" ? (N(), ot(Eo, {
|
|
4048
4057
|
key: 0,
|
|
4049
4058
|
transform: s,
|
|
4050
4059
|
"tree-data": h.value,
|
|
@@ -4054,34 +4063,34 @@ const Ji = {
|
|
|
4054
4063
|
onTreeDelete: p
|
|
4055
4064
|
}, null, 8, ["transform", "tree-data", "selected-object"])) : de("", !0)
|
|
4056
4065
|
], 2),
|
|
4057
|
-
|
|
4066
|
+
Ln(jo)
|
|
4058
4067
|
]));
|
|
4059
4068
|
}
|
|
4060
|
-
}),
|
|
4069
|
+
}), Vo = /* @__PURE__ */ Xe(Ho, [["__scopeId", "data-v-0efddd2c"]]);
|
|
4061
4070
|
export {
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4071
|
+
jo as BottomBar,
|
|
4072
|
+
Vo as DrawingBoard,
|
|
4073
|
+
Eo as PropertyPanel,
|
|
4074
|
+
Do as TopBar,
|
|
4075
|
+
$i as TreeItem,
|
|
4076
|
+
Xi as addBox,
|
|
4077
|
+
At as addModel,
|
|
4078
|
+
Ki as addModelByType,
|
|
4079
|
+
Yi as addSphere,
|
|
4080
|
+
Ko as exportSceneToJSON,
|
|
4081
|
+
Yo as getCamera,
|
|
4082
|
+
Bo as getRenderer,
|
|
4083
|
+
Xo as getScene,
|
|
4084
|
+
ei as getSceneObjects,
|
|
4085
|
+
Bi as importModelFromFile,
|
|
4086
|
+
ks as initEditor,
|
|
4087
|
+
ti as loadSceneFromJSON,
|
|
4088
|
+
Js as onSceneObjectsChangeCallback,
|
|
4089
|
+
Ks as removeModel,
|
|
4090
|
+
Vs as removeModelById,
|
|
4091
|
+
vt as selectObject,
|
|
4092
|
+
Ws as setSelectedObjectCallback,
|
|
4093
|
+
$s as setTransformChangeCallback,
|
|
4094
|
+
Ji as useTreeExpand
|
|
4086
4095
|
};
|
|
4087
4096
|
//# sourceMappingURL=three-editor.es.js.map
|