endset_three_editor 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/three-editor.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Xe, ref as G, inject as xn, computed as Qe, watchEffect as En, resolveComponent as Mn, openBlock as C, createElementBlock as U, createElementVNode as g, normalizeClass as Ue, withModifiers as Lt, unref as vn, toDisplayString as Ee, Fragment as nn, renderList as sn, createBlock as ke, createCommentVNode as ae, watch as on, toRef as Sn, provide as An, reactive as rn, withDirectives as N, vModelText as Q, vShow as ue, shallowRef as Rn, onMounted as Pn } from "vue";
|
|
2
2
|
import * as F from "three";
|
|
3
|
-
import { Controls as
|
|
3
|
+
import { Controls as an, Vector3 as M, MOUSE as Me, TOUCH as xe, Quaternion as K, Spherical as It, Vector2 as V, Ray as Ln, Plane as In, MathUtils as ln, Raycaster as On, Object3D as ze, MeshBasicMaterial as _e, LineBasicMaterial as je, CylinderGeometry as Y, BoxGeometry as z, BufferGeometry as Ge, Float32BufferAttribute as de, Mesh as T, OctahedronGeometry as qe, Line as re, TorusGeometry as Pe, SphereGeometry as Cn, Euler as Dn, Matrix4 as Se, PlaneGeometry as Nn, DoubleSide as cn, Loader as hn, FileLoader as Et, Color as pe, SRGBColorSpace as Ae, Group as nt, Material as Fe, PointsMaterial as Ce, MeshPhongMaterial as kn, LineSegments as gt, Points as st, TrianglesDrawMode as jn, TriangleFanDrawMode as yt, TriangleStripDrawMode as un, LoaderUtils as He, MeshPhysicalMaterial as se, LinearSRGBColorSpace as le, SpotLight as Fn, PointLight as Hn, DirectionalLight as Un, InstancedMesh as zn, InstancedBufferAttribute as Gn, TextureLoader as Xn, ImageBitmapLoader as Yn, BufferAttribute as rt, InterleavedBuffer as Bn, InterleavedBufferAttribute as Kn, LinearMipmapLinearFilter as dn, NearestMipmapLinearFilter as Vn, LinearMipmapNearestFilter as Zn, NearestMipmapNearestFilter as Qn, LinearFilter as _t, NearestFilter as pn, RepeatWrapping as bt, MirroredRepeatWrapping as qn, ClampToEdgeWrapping as Wn, MeshStandardMaterial as fn, PropertyBinding as $n, SkinnedMesh as Jn, LineLoop as es, PerspectiveCamera as ts, OrthographicCamera as ns, Skeleton as ss, AnimationClip as is, Bone as os, InterpolateDiscrete as rs, InterpolateLinear as mn, Texture as Ot, VectorKeyframeTrack as Ct, NumberKeyframeTrack as Dt, QuaternionKeyframeTrack as Nt, ColorManagement as kt, FrontSide as as, Interpolant as ls, Box3 as cs, Sphere as hs } from "three";
|
|
4
4
|
import us from "@tweenjs/tween.js";
|
|
5
|
-
const
|
|
5
|
+
const jt = { type: "change" }, Mt = { type: "start" }, gn = { type: "end" }, We = new Ln(), Ft = new In(), ds = Math.cos(70 * ln.DEG2RAD), k = new M(), B = 2 * Math.PI, P = {
|
|
6
6
|
NONE: -1,
|
|
7
7
|
ROTATE: 0,
|
|
8
8
|
DOLLY: 1,
|
|
@@ -12,7 +12,7 @@ const 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 ps extends
|
|
15
|
+
class ps 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 = ms.bind(this), this._onPointerDown = fs.bind(this), this._onPointerUp = gs.bind(this), this._onContextMenu = Es.bind(this), this._onMouseWheel = bs.bind(this), this._onKeyDown = ws.bind(this), this._onTouchStart = Ts.bind(this), this._onTouchMove = xs.bind(this), this._onMouseDown = ys.bind(this), this._onMouseMove = _s.bind(this), this._interceptControlDown = Ms.bind(this), this._interceptControlUp = vs.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Defines the visual representation of the cursor.
|
|
@@ -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) : (
|
|
167
|
+
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (We.origin.copy(this.object.position), We.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(We.direction)) < ds ? this.object.lookAt(this.target) : (Ft.setFromNormalAndCoplanarPoint(this.object.up, this.target), We.intersectPlane(Ft, this.target))));
|
|
168
168
|
} else if (this.object.isOrthographicCamera) {
|
|
169
169
|
const o = this.object.zoom;
|
|
170
170
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), o !== this.object.zoom && (this.object.updateProjectionMatrix(), i = !0);
|
|
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;
|
|
@@ -370,7 +370,7 @@ function ms(r) {
|
|
|
370
370
|
function gs(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];
|
|
@@ -419,7 +419,7 @@ 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
424
|
function _s(r) {
|
|
425
425
|
switch (this.state) {
|
|
@@ -438,7 +438,7 @@ function _s(r) {
|
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
function bs(r) {
|
|
441
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== P.NONE || (r.preventDefault(), this.dispatchEvent(
|
|
441
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== P.NONE || (r.preventDefault(), this.dispatchEvent(Mt), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(gn));
|
|
442
442
|
}
|
|
443
443
|
function ws(r) {
|
|
444
444
|
this.enabled !== !1 && this._handleKeyDown(r);
|
|
@@ -476,7 +476,7 @@ 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
481
|
function xs(r) {
|
|
482
482
|
switch (this._trackPointer(r), this.state) {
|
|
@@ -509,12 +509,12 @@ function Ms(r) {
|
|
|
509
509
|
function vs(r) {
|
|
510
510
|
r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
511
511
|
}
|
|
512
|
-
const me = new On(), H = new M(),
|
|
512
|
+
const me = new On(), H = new M(), ce = new M(), O = new K(), Ht = {
|
|
513
513
|
X: new M(1, 0, 0),
|
|
514
514
|
Y: new M(0, 1, 0),
|
|
515
515
|
Z: new M(0, 0, 1)
|
|
516
|
-
}, lt = { type: "change" },
|
|
517
|
-
class Ss extends
|
|
516
|
+
}, lt = { type: "change" }, Ut = { type: "mouseDown", mode: null }, zt = { type: "mouseUp", mode: null }, Gt = { type: "objectChange" };
|
|
517
|
+
class Ss extends an {
|
|
518
518
|
/**
|
|
519
519
|
* Constructs a new controls instance.
|
|
520
520
|
*
|
|
@@ -531,19 +531,19 @@ class Ss extends on {
|
|
|
531
531
|
this._plane = i, s.add(i);
|
|
532
532
|
const o = this;
|
|
533
533
|
function a(x, S) {
|
|
534
|
-
let
|
|
534
|
+
let R = S;
|
|
535
535
|
Object.defineProperty(o, x, {
|
|
536
536
|
get: function() {
|
|
537
|
-
return
|
|
537
|
+
return R !== void 0 ? R : S;
|
|
538
538
|
},
|
|
539
539
|
set: function(v) {
|
|
540
|
-
|
|
540
|
+
R !== v && (R = v, i[x] = v, n[x] = v, o.dispatchEvent({ type: x + "-changed", value: v }), o.dispatchEvent(lt));
|
|
541
541
|
}
|
|
542
542
|
}), o[x] = S, i[x] = S, n[x] = S;
|
|
543
543
|
}
|
|
544
544
|
a("camera", e), a("object", void 0), a("enabled", !0), a("axis", null), a("mode", "translate"), a("translationSnap", null), a("rotationSnap", null), a("scaleSnap", null), a("space", "world"), a("size", 1), a("dragging", !1), a("showX", !0), a("showY", !0), a("showZ", !0), a("showXY", !0), a("showYZ", !0), a("showXZ", !0), a("minX", -1 / 0), a("maxX", 1 / 0), a("minY", -1 / 0), a("maxY", 1 / 0), a("minZ", -1 / 0), a("maxZ", 1 / 0);
|
|
545
545
|
const l = new M(), h = new M(), u = new K(), c = new K(), p = new M(), m = new K(), b = new M(), f = new M(), y = new M(), d = 0, _ = new M();
|
|
546
|
-
a("worldPosition", l), a("worldPositionStart", h), a("worldQuaternion", u), a("worldQuaternionStart", c), a("cameraPosition", p), a("cameraQuaternion", m), a("pointStart", b), a("pointEnd", f), a("rotationAxis", y), a("rotationAngle", d), a("eye", _), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer =
|
|
546
|
+
a("worldPosition", l), a("worldPositionStart", h), a("worldQuaternion", u), a("worldQuaternionStart", c), a("cameraPosition", p), a("cameraQuaternion", m), a("pointStart", b), a("pointEnd", f), a("rotationAxis", y), a("rotationAngle", d), a("eye", _), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer = As.bind(this), this._onPointerDown = Ps.bind(this), this._onPointerHover = Rs.bind(this), this._onPointerMove = Ls.bind(this), this._onPointerUp = Is.bind(this), t !== null && this.connect(t);
|
|
547
547
|
}
|
|
548
548
|
connect(e) {
|
|
549
549
|
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
|
|
@@ -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) {
|
|
@@ -585,21 +585,21 @@ class Ss extends on {
|
|
|
585
585
|
else if (s === "scale") {
|
|
586
586
|
if (t.search("XYZ") !== -1) {
|
|
587
587
|
let a = this.pointEnd.length() / this.pointStart.length();
|
|
588
|
-
this.pointEnd.dot(this.pointStart) < 0 && (a *= -1),
|
|
588
|
+
this.pointEnd.dot(this.pointStart) < 0 && (a *= -1), ce.set(a, a, a);
|
|
589
589
|
} else
|
|
590
|
-
H.copy(this.pointStart),
|
|
591
|
-
n.scale.copy(this._scaleStart).multiply(
|
|
590
|
+
H.copy(this.pointStart), ce.copy(this.pointEnd), H.applyQuaternion(this._worldQuaternionInv), ce.applyQuaternion(this._worldQuaternionInv), ce.divide(H), t.search("X") === -1 && (ce.x = 1), t.search("Y") === -1 && (ce.y = 1), t.search("Z") === -1 && (ce.z = 1);
|
|
591
|
+
n.scale.copy(this._scaleStart).multiply(ce), this.scaleSnap && (t.search("X") !== -1 && (n.scale.x = Math.round(n.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (n.scale.y = Math.round(n.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (n.scale.z = Math.round(n.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
|
|
592
592
|
} else if (s === "rotate") {
|
|
593
593
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
|
594
594
|
const a = 20 / this.worldPosition.distanceTo(H.setFromMatrixPosition(this.camera.matrixWorld));
|
|
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 As(r) {
|
|
709
709
|
if (this.domElement.ownerDocument.pointerLockElement)
|
|
710
710
|
return {
|
|
711
711
|
x: 0,
|
|
@@ -721,7 +721,7 @@ function Rs(r) {
|
|
|
721
721
|
};
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function Rs(r) {
|
|
725
725
|
if (this.enabled)
|
|
726
726
|
switch (r.pointerType) {
|
|
727
727
|
case "mouse":
|
|
@@ -746,8 +746,8 @@ function ct(r, e, t) {
|
|
|
746
746
|
return s[n];
|
|
747
747
|
return !1;
|
|
748
748
|
}
|
|
749
|
-
const
|
|
750
|
-
class Os extends
|
|
749
|
+
const $e = new Dn(), L = new M(0, 1, 0), Xt = new M(0, 0, 0), Yt = new Se(), Je = new K(), it = new K(), te = new M(), Bt = new Se(), De = new M(1, 0, 0), ye = new M(0, 1, 0), Ne = new M(0, 0, 1), et = new M(), Le = new M(), Ie = new M();
|
|
750
|
+
class Os extends ze {
|
|
751
751
|
constructor(e) {
|
|
752
752
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
753
753
|
}
|
|
@@ -762,7 +762,7 @@ class Os extends Ue {
|
|
|
762
762
|
});
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
|
-
class Cs extends
|
|
765
|
+
class Cs extends ze {
|
|
766
766
|
constructor() {
|
|
767
767
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
|
768
768
|
const e = new _e({
|
|
@@ -771,7 +771,7 @@ class Cs extends Ue {
|
|
|
771
771
|
fog: !1,
|
|
772
772
|
toneMapped: !1,
|
|
773
773
|
transparent: !0
|
|
774
|
-
}), t = new
|
|
774
|
+
}), t = new je({
|
|
775
775
|
depthTest: !1,
|
|
776
776
|
depthWrite: !1,
|
|
777
777
|
fog: !1,
|
|
@@ -814,19 +814,19 @@ class Cs extends Ue {
|
|
|
814
814
|
f.translate(0, 0.05, 0);
|
|
815
815
|
const y = new z(0.08, 0.08, 0.08);
|
|
816
816
|
y.translate(0, 0.04, 0);
|
|
817
|
-
const d = new
|
|
818
|
-
d.setAttribute("position", new
|
|
817
|
+
const d = new Ge();
|
|
818
|
+
d.setAttribute("position", new de([0, 0, 0, 1, 0, 0], 3));
|
|
819
819
|
const _ = new Y(75e-4, 75e-4, 0.5, 3);
|
|
820
820
|
_.translate(0, 0.25, 0);
|
|
821
|
-
function x(Z,
|
|
822
|
-
const J = new Pe(Z, 75e-4, 3, 64,
|
|
821
|
+
function x(Z, Be) {
|
|
822
|
+
const J = new Pe(Z, 75e-4, 3, 64, Be * Math.PI * 2);
|
|
823
823
|
return J.rotateY(Math.PI / 2), J.rotateX(Math.PI / 2), J;
|
|
824
824
|
}
|
|
825
825
|
function S() {
|
|
826
|
-
const Z = new
|
|
827
|
-
return Z.setAttribute("position", new
|
|
826
|
+
const Z = new Ge();
|
|
827
|
+
return Z.setAttribute("position", new de([0, 0, 0, 1, 1, 1], 3)), Z;
|
|
828
828
|
}
|
|
829
|
-
const
|
|
829
|
+
const R = {
|
|
830
830
|
X: [
|
|
831
831
|
[new T(f, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
832
832
|
[new T(f, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
@@ -843,7 +843,7 @@ class Cs extends Ue {
|
|
|
843
843
|
[new T(_, a), null, [Math.PI / 2, 0, 0]]
|
|
844
844
|
],
|
|
845
845
|
XYZ: [
|
|
846
|
-
[new T(new
|
|
846
|
+
[new T(new qe(0.1, 0), c), [0, 0, 0]]
|
|
847
847
|
],
|
|
848
848
|
XY: [
|
|
849
849
|
[new T(new z(0.15, 0.15, 0.01), u), [0.15, 0.15, 0]]
|
|
@@ -868,7 +868,7 @@ class Cs extends Ue {
|
|
|
868
868
|
[new T(new Y(0.2, 0, 0.6, 4), s), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
|
869
869
|
],
|
|
870
870
|
XYZ: [
|
|
871
|
-
[new T(new
|
|
871
|
+
[new T(new qe(0.2, 0), s)]
|
|
872
872
|
],
|
|
873
873
|
XY: [
|
|
874
874
|
[new T(new z(0.2, 0.2, 0.01), s), [0.15, 0.15, 0]]
|
|
@@ -881,10 +881,10 @@ class Cs extends Ue {
|
|
|
881
881
|
]
|
|
882
882
|
}, I = {
|
|
883
883
|
START: [
|
|
884
|
-
[new T(new
|
|
884
|
+
[new T(new qe(0.01, 2), n), null, null, null, "helper"]
|
|
885
885
|
],
|
|
886
886
|
END: [
|
|
887
|
-
[new T(new
|
|
887
|
+
[new T(new qe(0.01, 2), n), null, null, null, "helper"]
|
|
888
888
|
],
|
|
889
889
|
DELTA: [
|
|
890
890
|
[new re(S(), n), null, null, null, "helper"]
|
|
@@ -999,21 +999,21 @@ class Cs extends Ue {
|
|
|
999
999
|
]
|
|
1000
1000
|
};
|
|
1001
1001
|
function oe(Z) {
|
|
1002
|
-
const
|
|
1002
|
+
const Be = new ze();
|
|
1003
1003
|
for (const J in Z)
|
|
1004
1004
|
for (let Te = Z[J].length; Te--; ) {
|
|
1005
|
-
const X = Z[J][Te][0].clone(),
|
|
1006
|
-
X.name = J, X.tag =
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1005
|
+
const X = Z[J][Te][0].clone(), Ke = Z[J][Te][1], Ve = Z[J][Te][2], Ze = Z[J][Te][3], Tn = Z[J][Te][4];
|
|
1006
|
+
X.name = J, X.tag = Tn, Ke && X.position.set(Ke[0], Ke[1], Ke[2]), Ve && X.rotation.set(Ve[0], Ve[1], Ve[2]), Ze && X.scale.set(Ze[0], Ze[1], Ze[2]), X.updateMatrix();
|
|
1007
|
+
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), Be.add(X);
|
|
1009
1009
|
}
|
|
1010
|
-
return
|
|
1010
|
+
return Be;
|
|
1011
1011
|
}
|
|
1012
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = oe(
|
|
1012
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = oe(R)), this.add(this.gizmo.rotate = oe(ie)), this.add(this.gizmo.scale = oe($)), this.add(this.picker.translate = oe(v)), this.add(this.picker.rotate = oe(fe)), this.add(this.picker.scale = oe(E)), this.add(this.helper.translate = oe(I)), this.add(this.helper.rotate = oe(ee)), this.add(this.helper.scale = oe(j)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
1013
1013
|
}
|
|
1014
1014
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
1015
1015
|
updateMatrixWorld(e) {
|
|
1016
|
-
const s = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion :
|
|
1016
|
+
const s = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : it;
|
|
1017
1017
|
this.gizmo.translate.visible = this.mode === "translate", this.gizmo.rotate.visible = this.mode === "rotate", this.gizmo.scale.visible = this.mode === "scale", this.helper.translate.visible = this.mode === "translate", this.helper.rotate.visible = this.mode === "rotate", this.helper.scale.visible = this.mode === "scale";
|
|
1018
1018
|
let n = [];
|
|
1019
1019
|
n = n.concat(this.picker[this.mode].children), n = n.concat(this.gizmo[this.mode].children), n = n.concat(this.helper[this.mode].children);
|
|
@@ -1022,10 +1022,10 @@ 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(
|
|
1025
|
+
o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (O.setFromEuler($e.set(0, 0, 0)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (O.setFromEuler($e.set(0, 0, Math.PI / 2)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (O.setFromEuler($e.set(0, Math.PI / 2, 0)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (O.setFromEuler($e.set(0, Math.PI / 2, 0)), L.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(Yt.lookAt(Xt, L, ye)), o.quaternion.multiply(O), o.visible = this.dragging), this.axis === "E" && (o.visible = !1)) : o.name === "START" ? (o.position.copy(this.worldPositionStart), o.visible = this.dragging) : o.name === "END" ? (o.position.copy(this.worldPosition), o.visible = this.dragging) : o.name === "DELTA" ? (o.position.copy(this.worldPositionStart), o.quaternion.copy(this.worldQuaternionStart), H.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), H.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(H), o.visible = this.dragging) : (o.quaternion.copy(s), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
|
|
1026
1026
|
continue;
|
|
1027
1027
|
}
|
|
1028
|
-
o.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (
|
|
1028
|
+
o.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (Je.copy(s), L.copy(this.eye).applyQuaternion(O.copy(s).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(Yt.lookAt(this.eye, Xt, ye)), o.name === "X" && (O.setFromAxisAngle(De, Math.atan2(-L.y, L.z)), O.multiplyQuaternions(Je, O), o.quaternion.copy(O)), o.name === "Y" && (O.setFromAxisAngle(ye, Math.atan2(L.x, L.z)), O.multiplyQuaternions(Je, O), o.quaternion.copy(O)), o.name === "Z" && (O.setFromAxisAngle(Ne, Math.atan2(L.y, L.x)), O.multiplyQuaternions(Je, O), o.quaternion.copy(O))), o.visible = o.visible && (o.name.indexOf("X") === -1 || this.showX), o.visible = o.visible && (o.name.indexOf("Y") === -1 || this.showY), o.visible = o.visible && (o.name.indexOf("Z") === -1 || this.showZ), o.visible = o.visible && (o.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), o.visible = o.visible && (o.name.indexOf("XY") === -1 || this.showXY), o.visible = o.visible && (o.name.indexOf("YZ") === -1 || this.showYZ), o.visible = o.visible && (o.name.indexOf("XZ") === -1 || this.showXZ), o.material._color = o.material._color || o.material.color.clone(), o.material._opacity = o.material._opacity || o.material.opacity, o.material.color.copy(o.material._color), o.material.opacity = o.material._opacity, this.enabled && this.axis && (o.name === this.axis ? (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1) : this.axis.split("").some(function(l) {
|
|
1029
1029
|
return o.name === l;
|
|
1030
1030
|
}) && (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1));
|
|
1031
1031
|
}
|
|
@@ -1036,17 +1036,17 @@ class Ds extends T {
|
|
|
1036
1036
|
constructor() {
|
|
1037
1037
|
super(
|
|
1038
1038
|
new Nn(1e5, 1e5, 2, 2),
|
|
1039
|
-
new _e({ visible: !1, wireframe: !0, side:
|
|
1039
|
+
new _e({ visible: !1, wireframe: !0, side: cn, transparent: !0, opacity: 0.1, toneMapped: !1 })
|
|
1040
1040
|
), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
|
|
1041
1041
|
}
|
|
1042
1042
|
updateMatrixWorld(e) {
|
|
1043
1043
|
let t = this.space;
|
|
1044
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"),
|
|
1044
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), et.copy(De).applyQuaternion(t === "local" ? this.worldQuaternion : it), Le.copy(ye).applyQuaternion(t === "local" ? this.worldQuaternion : it), Ie.copy(Ne).applyQuaternion(t === "local" ? this.worldQuaternion : it), L.copy(Le), this.mode) {
|
|
1045
1045
|
case "translate":
|
|
1046
1046
|
case "scale":
|
|
1047
1047
|
switch (this.axis) {
|
|
1048
1048
|
case "X":
|
|
1049
|
-
L.copy(this.eye).cross(
|
|
1049
|
+
L.copy(this.eye).cross(et), te.copy(et).cross(L);
|
|
1050
1050
|
break;
|
|
1051
1051
|
case "Y":
|
|
1052
1052
|
L.copy(this.eye).cross(Le), te.copy(Le).cross(L);
|
|
@@ -1058,7 +1058,7 @@ class Ds extends T {
|
|
|
1058
1058
|
te.copy(Ie);
|
|
1059
1059
|
break;
|
|
1060
1060
|
case "YZ":
|
|
1061
|
-
te.copy(
|
|
1061
|
+
te.copy(et);
|
|
1062
1062
|
break;
|
|
1063
1063
|
case "XZ":
|
|
1064
1064
|
L.copy(Ie), te.copy(Le);
|
|
@@ -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,22 +1095,21 @@ const w = {
|
|
|
1095
1095
|
/** 当前选中的物体 */
|
|
1096
1096
|
selectedObject: null
|
|
1097
1097
|
};
|
|
1098
|
-
let ht = !1,
|
|
1098
|
+
let ht = !1, Re = !1, be = null, wt = null, ot = null, we = [], ut;
|
|
1099
1099
|
function Ns(r, e = "edit", t) {
|
|
1100
|
-
if (w.container = r, w.mode = e, ks(), js(), Hs(), t) {
|
|
1101
|
-
ei(t.scene, e);
|
|
1100
|
+
if (w.container = r, w.mode = e, ks(), js(), Hs(), t && (ei(t.scene, e), t != null && t.camera)) {
|
|
1102
1101
|
const s = t.camera;
|
|
1103
1102
|
w.camera.position.set(
|
|
1104
|
-
s.position
|
|
1105
|
-
s.position
|
|
1106
|
-
s.position
|
|
1103
|
+
s.position[0],
|
|
1104
|
+
s.position[1],
|
|
1105
|
+
s.position[2]
|
|
1107
1106
|
), w.camera.rotation.set(
|
|
1108
|
-
s.rotation
|
|
1109
|
-
s.rotation
|
|
1110
|
-
s.rotation
|
|
1111
|
-
);
|
|
1107
|
+
s.rotation[0],
|
|
1108
|
+
s.rotation[1],
|
|
1109
|
+
s.rotation[2]
|
|
1110
|
+
), w.camera.updateProjectionMatrix(), ut = s.target;
|
|
1112
1111
|
}
|
|
1113
|
-
zs(), Us(), Qs(),
|
|
1112
|
+
zs(), Us(), ut && w.orbitControls && (w.orbitControls.target.fromArray(ut), w.orbitControls.update()), Qs(), yn(), e === "edit" && r.addEventListener("click", Ys), window.addEventListener("resize", Xs), t || Gs(), e === "edit" && Fs();
|
|
1114
1113
|
}
|
|
1115
1114
|
function ks() {
|
|
1116
1115
|
const r = new F.WebGLRenderer({ antialias: !0, alpha: !0 });
|
|
@@ -1134,8 +1133,8 @@ function Us() {
|
|
|
1134
1133
|
}), r.addEventListener("change", () => {
|
|
1135
1134
|
ht = !0;
|
|
1136
1135
|
}), r.addEventListener("end", () => {
|
|
1137
|
-
ht && (
|
|
1138
|
-
|
|
1136
|
+
ht && (Re = !0, setTimeout(() => {
|
|
1137
|
+
Re = !1;
|
|
1139
1138
|
}, 200));
|
|
1140
1139
|
}), w.orbitControls = r;
|
|
1141
1140
|
}
|
|
@@ -1145,11 +1144,11 @@ function zs() {
|
|
|
1145
1144
|
w.renderer.domElement
|
|
1146
1145
|
);
|
|
1147
1146
|
r.addEventListener("dragging-changed", (e) => {
|
|
1148
|
-
w.orbitControls.enabled = !e.value, e.value || (
|
|
1149
|
-
|
|
1147
|
+
w.orbitControls.enabled = !e.value, e.value || (Re = !0, setTimeout(() => {
|
|
1148
|
+
Re = !1;
|
|
1150
1149
|
}, 200));
|
|
1151
1150
|
}), r.addEventListener("objectChange", () => {
|
|
1152
|
-
|
|
1151
|
+
wt && w.selectedObject && wt(w.selectedObject);
|
|
1153
1152
|
}), w.scene.add(r.getHelper()), w.transformControls = r;
|
|
1154
1153
|
}
|
|
1155
1154
|
function Gs() {
|
|
@@ -1158,24 +1157,24 @@ function Gs() {
|
|
|
1158
1157
|
const e = new F.DirectionalLight(16777215, 3);
|
|
1159
1158
|
e.position.set(48, 104, 138), w.scene.add(e);
|
|
1160
1159
|
}
|
|
1161
|
-
function
|
|
1160
|
+
function yn() {
|
|
1162
1161
|
var r, e;
|
|
1163
|
-
requestAnimationFrame(
|
|
1162
|
+
requestAnimationFrame(yn), us.update(), (r = w.orbitControls) == null || r.update(), (e = w.renderer) == null || e.render(w.scene, w.camera);
|
|
1164
1163
|
}
|
|
1165
1164
|
function Xs() {
|
|
1166
1165
|
if (!w.container || !w.camera || !w.renderer) return;
|
|
1167
1166
|
const r = w.container.clientWidth, e = w.container.clientHeight;
|
|
1168
1167
|
r === 0 || e === 0 || (w.camera.aspect = r / e, w.camera.updateProjectionMatrix(), w.renderer.setSize(r, e));
|
|
1169
1168
|
}
|
|
1170
|
-
function
|
|
1169
|
+
function vt(r) {
|
|
1171
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));
|
|
1172
1171
|
}
|
|
1173
|
-
function
|
|
1172
|
+
function St() {
|
|
1174
1173
|
w.selectedObject && (w.transformControls.detach(), w.selectedObject = null, be == null || be(null));
|
|
1175
1174
|
}
|
|
1176
1175
|
function Ys(r) {
|
|
1177
|
-
if (
|
|
1178
|
-
|
|
1176
|
+
if (Re) {
|
|
1177
|
+
Re = !1;
|
|
1179
1178
|
return;
|
|
1180
1179
|
}
|
|
1181
1180
|
const e = w.renderer.domElement.getBoundingClientRect(), t = new F.Vector2(
|
|
@@ -1188,13 +1187,13 @@ function Ys(r) {
|
|
|
1188
1187
|
o.type === "Mesh" && o.userData.isMovable && n.push(o);
|
|
1189
1188
|
});
|
|
1190
1189
|
const i = s.intersectObjects(n);
|
|
1191
|
-
i.length > 0 ?
|
|
1190
|
+
i.length > 0 ? vt(i[0].object) : St();
|
|
1192
1191
|
}
|
|
1193
|
-
function
|
|
1194
|
-
w.scene.add(r), r.userData.isMovable && (Vs(r),
|
|
1192
|
+
function At(r, e = !1) {
|
|
1193
|
+
w.scene.add(r), r.userData.isMovable && (Vs(r), Rt()), e && w.mode === "edit" && vt(r);
|
|
1195
1194
|
}
|
|
1196
1195
|
function Bs(r) {
|
|
1197
|
-
w.selectedObject === r &&
|
|
1196
|
+
w.selectedObject === r && St(), r.parent ? r.parent.remove(r) : w.scene.remove(r), Zs(r), Rt();
|
|
1198
1197
|
}
|
|
1199
1198
|
function Ks(r) {
|
|
1200
1199
|
const e = w.scene.getObjectByProperty("uuid", r);
|
|
@@ -1211,19 +1210,19 @@ function Qs() {
|
|
|
1211
1210
|
const r = [];
|
|
1212
1211
|
w.scene.children.forEach((e) => {
|
|
1213
1212
|
e.userData.isMovable && r.push(e);
|
|
1214
|
-
}), we = r,
|
|
1213
|
+
}), we = r, Rt();
|
|
1215
1214
|
}
|
|
1216
|
-
function
|
|
1217
|
-
|
|
1215
|
+
function Rt() {
|
|
1216
|
+
ot == null || ot([...we]);
|
|
1218
1217
|
}
|
|
1219
1218
|
function qs(r) {
|
|
1220
1219
|
be = r;
|
|
1221
1220
|
}
|
|
1222
1221
|
function Ws(r) {
|
|
1223
|
-
|
|
1222
|
+
wt = r;
|
|
1224
1223
|
}
|
|
1225
1224
|
function $s(r) {
|
|
1226
|
-
|
|
1225
|
+
ot = r;
|
|
1227
1226
|
}
|
|
1228
1227
|
function Js() {
|
|
1229
1228
|
return we;
|
|
@@ -1238,16 +1237,18 @@ function Yo() {
|
|
|
1238
1237
|
return w.renderer;
|
|
1239
1238
|
}
|
|
1240
1239
|
function Bo() {
|
|
1241
|
-
var n, i;
|
|
1240
|
+
var n, i, o;
|
|
1241
|
+
St();
|
|
1242
1242
|
const r = w.scene;
|
|
1243
1243
|
if (!r) return "{}";
|
|
1244
1244
|
let e = r;
|
|
1245
1245
|
e = r.clone(), e.children = e.children.filter(
|
|
1246
|
-
(
|
|
1246
|
+
(a) => a.userData.type !== "initFloor"
|
|
1247
1247
|
);
|
|
1248
1248
|
const t = e.toJSON(), s = {
|
|
1249
|
-
position: (n = w.camera) == null ? void 0 : n.position,
|
|
1250
|
-
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]
|
|
1251
1252
|
};
|
|
1252
1253
|
return JSON.stringify({ scene: t, camera: s });
|
|
1253
1254
|
}
|
|
@@ -1256,7 +1257,7 @@ function ei(r, e = "edit") {
|
|
|
1256
1257
|
const t = typeof r == "string" ? JSON.parse(r) : r, n = new F.ObjectLoader().parse(t);
|
|
1257
1258
|
n.type === "Scene" ? w.scene = n : (i = w.scene) == null || i.add(n);
|
|
1258
1259
|
}
|
|
1259
|
-
const ti = /^[og]\s*(.+)?/, ni = /^mtllib /, si = /^usemtl /, ii = /^usemap /,
|
|
1260
|
+
const ti = /^[og]\s*(.+)?/, ni = /^mtllib /, si = /^usemtl /, ii = /^usemap /, Kt = /\s+/, Vt = new M(), dt = new M(), Zt = new M(), Qt = new M(), q = new M(), tt = new pe();
|
|
1260
1261
|
function oi() {
|
|
1261
1262
|
const r = {
|
|
1262
1263
|
objects: [],
|
|
@@ -1366,7 +1367,7 @@ function oi() {
|
|
|
1366
1367
|
},
|
|
1367
1368
|
addFaceNormal: function(e, t, s) {
|
|
1368
1369
|
const n = this.vertices, i = this.object.geometry.normals;
|
|
1369
|
-
|
|
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);
|
|
1370
1371
|
},
|
|
1371
1372
|
addColor: function(e, t, s) {
|
|
1372
1373
|
const n = this.colors, i = this.object.geometry.colors;
|
|
@@ -1417,7 +1418,7 @@ function oi() {
|
|
|
1417
1418
|
};
|
|
1418
1419
|
return r.startObject("", !1), r;
|
|
1419
1420
|
}
|
|
1420
|
-
class ri extends
|
|
1421
|
+
class ri extends hn {
|
|
1421
1422
|
/**
|
|
1422
1423
|
* Constructs a new OBJ loader.
|
|
1423
1424
|
*
|
|
@@ -1436,7 +1437,7 @@ class ri extends ln {
|
|
|
1436
1437
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
1437
1438
|
*/
|
|
1438
1439
|
load(e, t, s, n) {
|
|
1439
|
-
const i = this, o = new
|
|
1440
|
+
const i = this, o = new Et(this.manager);
|
|
1440
1441
|
o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, function(a) {
|
|
1441
1442
|
try {
|
|
1442
1443
|
t(i.parse(a));
|
|
@@ -1475,19 +1476,19 @@ class ri extends ln {
|
|
|
1475
1476
|
const u = h.charAt(0);
|
|
1476
1477
|
if (u !== "#")
|
|
1477
1478
|
if (u === "v") {
|
|
1478
|
-
const c = h.split(
|
|
1479
|
+
const c = h.split(Kt);
|
|
1479
1480
|
switch (c[0]) {
|
|
1480
1481
|
case "v":
|
|
1481
1482
|
t.vertices.push(
|
|
1482
1483
|
parseFloat(c[1]),
|
|
1483
1484
|
parseFloat(c[2]),
|
|
1484
1485
|
parseFloat(c[3])
|
|
1485
|
-
), c.length >= 7 ? (
|
|
1486
|
+
), c.length >= 7 ? (tt.setRGB(
|
|
1486
1487
|
parseFloat(c[4]),
|
|
1487
1488
|
parseFloat(c[5]),
|
|
1488
1489
|
parseFloat(c[6]),
|
|
1489
|
-
|
|
1490
|
-
), t.colors.push(
|
|
1490
|
+
Ae
|
|
1491
|
+
), t.colors.push(tt.r, tt.g, tt.b)) : t.colors.push(void 0, void 0, void 0);
|
|
1491
1492
|
break;
|
|
1492
1493
|
case "vn":
|
|
1493
1494
|
t.normals.push(
|
|
@@ -1504,7 +1505,7 @@ class ri extends ln {
|
|
|
1504
1505
|
break;
|
|
1505
1506
|
}
|
|
1506
1507
|
} else if (u === "f") {
|
|
1507
|
-
const p = h.slice(1).trim().split(
|
|
1508
|
+
const p = h.slice(1).trim().split(Kt), m = [];
|
|
1508
1509
|
for (let f = 0, y = p.length; f < y; f++) {
|
|
1509
1510
|
const d = p[f];
|
|
1510
1511
|
if (d.length > 0) {
|
|
@@ -1565,28 +1566,28 @@ class ri extends ln {
|
|
|
1565
1566
|
}
|
|
1566
1567
|
}
|
|
1567
1568
|
t.finalize();
|
|
1568
|
-
const i = new
|
|
1569
|
+
const i = new nt();
|
|
1569
1570
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
|
|
1570
1571
|
for (let a = 0, l = t.objects.length; a < l; a++) {
|
|
1571
1572
|
const h = t.objects[a], u = h.geometry, c = h.materials, p = u.type === "Line", m = u.type === "Points";
|
|
1572
1573
|
let b = !1;
|
|
1573
1574
|
if (u.vertices.length === 0) continue;
|
|
1574
|
-
const f = new
|
|
1575
|
-
f.setAttribute("position", new
|
|
1575
|
+
const f = new Ge();
|
|
1576
|
+
f.setAttribute("position", new de(u.vertices, 3)), u.normals.length > 0 && f.setAttribute("normal", new de(u.normals, 3)), u.colors.length > 0 && (b = !0, f.setAttribute("color", new de(u.colors, 3))), u.hasUVIndices === !0 && f.setAttribute("uv", new de(u.uvs, 2));
|
|
1576
1577
|
const y = [];
|
|
1577
1578
|
for (let _ = 0, x = c.length; _ < x; _++) {
|
|
1578
|
-
const S = c[_],
|
|
1579
|
-
let v = t.materials[
|
|
1579
|
+
const S = c[_], R = S.name + "_" + S.smooth + "_" + b;
|
|
1580
|
+
let v = t.materials[R];
|
|
1580
1581
|
if (this.materials !== null) {
|
|
1581
|
-
if (v = this.materials.create(S.name), p && v && !(v instanceof
|
|
1582
|
-
const I = new
|
|
1583
|
-
|
|
1582
|
+
if (v = this.materials.create(S.name), p && v && !(v instanceof je)) {
|
|
1583
|
+
const I = new je();
|
|
1584
|
+
Fe.prototype.copy.call(I, v), I.color.copy(v.color), v = I;
|
|
1584
1585
|
} else if (m && v && !(v instanceof Ce)) {
|
|
1585
1586
|
const I = new Ce({ size: 10, sizeAttenuation: !1 });
|
|
1586
|
-
|
|
1587
|
+
Fe.prototype.copy.call(I, v), I.color.copy(v.color), I.map = v.map, v = I;
|
|
1587
1588
|
}
|
|
1588
1589
|
}
|
|
1589
|
-
v === void 0 && (p ? v = new
|
|
1590
|
+
v === void 0 && (p ? v = new je() : m ? v = new Ce({ size: 1, sizeAttenuation: !1 }) : v = new kn(), v.name = S.name, v.flatShading = !S.smooth, v.vertexColors = b, t.materials[R] = v), y.push(v);
|
|
1590
1591
|
}
|
|
1591
1592
|
let d;
|
|
1592
1593
|
if (y.length > 1) {
|
|
@@ -1594,24 +1595,24 @@ class ri extends ln {
|
|
|
1594
1595
|
const S = c[_];
|
|
1595
1596
|
f.addGroup(S.groupStart, S.groupCount, _);
|
|
1596
1597
|
}
|
|
1597
|
-
p ? d = new
|
|
1598
|
+
p ? d = new gt(f, y) : m ? d = new st(f, y) : d = new T(f, y);
|
|
1598
1599
|
} else
|
|
1599
|
-
p ? d = new
|
|
1600
|
+
p ? d = new gt(f, y[0]) : m ? d = new st(f, y[0]) : d = new T(f, y[0]);
|
|
1600
1601
|
d.name = h.name, i.add(d);
|
|
1601
1602
|
}
|
|
1602
1603
|
else if (t.vertices.length > 0) {
|
|
1603
|
-
const a = new Ce({ size: 1, sizeAttenuation: !1 }), l = new
|
|
1604
|
-
l.setAttribute("position", new
|
|
1605
|
-
const h = new
|
|
1604
|
+
const a = new Ce({ size: 1, sizeAttenuation: !1 }), l = new Ge();
|
|
1605
|
+
l.setAttribute("position", new de(t.vertices, 3)), t.colors.length > 0 && t.colors[0] !== void 0 && (l.setAttribute("color", new de(t.colors, 3)), a.vertexColors = !0);
|
|
1606
|
+
const h = new st(l, a);
|
|
1606
1607
|
i.add(h);
|
|
1607
1608
|
}
|
|
1608
1609
|
return i;
|
|
1609
1610
|
}
|
|
1610
1611
|
}
|
|
1611
|
-
function
|
|
1612
|
+
function qt(r, e) {
|
|
1612
1613
|
if (e === jn)
|
|
1613
1614
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), r;
|
|
1614
|
-
if (e ===
|
|
1615
|
+
if (e === yt || e === un) {
|
|
1615
1616
|
let t = r.getIndex();
|
|
1616
1617
|
if (t === null) {
|
|
1617
1618
|
const o = [], a = r.getAttribute("position");
|
|
@@ -1623,7 +1624,7 @@ function Zt(r, e) {
|
|
|
1623
1624
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), r;
|
|
1624
1625
|
}
|
|
1625
1626
|
const s = t.count - 2, n = [];
|
|
1626
|
-
if (e ===
|
|
1627
|
+
if (e === yt)
|
|
1627
1628
|
for (let o = 1; o <= s; o++)
|
|
1628
1629
|
n.push(t.getX(0)), n.push(t.getX(o)), n.push(t.getX(o + 1));
|
|
1629
1630
|
else
|
|
@@ -1637,7 +1638,7 @@ function Zt(r, e) {
|
|
|
1637
1638
|
}
|
|
1638
1639
|
function ai(r) {
|
|
1639
1640
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), s = r.clone();
|
|
1640
|
-
return
|
|
1641
|
+
return _n(r, s, function(n, i) {
|
|
1641
1642
|
e.set(i, n), t.set(n, i);
|
|
1642
1643
|
}), s.traverse(function(n) {
|
|
1643
1644
|
if (!n.isSkinnedMesh) return;
|
|
@@ -1647,12 +1648,12 @@ function ai(r) {
|
|
|
1647
1648
|
}), i.bind(i.skeleton, i.bindMatrix);
|
|
1648
1649
|
}), s;
|
|
1649
1650
|
}
|
|
1650
|
-
function
|
|
1651
|
+
function _n(r, e, t) {
|
|
1651
1652
|
t(r, e);
|
|
1652
1653
|
for (let s = 0; s < r.children.length; s++)
|
|
1653
|
-
|
|
1654
|
+
_n(r.children[s], e.children[s], t);
|
|
1654
1655
|
}
|
|
1655
|
-
class li extends
|
|
1656
|
+
class li extends hn {
|
|
1656
1657
|
/**
|
|
1657
1658
|
* Constructs a new glTF loader.
|
|
1658
1659
|
*
|
|
@@ -1690,9 +1691,9 @@ class li extends ln {
|
|
|
1690
1691
|
}), this.register(function(t) {
|
|
1691
1692
|
return new hi(t);
|
|
1692
1693
|
}), this.register(function(t) {
|
|
1693
|
-
return new
|
|
1694
|
+
return new Wt(t, A.EXT_MESHOPT_COMPRESSION);
|
|
1694
1695
|
}), this.register(function(t) {
|
|
1695
|
-
return new
|
|
1696
|
+
return new Wt(t, A.KHR_MESHOPT_COMPRESSION);
|
|
1696
1697
|
}), this.register(function(t) {
|
|
1697
1698
|
return new Si(t);
|
|
1698
1699
|
});
|
|
@@ -1712,14 +1713,14 @@ class li extends ln {
|
|
|
1712
1713
|
if (this.resourcePath !== "")
|
|
1713
1714
|
o = this.resourcePath;
|
|
1714
1715
|
else if (this.path !== "") {
|
|
1715
|
-
const h =
|
|
1716
|
-
o =
|
|
1716
|
+
const h = He.extractUrlBase(e);
|
|
1717
|
+
o = He.resolveURL(h, this.path);
|
|
1717
1718
|
} else
|
|
1718
|
-
o =
|
|
1719
|
+
o = He.extractUrlBase(e);
|
|
1719
1720
|
this.manager.itemStart(e);
|
|
1720
1721
|
const a = function(h) {
|
|
1721
1722
|
n ? n(h) : console.error(h), i.manager.itemError(e), i.manager.itemEnd(e);
|
|
1722
|
-
}, l = new
|
|
1723
|
+
}, l = new Et(this.manager);
|
|
1723
1724
|
l.setPath(this.path), l.setResponseType("arraybuffer"), l.setRequestHeader(this.requestHeader), l.setWithCredentials(this.withCredentials), l.load(e, function(h) {
|
|
1724
1725
|
try {
|
|
1725
1726
|
i.parse(h, o, function(u) {
|
|
@@ -1794,14 +1795,14 @@ class li extends ln {
|
|
|
1794
1795
|
if (typeof e == "string")
|
|
1795
1796
|
i = JSON.parse(e);
|
|
1796
1797
|
else if (e instanceof ArrayBuffer)
|
|
1797
|
-
if (l.decode(new Uint8Array(e, 0, 4)) ===
|
|
1798
|
+
if (l.decode(new Uint8Array(e, 0, 4)) === bn) {
|
|
1798
1799
|
try {
|
|
1799
|
-
o[
|
|
1800
|
+
o[A.KHR_BINARY_GLTF] = new Ai(e);
|
|
1800
1801
|
} catch (c) {
|
|
1801
1802
|
n && n(c);
|
|
1802
1803
|
return;
|
|
1803
1804
|
}
|
|
1804
|
-
i = JSON.parse(o[
|
|
1805
|
+
i = JSON.parse(o[A.KHR_BINARY_GLTF].content);
|
|
1805
1806
|
} else
|
|
1806
1807
|
i = JSON.parse(l.decode(e));
|
|
1807
1808
|
else
|
|
@@ -1827,16 +1828,16 @@ class li extends ln {
|
|
|
1827
1828
|
for (let u = 0; u < i.extensionsUsed.length; ++u) {
|
|
1828
1829
|
const c = i.extensionsUsed[u], p = i.extensionsRequired || [];
|
|
1829
1830
|
switch (c) {
|
|
1830
|
-
case
|
|
1831
|
+
case A.KHR_MATERIALS_UNLIT:
|
|
1831
1832
|
o[c] = new ui();
|
|
1832
1833
|
break;
|
|
1833
|
-
case
|
|
1834
|
-
o[c] = new
|
|
1834
|
+
case A.KHR_DRACO_MESH_COMPRESSION:
|
|
1835
|
+
o[c] = new Ri(i, this.dracoLoader);
|
|
1835
1836
|
break;
|
|
1836
|
-
case
|
|
1837
|
+
case A.KHR_TEXTURE_TRANSFORM:
|
|
1837
1838
|
o[c] = new Pi();
|
|
1838
1839
|
break;
|
|
1839
|
-
case
|
|
1840
|
+
case A.KHR_MESH_QUANTIZATION:
|
|
1840
1841
|
o[c] = new Li();
|
|
1841
1842
|
break;
|
|
1842
1843
|
default:
|
|
@@ -1877,11 +1878,11 @@ function ci() {
|
|
|
1877
1878
|
}
|
|
1878
1879
|
};
|
|
1879
1880
|
}
|
|
1880
|
-
function
|
|
1881
|
+
function D(r, e, t) {
|
|
1881
1882
|
const s = r.json.materials[e];
|
|
1882
1883
|
return s.extensions && s.extensions[t] ? s.extensions[t] : null;
|
|
1883
1884
|
}
|
|
1884
|
-
const
|
|
1885
|
+
const A = {
|
|
1885
1886
|
KHR_BINARY_GLTF: "KHR_binary_glTF",
|
|
1886
1887
|
KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
|
|
1887
1888
|
KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
|
|
@@ -1908,7 +1909,7 @@ const R = {
|
|
|
1908
1909
|
};
|
|
1909
1910
|
class hi {
|
|
1910
1911
|
constructor(e) {
|
|
1911
|
-
this.parser = e, this.name =
|
|
1912
|
+
this.parser = e, this.name = A.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
1912
1913
|
}
|
|
1913
1914
|
_markDefs() {
|
|
1914
1915
|
const e = this.parser, t = this.parser.json.nodes || [];
|
|
@@ -1924,7 +1925,7 @@ class hi {
|
|
|
1924
1925
|
const i = t.json, l = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
|
|
1925
1926
|
let h;
|
|
1926
1927
|
const u = new pe(16777215);
|
|
1927
|
-
l.color !== void 0 && u.setRGB(l.color[0], l.color[1], l.color[2],
|
|
1928
|
+
l.color !== void 0 && u.setRGB(l.color[0], l.color[1], l.color[2], le);
|
|
1928
1929
|
const c = l.range !== void 0 ? l.range : 0;
|
|
1929
1930
|
switch (l.type) {
|
|
1930
1931
|
case "directional":
|
|
@@ -1954,7 +1955,7 @@ class hi {
|
|
|
1954
1955
|
}
|
|
1955
1956
|
class ui {
|
|
1956
1957
|
constructor() {
|
|
1957
|
-
this.name =
|
|
1958
|
+
this.name = A.KHR_MATERIALS_UNLIT;
|
|
1958
1959
|
}
|
|
1959
1960
|
getMaterialType() {
|
|
1960
1961
|
return _e;
|
|
@@ -1966,31 +1967,31 @@ class ui {
|
|
|
1966
1967
|
if (i) {
|
|
1967
1968
|
if (Array.isArray(i.baseColorFactor)) {
|
|
1968
1969
|
const o = i.baseColorFactor;
|
|
1969
|
-
e.color.setRGB(o[0], o[1], o[2],
|
|
1970
|
+
e.color.setRGB(o[0], o[1], o[2], le), e.opacity = o[3];
|
|
1970
1971
|
}
|
|
1971
|
-
i.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", i.baseColorTexture,
|
|
1972
|
+
i.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", i.baseColorTexture, Ae));
|
|
1972
1973
|
}
|
|
1973
1974
|
return Promise.all(n);
|
|
1974
1975
|
}
|
|
1975
1976
|
}
|
|
1976
1977
|
class di {
|
|
1977
1978
|
constructor(e) {
|
|
1978
|
-
this.parser = e, this.name =
|
|
1979
|
+
this.parser = e, this.name = A.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
1979
1980
|
}
|
|
1980
1981
|
extendMaterialParams(e, t) {
|
|
1981
|
-
const s =
|
|
1982
|
+
const s = D(this.parser, e, this.name);
|
|
1982
1983
|
return s === null || s.emissiveStrength !== void 0 && (t.emissiveIntensity = s.emissiveStrength), Promise.resolve();
|
|
1983
1984
|
}
|
|
1984
1985
|
}
|
|
1985
1986
|
class pi {
|
|
1986
1987
|
constructor(e) {
|
|
1987
|
-
this.parser = e, this.name =
|
|
1988
|
+
this.parser = e, this.name = A.KHR_MATERIALS_CLEARCOAT;
|
|
1988
1989
|
}
|
|
1989
1990
|
getMaterialType(e) {
|
|
1990
|
-
return
|
|
1991
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
1991
1992
|
}
|
|
1992
1993
|
extendMaterialParams(e, t) {
|
|
1993
|
-
const s =
|
|
1994
|
+
const s = D(this.parser, e, this.name);
|
|
1994
1995
|
if (s === null) return Promise.resolve();
|
|
1995
1996
|
const n = [];
|
|
1996
1997
|
if (s.clearcoatFactor !== void 0 && (t.clearcoat = s.clearcoatFactor), s.clearcoatTexture !== void 0 && n.push(this.parser.assignTexture(t, "clearcoatMap", s.clearcoatTexture)), s.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = s.clearcoatRoughnessFactor), s.clearcoatRoughnessTexture !== void 0 && n.push(this.parser.assignTexture(t, "clearcoatRoughnessMap", s.clearcoatRoughnessTexture)), s.clearcoatNormalTexture !== void 0 && (n.push(this.parser.assignTexture(t, "clearcoatNormalMap", s.clearcoatNormalTexture)), s.clearcoatNormalTexture.scale !== void 0)) {
|
|
@@ -2002,25 +2003,25 @@ class pi {
|
|
|
2002
2003
|
}
|
|
2003
2004
|
class fi {
|
|
2004
2005
|
constructor(e) {
|
|
2005
|
-
this.parser = e, this.name =
|
|
2006
|
+
this.parser = e, this.name = A.KHR_MATERIALS_DISPERSION;
|
|
2006
2007
|
}
|
|
2007
2008
|
getMaterialType(e) {
|
|
2008
|
-
return
|
|
2009
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2009
2010
|
}
|
|
2010
2011
|
extendMaterialParams(e, t) {
|
|
2011
|
-
const s =
|
|
2012
|
+
const s = D(this.parser, e, this.name);
|
|
2012
2013
|
return s === null || (t.dispersion = s.dispersion !== void 0 ? s.dispersion : 0), Promise.resolve();
|
|
2013
2014
|
}
|
|
2014
2015
|
}
|
|
2015
2016
|
class mi {
|
|
2016
2017
|
constructor(e) {
|
|
2017
|
-
this.parser = e, this.name =
|
|
2018
|
+
this.parser = e, this.name = A.KHR_MATERIALS_IRIDESCENCE;
|
|
2018
2019
|
}
|
|
2019
2020
|
getMaterialType(e) {
|
|
2020
|
-
return
|
|
2021
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2021
2022
|
}
|
|
2022
2023
|
extendMaterialParams(e, t) {
|
|
2023
|
-
const s =
|
|
2024
|
+
const s = D(this.parser, e, this.name);
|
|
2024
2025
|
if (s === null) return Promise.resolve();
|
|
2025
2026
|
const n = [];
|
|
2026
2027
|
return s.iridescenceFactor !== void 0 && (t.iridescence = s.iridescenceFactor), s.iridescenceTexture !== void 0 && n.push(this.parser.assignTexture(t, "iridescenceMap", s.iridescenceTexture)), s.iridescenceIor !== void 0 && (t.iridescenceIOR = s.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), s.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = s.iridescenceThicknessMinimum), s.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = s.iridescenceThicknessMaximum), s.iridescenceThicknessTexture !== void 0 && n.push(this.parser.assignTexture(t, "iridescenceThicknessMap", s.iridescenceThicknessTexture)), Promise.all(n);
|
|
@@ -2028,31 +2029,31 @@ class mi {
|
|
|
2028
2029
|
}
|
|
2029
2030
|
class gi {
|
|
2030
2031
|
constructor(e) {
|
|
2031
|
-
this.parser = e, this.name =
|
|
2032
|
+
this.parser = e, this.name = A.KHR_MATERIALS_SHEEN;
|
|
2032
2033
|
}
|
|
2033
2034
|
getMaterialType(e) {
|
|
2034
|
-
return
|
|
2035
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2035
2036
|
}
|
|
2036
2037
|
extendMaterialParams(e, t) {
|
|
2037
|
-
const s =
|
|
2038
|
+
const s = D(this.parser, e, this.name);
|
|
2038
2039
|
if (s === null) return Promise.resolve();
|
|
2039
2040
|
const n = [];
|
|
2040
2041
|
if (t.sheenColor = new pe(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, s.sheenColorFactor !== void 0) {
|
|
2041
2042
|
const i = s.sheenColorFactor;
|
|
2042
|
-
t.sheenColor.setRGB(i[0], i[1], i[2],
|
|
2043
|
+
t.sheenColor.setRGB(i[0], i[1], i[2], le);
|
|
2043
2044
|
}
|
|
2044
|
-
return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenColorMap", s.sheenColorTexture,
|
|
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);
|
|
2045
2046
|
}
|
|
2046
2047
|
}
|
|
2047
2048
|
class yi {
|
|
2048
2049
|
constructor(e) {
|
|
2049
|
-
this.parser = e, this.name =
|
|
2050
|
+
this.parser = e, this.name = A.KHR_MATERIALS_TRANSMISSION;
|
|
2050
2051
|
}
|
|
2051
2052
|
getMaterialType(e) {
|
|
2052
|
-
return
|
|
2053
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2053
2054
|
}
|
|
2054
2055
|
extendMaterialParams(e, t) {
|
|
2055
|
-
const s =
|
|
2056
|
+
const s = D(this.parser, e, this.name);
|
|
2056
2057
|
if (s === null) return Promise.resolve();
|
|
2057
2058
|
const n = [];
|
|
2058
2059
|
return s.transmissionFactor !== void 0 && (t.transmission = s.transmissionFactor), s.transmissionTexture !== void 0 && n.push(this.parser.assignTexture(t, "transmissionMap", s.transmissionTexture)), Promise.all(n);
|
|
@@ -2060,57 +2061,57 @@ class yi {
|
|
|
2060
2061
|
}
|
|
2061
2062
|
class _i {
|
|
2062
2063
|
constructor(e) {
|
|
2063
|
-
this.parser = e, this.name =
|
|
2064
|
+
this.parser = e, this.name = A.KHR_MATERIALS_VOLUME;
|
|
2064
2065
|
}
|
|
2065
2066
|
getMaterialType(e) {
|
|
2066
|
-
return
|
|
2067
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2067
2068
|
}
|
|
2068
2069
|
extendMaterialParams(e, t) {
|
|
2069
|
-
const s =
|
|
2070
|
+
const s = D(this.parser, e, this.name);
|
|
2070
2071
|
if (s === null) return Promise.resolve();
|
|
2071
2072
|
const n = [];
|
|
2072
2073
|
t.thickness = s.thicknessFactor !== void 0 ? s.thicknessFactor : 0, s.thicknessTexture !== void 0 && n.push(this.parser.assignTexture(t, "thicknessMap", s.thicknessTexture)), t.attenuationDistance = s.attenuationDistance || 1 / 0;
|
|
2073
2074
|
const i = s.attenuationColor || [1, 1, 1];
|
|
2074
|
-
return t.attenuationColor = new pe().setRGB(i[0], i[1], i[2],
|
|
2075
|
+
return t.attenuationColor = new pe().setRGB(i[0], i[1], i[2], le), Promise.all(n);
|
|
2075
2076
|
}
|
|
2076
2077
|
}
|
|
2077
2078
|
class bi {
|
|
2078
2079
|
constructor(e) {
|
|
2079
|
-
this.parser = e, this.name =
|
|
2080
|
+
this.parser = e, this.name = A.KHR_MATERIALS_IOR;
|
|
2080
2081
|
}
|
|
2081
2082
|
getMaterialType(e) {
|
|
2082
|
-
return
|
|
2083
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2083
2084
|
}
|
|
2084
2085
|
extendMaterialParams(e, t) {
|
|
2085
|
-
const s =
|
|
2086
|
+
const s = D(this.parser, e, this.name);
|
|
2086
2087
|
return s === null || (t.ior = s.ior !== void 0 ? s.ior : 1.5, t.ior === 0 && (t.ior = 1e3)), Promise.resolve();
|
|
2087
2088
|
}
|
|
2088
2089
|
}
|
|
2089
2090
|
class wi {
|
|
2090
2091
|
constructor(e) {
|
|
2091
|
-
this.parser = e, this.name =
|
|
2092
|
+
this.parser = e, this.name = A.KHR_MATERIALS_SPECULAR;
|
|
2092
2093
|
}
|
|
2093
2094
|
getMaterialType(e) {
|
|
2094
|
-
return
|
|
2095
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2095
2096
|
}
|
|
2096
2097
|
extendMaterialParams(e, t) {
|
|
2097
|
-
const s =
|
|
2098
|
+
const s = D(this.parser, e, this.name);
|
|
2098
2099
|
if (s === null) return Promise.resolve();
|
|
2099
2100
|
const n = [];
|
|
2100
2101
|
t.specularIntensity = s.specularFactor !== void 0 ? s.specularFactor : 1, s.specularTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularIntensityMap", s.specularTexture));
|
|
2101
2102
|
const i = s.specularColorFactor || [1, 1, 1];
|
|
2102
|
-
return t.specularColor = new pe().setRGB(i[0], i[1], i[2],
|
|
2103
|
+
return t.specularColor = new pe().setRGB(i[0], i[1], i[2], le), s.specularColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularColorMap", s.specularColorTexture, Ae)), Promise.all(n);
|
|
2103
2104
|
}
|
|
2104
2105
|
}
|
|
2105
2106
|
class Ti {
|
|
2106
2107
|
constructor(e) {
|
|
2107
|
-
this.parser = e, this.name =
|
|
2108
|
+
this.parser = e, this.name = A.EXT_MATERIALS_BUMP;
|
|
2108
2109
|
}
|
|
2109
2110
|
getMaterialType(e) {
|
|
2110
|
-
return
|
|
2111
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2111
2112
|
}
|
|
2112
2113
|
extendMaterialParams(e, t) {
|
|
2113
|
-
const s =
|
|
2114
|
+
const s = D(this.parser, e, this.name);
|
|
2114
2115
|
if (s === null) return Promise.resolve();
|
|
2115
2116
|
const n = [];
|
|
2116
2117
|
return t.bumpScale = s.bumpFactor !== void 0 ? s.bumpFactor : 1, s.bumpTexture !== void 0 && n.push(this.parser.assignTexture(t, "bumpMap", s.bumpTexture)), Promise.all(n);
|
|
@@ -2118,13 +2119,13 @@ class Ti {
|
|
|
2118
2119
|
}
|
|
2119
2120
|
class xi {
|
|
2120
2121
|
constructor(e) {
|
|
2121
|
-
this.parser = e, this.name =
|
|
2122
|
+
this.parser = e, this.name = A.KHR_MATERIALS_ANISOTROPY;
|
|
2122
2123
|
}
|
|
2123
2124
|
getMaterialType(e) {
|
|
2124
|
-
return
|
|
2125
|
+
return D(this.parser, e, this.name) !== null ? se : null;
|
|
2125
2126
|
}
|
|
2126
2127
|
extendMaterialParams(e, t) {
|
|
2127
|
-
const s =
|
|
2128
|
+
const s = D(this.parser, e, this.name);
|
|
2128
2129
|
if (s === null) return Promise.resolve();
|
|
2129
2130
|
const n = [];
|
|
2130
2131
|
return s.anisotropyStrength !== void 0 && (t.anisotropy = s.anisotropyStrength), s.anisotropyRotation !== void 0 && (t.anisotropyRotation = s.anisotropyRotation), s.anisotropyTexture !== void 0 && n.push(this.parser.assignTexture(t, "anisotropyMap", s.anisotropyTexture)), Promise.all(n);
|
|
@@ -2132,7 +2133,7 @@ class xi {
|
|
|
2132
2133
|
}
|
|
2133
2134
|
class Ei {
|
|
2134
2135
|
constructor(e) {
|
|
2135
|
-
this.parser = e, this.name =
|
|
2136
|
+
this.parser = e, this.name = A.KHR_TEXTURE_BASISU;
|
|
2136
2137
|
}
|
|
2137
2138
|
loadTexture(e) {
|
|
2138
2139
|
const t = this.parser, s = t.json, n = s.textures[e];
|
|
@@ -2149,7 +2150,7 @@ class Ei {
|
|
|
2149
2150
|
}
|
|
2150
2151
|
class Mi {
|
|
2151
2152
|
constructor(e) {
|
|
2152
|
-
this.parser = e, this.name =
|
|
2153
|
+
this.parser = e, this.name = A.EXT_TEXTURE_WEBP;
|
|
2153
2154
|
}
|
|
2154
2155
|
loadTexture(e) {
|
|
2155
2156
|
const t = this.name, s = this.parser, n = s.json, i = n.textures[e];
|
|
@@ -2166,7 +2167,7 @@ class Mi {
|
|
|
2166
2167
|
}
|
|
2167
2168
|
class vi {
|
|
2168
2169
|
constructor(e) {
|
|
2169
|
-
this.parser = e, this.name =
|
|
2170
|
+
this.parser = e, this.name = A.EXT_TEXTURE_AVIF;
|
|
2170
2171
|
}
|
|
2171
2172
|
loadTexture(e) {
|
|
2172
2173
|
const t = this.name, s = this.parser, n = s.json, i = n.textures[e];
|
|
@@ -2181,7 +2182,7 @@ class vi {
|
|
|
2181
2182
|
return s.loadTextureImage(e, o.source, l);
|
|
2182
2183
|
}
|
|
2183
2184
|
}
|
|
2184
|
-
class
|
|
2185
|
+
class Wt {
|
|
2185
2186
|
constructor(e, t) {
|
|
2186
2187
|
this.name = t, this.parser = e;
|
|
2187
2188
|
}
|
|
@@ -2209,7 +2210,7 @@ class Qt {
|
|
|
2209
2210
|
}
|
|
2210
2211
|
class Si {
|
|
2211
2212
|
constructor(e) {
|
|
2212
|
-
this.name =
|
|
2213
|
+
this.name = A.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
2213
2214
|
}
|
|
2214
2215
|
createNodeMesh(e) {
|
|
2215
2216
|
const t = this.parser.json, s = t.nodes[e];
|
|
@@ -2230,25 +2231,25 @@ class Si {
|
|
|
2230
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, _));
|
|
2231
2232
|
for (const S in l)
|
|
2232
2233
|
if (S === "_COLOR_0") {
|
|
2233
|
-
const
|
|
2234
|
-
x.instanceColor = new Gn(
|
|
2234
|
+
const R = l[S];
|
|
2235
|
+
x.instanceColor = new Gn(R.array, R.itemSize, R.normalized);
|
|
2235
2236
|
} else S !== "TRANSLATION" && S !== "ROTATION" && S !== "SCALE" && b.geometry.setAttribute(S, l[S]);
|
|
2236
|
-
|
|
2237
|
+
ze.prototype.copy.call(x, b), this.parser.assignFinalMaterial(x), m.push(x);
|
|
2237
2238
|
}
|
|
2238
2239
|
return u.isGroup ? (u.clear(), u.add(...m), u) : m[0];
|
|
2239
2240
|
}));
|
|
2240
2241
|
}
|
|
2241
2242
|
}
|
|
2242
|
-
const
|
|
2243
|
-
class
|
|
2243
|
+
const bn = "glTF", Oe = 12, $t = { JSON: 1313821514, BIN: 5130562 };
|
|
2244
|
+
class Ai {
|
|
2244
2245
|
constructor(e) {
|
|
2245
|
-
this.name =
|
|
2246
|
+
this.name = A.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
2246
2247
|
const t = new DataView(e, 0, Oe), s = new TextDecoder();
|
|
2247
2248
|
if (this.header = {
|
|
2248
2249
|
magic: s.decode(new Uint8Array(e.slice(0, 4))),
|
|
2249
2250
|
version: t.getUint32(4, !0),
|
|
2250
2251
|
length: t.getUint32(8, !0)
|
|
2251
|
-
}, this.header.magic !==
|
|
2252
|
+
}, this.header.magic !== bn)
|
|
2252
2253
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
2253
2254
|
if (this.header.version < 2)
|
|
2254
2255
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
@@ -2258,10 +2259,10 @@ class Ri {
|
|
|
2258
2259
|
const a = i.getUint32(o, !0);
|
|
2259
2260
|
o += 4;
|
|
2260
2261
|
const l = i.getUint32(o, !0);
|
|
2261
|
-
if (o += 4, l ===
|
|
2262
|
+
if (o += 4, l === $t.JSON) {
|
|
2262
2263
|
const h = new Uint8Array(e, Oe + o, a);
|
|
2263
2264
|
this.content = s.decode(h);
|
|
2264
|
-
} else if (l ===
|
|
2265
|
+
} else if (l === $t.BIN) {
|
|
2265
2266
|
const h = Oe + o;
|
|
2266
2267
|
this.body = e.slice(h, h + a);
|
|
2267
2268
|
}
|
|
@@ -2271,20 +2272,20 @@ class Ri {
|
|
|
2271
2272
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
2272
2273
|
}
|
|
2273
2274
|
}
|
|
2274
|
-
class
|
|
2275
|
+
class Ri {
|
|
2275
2276
|
constructor(e, t) {
|
|
2276
2277
|
if (!t)
|
|
2277
2278
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
2278
|
-
this.name =
|
|
2279
|
+
this.name = A.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
|
|
2279
2280
|
}
|
|
2280
2281
|
decodePrimitive(e, t) {
|
|
2281
2282
|
const s = this.json, n = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, h = {};
|
|
2282
2283
|
for (const u in o) {
|
|
2283
|
-
const c =
|
|
2284
|
+
const c = Tt[u] || u.toLowerCase();
|
|
2284
2285
|
a[c] = o[u];
|
|
2285
2286
|
}
|
|
2286
2287
|
for (const u in e.attributes) {
|
|
2287
|
-
const c =
|
|
2288
|
+
const c = Tt[u] || u.toLowerCase();
|
|
2288
2289
|
if (o[u] !== void 0) {
|
|
2289
2290
|
const p = s.accessors[e.attributes[u]], m = ve[p.componentType];
|
|
2290
2291
|
h[c] = m.name, l[c] = p.normalized === !0;
|
|
@@ -2298,14 +2299,14 @@ class Ai {
|
|
|
2298
2299
|
y !== void 0 && (f.normalized = y);
|
|
2299
2300
|
}
|
|
2300
2301
|
c(m);
|
|
2301
|
-
}, a, h,
|
|
2302
|
+
}, a, h, le, p);
|
|
2302
2303
|
});
|
|
2303
2304
|
});
|
|
2304
2305
|
}
|
|
2305
2306
|
}
|
|
2306
2307
|
class Pi {
|
|
2307
2308
|
constructor() {
|
|
2308
|
-
this.name =
|
|
2309
|
+
this.name = A.KHR_TEXTURE_TRANSFORM;
|
|
2309
2310
|
}
|
|
2310
2311
|
extendTexture(e, t) {
|
|
2311
2312
|
return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e;
|
|
@@ -2313,10 +2314,10 @@ class Pi {
|
|
|
2313
2314
|
}
|
|
2314
2315
|
class Li {
|
|
2315
2316
|
constructor() {
|
|
2316
|
-
this.name =
|
|
2317
|
+
this.name = A.KHR_MESH_QUANTIZATION;
|
|
2317
2318
|
}
|
|
2318
2319
|
}
|
|
2319
|
-
class
|
|
2320
|
+
class wn extends ls {
|
|
2320
2321
|
constructor(e, t, s, n) {
|
|
2321
2322
|
super(e, t, s, n);
|
|
2322
2323
|
}
|
|
@@ -2329,14 +2330,14 @@ class bn extends ls {
|
|
|
2329
2330
|
interpolate_(e, t, s, n) {
|
|
2330
2331
|
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, h = a * 3, u = n - t, c = (s - t) / u, p = c * c, m = p * c, b = e * h, f = b - h, y = -2 * m + 3 * p, d = m - p, _ = 1 - y, x = d - p + c;
|
|
2331
2332
|
for (let S = 0; S !== a; S++) {
|
|
2332
|
-
const
|
|
2333
|
-
i[S] = _ *
|
|
2333
|
+
const R = o[f + S + a], v = o[f + S + l] * u, I = o[b + S + a], ie = o[b + S] * u;
|
|
2334
|
+
i[S] = _ * R + x * v + y * I + d * ie;
|
|
2334
2335
|
}
|
|
2335
2336
|
return i;
|
|
2336
2337
|
}
|
|
2337
2338
|
}
|
|
2338
2339
|
const Ii = new K();
|
|
2339
|
-
class Oi extends
|
|
2340
|
+
class Oi extends wn {
|
|
2340
2341
|
interpolate_(e, t, s, n) {
|
|
2341
2342
|
const i = super.interpolate_(e, t, s, n);
|
|
2342
2343
|
return Ii.fromArray(i).normalize().toArray(i), i;
|
|
@@ -2357,18 +2358,18 @@ const W = {
|
|
|
2357
2358
|
5123: Uint16Array,
|
|
2358
2359
|
5125: Uint32Array,
|
|
2359
2360
|
5126: Float32Array
|
|
2360
|
-
},
|
|
2361
|
-
9728:
|
|
2362
|
-
9729:
|
|
2361
|
+
}, Jt = {
|
|
2362
|
+
9728: pn,
|
|
2363
|
+
9729: _t,
|
|
2363
2364
|
9984: Qn,
|
|
2364
2365
|
9985: Zn,
|
|
2365
2366
|
9986: Vn,
|
|
2366
|
-
9987:
|
|
2367
|
-
},
|
|
2367
|
+
9987: dn
|
|
2368
|
+
}, en = {
|
|
2368
2369
|
33071: Wn,
|
|
2369
2370
|
33648: qn,
|
|
2370
|
-
10497:
|
|
2371
|
-
},
|
|
2371
|
+
10497: bt
|
|
2372
|
+
}, pt = {
|
|
2372
2373
|
SCALAR: 1,
|
|
2373
2374
|
VEC2: 2,
|
|
2374
2375
|
VEC3: 3,
|
|
@@ -2376,7 +2377,7 @@ const W = {
|
|
|
2376
2377
|
MAT2: 4,
|
|
2377
2378
|
MAT3: 9,
|
|
2378
2379
|
MAT4: 16
|
|
2379
|
-
},
|
|
2380
|
+
}, Tt = {
|
|
2380
2381
|
POSITION: "position",
|
|
2381
2382
|
NORMAL: "normal",
|
|
2382
2383
|
TANGENT: "tangent",
|
|
@@ -2387,7 +2388,7 @@ const W = {
|
|
|
2387
2388
|
COLOR_0: "color",
|
|
2388
2389
|
WEIGHTS_0: "skinWeight",
|
|
2389
2390
|
JOINTS_0: "skinIndex"
|
|
2390
|
-
},
|
|
2391
|
+
}, he = {
|
|
2391
2392
|
scale: "scale",
|
|
2392
2393
|
translation: "position",
|
|
2393
2394
|
rotation: "quaternion",
|
|
@@ -2396,15 +2397,15 @@ const W = {
|
|
|
2396
2397
|
CUBICSPLINE: void 0,
|
|
2397
2398
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
2398
2399
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
2399
|
-
LINEAR:
|
|
2400
|
+
LINEAR: mn,
|
|
2400
2401
|
STEP: rs
|
|
2401
|
-
},
|
|
2402
|
+
}, ft = {
|
|
2402
2403
|
OPAQUE: "OPAQUE",
|
|
2403
2404
|
MASK: "MASK",
|
|
2404
2405
|
BLEND: "BLEND"
|
|
2405
2406
|
};
|
|
2406
2407
|
function Di(r) {
|
|
2407
|
-
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new
|
|
2408
|
+
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new fn({
|
|
2408
2409
|
color: 16777215,
|
|
2409
2410
|
emissive: 0,
|
|
2410
2411
|
metalness: 1,
|
|
@@ -2469,20 +2470,20 @@ function ki(r, e) {
|
|
|
2469
2470
|
}
|
|
2470
2471
|
function ji(r) {
|
|
2471
2472
|
let e;
|
|
2472
|
-
const t = r.extensions && r.extensions[
|
|
2473
|
-
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" +
|
|
2473
|
+
const t = r.extensions && r.extensions[A.KHR_DRACO_MESH_COMPRESSION];
|
|
2474
|
+
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + mt(t.attributes) : e = r.indices + ":" + mt(r.attributes) + ":" + r.mode, r.targets !== void 0)
|
|
2474
2475
|
for (let s = 0, n = r.targets.length; s < n; s++)
|
|
2475
|
-
e += ":" +
|
|
2476
|
+
e += ":" + mt(r.targets[s]);
|
|
2476
2477
|
return e;
|
|
2477
2478
|
}
|
|
2478
|
-
function
|
|
2479
|
+
function mt(r) {
|
|
2479
2480
|
let e = "";
|
|
2480
2481
|
const t = Object.keys(r).sort();
|
|
2481
2482
|
for (let s = 0, n = t.length; s < n; s++)
|
|
2482
2483
|
e += t[s] + ":" + r[t[s]] + ";";
|
|
2483
2484
|
return e;
|
|
2484
2485
|
}
|
|
2485
|
-
function
|
|
2486
|
+
function xt(r) {
|
|
2486
2487
|
switch (r) {
|
|
2487
2488
|
case Int8Array:
|
|
2488
2489
|
return 1 / 127;
|
|
@@ -2510,7 +2511,7 @@ class Ui {
|
|
|
2510
2511
|
const l = a.match(/Version\/(\d+)/);
|
|
2511
2512
|
n = s && l ? parseInt(l[1], 10) : -1, i = a.indexOf("Firefox") > -1, o = i ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
2512
2513
|
}
|
|
2513
|
-
typeof createImageBitmap > "u" || s && n < 17 || i && o < 98 ? this.textureLoader = new Xn(this.options.manager) : this.textureLoader = new Yn(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new
|
|
2514
|
+
typeof createImageBitmap > "u" || s && n < 17 || i && o < 98 ? this.textureLoader = new Xn(this.options.manager) : this.textureLoader = new Yn(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Et(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
2514
2515
|
}
|
|
2515
2516
|
setExtensions(e) {
|
|
2516
2517
|
this.extensions = e;
|
|
@@ -2718,10 +2719,10 @@ class Ui {
|
|
|
2718
2719
|
if (t.type && t.type !== "arraybuffer")
|
|
2719
2720
|
throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
|
|
2720
2721
|
if (t.uri === void 0 && e === 0)
|
|
2721
|
-
return Promise.resolve(this.extensions[
|
|
2722
|
+
return Promise.resolve(this.extensions[A.KHR_BINARY_GLTF].body);
|
|
2722
2723
|
const n = this.options;
|
|
2723
2724
|
return new Promise(function(i, o) {
|
|
2724
|
-
s.load(
|
|
2725
|
+
s.load(He.resolveURL(t.uri, n.path), i, void 0, function() {
|
|
2725
2726
|
o(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
|
|
2726
2727
|
});
|
|
2727
2728
|
});
|
|
@@ -2750,12 +2751,12 @@ class Ui {
|
|
|
2750
2751
|
loadAccessor(e) {
|
|
2751
2752
|
const t = this, s = this.json, n = this.json.accessors[e];
|
|
2752
2753
|
if (n.bufferView === void 0 && n.sparse === void 0) {
|
|
2753
|
-
const o =
|
|
2754
|
+
const o = pt[n.type], a = ve[n.componentType], l = n.normalized === !0, h = new a(n.count * o);
|
|
2754
2755
|
return Promise.resolve(new rt(h, o, l));
|
|
2755
2756
|
}
|
|
2756
2757
|
const i = [];
|
|
2757
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) {
|
|
2758
|
-
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;
|
|
2759
2760
|
let f, y;
|
|
2760
2761
|
if (m && m !== c) {
|
|
2761
2762
|
const d = Math.floor(p / m), _ = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + d + ":" + n.count;
|
|
@@ -2764,10 +2765,10 @@ class Ui {
|
|
|
2764
2765
|
} else
|
|
2765
2766
|
a === null ? f = new h(n.count * l) : f = new h(a, p, n.count * l), y = new rt(f, l, b);
|
|
2766
2767
|
if (n.sparse !== void 0) {
|
|
2767
|
-
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);
|
|
2768
2769
|
a !== null && (y = new rt(y.array.slice(), y.itemSize, y.normalized)), y.normalized = !1;
|
|
2769
|
-
for (let I = 0, ie =
|
|
2770
|
-
const ee =
|
|
2770
|
+
for (let I = 0, ie = R.length; I < ie; I++) {
|
|
2771
|
+
const ee = R[I];
|
|
2771
2772
|
if (y.setX(ee, v[I * l]), l >= 2 && y.setY(ee, v[I * l + 1]), l >= 3 && y.setZ(ee, v[I * l + 2]), l >= 4 && y.setW(ee, v[I * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
2772
2773
|
}
|
|
2773
2774
|
y.normalized = b;
|
|
@@ -2798,7 +2799,7 @@ class Ui {
|
|
|
2798
2799
|
const h = this.loadImageSource(t, s).then(function(u) {
|
|
2799
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);
|
|
2800
2801
|
const p = (i.samplers || {})[o.sampler] || {};
|
|
2801
|
-
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;
|
|
2802
2803
|
}).catch(function() {
|
|
2803
2804
|
return null;
|
|
2804
2805
|
});
|
|
@@ -2822,9 +2823,9 @@ class Ui {
|
|
|
2822
2823
|
return new Promise(function(p, m) {
|
|
2823
2824
|
let b = p;
|
|
2824
2825
|
t.isImageBitmapLoader === !0 && (b = function(f) {
|
|
2825
|
-
const y = new
|
|
2826
|
+
const y = new Ot(f);
|
|
2826
2827
|
y.needsUpdate = !0, p(y);
|
|
2827
|
-
}), t.load(
|
|
2828
|
+
}), t.load(He.resolveURL(c, i.path), b, void 0, m);
|
|
2828
2829
|
});
|
|
2829
2830
|
}).then(function(c) {
|
|
2830
2831
|
return h === !0 && a.revokeObjectURL(l), ne(c, o), c.userData.mimeType = o.mimeType || Fi(o.uri), c;
|
|
@@ -2847,11 +2848,11 @@ class Ui {
|
|
|
2847
2848
|
const i = this;
|
|
2848
2849
|
return this.getDependency("texture", s.index).then(function(o) {
|
|
2849
2850
|
if (!o) return null;
|
|
2850
|
-
if (s.texCoord !== void 0 && s.texCoord > 0 && (o = o.clone(), o.channel = s.texCoord), i.extensions[
|
|
2851
|
-
const a = s.extensions !== void 0 ? s.extensions[
|
|
2851
|
+
if (s.texCoord !== void 0 && s.texCoord > 0 && (o = o.clone(), o.channel = s.texCoord), i.extensions[A.KHR_TEXTURE_TRANSFORM]) {
|
|
2852
|
+
const a = s.extensions !== void 0 ? s.extensions[A.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
2852
2853
|
if (a) {
|
|
2853
2854
|
const l = i.associations.get(o);
|
|
2854
|
-
o = i.extensions[
|
|
2855
|
+
o = i.extensions[A.KHR_TEXTURE_TRANSFORM].extendTexture(o, a), i.associations.set(o, l);
|
|
2855
2856
|
}
|
|
2856
2857
|
}
|
|
2857
2858
|
return n !== void 0 && (o.colorSpace = n), e[t] = o, o;
|
|
@@ -2874,11 +2875,11 @@ class Ui {
|
|
|
2874
2875
|
if (e.isPoints) {
|
|
2875
2876
|
const a = "PointsMaterial:" + s.uuid;
|
|
2876
2877
|
let l = this.cache.get(a);
|
|
2877
|
-
l || (l = new Ce(),
|
|
2878
|
+
l || (l = new Ce(), Fe.prototype.copy.call(l, s), l.color.copy(s.color), l.map = s.map, l.sizeAttenuation = !1, this.cache.add(a, l)), s = l;
|
|
2878
2879
|
} else if (e.isLine) {
|
|
2879
2880
|
const a = "LineBasicMaterial:" + s.uuid;
|
|
2880
2881
|
let l = this.cache.get(a);
|
|
2881
|
-
l || (l = new
|
|
2882
|
+
l || (l = new je(), Fe.prototype.copy.call(l, s), l.color.copy(s.color), l.map = s.map, this.cache.add(a, l)), s = l;
|
|
2882
2883
|
}
|
|
2883
2884
|
if (n || i || o) {
|
|
2884
2885
|
let a = "ClonedMaterial:" + s.uuid + ":";
|
|
@@ -2889,7 +2890,7 @@ class Ui {
|
|
|
2889
2890
|
e.material = s;
|
|
2890
2891
|
}
|
|
2891
2892
|
getMaterialType() {
|
|
2892
|
-
return
|
|
2893
|
+
return fn;
|
|
2893
2894
|
}
|
|
2894
2895
|
/**
|
|
2895
2896
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -2902,32 +2903,32 @@ class Ui {
|
|
|
2902
2903
|
const t = this, s = this.json, n = this.extensions, i = s.materials[e];
|
|
2903
2904
|
let o;
|
|
2904
2905
|
const a = {}, l = i.extensions || {}, h = [];
|
|
2905
|
-
if (l[
|
|
2906
|
-
const c = n[
|
|
2906
|
+
if (l[A.KHR_MATERIALS_UNLIT]) {
|
|
2907
|
+
const c = n[A.KHR_MATERIALS_UNLIT];
|
|
2907
2908
|
o = c.getMaterialType(), h.push(c.extendParams(a, i, t));
|
|
2908
2909
|
} else {
|
|
2909
2910
|
const c = i.pbrMetallicRoughness || {};
|
|
2910
2911
|
if (a.color = new pe(1, 1, 1), a.opacity = 1, Array.isArray(c.baseColorFactor)) {
|
|
2911
2912
|
const p = c.baseColorFactor;
|
|
2912
|
-
a.color.setRGB(p[0], p[1], p[2],
|
|
2913
|
+
a.color.setRGB(p[0], p[1], p[2], le), a.opacity = p[3];
|
|
2913
2914
|
}
|
|
2914
|
-
c.baseColorTexture !== void 0 && h.push(t.assignTexture(a, "map", c.baseColorTexture,
|
|
2915
|
+
c.baseColorTexture !== void 0 && h.push(t.assignTexture(a, "map", c.baseColorTexture, Ae)), a.metalness = c.metallicFactor !== void 0 ? c.metallicFactor : 1, a.roughness = c.roughnessFactor !== void 0 ? c.roughnessFactor : 1, c.metallicRoughnessTexture !== void 0 && (h.push(t.assignTexture(a, "metalnessMap", c.metallicRoughnessTexture)), h.push(t.assignTexture(a, "roughnessMap", c.metallicRoughnessTexture))), o = this._invokeOne(function(p) {
|
|
2915
2916
|
return p.getMaterialType && p.getMaterialType(e);
|
|
2916
2917
|
}), h.push(Promise.all(this._invokeAll(function(p) {
|
|
2917
2918
|
return p.extendMaterialParams && p.extendMaterialParams(e, a);
|
|
2918
2919
|
})));
|
|
2919
2920
|
}
|
|
2920
|
-
i.doubleSided === !0 && (a.side =
|
|
2921
|
-
const u = i.alphaMode ||
|
|
2922
|
-
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)) {
|
|
2923
2924
|
const c = i.normalTexture.scale;
|
|
2924
2925
|
a.normalScale.set(c, c);
|
|
2925
2926
|
}
|
|
2926
2927
|
if (i.occlusionTexture !== void 0 && o !== _e && (h.push(t.assignTexture(a, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && o !== _e) {
|
|
2927
2928
|
const c = i.emissiveFactor;
|
|
2928
|
-
a.emissive = new pe().setRGB(c[0], c[1], c[2],
|
|
2929
|
+
a.emissive = new pe().setRGB(c[0], c[1], c[2], le);
|
|
2929
2930
|
}
|
|
2930
|
-
return i.emissiveTexture !== void 0 && o !== _e && h.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture,
|
|
2931
|
+
return i.emissiveTexture !== void 0 && o !== _e && h.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, Ae)), Promise.all(h).then(function() {
|
|
2931
2932
|
const c = new o(a);
|
|
2932
2933
|
return i.name && (c.name = i.name), ne(c, i), t.associations.set(c, { materials: e }), i.extensions && ge(n, c, i), c;
|
|
2933
2934
|
});
|
|
@@ -2955,8 +2956,8 @@ class Ui {
|
|
|
2955
2956
|
loadGeometries(e) {
|
|
2956
2957
|
const t = this, s = this.extensions, n = this.primitiveCache;
|
|
2957
2958
|
function i(a) {
|
|
2958
|
-
return s[
|
|
2959
|
-
return
|
|
2959
|
+
return s[A.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(l) {
|
|
2960
|
+
return tn(l, a, t);
|
|
2960
2961
|
});
|
|
2961
2962
|
}
|
|
2962
2963
|
const o = [];
|
|
@@ -2966,7 +2967,7 @@ class Ui {
|
|
|
2966
2967
|
o.push(c.promise);
|
|
2967
2968
|
else {
|
|
2968
2969
|
let p;
|
|
2969
|
-
h.extensions && h.extensions[
|
|
2970
|
+
h.extensions && h.extensions[A.KHR_DRACO_MESH_COMPRESSION] ? p = i(h) : p = tn(new Ge(), h, t), n[u] = { primitive: h, promise: p }, o.push(p);
|
|
2970
2971
|
}
|
|
2971
2972
|
}
|
|
2972
2973
|
return Promise.all(o);
|
|
@@ -2991,15 +2992,15 @@ class Ui {
|
|
|
2991
2992
|
let d;
|
|
2992
2993
|
const _ = h[m];
|
|
2993
2994
|
if (y.mode === W.TRIANGLES || y.mode === W.TRIANGLE_STRIP || y.mode === W.TRIANGLE_FAN || y.mode === void 0)
|
|
2994
|
-
d = i.isSkinnedMesh === !0 ? new Jn(f, _) : new T(f, _), d.isSkinnedMesh === !0 && d.normalizeSkinWeights(), y.mode === W.TRIANGLE_STRIP ? d.geometry =
|
|
2995
|
+
d = i.isSkinnedMesh === !0 ? new Jn(f, _) : new T(f, _), d.isSkinnedMesh === !0 && d.normalizeSkinWeights(), y.mode === W.TRIANGLE_STRIP ? d.geometry = qt(d.geometry, un) : y.mode === W.TRIANGLE_FAN && (d.geometry = qt(d.geometry, yt));
|
|
2995
2996
|
else if (y.mode === W.LINES)
|
|
2996
|
-
d = new
|
|
2997
|
+
d = new gt(f, _);
|
|
2997
2998
|
else if (y.mode === W.LINE_STRIP)
|
|
2998
2999
|
d = new re(f, _);
|
|
2999
3000
|
else if (y.mode === W.LINE_LOOP)
|
|
3000
3001
|
d = new es(f, _);
|
|
3001
3002
|
else if (y.mode === W.POINTS)
|
|
3002
|
-
d = new
|
|
3003
|
+
d = new st(f, _);
|
|
3003
3004
|
else
|
|
3004
3005
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + y.mode);
|
|
3005
3006
|
Object.keys(d.geometry.morphAttributes).length > 0 && ki(d, i), d.name = t.createUniqueName(i.name || "mesh_" + e), ne(d, i), y.extensions && ge(n, d, y), t.assignFinalMaterial(d), c.push(d);
|
|
@@ -3011,7 +3012,7 @@ class Ui {
|
|
|
3011
3012
|
});
|
|
3012
3013
|
if (c.length === 1)
|
|
3013
3014
|
return i.extensions && ge(n, c[0], i), c[0];
|
|
3014
|
-
const p = new
|
|
3015
|
+
const p = new nt();
|
|
3015
3016
|
i.extensions && ge(n, p, i), t.associations.set(p, { meshes: e });
|
|
3016
3017
|
for (let m = 0, b = c.length; m < b; m++)
|
|
3017
3018
|
p.add(c[m]);
|
|
@@ -3032,7 +3033,7 @@ class Ui {
|
|
|
3032
3033
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
3033
3034
|
return;
|
|
3034
3035
|
}
|
|
3035
|
-
return s.type === "perspective" ? t = new ts(
|
|
3036
|
+
return s.type === "perspective" ? t = new ts(ln.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new ns(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), s.name && (t.name = this.createUniqueName(s.name)), ne(t, s), Promise.resolve(t);
|
|
3036
3037
|
}
|
|
3037
3038
|
/**
|
|
3038
3039
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -3081,10 +3082,10 @@ class Ui {
|
|
|
3081
3082
|
]).then(function(c) {
|
|
3082
3083
|
const p = c[0], m = c[1], b = c[2], f = c[3], y = c[4], d = [];
|
|
3083
3084
|
for (let x = 0, S = p.length; x < S; x++) {
|
|
3084
|
-
const
|
|
3085
|
-
if (
|
|
3086
|
-
|
|
3087
|
-
const fe = s._createAnimationTracks(
|
|
3085
|
+
const R = p[x], v = m[x], I = b[x], ie = f[x], ee = y[x];
|
|
3086
|
+
if (R === void 0) continue;
|
|
3087
|
+
R.updateMatrix && R.updateMatrix();
|
|
3088
|
+
const fe = s._createAnimationTracks(R, v, I, ie, ee);
|
|
3088
3089
|
if (fe)
|
|
3089
3090
|
for (let $ = 0; $ < fe.length; $++)
|
|
3090
3091
|
d.push(fe[$]);
|
|
@@ -3151,7 +3152,7 @@ class Ui {
|
|
|
3151
3152
|
a.push(h);
|
|
3152
3153
|
}), this.nodeCache[e] = Promise.all(a).then(function(h) {
|
|
3153
3154
|
let u;
|
|
3154
|
-
if (i.isBone === !0 ? u = new os() : h.length > 1 ? u = new
|
|
3155
|
+
if (i.isBone === !0 ? u = new os() : h.length > 1 ? u = new nt() : h.length === 1 ? u = h[0] : u = new ze(), u !== h[0])
|
|
3155
3156
|
for (let c = 0, p = h.length; c < p; c++)
|
|
3156
3157
|
u.add(h[c]);
|
|
3157
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,7 +3177,7 @@ class Ui {
|
|
|
3176
3177
|
* @return {Promise<Group>}
|
|
3177
3178
|
*/
|
|
3178
3179
|
loadScene(e) {
|
|
3179
|
-
const t = this.extensions, s = this.json.scenes[e], n = this, i = new
|
|
3180
|
+
const t = this.extensions, s = this.json.scenes[e], n = this, i = new nt();
|
|
3180
3181
|
s.name && (i.name = n.createUniqueName(s.name)), ne(i, s), s.extensions && ge(t, i, s);
|
|
3181
3182
|
const o = s.nodes || [], a = [];
|
|
3182
3183
|
for (let l = 0, h = o.length; l < h; l++)
|
|
@@ -3189,7 +3190,7 @@ class Ui {
|
|
|
3189
3190
|
const h = (u) => {
|
|
3190
3191
|
const c = /* @__PURE__ */ new Map();
|
|
3191
3192
|
for (const [p, m] of n.associations)
|
|
3192
|
-
(p instanceof
|
|
3193
|
+
(p instanceof Fe || p instanceof Ot) && c.set(p, m);
|
|
3193
3194
|
return u.traverse((p) => {
|
|
3194
3195
|
const m = n.associations.get(p);
|
|
3195
3196
|
m != null && c.set(p, m);
|
|
@@ -3203,36 +3204,36 @@ class Ui {
|
|
|
3203
3204
|
function h(m) {
|
|
3204
3205
|
m.morphTargetInfluences && l.push(m.name ? m.name : m.uuid);
|
|
3205
3206
|
}
|
|
3206
|
-
|
|
3207
|
+
he[i.path] === he.weights ? (h(e), e.isGroup && e.children.forEach(h)) : l.push(a);
|
|
3207
3208
|
let u;
|
|
3208
|
-
switch (
|
|
3209
|
-
case
|
|
3210
|
-
u =
|
|
3209
|
+
switch (he[i.path]) {
|
|
3210
|
+
case he.weights:
|
|
3211
|
+
u = Dt;
|
|
3211
3212
|
break;
|
|
3212
|
-
case
|
|
3213
|
-
u =
|
|
3213
|
+
case he.rotation:
|
|
3214
|
+
u = Nt;
|
|
3214
3215
|
break;
|
|
3215
|
-
case
|
|
3216
|
-
case
|
|
3217
|
-
u =
|
|
3216
|
+
case he.translation:
|
|
3217
|
+
case he.scale:
|
|
3218
|
+
u = Ct;
|
|
3218
3219
|
break;
|
|
3219
3220
|
default:
|
|
3220
3221
|
switch (s.itemSize) {
|
|
3221
3222
|
case 1:
|
|
3222
|
-
u =
|
|
3223
|
+
u = Dt;
|
|
3223
3224
|
break;
|
|
3224
3225
|
case 2:
|
|
3225
3226
|
case 3:
|
|
3226
3227
|
default:
|
|
3227
|
-
u =
|
|
3228
|
+
u = Ct;
|
|
3228
3229
|
break;
|
|
3229
3230
|
}
|
|
3230
3231
|
break;
|
|
3231
3232
|
}
|
|
3232
|
-
const c = n.interpolation !== void 0 ? Ci[n.interpolation] :
|
|
3233
|
+
const c = n.interpolation !== void 0 ? Ci[n.interpolation] : mn, p = this._getArrayFromAccessor(s);
|
|
3233
3234
|
for (let m = 0, b = l.length; m < b; m++) {
|
|
3234
3235
|
const f = new u(
|
|
3235
|
-
l[m] + "." +
|
|
3236
|
+
l[m] + "." + he[i.path],
|
|
3236
3237
|
t.array,
|
|
3237
3238
|
p,
|
|
3238
3239
|
c
|
|
@@ -3244,7 +3245,7 @@ class Ui {
|
|
|
3244
3245
|
_getArrayFromAccessor(e) {
|
|
3245
3246
|
let t = e.array;
|
|
3246
3247
|
if (e.normalized) {
|
|
3247
|
-
const s =
|
|
3248
|
+
const s = xt(t.constructor), n = new Float32Array(t.length);
|
|
3248
3249
|
for (let i = 0, o = t.length; i < o; i++)
|
|
3249
3250
|
n[i] = t[i] * s;
|
|
3250
3251
|
t = n;
|
|
@@ -3253,7 +3254,7 @@ class Ui {
|
|
|
3253
3254
|
}
|
|
3254
3255
|
_createCubicSplineTrackInterpolant(e) {
|
|
3255
3256
|
e.createInterpolant = function(s) {
|
|
3256
|
-
const n = this instanceof
|
|
3257
|
+
const n = this instanceof Nt ? Oi : wn;
|
|
3257
3258
|
return new n(this.times, this.values, this.getValueSize() / 3, s);
|
|
3258
3259
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
3259
3260
|
}
|
|
@@ -3267,7 +3268,7 @@ function zi(r, e, t) {
|
|
|
3267
3268
|
new M(l[0], l[1], l[2]),
|
|
3268
3269
|
new M(h[0], h[1], h[2])
|
|
3269
3270
|
), a.normalized) {
|
|
3270
|
-
const u =
|
|
3271
|
+
const u = xt(ve[a.componentType]);
|
|
3271
3272
|
n.min.multiplyScalar(u), n.max.multiplyScalar(u);
|
|
3272
3273
|
}
|
|
3273
3274
|
} else {
|
|
@@ -3285,7 +3286,7 @@ function zi(r, e, t) {
|
|
|
3285
3286
|
const p = t.json.accessors[c.POSITION], m = p.min, b = p.max;
|
|
3286
3287
|
if (m !== void 0 && b !== void 0) {
|
|
3287
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) {
|
|
3288
|
-
const f =
|
|
3289
|
+
const f = xt(ve[p.componentType]);
|
|
3289
3290
|
l.multiplyScalar(f);
|
|
3290
3291
|
}
|
|
3291
3292
|
a.max(l);
|
|
@@ -3299,7 +3300,7 @@ function zi(r, e, t) {
|
|
|
3299
3300
|
const o = new hs();
|
|
3300
3301
|
n.getCenter(o.center), o.radius = n.min.distanceTo(n.max) / 2, r.boundingSphere = o;
|
|
3301
3302
|
}
|
|
3302
|
-
function
|
|
3303
|
+
function tn(r, e, t) {
|
|
3303
3304
|
const s = e.attributes, n = [];
|
|
3304
3305
|
function i(o, a) {
|
|
3305
3306
|
return t.getDependency("accessor", o).then(function(l) {
|
|
@@ -3307,7 +3308,7 @@ function Jt(r, e, t) {
|
|
|
3307
3308
|
});
|
|
3308
3309
|
}
|
|
3309
3310
|
for (const o in s) {
|
|
3310
|
-
const a =
|
|
3311
|
+
const a = Tt[o] || o.toLowerCase();
|
|
3311
3312
|
a in r.attributes || n.push(i(s[o], a));
|
|
3312
3313
|
}
|
|
3313
3314
|
if (e.indices !== void 0 && !r.index) {
|
|
@@ -3316,17 +3317,17 @@ function Jt(r, e, t) {
|
|
|
3316
3317
|
});
|
|
3317
3318
|
n.push(o);
|
|
3318
3319
|
}
|
|
3319
|
-
return
|
|
3320
|
+
return kt.workingColorSpace !== le && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${kt.workingColorSpace}" not supported.`), ne(r, e), zi(r, e, t), Promise.all(n).then(function() {
|
|
3320
3321
|
return e.targets !== void 0 ? Ni(r, e.targets, t) : r;
|
|
3321
3322
|
});
|
|
3322
3323
|
}
|
|
3323
3324
|
function Gi() {
|
|
3324
3325
|
const r = new F.BoxGeometry(1, 1, 1), e = new F.MeshStandardMaterial({ color: 43775 }), t = new F.Mesh(r, e);
|
|
3325
|
-
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;
|
|
3326
3327
|
}
|
|
3327
3328
|
function Xi() {
|
|
3328
3329
|
const r = new F.SphereGeometry(0.6, 32, 32), e = new F.MeshStandardMaterial({ color: 16746496 }), t = new F.Mesh(r, e);
|
|
3329
|
-
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;
|
|
3330
3331
|
}
|
|
3331
3332
|
function Yi(r) {
|
|
3332
3333
|
return new Promise((e, t) => {
|
|
@@ -3348,7 +3349,7 @@ function Yi(r) {
|
|
|
3348
3349
|
c.userData.isMovable = !0, c.name || (c.name = c.type), c.type === "Mesh" && (c.frustumCulled = !0, (p = c.geometry) == null || p.computeVertexNormals());
|
|
3349
3350
|
});
|
|
3350
3351
|
const u = new F.Box3().setFromObject(l).getCenter(new F.Vector3());
|
|
3351
|
-
l.position.sub(u),
|
|
3352
|
+
l.position.sub(u), At(l, !0), e(l);
|
|
3352
3353
|
},
|
|
3353
3354
|
void 0,
|
|
3354
3355
|
(a) => t(a)
|
|
@@ -3371,7 +3372,7 @@ const Ki = {
|
|
|
3371
3372
|
}, Vi = { class: "tree-icon" }, Zi = { class: "tree-name" }, Qi = {
|
|
3372
3373
|
key: 0,
|
|
3373
3374
|
class: "tree-children"
|
|
3374
|
-
}, qi = /* @__PURE__ */
|
|
3375
|
+
}, qi = /* @__PURE__ */ Xe({
|
|
3375
3376
|
__name: "TreeItem",
|
|
3376
3377
|
props: {
|
|
3377
3378
|
node: {},
|
|
@@ -3380,15 +3381,15 @@ const Ki = {
|
|
|
3380
3381
|
},
|
|
3381
3382
|
emits: ["select", "delete"],
|
|
3382
3383
|
setup(r, { emit: e }) {
|
|
3383
|
-
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 = Qe(() => i.value.has(t.node.uuid)), l = Qe(() => (t.version, t.node.children.some((f) => f.userData.isMovable === !0))), h = Qe(() => (t.version, t.node.children.filter(
|
|
3384
3385
|
(f) => f.userData.isMovable === !0
|
|
3385
|
-
))), u =
|
|
3386
|
+
))), u = Qe(
|
|
3386
3387
|
() => {
|
|
3387
3388
|
var f;
|
|
3388
3389
|
return ((f = t.selectedObject) == null ? void 0 : f.uuid) === t.node.uuid;
|
|
3389
3390
|
}
|
|
3390
3391
|
);
|
|
3391
|
-
|
|
3392
|
+
En(
|
|
3392
3393
|
() => {
|
|
3393
3394
|
u.value && n.value && n.value.scrollIntoView({
|
|
3394
3395
|
block: "nearest",
|
|
@@ -3405,30 +3406,30 @@ const Ki = {
|
|
|
3405
3406
|
f.stopPropagation(), s("delete", t.node);
|
|
3406
3407
|
}, m = (f) => f.type === "Mesh" || f.type === "Sprite" ? "🟦" : f.type === "Light" ? "💡" : "📦", b = (f) => f.name || `${f.type} (${f.id})`;
|
|
3407
3408
|
return (f, y) => {
|
|
3408
|
-
const d =
|
|
3409
|
-
return
|
|
3409
|
+
const d = Mn("TreeItem", !0);
|
|
3410
|
+
return C(), U("div", {
|
|
3410
3411
|
class: "tree-node",
|
|
3411
3412
|
ref_key: "nodeRef",
|
|
3412
3413
|
ref: n
|
|
3413
3414
|
}, [
|
|
3414
3415
|
g("div", {
|
|
3415
|
-
class:
|
|
3416
|
+
class: Ue(["tree-item", { selected: u.value }]),
|
|
3416
3417
|
onClick: c
|
|
3417
3418
|
}, [
|
|
3418
|
-
l.value ? (
|
|
3419
|
+
l.value ? (C(), U("span", {
|
|
3419
3420
|
key: 0,
|
|
3420
3421
|
class: "toggle-icon",
|
|
3421
|
-
onClick: y[0] || (y[0] =
|
|
3422
|
-
}, Ee(a.value ? "▼" : "▶"), 1)) : (
|
|
3422
|
+
onClick: y[0] || (y[0] = Lt((_) => vn(o)(r.node.uuid), ["stop"]))
|
|
3423
|
+
}, Ee(a.value ? "▼" : "▶"), 1)) : (C(), U("span", Ki)),
|
|
3423
3424
|
g("span", Vi, Ee(m(r.node)), 1),
|
|
3424
3425
|
g("span", Zi, Ee(b(r.node)), 1),
|
|
3425
3426
|
g("button", {
|
|
3426
3427
|
class: "tree-delete",
|
|
3427
|
-
onClick:
|
|
3428
|
+
onClick: Lt(p, ["stop"])
|
|
3428
3429
|
}, "×")
|
|
3429
3430
|
], 2),
|
|
3430
|
-
a.value && l.value ? (
|
|
3431
|
-
(
|
|
3431
|
+
a.value && l.value ? (C(), U("div", Qi, [
|
|
3432
|
+
(C(!0), U(nn, null, sn(h.value, (_) => (C(), ke(d, {
|
|
3432
3433
|
key: _.uuid,
|
|
3433
3434
|
node: _,
|
|
3434
3435
|
"selected-object": r.selectedObject,
|
|
@@ -3436,16 +3437,16 @@ const Ki = {
|
|
|
3436
3437
|
onSelect: y[1] || (y[1] = (x) => s("select", x)),
|
|
3437
3438
|
onDelete: y[2] || (y[2] = (x) => s("delete", x))
|
|
3438
3439
|
}, null, 8, ["node", "selected-object", "version"]))), 128))
|
|
3439
|
-
])) :
|
|
3440
|
+
])) : ae("", !0)
|
|
3440
3441
|
], 512);
|
|
3441
3442
|
};
|
|
3442
3443
|
}
|
|
3443
|
-
}),
|
|
3444
|
+
}), Ye = (r, e) => {
|
|
3444
3445
|
const t = r.__vccOpts || r;
|
|
3445
3446
|
for (const [s, n] of e)
|
|
3446
3447
|
t[s] = n;
|
|
3447
3448
|
return t;
|
|
3448
|
-
}, Wi = /* @__PURE__ */
|
|
3449
|
+
}, Wi = /* @__PURE__ */ Ye(qi, [["__scopeId", "data-v-5ad9c842"]]);
|
|
3449
3450
|
function $i(r) {
|
|
3450
3451
|
const e = G(/* @__PURE__ */ new Set()), t = (n) => {
|
|
3451
3452
|
const i = new Set(e.value);
|
|
@@ -3458,7 +3459,7 @@ function $i(r) {
|
|
|
3458
3459
|
i.add(o.uuid), o = o.parent;
|
|
3459
3460
|
e.value = i;
|
|
3460
3461
|
};
|
|
3461
|
-
return
|
|
3462
|
+
return on(
|
|
3462
3463
|
r,
|
|
3463
3464
|
(n) => {
|
|
3464
3465
|
n && s(n);
|
|
@@ -3487,7 +3488,7 @@ const Ji = {
|
|
|
3487
3488
|
}, wo = {
|
|
3488
3489
|
key: 1,
|
|
3489
3490
|
class: "property-panel empty"
|
|
3490
|
-
}, To = /* @__PURE__ */
|
|
3491
|
+
}, To = /* @__PURE__ */ Xe({
|
|
3491
3492
|
__name: "PropertyPanel",
|
|
3492
3493
|
props: {
|
|
3493
3494
|
transform: {},
|
|
@@ -3496,11 +3497,11 @@ const Ji = {
|
|
|
3496
3497
|
},
|
|
3497
3498
|
emits: ["propertyChange", "treeSelect", "treeDelete"],
|
|
3498
3499
|
setup(r, { emit: e }) {
|
|
3499
|
-
const t = r, s = e, n = () => s("propertyChange"), i = G("transform"), o = G(0), a =
|
|
3500
|
-
|
|
3500
|
+
const t = r, s = e, n = () => s("propertyChange"), i = G("transform"), o = G(0), a = Sn(t, "selectedObject"), { expandedSet: l, toggleExpand: h } = $i(a);
|
|
3501
|
+
An("treeExpand", { expandedSet: l, toggleExpand: h });
|
|
3501
3502
|
const u = (y) => {
|
|
3502
3503
|
o.value++, s("treeDelete", y);
|
|
3503
|
-
}, c =
|
|
3504
|
+
}, c = rn({
|
|
3504
3505
|
metalness: 0,
|
|
3505
3506
|
roughness: 0.5,
|
|
3506
3507
|
opacity: 1
|
|
@@ -3510,13 +3511,13 @@ const Ji = {
|
|
|
3510
3511
|
return y.traverse((_) => {
|
|
3511
3512
|
if (_.type === "Mesh" && !d) {
|
|
3512
3513
|
const x = _, S = Array.isArray(x.material) ? x.material : [x.material];
|
|
3513
|
-
for (const
|
|
3514
|
-
if (
|
|
3515
|
-
const v =
|
|
3514
|
+
for (const R of S)
|
|
3515
|
+
if (R && (R.type === "MeshStandardMaterial" || R.type === "MeshPhongMaterial")) {
|
|
3516
|
+
const v = R;
|
|
3516
3517
|
d = {
|
|
3517
3518
|
metalness: v.metalness ?? 0,
|
|
3518
3519
|
roughness: v.roughness ?? 0.5,
|
|
3519
|
-
opacity:
|
|
3520
|
+
opacity: R.opacity ?? 1
|
|
3520
3521
|
};
|
|
3521
3522
|
break;
|
|
3522
3523
|
}
|
|
@@ -3527,8 +3528,8 @@ const Ji = {
|
|
|
3527
3528
|
let _ = !1;
|
|
3528
3529
|
return y.traverse((x) => {
|
|
3529
3530
|
if (x.type === "Mesh") {
|
|
3530
|
-
const S = x,
|
|
3531
|
-
for (const v of
|
|
3531
|
+
const S = x, R = Array.isArray(S.material) ? S.material : [S.material];
|
|
3532
|
+
for (const v of R)
|
|
3532
3533
|
v && (v.type === "MeshStandardMaterial" || v.type === "MeshPhongMaterial") && (d.metalness !== void 0 && (v.metalness = d.metalness), d.roughness !== void 0 && (v.roughness = d.roughness), d.opacity !== void 0 && (v.opacity = d.opacity, v.transparent = d.opacity < 1), v.needsUpdate = !0, _ = !0);
|
|
3533
3534
|
}
|
|
3534
3535
|
}), _;
|
|
@@ -3543,7 +3544,7 @@ const Ji = {
|
|
|
3543
3544
|
p.value = y;
|
|
3544
3545
|
}
|
|
3545
3546
|
}
|
|
3546
|
-
return
|
|
3547
|
+
return on(
|
|
3547
3548
|
() => t.selectedObject,
|
|
3548
3549
|
(y) => {
|
|
3549
3550
|
if (y) {
|
|
@@ -3553,12 +3554,12 @@ const Ji = {
|
|
|
3553
3554
|
c.metalness = 0, c.roughness = 0.5, c.opacity = 1, p.value = !1;
|
|
3554
3555
|
},
|
|
3555
3556
|
{ immediate: !0 }
|
|
3556
|
-
), (y, d) => r.transform ? (
|
|
3557
|
+
), (y, d) => r.transform ? (C(), U("div", Ji, [
|
|
3557
3558
|
d[32] || (d[32] = g("h3", null, "属性面板", -1)),
|
|
3558
3559
|
g("div", eo, [
|
|
3559
3560
|
d[15] || (d[15] = g("label", null, "场景物体", -1)),
|
|
3560
3561
|
g("div", to, [
|
|
3561
|
-
(
|
|
3562
|
+
(C(!0), U(nn, null, sn(r.treeData, (_) => (C(), ke(Wi, {
|
|
3562
3563
|
key: _.uuid,
|
|
3563
3564
|
node: _,
|
|
3564
3565
|
"selected-object": r.selectedObject,
|
|
@@ -3566,30 +3567,30 @@ const Ji = {
|
|
|
3566
3567
|
onSelect: d[0] || (d[0] = (x) => s("treeSelect", x)),
|
|
3567
3568
|
onDelete: u
|
|
3568
3569
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
3569
|
-
r.treeData.length === 0 ? (
|
|
3570
|
+
r.treeData.length === 0 ? (C(), U("div", no, "暂无物体")) : ae("", !0)
|
|
3570
3571
|
])
|
|
3571
3572
|
]),
|
|
3572
3573
|
d[33] || (d[33] = g("div", { class: "property-group" }, [
|
|
3573
3574
|
g("label", null, "全局属性"),
|
|
3574
3575
|
g("div", { class: "row" })
|
|
3575
3576
|
], -1)),
|
|
3576
|
-
r.selectedObject ? (
|
|
3577
|
+
r.selectedObject ? (C(), U("div", so, [
|
|
3577
3578
|
g("button", {
|
|
3578
|
-
class:
|
|
3579
|
+
class: Ue(["tab-btn", { active: i.value === "transform" }]),
|
|
3579
3580
|
onClick: d[1] || (d[1] = (_) => i.value = "transform")
|
|
3580
3581
|
}, " 🔄 变换 ", 2),
|
|
3581
3582
|
g("button", {
|
|
3582
|
-
class:
|
|
3583
|
+
class: Ue(["tab-btn", { active: i.value === "info" }]),
|
|
3583
3584
|
onClick: d[2] || (d[2] = (_) => i.value = "info")
|
|
3584
3585
|
}, " ℹ️ 信息 ", 2)
|
|
3585
|
-
])) :
|
|
3586
|
-
r.selectedObject ? (
|
|
3587
|
-
|
|
3586
|
+
])) : ae("", !0),
|
|
3587
|
+
r.selectedObject ? (C(), U("div", io, [
|
|
3588
|
+
N(g("div", null, [
|
|
3588
3589
|
g("div", oo, [
|
|
3589
3590
|
d[19] || (d[19] = g("label", null, "位置", -1)),
|
|
3590
3591
|
g("div", ro, [
|
|
3591
3592
|
d[16] || (d[16] = g("span", null, "X:", -1)),
|
|
3592
|
-
|
|
3593
|
+
N(g("input", {
|
|
3593
3594
|
type: "number",
|
|
3594
3595
|
"onUpdate:modelValue": d[3] || (d[3] = (_) => r.transform.position.x = _),
|
|
3595
3596
|
step: "0.01",
|
|
@@ -3603,7 +3604,7 @@ const Ji = {
|
|
|
3603
3604
|
]
|
|
3604
3605
|
]),
|
|
3605
3606
|
d[17] || (d[17] = g("span", null, "Y:", -1)),
|
|
3606
|
-
|
|
3607
|
+
N(g("input", {
|
|
3607
3608
|
type: "number",
|
|
3608
3609
|
"onUpdate:modelValue": d[4] || (d[4] = (_) => r.transform.position.y = _),
|
|
3609
3610
|
step: "0.01",
|
|
@@ -3617,7 +3618,7 @@ const Ji = {
|
|
|
3617
3618
|
]
|
|
3618
3619
|
]),
|
|
3619
3620
|
d[18] || (d[18] = g("span", null, "Z:", -1)),
|
|
3620
|
-
|
|
3621
|
+
N(g("input", {
|
|
3621
3622
|
type: "number",
|
|
3622
3623
|
"onUpdate:modelValue": d[5] || (d[5] = (_) => r.transform.position.z = _),
|
|
3623
3624
|
step: "0.01",
|
|
@@ -3636,7 +3637,7 @@ const Ji = {
|
|
|
3636
3637
|
d[23] || (d[23] = g("label", null, "旋转 (弧度)", -1)),
|
|
3637
3638
|
g("div", lo, [
|
|
3638
3639
|
d[20] || (d[20] = g("span", null, "X:", -1)),
|
|
3639
|
-
|
|
3640
|
+
N(g("input", {
|
|
3640
3641
|
type: "number",
|
|
3641
3642
|
"onUpdate:modelValue": d[6] || (d[6] = (_) => r.transform.rotation.x = _),
|
|
3642
3643
|
step: "0.01",
|
|
@@ -3650,7 +3651,7 @@ const Ji = {
|
|
|
3650
3651
|
]
|
|
3651
3652
|
]),
|
|
3652
3653
|
d[21] || (d[21] = g("span", null, "Y:", -1)),
|
|
3653
|
-
|
|
3654
|
+
N(g("input", {
|
|
3654
3655
|
type: "number",
|
|
3655
3656
|
"onUpdate:modelValue": d[7] || (d[7] = (_) => r.transform.rotation.y = _),
|
|
3656
3657
|
step: "0.01",
|
|
@@ -3664,7 +3665,7 @@ const Ji = {
|
|
|
3664
3665
|
]
|
|
3665
3666
|
]),
|
|
3666
3667
|
d[22] || (d[22] = g("span", null, "Z:", -1)),
|
|
3667
|
-
|
|
3668
|
+
N(g("input", {
|
|
3668
3669
|
type: "number",
|
|
3669
3670
|
"onUpdate:modelValue": d[8] || (d[8] = (_) => r.transform.rotation.z = _),
|
|
3670
3671
|
step: "0.01",
|
|
@@ -3683,7 +3684,7 @@ const Ji = {
|
|
|
3683
3684
|
d[27] || (d[27] = g("label", null, "缩放", -1)),
|
|
3684
3685
|
g("div", ho, [
|
|
3685
3686
|
d[24] || (d[24] = g("span", null, "X:", -1)),
|
|
3686
|
-
|
|
3687
|
+
N(g("input", {
|
|
3687
3688
|
type: "number",
|
|
3688
3689
|
"onUpdate:modelValue": d[9] || (d[9] = (_) => r.transform.scale.x = _),
|
|
3689
3690
|
step: "0.01",
|
|
@@ -3697,7 +3698,7 @@ const Ji = {
|
|
|
3697
3698
|
]
|
|
3698
3699
|
]),
|
|
3699
3700
|
d[25] || (d[25] = g("span", null, "Y:", -1)),
|
|
3700
|
-
|
|
3701
|
+
N(g("input", {
|
|
3701
3702
|
type: "number",
|
|
3702
3703
|
"onUpdate:modelValue": d[10] || (d[10] = (_) => r.transform.scale.y = _),
|
|
3703
3704
|
step: "0.01",
|
|
@@ -3711,7 +3712,7 @@ const Ji = {
|
|
|
3711
3712
|
]
|
|
3712
3713
|
]),
|
|
3713
3714
|
d[26] || (d[26] = g("span", null, "Z:", -1)),
|
|
3714
|
-
|
|
3715
|
+
N(g("input", {
|
|
3715
3716
|
type: "number",
|
|
3716
3717
|
"onUpdate:modelValue": d[11] || (d[11] = (_) => r.transform.scale.z = _),
|
|
3717
3718
|
step: "0.01",
|
|
@@ -3726,11 +3727,11 @@ const Ji = {
|
|
|
3726
3727
|
])
|
|
3727
3728
|
])
|
|
3728
3729
|
]),
|
|
3729
|
-
r.selectedObject ? (
|
|
3730
|
+
r.selectedObject ? (C(), U("div", uo, [
|
|
3730
3731
|
d[31] || (d[31] = g("label", null, "材质", -1)),
|
|
3731
3732
|
g("div", po, [
|
|
3732
3733
|
d[28] || (d[28] = g("span", { class: "slider-label" }, "金属度", -1)),
|
|
3733
|
-
|
|
3734
|
+
N(g("input", {
|
|
3734
3735
|
type: "range",
|
|
3735
3736
|
min: "0",
|
|
3736
3737
|
max: "1",
|
|
@@ -3749,7 +3750,7 @@ const Ji = {
|
|
|
3749
3750
|
]),
|
|
3750
3751
|
g("div", mo, [
|
|
3751
3752
|
d[29] || (d[29] = g("span", { class: "slider-label" }, "粗糙度", -1)),
|
|
3752
|
-
|
|
3753
|
+
N(g("input", {
|
|
3753
3754
|
type: "range",
|
|
3754
3755
|
min: "0",
|
|
3755
3756
|
max: "1",
|
|
@@ -3768,7 +3769,7 @@ const Ji = {
|
|
|
3768
3769
|
]),
|
|
3769
3770
|
g("div", yo, [
|
|
3770
3771
|
d[30] || (d[30] = g("span", { class: "slider-label" }, "透明度", -1)),
|
|
3771
|
-
|
|
3772
|
+
N(g("input", {
|
|
3772
3773
|
type: "range",
|
|
3773
3774
|
min: "0",
|
|
3774
3775
|
max: "1",
|
|
@@ -3785,17 +3786,17 @@ const Ji = {
|
|
|
3785
3786
|
]),
|
|
3786
3787
|
g("span", _o, Ee(c.opacity.toFixed(2)), 1)
|
|
3787
3788
|
]),
|
|
3788
|
-
p.value ?
|
|
3789
|
-
])) :
|
|
3789
|
+
p.value ? ae("", !0) : (C(), U("div", bo, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
|
|
3790
|
+
])) : ae("", !0)
|
|
3790
3791
|
], 512), [
|
|
3791
|
-
[
|
|
3792
|
+
[ue, i.value === "transform"]
|
|
3792
3793
|
])
|
|
3793
|
-
])) :
|
|
3794
|
-
])) : (
|
|
3794
|
+
])) : ae("", !0)
|
|
3795
|
+
])) : (C(), U("div", wo, [...d[34] || (d[34] = [
|
|
3795
3796
|
g("p", null, "未选中任何模型", -1)
|
|
3796
3797
|
])]));
|
|
3797
3798
|
}
|
|
3798
|
-
}), xo = /* @__PURE__ */
|
|
3799
|
+
}), xo = /* @__PURE__ */ Ye(To, [["__scopeId", "data-v-d75c643f"]]), Eo = { class: "top-bar" }, Mo = { class: "left-section" }, vo = { class: "dropdown-menu" }, So = { class: "dropdown-menu sub-menu" }, Ao = { class: "dropdown-menu" }, Ro = { class: "dropdown-menu sub-menu" }, Po = { class: "dropdown-menu" }, Lo = { class: "dropdown-menu" }, Io = { class: "dropdown-menu" }, Oo = /* @__PURE__ */ Xe({
|
|
3799
3800
|
__name: "TopBar",
|
|
3800
3801
|
emits: ["addModel", "importModel"],
|
|
3801
3802
|
setup(r, { emit: e }) {
|
|
@@ -3805,8 +3806,8 @@ const Ji = {
|
|
|
3805
3806
|
}, p = ($) => {
|
|
3806
3807
|
const E = $.target;
|
|
3807
3808
|
E.files && E.files.length > 0 && (h("importModel", E.files[0]), E.value = "");
|
|
3808
|
-
}, m = () => console.log("新建项目"), b = () => console.log("保存场景"), f = () => console.log("导出模型"), y = () => console.log("撤销"), d = () => console.log("重做"), _ = () => console.log("复制物体"), x = () => console.log("删除物体"), S = () => console.log("重置相机"),
|
|
3809
|
-
return ($, E) => (
|
|
3809
|
+
}, m = () => console.log("新建项目"), b = () => console.log("保存场景"), f = () => console.log("导出模型"), y = () => console.log("撤销"), d = () => console.log("重做"), _ = () => console.log("复制物体"), x = () => console.log("删除物体"), S = () => console.log("重置相机"), R = () => console.log("切换网格"), v = () => console.log("打开帮助"), I = () => console.log("关于编辑器"), ie = () => console.log("打开项目"), ee = () => console.log("打开模型"), fe = () => console.log("打开场景");
|
|
3810
|
+
return ($, E) => (C(), U("div", Eo, [
|
|
3810
3811
|
g("div", Mo, [
|
|
3811
3812
|
g("div", {
|
|
3812
3813
|
class: "dropdown-wrapper",
|
|
@@ -3814,7 +3815,7 @@ const Ji = {
|
|
|
3814
3815
|
onMouseleave: E[3] || (E[3] = (j) => t.value = !1)
|
|
3815
3816
|
}, [
|
|
3816
3817
|
E[17] || (E[17] = g("button", { class: "menu-btn" }, "文件", -1)),
|
|
3817
|
-
|
|
3818
|
+
N(g("div", vo, [
|
|
3818
3819
|
g("div", {
|
|
3819
3820
|
class: "menu-item",
|
|
3820
3821
|
onClick: m
|
|
@@ -3825,7 +3826,7 @@ const Ji = {
|
|
|
3825
3826
|
onMouseleave: E[1] || (E[1] = (j) => a.value = !1)
|
|
3826
3827
|
}, [
|
|
3827
3828
|
E[16] || (E[16] = g("span", null, "打开", -1)),
|
|
3828
|
-
|
|
3829
|
+
N(g("div", So, [
|
|
3829
3830
|
g("div", {
|
|
3830
3831
|
class: "menu-item",
|
|
3831
3832
|
onClick: ie
|
|
@@ -3839,7 +3840,7 @@ const Ji = {
|
|
|
3839
3840
|
onClick: fe
|
|
3840
3841
|
}, "打开场景")
|
|
3841
3842
|
], 512), [
|
|
3842
|
-
[
|
|
3843
|
+
[ue, a.value]
|
|
3843
3844
|
])
|
|
3844
3845
|
], 32),
|
|
3845
3846
|
g("div", {
|
|
@@ -3851,7 +3852,7 @@ const Ji = {
|
|
|
3851
3852
|
onClick: f
|
|
3852
3853
|
}, "导出")
|
|
3853
3854
|
], 512), [
|
|
3854
|
-
[
|
|
3855
|
+
[ue, t.value]
|
|
3855
3856
|
])
|
|
3856
3857
|
], 32),
|
|
3857
3858
|
g("div", {
|
|
@@ -3860,7 +3861,7 @@ const Ji = {
|
|
|
3860
3861
|
onMouseleave: E[9] || (E[9] = (j) => o.value = !1)
|
|
3861
3862
|
}, [
|
|
3862
3863
|
E[19] || (E[19] = g("button", { class: "menu-btn" }, "添加", -1)),
|
|
3863
|
-
|
|
3864
|
+
N(g("div", Ao, [
|
|
3864
3865
|
g("div", {
|
|
3865
3866
|
class: "menu-item",
|
|
3866
3867
|
onClick: y
|
|
@@ -3871,7 +3872,7 @@ const Ji = {
|
|
|
3871
3872
|
onMouseleave: E[7] || (E[7] = (j) => l.value = !1)
|
|
3872
3873
|
}, [
|
|
3873
3874
|
E[18] || (E[18] = g("span", null, "网格", -1)),
|
|
3874
|
-
|
|
3875
|
+
N(g("div", Ro, [
|
|
3875
3876
|
g("div", {
|
|
3876
3877
|
class: "menu-item",
|
|
3877
3878
|
onClick: E[4] || (E[4] = (j) => h("addModel", "box"))
|
|
@@ -3885,7 +3886,7 @@ const Ji = {
|
|
|
3885
3886
|
onClick: c
|
|
3886
3887
|
}, "导入")
|
|
3887
3888
|
], 512), [
|
|
3888
|
-
[
|
|
3889
|
+
[ue, l.value]
|
|
3889
3890
|
])
|
|
3890
3891
|
], 32),
|
|
3891
3892
|
g("div", {
|
|
@@ -3897,7 +3898,7 @@ const Ji = {
|
|
|
3897
3898
|
onClick: x
|
|
3898
3899
|
}, "摄像机")
|
|
3899
3900
|
], 512), [
|
|
3900
|
-
[
|
|
3901
|
+
[ue, o.value]
|
|
3901
3902
|
])
|
|
3902
3903
|
], 32),
|
|
3903
3904
|
g("div", {
|
|
@@ -3906,7 +3907,7 @@ const Ji = {
|
|
|
3906
3907
|
onMouseleave: E[11] || (E[11] = (j) => s.value = !1)
|
|
3907
3908
|
}, [
|
|
3908
3909
|
E[20] || (E[20] = g("button", { class: "menu-btn" }, "编辑", -1)),
|
|
3909
|
-
|
|
3910
|
+
N(g("div", Po, [
|
|
3910
3911
|
g("div", {
|
|
3911
3912
|
class: "menu-item",
|
|
3912
3913
|
onClick: y
|
|
@@ -3924,7 +3925,7 @@ const Ji = {
|
|
|
3924
3925
|
onClick: x
|
|
3925
3926
|
}, "删除")
|
|
3926
3927
|
], 512), [
|
|
3927
|
-
[
|
|
3928
|
+
[ue, s.value]
|
|
3928
3929
|
])
|
|
3929
3930
|
], 32),
|
|
3930
3931
|
g("div", {
|
|
@@ -3933,17 +3934,17 @@ const Ji = {
|
|
|
3933
3934
|
onMouseleave: E[13] || (E[13] = (j) => n.value = !1)
|
|
3934
3935
|
}, [
|
|
3935
3936
|
E[21] || (E[21] = g("button", { class: "menu-btn" }, "视图", -1)),
|
|
3936
|
-
|
|
3937
|
+
N(g("div", Lo, [
|
|
3937
3938
|
g("div", {
|
|
3938
3939
|
class: "menu-item",
|
|
3939
3940
|
onClick: S
|
|
3940
3941
|
}, "重置相机"),
|
|
3941
3942
|
g("div", {
|
|
3942
3943
|
class: "menu-item",
|
|
3943
|
-
onClick:
|
|
3944
|
+
onClick: R
|
|
3944
3945
|
}, "显示网格")
|
|
3945
3946
|
], 512), [
|
|
3946
|
-
[
|
|
3947
|
+
[ue, n.value]
|
|
3947
3948
|
])
|
|
3948
3949
|
], 32),
|
|
3949
3950
|
g("div", {
|
|
@@ -3952,7 +3953,7 @@ const Ji = {
|
|
|
3952
3953
|
onMouseleave: E[15] || (E[15] = (j) => i.value = !1)
|
|
3953
3954
|
}, [
|
|
3954
3955
|
E[22] || (E[22] = g("button", { class: "menu-btn" }, "帮助", -1)),
|
|
3955
|
-
|
|
3956
|
+
N(g("div", Io, [
|
|
3956
3957
|
g("div", {
|
|
3957
3958
|
class: "menu-item",
|
|
3958
3959
|
onClick: v
|
|
@@ -3962,7 +3963,7 @@ const Ji = {
|
|
|
3962
3963
|
onClick: I
|
|
3963
3964
|
}, "关于")
|
|
3964
3965
|
], 512), [
|
|
3965
|
-
[
|
|
3966
|
+
[ue, i.value]
|
|
3966
3967
|
])
|
|
3967
3968
|
], 32)
|
|
3968
3969
|
]),
|
|
@@ -3979,10 +3980,10 @@ const Ji = {
|
|
|
3979
3980
|
}, null, 544)
|
|
3980
3981
|
]));
|
|
3981
3982
|
}
|
|
3982
|
-
}), Co = /* @__PURE__ */
|
|
3983
|
+
}), Co = /* @__PURE__ */ Ye(Oo, [["__scopeId", "data-v-6bb4762f"]]), Do = { class: "bottom-bar" }, No = /* @__PURE__ */ Xe({
|
|
3983
3984
|
__name: "BottomBar",
|
|
3984
3985
|
setup(r) {
|
|
3985
|
-
return (e, t) => (
|
|
3986
|
+
return (e, t) => (C(), U("div", Do, [...t[0] || (t[0] = [
|
|
3986
3987
|
g("div", { class: "status-left" }, [
|
|
3987
3988
|
g("span", null, "就绪")
|
|
3988
3989
|
], -1),
|
|
@@ -3991,14 +3992,14 @@ const Ji = {
|
|
|
3991
3992
|
], -1)
|
|
3992
3993
|
])]));
|
|
3993
3994
|
}
|
|
3994
|
-
}), ko = /* @__PURE__ */
|
|
3995
|
+
}), ko = /* @__PURE__ */ Ye(No, [["__scopeId", "data-v-3427bb27"]]), jo = { class: "app-layout" }, Fo = /* @__PURE__ */ Xe({
|
|
3995
3996
|
__name: "DrawingBoard",
|
|
3996
3997
|
props: {
|
|
3997
3998
|
mode: { default: "edit" },
|
|
3998
3999
|
sceneData: { default: null }
|
|
3999
4000
|
},
|
|
4000
4001
|
setup(r) {
|
|
4001
|
-
const e = r, t = G(null), s =
|
|
4002
|
+
const e = r, t = G(null), s = rn({
|
|
4002
4003
|
position: { x: 0, y: 0, z: 0 },
|
|
4003
4004
|
rotation: { x: 0, y: 0, z: 0 },
|
|
4004
4005
|
scale: { x: 1, y: 1, z: 1 }
|
|
@@ -4035,24 +4036,24 @@ const Ji = {
|
|
|
4035
4036
|
const u = () => {
|
|
4036
4037
|
const f = Js();
|
|
4037
4038
|
f && (h.value = f);
|
|
4038
|
-
}, c = (f) =>
|
|
4039
|
-
return
|
|
4039
|
+
}, c = (f) => vt(f), p = (f) => Ks(f.uuid), m = G(null);
|
|
4040
|
+
return Pn(() => {
|
|
4040
4041
|
m.value && Ns(m.value, e.mode, e.sceneData), u();
|
|
4041
|
-
}), (f, y) => (
|
|
4042
|
-
r.mode === "edit" ? (
|
|
4042
|
+
}), (f, y) => (C(), U("div", jo, [
|
|
4043
|
+
r.mode === "edit" ? (C(), ke(Co, {
|
|
4043
4044
|
key: 0,
|
|
4044
4045
|
onAddModel: a,
|
|
4045
4046
|
onImportModel: l
|
|
4046
|
-
})) :
|
|
4047
|
+
})) : ae("", !0),
|
|
4047
4048
|
g("div", {
|
|
4048
|
-
class:
|
|
4049
|
+
class: Ue(`editor-container editor-container-mode-${r.mode}`)
|
|
4049
4050
|
}, [
|
|
4050
4051
|
g("div", {
|
|
4051
|
-
class:
|
|
4052
|
+
class: Ue(`canvas canvas-mode-${r.mode}`),
|
|
4052
4053
|
ref_key: "containerRef",
|
|
4053
4054
|
ref: m
|
|
4054
4055
|
}, null, 2),
|
|
4055
|
-
r.mode === "edit" ? (
|
|
4056
|
+
r.mode === "edit" ? (C(), ke(xo, {
|
|
4056
4057
|
key: 0,
|
|
4057
4058
|
transform: s,
|
|
4058
4059
|
"tree-data": h.value,
|
|
@@ -4060,12 +4061,12 @@ const Ji = {
|
|
|
4060
4061
|
onPropertyChange: o,
|
|
4061
4062
|
onTreeSelect: c,
|
|
4062
4063
|
onTreeDelete: p
|
|
4063
|
-
}, null, 8, ["transform", "tree-data", "selected-object"])) :
|
|
4064
|
+
}, null, 8, ["transform", "tree-data", "selected-object"])) : ae("", !0)
|
|
4064
4065
|
], 2),
|
|
4065
|
-
|
|
4066
|
+
r.mode === "edit" ? (C(), ke(ko, { key: 1 })) : ae("", !0)
|
|
4066
4067
|
]));
|
|
4067
4068
|
}
|
|
4068
|
-
}), Ko = /* @__PURE__ */
|
|
4069
|
+
}), Ko = /* @__PURE__ */ Ye(Fo, [["__scopeId", "data-v-54071644"]]);
|
|
4069
4070
|
export {
|
|
4070
4071
|
ko as BottomBar,
|
|
4071
4072
|
Ko as DrawingBoard,
|
|
@@ -4073,7 +4074,7 @@ export {
|
|
|
4073
4074
|
Co as TopBar,
|
|
4074
4075
|
Wi as TreeItem,
|
|
4075
4076
|
Gi as addBox,
|
|
4076
|
-
|
|
4077
|
+
At as addModel,
|
|
4077
4078
|
Bi as addModelByType,
|
|
4078
4079
|
Xi as addSphere,
|
|
4079
4080
|
Bo as exportSceneToJSON,
|
|
@@ -4087,7 +4088,7 @@ export {
|
|
|
4087
4088
|
$s as onSceneObjectsChangeCallback,
|
|
4088
4089
|
Bs as removeModel,
|
|
4089
4090
|
Ks as removeModelById,
|
|
4090
|
-
|
|
4091
|
+
vt as selectObject,
|
|
4091
4092
|
qs as setSelectedObjectCallback,
|
|
4092
4093
|
Ws as setTransformChangeCallback,
|
|
4093
4094
|
$i as useTreeExpand
|