endset_three_editor 0.10.16 → 0.10.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/three-editor.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var Gi = Object.defineProperty;
|
|
2
2
|
var Bi = (r, e, t) => e in r ? Gi(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var Je = (r, e, t) => Bi(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { toRaw as us, reactive as ts, defineComponent as Ze, ref as G, inject as Xi, computed as tt, watchEffect as Vi, resolveComponent as qi, openBlock as H, createElementBlock as k, createElementVNode as y, normalizeClass as Pe, withModifiers as ss, unref as ns, toDisplayString as fe, Fragment as Ee, renderList as At, createBlock as vt, createCommentVNode as re, watch as Me, withDirectives as j, vModelText as W, createTextVNode as ms, withKeys as ut, vModelCheckbox as Yi, toRef as Ki, provide as Zi, createVNode as gs, vShow as st, shallowRef as
|
|
4
|
+
import { toRaw as us, reactive as ts, defineComponent as Ze, ref as G, inject as Xi, computed as tt, watchEffect as Vi, resolveComponent as qi, openBlock as H, createElementBlock as k, createElementVNode as y, normalizeClass as Pe, withModifiers as ss, unref as ns, toDisplayString as fe, Fragment as Ee, renderList as At, createBlock as vt, createCommentVNode as re, watch as Me, withDirectives as j, vModelText as W, createTextVNode as ms, withKeys as ut, vModelCheckbox as Yi, toRef as Ki, provide as Zi, createVNode as gs, vShow as st, shallowRef as Js, onMounted as Qi, onBeforeUnmount as Ji } from "vue";
|
|
5
5
|
import * as R from "three";
|
|
6
|
-
import { Controls as
|
|
6
|
+
import { Controls as Un, Vector3 as P, MOUSE as ht, TOUCH as dt, Quaternion as Ae, Spherical as _s, Vector2 as ue, Ray as _i, Plane as zn, MathUtils as Pt, Raycaster as $i, Object3D as mt, MeshBasicMaterial as nt, LineBasicMaterial as Mt, CylinderGeometry as ge, BoxGeometry as pe, BufferGeometry as rt, Float32BufferAttribute as ke, Mesh as L, OctahedronGeometry as Ft, Line as We, TorusGeometry as gt, SphereGeometry as eo, Euler as to, Matrix4 as Ce, PlaneGeometry as so, DoubleSide as Ws, OrthographicCamera as Wn, ShaderMaterial as Rs, UniformsUtils as is, WebGLRenderTarget as Gn, HalfFloatType as Bn, NoBlending as no, Timer as io, Color as le, RawShaderMaterial as oo, ColorManagement as os, SRGBTransfer as ro, LinearToneMapping as ao, ReinhardToneMapping as lo, CineonToneMapping as co, ACESFilmicToneMapping as uo, AgXToneMapping as fo, NeutralToneMapping as ho, CustomToneMapping as po, BufferAttribute as De, REVISION as Ao, CompressedTexture as ys, Source as mo, NoColorSpace as go, RGBAFormat as yo, ImageUtils as bo, PropertyBinding as St, InterpolateDiscrete as Xn, Scene as $s, SRGBColorSpace as je, NearestFilter as Gs, NearestMipmapNearestFilter as Vn, NearestMipmapLinearFilter as qn, LinearFilter as rs, LinearMipmapNearestFilter as Yn, LinearMipmapLinearFilter as Bs, ClampToEdgeWrapping as Kn, RepeatWrapping as it, MirroredRepeatWrapping as Zn, InterpolateLinear as Xs, TrianglesDrawMode as xo, TriangleFanDrawMode as Ps, TriangleStripDrawMode as Qn, Loader as Vs, LoaderUtils as Tt, FileLoader as Lt, MeshPhysicalMaterial as Ue, LinearSRGBColorSpace as Fe, SpotLight as Io, PointLight as Co, DirectionalLight as wo, InstancedMesh as vo, InstancedBufferAttribute as Mo, TextureLoader as Yt, ImageBitmapLoader as To, InterleavedBuffer as Jn, InterleavedBufferAttribute as _n, PointsMaterial as It, Material as Et, MeshStandardMaterial as $n, SkinnedMesh as Eo, LineSegments as Ss, LineLoop as Do, Points as Kt, Group as Zt, PerspectiveCamera as ei, Skeleton as Oo, AnimationClip as Ro, Bone as Po, Texture as en, VectorKeyframeTrack as tn, NumberKeyframeTrack as sn, QuaternionKeyframeTrack as nn, FrontSide as ti, Interpolant as So, Box3 as Lo, Sphere as No, MeshPhongMaterial as Ho, Vector4 as on, UniformsLib as rn } from "three";
|
|
7
7
|
import de from "@tweenjs/tween.js";
|
|
8
|
-
const
|
|
8
|
+
const an = { type: "change" }, qs = { type: "start" }, si = { type: "end" }, Ut = new _i(), ln = new zn(), ko = Math.cos(70 * Pt.DEG2RAD), ce = new P(), ye = 2 * Math.PI, ee = {
|
|
9
9
|
NONE: -1,
|
|
10
10
|
ROTATE: 0,
|
|
11
11
|
DOLLY: 1,
|
|
@@ -15,7 +15,7 @@ const rn = { type: "change" }, Vs = { type: "start" }, ti = { type: "end" }, Ut
|
|
|
15
15
|
TOUCH_DOLLY_PAN: 5,
|
|
16
16
|
TOUCH_DOLLY_ROTATE: 6
|
|
17
17
|
}, bs = 1e-6;
|
|
18
|
-
class jo extends
|
|
18
|
+
class jo extends Un {
|
|
19
19
|
/**
|
|
20
20
|
* Constructs a new controls instance.
|
|
21
21
|
*
|
|
@@ -23,7 +23,7 @@ class jo extends Fn {
|
|
|
23
23
|
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
24
24
|
*/
|
|
25
25
|
constructor(e, t = null) {
|
|
26
|
-
super(e, t), this.state = ee.NONE, this.target = new P(), this.cursor = new P(), 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: ht.ROTATE, MIDDLE: ht.DOLLY, RIGHT: ht.PAN }, this.touches = { ONE: dt.ROTATE, TWO: dt.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 P(), this._lastQuaternion = new Ae(), this._lastTargetPosition = new P(), this._quat = new Ae().setFromUnitVectors(e.up, new P(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new
|
|
26
|
+
super(e, t), this.state = ee.NONE, this.target = new P(), this.cursor = new P(), 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: ht.ROTATE, MIDDLE: ht.DOLLY, RIGHT: ht.PAN }, this.touches = { ONE: dt.ROTATE, TWO: dt.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 P(), this._lastQuaternion = new Ae(), this._lastTargetPosition = new P(), this._quat = new Ae().setFromUnitVectors(e.up, new P(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new _s(), this._sphericalDelta = new _s(), this._scale = 1, this._panOffset = new P(), this._rotateStart = new ue(), this._rotateEnd = new ue(), this._rotateDelta = new ue(), this._panStart = new ue(), this._panEnd = new ue(), this._panDelta = new ue(), this._dollyStart = new ue(), this._dollyEnd = new ue(), this._dollyDelta = new ue(), this._dollyDirection = new P(), this._mouse = new ue(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Uo.bind(this), this._onPointerDown = Fo.bind(this), this._onPointerUp = zo.bind(this), this._onContextMenu = Yo.bind(this), this._onMouseWheel = Bo.bind(this), this._onKeyDown = Xo.bind(this), this._onTouchStart = Vo.bind(this), this._onTouchMove = qo.bind(this), this._onMouseDown = Wo.bind(this), this._onMouseMove = Go.bind(this), this._interceptControlDown = Ko.bind(this), this._interceptControlUp = Zo.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Defines the visual representation of the cursor.
|
|
@@ -96,7 +96,7 @@ class jo extends Fn {
|
|
|
96
96
|
* was called, or the initial state.
|
|
97
97
|
*/
|
|
98
98
|
reset() {
|
|
99
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
99
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(an), this.update(), this.state = ee.NONE;
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
102
|
* Programmatically pan the camera.
|
|
@@ -167,12 +167,12 @@ class jo extends Fn {
|
|
|
167
167
|
c.unproject(this.object), this.object.position.sub(c).add(a), this.object.updateMatrixWorld(), o = ce.length();
|
|
168
168
|
} else
|
|
169
169
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
170
|
-
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Ut.origin.copy(this.object.position), Ut.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ut.direction)) < ko ? this.object.lookAt(this.target) : (
|
|
170
|
+
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Ut.origin.copy(this.object.position), Ut.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ut.direction)) < ko ? this.object.lookAt(this.target) : (ln.setFromNormalAndCoplanarPoint(this.object.up, this.target), Ut.intersectPlane(ln, this.target))));
|
|
171
171
|
} else if (this.object.isOrthographicCamera) {
|
|
172
172
|
const o = this.object.zoom;
|
|
173
173
|
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);
|
|
174
174
|
}
|
|
175
|
-
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > bs || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > bs || this._lastTargetPosition.distanceToSquared(this.target) > bs ? (this.dispatchEvent(
|
|
175
|
+
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > bs || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > bs || this._lastTargetPosition.distanceToSquared(this.target) > bs ? (this.dispatchEvent(an), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
176
176
|
}
|
|
177
177
|
_getAutoRotationAngle(e) {
|
|
178
178
|
return e !== null ? ye / 60 * this.autoRotateSpeed * e : ye / 60 / 60 * this.autoRotateSpeed;
|
|
@@ -373,7 +373,7 @@ function Uo(r) {
|
|
|
373
373
|
function zo(r) {
|
|
374
374
|
switch (this._removePointer(r), this._pointers.length) {
|
|
375
375
|
case 0:
|
|
376
|
-
this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
|
376
|
+
this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(si), this.state = ee.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
|
|
377
377
|
break;
|
|
378
378
|
case 1:
|
|
379
379
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
|
@@ -422,7 +422,7 @@ function Wo(r) {
|
|
|
422
422
|
default:
|
|
423
423
|
this.state = ee.NONE;
|
|
424
424
|
}
|
|
425
|
-
this.state !== ee.NONE && this.dispatchEvent(
|
|
425
|
+
this.state !== ee.NONE && this.dispatchEvent(qs);
|
|
426
426
|
}
|
|
427
427
|
function Go(r) {
|
|
428
428
|
switch (this.state) {
|
|
@@ -441,7 +441,7 @@ function Go(r) {
|
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
function Bo(r) {
|
|
444
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== ee.NONE || (r.preventDefault(), this.dispatchEvent(
|
|
444
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== ee.NONE || (r.preventDefault(), this.dispatchEvent(qs), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(si));
|
|
445
445
|
}
|
|
446
446
|
function Xo(r) {
|
|
447
447
|
this.enabled !== !1 && this._handleKeyDown(r);
|
|
@@ -479,7 +479,7 @@ function Vo(r) {
|
|
|
479
479
|
default:
|
|
480
480
|
this.state = ee.NONE;
|
|
481
481
|
}
|
|
482
|
-
this.state !== ee.NONE && this.dispatchEvent(
|
|
482
|
+
this.state !== ee.NONE && this.dispatchEvent(qs);
|
|
483
483
|
}
|
|
484
484
|
function qo(r) {
|
|
485
485
|
switch (this._trackPointer(r), this.state) {
|
|
@@ -512,12 +512,12 @@ function Ko(r) {
|
|
|
512
512
|
function Zo(r) {
|
|
513
513
|
r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
514
514
|
}
|
|
515
|
-
const _e = new $i(), he = new P(), Ve = new P(), ie = new Ae(),
|
|
515
|
+
const _e = new $i(), he = new P(), Ve = new P(), ie = new Ae(), cn = {
|
|
516
516
|
X: new P(1, 0, 0),
|
|
517
517
|
Y: new P(0, 1, 0),
|
|
518
518
|
Z: new P(0, 0, 1)
|
|
519
|
-
}, xs = { type: "change" },
|
|
520
|
-
class Qo extends
|
|
519
|
+
}, xs = { type: "change" }, un = { type: "mouseDown", mode: null }, dn = { type: "mouseUp", mode: null }, fn = { type: "objectChange" };
|
|
520
|
+
class Qo extends Un {
|
|
521
521
|
/**
|
|
522
522
|
* Constructs a new controls instance.
|
|
523
523
|
*
|
|
@@ -573,7 +573,7 @@ class Qo extends Fn {
|
|
|
573
573
|
if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
|
|
574
574
|
e !== null && _e.setFromCamera(e, this.camera);
|
|
575
575
|
const t = Is(this._plane, _e, !0);
|
|
576
|
-
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,
|
|
576
|
+
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, un.mode = this.mode, this.dispatchEvent(un);
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
pointerMove(e) {
|
|
@@ -596,13 +596,13 @@ class Qo extends Fn {
|
|
|
596
596
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
|
597
597
|
const a = 20 / this.worldPosition.distanceTo(he.setFromMatrixPosition(this.camera.matrixWorld));
|
|
598
598
|
let l = !1;
|
|
599
|
-
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(he.copy(this.rotationAxis).cross(this.eye)) * a) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(
|
|
599
|
+
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(he.copy(this.rotationAxis).cross(this.eye)) * a) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(cn[t]), he.copy(cn[t]), i === "local" && he.applyQuaternion(this.worldQuaternion), he.cross(this.eye), he.length() === 0 ? l = !0 : this.rotationAngle = this._offset.dot(he.normalize()) * a), (t === "E" || l) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), i === "local" && t !== "E" && t !== "XYZE" ? (s.quaternion.copy(this._quaternionStart), s.quaternion.multiply(ie.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), s.quaternion.copy(ie.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), s.quaternion.multiply(this._quaternionStart).normalize());
|
|
600
600
|
}
|
|
601
|
-
this.dispatchEvent(xs), this.dispatchEvent(
|
|
601
|
+
this.dispatchEvent(xs), this.dispatchEvent(fn);
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
pointerUp(e) {
|
|
605
|
-
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (
|
|
605
|
+
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (dn.mode = this.mode, this.dispatchEvent(dn)), this.dragging = !1, this.axis = null);
|
|
606
606
|
}
|
|
607
607
|
dispose() {
|
|
608
608
|
this.disconnect(), this._root.dispose();
|
|
@@ -628,7 +628,7 @@ class Qo extends Fn {
|
|
|
628
628
|
* Resets the object's position, rotation and scale to when the current transform began.
|
|
629
629
|
*/
|
|
630
630
|
reset() {
|
|
631
|
-
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(xs), this.dispatchEvent(
|
|
631
|
+
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(xs), this.dispatchEvent(fn), this.pointStart.copy(this.pointEnd));
|
|
632
632
|
}
|
|
633
633
|
/**
|
|
634
634
|
* Returns the raycaster that is used for user interaction. This object is shared between all
|
|
@@ -749,7 +749,7 @@ function Is(r, e, t) {
|
|
|
749
749
|
return n[s];
|
|
750
750
|
return !1;
|
|
751
751
|
}
|
|
752
|
-
const zt = new to(), te = new P(0, 1, 0),
|
|
752
|
+
const zt = new to(), te = new P(0, 1, 0), hn = new P(0, 0, 0), pn = new Ce(), Wt = new Ae(), Qt = new Ae(), Ne = new P(), An = new Ce(), Ct = new P(1, 0, 0), et = new P(0, 1, 0), wt = new P(0, 0, 1), Gt = new P(), yt = new P(), bt = new P();
|
|
753
753
|
class sr extends mt {
|
|
754
754
|
constructor(e) {
|
|
755
755
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
@@ -1025,10 +1025,10 @@ class nr extends mt {
|
|
|
1025
1025
|
o.visible = !0, o.rotation.set(0, 0, 0), o.position.copy(this.worldPosition);
|
|
1026
1026
|
let a;
|
|
1027
1027
|
if (this.camera.isOrthographicCamera ? a = (this.camera.top - this.camera.bottom) / this.camera.zoom : a = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), o.scale.set(1, 1, 1).multiplyScalar(a * this.size / 4), o.tag === "helper") {
|
|
1028
|
-
o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (ie.setFromEuler(zt.set(0, 0, 0)), o.quaternion.copy(n).multiply(ie), Math.abs(te.copy(Ct).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (ie.setFromEuler(zt.set(0, 0, Math.PI / 2)), o.quaternion.copy(n).multiply(ie), Math.abs(te.copy(et).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (ie.setFromEuler(zt.set(0, Math.PI / 2, 0)), o.quaternion.copy(n).multiply(ie), Math.abs(te.copy(wt).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (ie.setFromEuler(zt.set(0, Math.PI / 2, 0)), te.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(
|
|
1028
|
+
o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (ie.setFromEuler(zt.set(0, 0, 0)), o.quaternion.copy(n).multiply(ie), Math.abs(te.copy(Ct).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (ie.setFromEuler(zt.set(0, 0, Math.PI / 2)), o.quaternion.copy(n).multiply(ie), Math.abs(te.copy(et).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (ie.setFromEuler(zt.set(0, Math.PI / 2, 0)), o.quaternion.copy(n).multiply(ie), Math.abs(te.copy(wt).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (ie.setFromEuler(zt.set(0, Math.PI / 2, 0)), te.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(pn.lookAt(hn, te, et)), o.quaternion.multiply(ie), o.visible = this.dragging), this.axis === "E" && (o.visible = !1)) : o.name === "START" ? (o.position.copy(this.worldPositionStart), o.visible = this.dragging) : o.name === "END" ? (o.position.copy(this.worldPosition), o.visible = this.dragging) : o.name === "DELTA" ? (o.position.copy(this.worldPositionStart), o.quaternion.copy(this.worldQuaternionStart), he.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), he.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(he), o.visible = this.dragging) : (o.quaternion.copy(n), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
|
|
1029
1029
|
continue;
|
|
1030
1030
|
}
|
|
1031
|
-
o.quaternion.copy(n), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(te.copy(Ct).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(te.copy(et).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(te.copy(wt).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(te.copy(wt).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(te.copy(Ct).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(te.copy(et).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (Wt.copy(n), te.copy(this.eye).applyQuaternion(ie.copy(n).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(
|
|
1031
|
+
o.quaternion.copy(n), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(te.copy(Ct).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(te.copy(et).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(te.copy(wt).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(te.copy(wt).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(te.copy(Ct).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(te.copy(et).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (Wt.copy(n), te.copy(this.eye).applyQuaternion(ie.copy(n).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(pn.lookAt(this.eye, hn, et)), o.name === "X" && (ie.setFromAxisAngle(Ct, Math.atan2(-te.y, te.z)), ie.multiplyQuaternions(Wt, ie), o.quaternion.copy(ie)), o.name === "Y" && (ie.setFromAxisAngle(et, Math.atan2(te.x, te.z)), ie.multiplyQuaternions(Wt, ie), o.quaternion.copy(ie)), o.name === "Z" && (ie.setFromAxisAngle(wt, Math.atan2(te.y, te.x)), ie.multiplyQuaternions(Wt, ie), o.quaternion.copy(ie))), o.visible = o.visible && (o.name.indexOf("X") === -1 || this.showX), o.visible = o.visible && (o.name.indexOf("Y") === -1 || this.showY), o.visible = o.visible && (o.name.indexOf("Z") === -1 || this.showZ), o.visible = o.visible && (o.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), o.visible = o.visible && (o.name.indexOf("XY") === -1 || this.showXY), o.visible = o.visible && (o.name.indexOf("YZ") === -1 || this.showYZ), o.visible = o.visible && (o.name.indexOf("XZ") === -1 || this.showXZ), o.material._color = o.material._color || o.material.color.clone(), o.material._opacity = o.material._opacity || o.material.opacity, o.material.color.copy(o.material._color), o.material.opacity = o.material._opacity, this.enabled && this.axis && (o.name === this.axis ? (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1) : this.axis.split("").some(function(l) {
|
|
1032
1032
|
return o.name === l;
|
|
1033
1033
|
}) && (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1));
|
|
1034
1034
|
}
|
|
@@ -1039,7 +1039,7 @@ class ir extends L {
|
|
|
1039
1039
|
constructor() {
|
|
1040
1040
|
super(
|
|
1041
1041
|
new so(1e5, 1e5, 2, 2),
|
|
1042
|
-
new nt({ visible: !1, wireframe: !0, side:
|
|
1042
|
+
new nt({ visible: !1, wireframe: !0, side: Ws, transparent: !0, opacity: 0.1, toneMapped: !1 })
|
|
1043
1043
|
), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
|
|
1044
1044
|
}
|
|
1045
1045
|
updateMatrixWorld(e) {
|
|
@@ -1076,7 +1076,7 @@ class ir extends L {
|
|
|
1076
1076
|
default:
|
|
1077
1077
|
Ne.set(0, 0, 0);
|
|
1078
1078
|
}
|
|
1079
|
-
Ne.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (
|
|
1079
|
+
Ne.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (An.lookAt(he.set(0, 0, 0), Ne, te), this.quaternion.setFromRotationMatrix(An)), super.updateMatrixWorld(e);
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
1082
|
const or = {
|
|
@@ -1157,14 +1157,14 @@ class kt {
|
|
|
1157
1157
|
dispose() {
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
|
-
const rr = new
|
|
1160
|
+
const rr = new Wn(-1, 1, 1, -1, 0, 1);
|
|
1161
1161
|
class ar extends rt {
|
|
1162
1162
|
constructor() {
|
|
1163
1163
|
super(), this.setAttribute("position", new ke([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)), this.setAttribute("uv", new ke([0, 2, 0, 0, 2, 0], 2));
|
|
1164
1164
|
}
|
|
1165
1165
|
}
|
|
1166
1166
|
const lr = new ar();
|
|
1167
|
-
class
|
|
1167
|
+
class ni {
|
|
1168
1168
|
/**
|
|
1169
1169
|
* Constructs a new full screen quad.
|
|
1170
1170
|
*
|
|
@@ -1216,7 +1216,7 @@ class cr extends kt {
|
|
|
1216
1216
|
uniforms: this.uniforms,
|
|
1217
1217
|
vertexShader: e.vertexShader,
|
|
1218
1218
|
fragmentShader: e.fragmentShader
|
|
1219
|
-
})), this._fsQuad = new
|
|
1219
|
+
})), this._fsQuad = new ni(this.material);
|
|
1220
1220
|
}
|
|
1221
1221
|
/**
|
|
1222
1222
|
* Performs the shader pass.
|
|
@@ -1240,7 +1240,7 @@ class cr extends kt {
|
|
|
1240
1240
|
this.material.dispose(), this._fsQuad.dispose();
|
|
1241
1241
|
}
|
|
1242
1242
|
}
|
|
1243
|
-
class
|
|
1243
|
+
class mn extends kt {
|
|
1244
1244
|
/**
|
|
1245
1245
|
* Constructs a new mask pass.
|
|
1246
1246
|
*
|
|
@@ -1302,7 +1302,7 @@ class dr {
|
|
|
1302
1302
|
constructor(e, t) {
|
|
1303
1303
|
if (this.renderer = e, this._pixelRatio = e.getPixelRatio(), t === void 0) {
|
|
1304
1304
|
const n = e.getSize(new ue());
|
|
1305
|
-
this._width = n.width, this._height = n.height, t = new
|
|
1305
|
+
this._width = n.width, this._height = n.height, t = new Gn(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: Bn }), t.texture.name = "EffectComposer.rt1";
|
|
1306
1306
|
} else
|
|
1307
1307
|
this._width = t.width, this._height = t.height;
|
|
1308
1308
|
this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.renderTarget2.texture.name = "EffectComposer.rt2", this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.renderToScreen = !0, this.passes = [], this.copyPass = new cr(or), this.copyPass.material.blending = no, this.timer = new io();
|
|
@@ -1372,7 +1372,7 @@ class dr {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
this.swapBuffers();
|
|
1374
1374
|
}
|
|
1375
|
-
|
|
1375
|
+
mn !== void 0 && (o instanceof mn ? n = !0 : o instanceof ur && (n = !1));
|
|
1376
1376
|
}
|
|
1377
1377
|
}
|
|
1378
1378
|
this.renderer.setRenderTarget(t);
|
|
@@ -1549,7 +1549,7 @@ class hr extends kt {
|
|
|
1549
1549
|
uniforms: this.uniforms,
|
|
1550
1550
|
vertexShader: Bt.vertexShader,
|
|
1551
1551
|
fragmentShader: Bt.fragmentShader
|
|
1552
|
-
}), this._fsQuad = new
|
|
1552
|
+
}), this._fsQuad = new ni(this.material), this._outputColorSpace = null, this._toneMapping = null;
|
|
1553
1553
|
}
|
|
1554
1554
|
/**
|
|
1555
1555
|
* Performs the output pass.
|
|
@@ -1590,7 +1590,7 @@ class pr extends mt {
|
|
|
1590
1590
|
return super.copy(e, t), this.element = e.element.cloneNode(!0), this.center = e.center, this;
|
|
1591
1591
|
}
|
|
1592
1592
|
}
|
|
1593
|
-
const ct = new P(),
|
|
1593
|
+
const ct = new P(), gn = new Ce(), yn = new Ce(), bn = new P(), xn = new P();
|
|
1594
1594
|
class Ar {
|
|
1595
1595
|
/**
|
|
1596
1596
|
* Constructs a new CSS2D renderer.
|
|
@@ -1609,7 +1609,7 @@ class Ar {
|
|
|
1609
1609
|
height: s
|
|
1610
1610
|
};
|
|
1611
1611
|
}, this.render = function(b, m) {
|
|
1612
|
-
b.matrixWorldAutoUpdate === !0 && b.updateMatrixWorld(), m.parent === null && m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(),
|
|
1612
|
+
b.matrixWorldAutoUpdate === !0 && b.updateMatrixWorld(), m.parent === null && m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), gn.copy(m.matrixWorldInverse), yn.multiplyMatrices(m.projectionMatrix, gn), d(b, b, m), this.sortObjects && A(b);
|
|
1613
1613
|
}, this.setSize = function(b, m) {
|
|
1614
1614
|
n = b, s = m, i = n / 2, o = s / 2, l.style.width = b + "px", l.style.height = m + "px";
|
|
1615
1615
|
};
|
|
@@ -1624,7 +1624,7 @@ class Ar {
|
|
|
1624
1624
|
return;
|
|
1625
1625
|
}
|
|
1626
1626
|
if (b.isCSS2DObject) {
|
|
1627
|
-
ct.setFromMatrixPosition(b.matrixWorld), ct.applyMatrix4(
|
|
1627
|
+
ct.setFromMatrixPosition(b.matrixWorld), ct.applyMatrix4(yn);
|
|
1628
1628
|
const I = ct.z >= -1 && ct.z <= 1 && b.layers.test(p.layers) === !0, w = b.element;
|
|
1629
1629
|
w.style.display = I === !0 ? "" : "none", I === !0 && (b.onBeforeRender(t, m, p), w.style.transform = "translate(" + -100 * b.center.x + "%," + -100 * b.center.y + "%)translate(" + (ct.x * i + i) + "px," + (-ct.y * o + o) + "px)", w.parentNode !== l && l.appendChild(w), b.onAfterRender(t, m, p));
|
|
1630
1630
|
const h = {
|
|
@@ -1636,7 +1636,7 @@ class Ar {
|
|
|
1636
1636
|
d(b.children[I], m, p);
|
|
1637
1637
|
}
|
|
1638
1638
|
function u(b, m) {
|
|
1639
|
-
return
|
|
1639
|
+
return bn.setFromMatrixPosition(b.matrixWorld), xn.setFromMatrixPosition(m.matrixWorld), bn.distanceToSquared(xn);
|
|
1640
1640
|
}
|
|
1641
1641
|
function g(b) {
|
|
1642
1642
|
const m = [];
|
|
@@ -1913,14 +1913,14 @@ const Xt = {
|
|
|
1913
1913
|
Je(ft, "_breathInjected", !1);
|
|
1914
1914
|
let as = ft;
|
|
1915
1915
|
const ls = /* @__PURE__ */ new WeakMap();
|
|
1916
|
-
function
|
|
1916
|
+
function ii(r, e) {
|
|
1917
1917
|
const t = us(r);
|
|
1918
1918
|
ls.set(t, e), t.userData._hasDataPanel = !0;
|
|
1919
1919
|
}
|
|
1920
1920
|
function jt(r) {
|
|
1921
1921
|
return ls.get(us(r)) || null;
|
|
1922
1922
|
}
|
|
1923
|
-
function
|
|
1923
|
+
function oi(r) {
|
|
1924
1924
|
const e = us(r), t = ls.get(e);
|
|
1925
1925
|
t && (t.dispose(), ls.delete(e)), e.userData._hasDataPanel = void 0;
|
|
1926
1926
|
}
|
|
@@ -1985,7 +1985,7 @@ function Jt(r) {
|
|
|
1985
1985
|
return console.error("环境贴图生成失败:", e), null;
|
|
1986
1986
|
}
|
|
1987
1987
|
}
|
|
1988
|
-
const
|
|
1988
|
+
const In = {
|
|
1989
1989
|
POSITION: [
|
|
1990
1990
|
"byte",
|
|
1991
1991
|
"byte normalized",
|
|
@@ -2133,21 +2133,21 @@ const q = {
|
|
|
2133
2133
|
MIRRORED_REPEAT: 33648,
|
|
2134
2134
|
REPEAT: 10497
|
|
2135
2135
|
}, Cs = "KHR_mesh_quantization", Ie = {};
|
|
2136
|
-
Ie[
|
|
2137
|
-
Ie[
|
|
2138
|
-
Ie[
|
|
2136
|
+
Ie[Gs] = q.NEAREST;
|
|
2137
|
+
Ie[Vn] = q.NEAREST_MIPMAP_NEAREST;
|
|
2138
|
+
Ie[qn] = q.NEAREST_MIPMAP_LINEAR;
|
|
2139
2139
|
Ie[rs] = q.LINEAR;
|
|
2140
|
-
Ie[
|
|
2141
|
-
Ie[
|
|
2142
|
-
Ie[
|
|
2140
|
+
Ie[Yn] = q.LINEAR_MIPMAP_NEAREST;
|
|
2141
|
+
Ie[Bs] = q.LINEAR_MIPMAP_LINEAR;
|
|
2142
|
+
Ie[Kn] = q.CLAMP_TO_EDGE;
|
|
2143
2143
|
Ie[it] = q.REPEAT;
|
|
2144
|
-
Ie[
|
|
2145
|
-
const
|
|
2144
|
+
Ie[Zn] = q.MIRRORED_REPEAT;
|
|
2145
|
+
const Cn = {
|
|
2146
2146
|
scale: "scale",
|
|
2147
2147
|
position: "translation",
|
|
2148
2148
|
quaternion: "rotation",
|
|
2149
2149
|
morphTargetInfluences: "weights"
|
|
2150
|
-
}, Or = new le(),
|
|
2150
|
+
}, Or = new le(), wn = 12, Rr = 1179937895, Pr = 2, vn = 8, Sr = 1313821514, Lr = 5130562;
|
|
2151
2151
|
function Ge(r, e) {
|
|
2152
2152
|
return r.length === e.length && r.every(function(t, n) {
|
|
2153
2153
|
return t === e[n];
|
|
@@ -2171,11 +2171,11 @@ function kr(r, e, t) {
|
|
|
2171
2171
|
}
|
|
2172
2172
|
return n;
|
|
2173
2173
|
}
|
|
2174
|
-
function
|
|
2174
|
+
function ri(r) {
|
|
2175
2175
|
return Math.ceil(r / 4) * 4;
|
|
2176
2176
|
}
|
|
2177
2177
|
function ws(r, e = 0) {
|
|
2178
|
-
const t =
|
|
2178
|
+
const t = ri(r.byteLength);
|
|
2179
2179
|
if (t !== r.byteLength) {
|
|
2180
2180
|
const n = new Uint8Array(t);
|
|
2181
2181
|
if (n.set(new Uint8Array(r)), e !== 0)
|
|
@@ -2185,7 +2185,7 @@ function ws(r, e = 0) {
|
|
|
2185
2185
|
}
|
|
2186
2186
|
return r;
|
|
2187
2187
|
}
|
|
2188
|
-
function
|
|
2188
|
+
function Mn() {
|
|
2189
2189
|
return typeof document > "u" && typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1) : document.createElement("canvas");
|
|
2190
2190
|
}
|
|
2191
2191
|
function jr(r, e) {
|
|
@@ -2243,13 +2243,13 @@ class Fr {
|
|
|
2243
2243
|
if (d.length > 0 && (o.extensionsUsed = d), u.length > 0 && (o.extensionsRequired = u), o.buffers && o.buffers.length > 0 && (o.buffers[0].byteLength = c.size), n.binary === !0) {
|
|
2244
2244
|
const g = new FileReader();
|
|
2245
2245
|
g.readAsArrayBuffer(c), g.onloadend = function() {
|
|
2246
|
-
const A = ws(g.result), b = new DataView(new ArrayBuffer(
|
|
2246
|
+
const A = ws(g.result), b = new DataView(new ArrayBuffer(vn));
|
|
2247
2247
|
b.setUint32(0, A.byteLength, !0), b.setUint32(4, Lr, !0);
|
|
2248
|
-
const m = ws(Nr(JSON.stringify(o)), 32), p = new DataView(new ArrayBuffer(
|
|
2248
|
+
const m = ws(Nr(JSON.stringify(o)), 32), p = new DataView(new ArrayBuffer(vn));
|
|
2249
2249
|
p.setUint32(0, m.byteLength, !0), p.setUint32(4, Sr, !0);
|
|
2250
|
-
const I = new ArrayBuffer(
|
|
2250
|
+
const I = new ArrayBuffer(wn), w = new DataView(I);
|
|
2251
2251
|
w.setUint32(0, Rr, !0), w.setUint32(4, Pr, !0);
|
|
2252
|
-
const h =
|
|
2252
|
+
const h = wn + p.byteLength + m.byteLength + b.byteLength + A.byteLength;
|
|
2253
2253
|
w.setUint32(8, h, !0);
|
|
2254
2254
|
const f = new Blob([
|
|
2255
2255
|
I,
|
|
@@ -2357,7 +2357,7 @@ class Fr {
|
|
|
2357
2357
|
};
|
|
2358
2358
|
}
|
|
2359
2359
|
e instanceof ys && (e = await this.decompressTextureAsync(e)), t instanceof ys && (t = await this.decompressTextureAsync(t));
|
|
2360
|
-
const s = e ? e.image : null, i = t ? t.image : null, o = Math.max(s ? s.width : 0, i ? i.width : 0), a = Math.max(s ? s.height : 0, i ? i.height : 0), l =
|
|
2360
|
+
const s = e ? e.image : null, i = t ? t.image : null, o = Math.max(s ? s.width : 0, i ? i.width : 0), a = Math.max(s ? s.height : 0, i ? i.height : 0), l = Mn();
|
|
2361
2361
|
l.width = o, l.height = a;
|
|
2362
2362
|
const c = l.getContext("2d", {
|
|
2363
2363
|
willReadFrequently: !0
|
|
@@ -2421,7 +2421,7 @@ class Fr {
|
|
|
2421
2421
|
}
|
|
2422
2422
|
let l = e.itemSize * a;
|
|
2423
2423
|
i === q.ARRAY_BUFFER && (l = Math.ceil(l / 4) * 4);
|
|
2424
|
-
const c =
|
|
2424
|
+
const c = ri(s * l), d = new DataView(new ArrayBuffer(c));
|
|
2425
2425
|
let u = 0;
|
|
2426
2426
|
for (let b = n; b < n + s; b++) {
|
|
2427
2427
|
for (let m = 0; m < e.itemSize; m++) {
|
|
@@ -2523,7 +2523,7 @@ class Fr {
|
|
|
2523
2523
|
const d = o.images.get(e), u = s + ":flipY/" + n.toString();
|
|
2524
2524
|
if (d[u] !== void 0) return d[u];
|
|
2525
2525
|
a.images || (a.images = []);
|
|
2526
|
-
const g = { mimeType: s }, A =
|
|
2526
|
+
const g = { mimeType: s }, A = Mn();
|
|
2527
2527
|
A.width = Math.min(e.width, l.maxTextureSize), A.height = Math.min(e.height, l.maxTextureSize);
|
|
2528
2528
|
const b = A.getContext("2d", {
|
|
2529
2529
|
willReadFrequently: !0
|
|
@@ -2636,7 +2636,7 @@ class Fr {
|
|
|
2636
2636
|
};
|
|
2637
2637
|
e.aoMapIntensity !== 1 && (a.strength = e.aoMapIntensity), this.applyTextureTransform(a, e.aoMap), s.occlusionTexture = a;
|
|
2638
2638
|
}
|
|
2639
|
-
e.transparent ? s.alphaMode = "BLEND" : e.alphaTest > 0 && (s.alphaMode = "MASK", s.alphaCutoff = e.alphaTest), e.side ===
|
|
2639
|
+
e.transparent ? s.alphaMode = "BLEND" : e.alphaTest > 0 && (s.alphaMode = "MASK", s.alphaCutoff = e.alphaTest), e.side === Ws && (s.doubleSided = !0), e.name !== "" && (s.name = e.name), this.serializeUserData(e, s), await this._invokeAllAsync(async function(a) {
|
|
2640
2640
|
a.writeMaterialAsync && await a.writeMaterialAsync(e, s);
|
|
2641
2641
|
});
|
|
2642
2642
|
const o = n.materials.push(s) - 1;
|
|
@@ -2773,7 +2773,7 @@ class Fr {
|
|
|
2773
2773
|
}
|
|
2774
2774
|
t.normalized && (n += " normalized");
|
|
2775
2775
|
const s = e.split("_", 1)[0];
|
|
2776
|
-
|
|
2776
|
+
In[s] && In[s].includes(n) && (this.extensionsUsed[Cs] = !0, this.extensionsRequired[Cs] = !0);
|
|
2777
2777
|
}
|
|
2778
2778
|
/**
|
|
2779
2779
|
* Process camera
|
|
@@ -2815,16 +2815,16 @@ class Fr {
|
|
|
2815
2815
|
for (let c = 0; c < i.length; ++c) {
|
|
2816
2816
|
const d = i[c], u = St.parseTrackName(d.name);
|
|
2817
2817
|
let g = St.findNode(t, u.nodeName);
|
|
2818
|
-
const A =
|
|
2818
|
+
const A = Cn[u.propertyName];
|
|
2819
2819
|
if (u.objectName === "bones" && (g.isSkinnedMesh === !0 ? g = g.skeleton.getBoneByName(u.objectIndex) : g = void 0), !g || !A) {
|
|
2820
2820
|
console.warn('THREE.GLTFExporter: Could not export animation track "%s".', d.name);
|
|
2821
2821
|
continue;
|
|
2822
2822
|
}
|
|
2823
2823
|
const b = 1;
|
|
2824
2824
|
let m = d.values.length / d.times.length;
|
|
2825
|
-
A ===
|
|
2825
|
+
A === Cn.morphTargetInfluences && (m /= g.morphTargetInfluences.length);
|
|
2826
2826
|
let p;
|
|
2827
|
-
d.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (p = "CUBICSPLINE", m /= 3) : d.getInterpolation() ===
|
|
2827
|
+
d.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (p = "CUBICSPLINE", m /= 3) : d.getInterpolation() === Xn ? p = "STEP" : p = "LINEAR", a.push({
|
|
2828
2828
|
input: this.processAccessor(new De(d.times, b)),
|
|
2829
2829
|
output: this.processAccessor(new De(d.values, m)),
|
|
2830
2830
|
interpolation: p
|
|
@@ -2957,7 +2957,7 @@ class Fr {
|
|
|
2957
2957
|
* @param {Array<THREE.Object3D>} objects List of objects to process
|
|
2958
2958
|
*/
|
|
2959
2959
|
async processObjectsAsync(e) {
|
|
2960
|
-
const t = new
|
|
2960
|
+
const t = new $s();
|
|
2961
2961
|
t.name = "AuxScene";
|
|
2962
2962
|
for (let n = 0; n < e.length; n++)
|
|
2963
2963
|
t.children.push(e[n]);
|
|
@@ -2973,7 +2973,7 @@ class Fr {
|
|
|
2973
2973
|
});
|
|
2974
2974
|
const n = [];
|
|
2975
2975
|
for (let s = 0; s < e.length; s++)
|
|
2976
|
-
e[s] instanceof
|
|
2976
|
+
e[s] instanceof $s ? await this.processSceneAsync(e[s]) : n.push(e[s]);
|
|
2977
2977
|
n.length > 0 && await this.processObjectsAsync(n);
|
|
2978
2978
|
for (let s = 0; s < this.skins.length; ++s)
|
|
2979
2979
|
this.processSkin(this.skins[s]);
|
|
@@ -3255,7 +3255,7 @@ Dt.Utils = {
|
|
|
3255
3255
|
if (o.createInterpolant !== o.InterpolantFactoryMethodDiscrete && o.createInterpolant !== o.InterpolantFactoryMethodLinear) {
|
|
3256
3256
|
if (o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)
|
|
3257
3257
|
throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");
|
|
3258
|
-
console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), o = o.clone(), o.setInterpolation(
|
|
3258
|
+
console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), o = o.clone(), o.setInterpolation(Xs);
|
|
3259
3259
|
}
|
|
3260
3260
|
const c = l.morphTargetInfluences.length, d = l.morphTargetDictionary[a.propertyIndex];
|
|
3261
3261
|
if (d === void 0)
|
|
@@ -3290,10 +3290,10 @@ Dt.Utils = {
|
|
|
3290
3290
|
return t;
|
|
3291
3291
|
}
|
|
3292
3292
|
};
|
|
3293
|
-
function
|
|
3293
|
+
function Tn(r, e) {
|
|
3294
3294
|
if (e === xo)
|
|
3295
3295
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), r;
|
|
3296
|
-
if (e === Ps || e ===
|
|
3296
|
+
if (e === Ps || e === Qn) {
|
|
3297
3297
|
let t = r.getIndex();
|
|
3298
3298
|
if (t === null) {
|
|
3299
3299
|
const o = [], a = r.getAttribute("position");
|
|
@@ -3319,7 +3319,7 @@ function Mn(r, e) {
|
|
|
3319
3319
|
}
|
|
3320
3320
|
function $r(r) {
|
|
3321
3321
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = r.clone();
|
|
3322
|
-
return
|
|
3322
|
+
return ai(r, n, function(s, i) {
|
|
3323
3323
|
e.set(i, s), t.set(s, i);
|
|
3324
3324
|
}), n.traverse(function(s) {
|
|
3325
3325
|
if (!s.isSkinnedMesh) return;
|
|
@@ -3329,12 +3329,12 @@ function $r(r) {
|
|
|
3329
3329
|
}), i.bind(i.skeleton, i.bindMatrix);
|
|
3330
3330
|
}), n;
|
|
3331
3331
|
}
|
|
3332
|
-
function
|
|
3332
|
+
function ai(r, e, t) {
|
|
3333
3333
|
t(r, e);
|
|
3334
3334
|
for (let n = 0; n < r.children.length; n++)
|
|
3335
|
-
|
|
3335
|
+
ai(r.children[n], e.children[n], t);
|
|
3336
3336
|
}
|
|
3337
|
-
class
|
|
3337
|
+
class li extends Vs {
|
|
3338
3338
|
/**
|
|
3339
3339
|
* Constructs a new glTF loader.
|
|
3340
3340
|
*
|
|
@@ -3372,9 +3372,9 @@ class ai extends Xs {
|
|
|
3372
3372
|
}), this.register(function(t) {
|
|
3373
3373
|
return new ta(t);
|
|
3374
3374
|
}), this.register(function(t) {
|
|
3375
|
-
return new
|
|
3375
|
+
return new En(t, V.EXT_MESHOPT_COMPRESSION);
|
|
3376
3376
|
}), this.register(function(t) {
|
|
3377
|
-
return new
|
|
3377
|
+
return new En(t, V.KHR_MESHOPT_COMPRESSION);
|
|
3378
3378
|
}), this.register(function(t) {
|
|
3379
3379
|
return new ga(t);
|
|
3380
3380
|
});
|
|
@@ -3476,7 +3476,7 @@ class ai extends Xs {
|
|
|
3476
3476
|
if (typeof e == "string")
|
|
3477
3477
|
i = JSON.parse(e);
|
|
3478
3478
|
else if (e instanceof ArrayBuffer)
|
|
3479
|
-
if (l.decode(new Uint8Array(e, 0, 4)) ===
|
|
3479
|
+
if (l.decode(new Uint8Array(e, 0, 4)) === ci) {
|
|
3480
3480
|
try {
|
|
3481
3481
|
o[V.KHR_BINARY_GLTF] = new ya(e);
|
|
3482
3482
|
} catch (u) {
|
|
@@ -3863,7 +3863,7 @@ class ma {
|
|
|
3863
3863
|
return n.loadTextureImage(e, o.source, l);
|
|
3864
3864
|
}
|
|
3865
3865
|
}
|
|
3866
|
-
class
|
|
3866
|
+
class En {
|
|
3867
3867
|
constructor(e, t) {
|
|
3868
3868
|
this.name = t, this.parser = e;
|
|
3869
3869
|
}
|
|
@@ -3921,7 +3921,7 @@ class ga {
|
|
|
3921
3921
|
}));
|
|
3922
3922
|
}
|
|
3923
3923
|
}
|
|
3924
|
-
const
|
|
3924
|
+
const ci = "glTF", xt = 12, Dn = { JSON: 1313821514, BIN: 5130562 };
|
|
3925
3925
|
class ya {
|
|
3926
3926
|
constructor(e) {
|
|
3927
3927
|
this.name = V.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
@@ -3930,7 +3930,7 @@ class ya {
|
|
|
3930
3930
|
magic: n.decode(new Uint8Array(e.slice(0, 4))),
|
|
3931
3931
|
version: t.getUint32(4, !0),
|
|
3932
3932
|
length: t.getUint32(8, !0)
|
|
3933
|
-
}, this.header.magic !==
|
|
3933
|
+
}, this.header.magic !== ci)
|
|
3934
3934
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
3935
3935
|
if (this.header.version < 2)
|
|
3936
3936
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
@@ -3940,10 +3940,10 @@ class ya {
|
|
|
3940
3940
|
const a = i.getUint32(o, !0);
|
|
3941
3941
|
o += 4;
|
|
3942
3942
|
const l = i.getUint32(o, !0);
|
|
3943
|
-
if (o += 4, l ===
|
|
3943
|
+
if (o += 4, l === Dn.JSON) {
|
|
3944
3944
|
const c = new Uint8Array(e, xt + o, a);
|
|
3945
3945
|
this.content = n.decode(c);
|
|
3946
|
-
} else if (l ===
|
|
3946
|
+
} else if (l === Dn.BIN) {
|
|
3947
3947
|
const c = xt + o;
|
|
3948
3948
|
this.body = e.slice(c, c + a);
|
|
3949
3949
|
}
|
|
@@ -3998,7 +3998,7 @@ class Ia {
|
|
|
3998
3998
|
this.name = V.KHR_MESH_QUANTIZATION;
|
|
3999
3999
|
}
|
|
4000
4000
|
}
|
|
4001
|
-
class
|
|
4001
|
+
class ui extends So {
|
|
4002
4002
|
constructor(e, t, n, s) {
|
|
4003
4003
|
super(e, t, n, s);
|
|
4004
4004
|
}
|
|
@@ -4018,7 +4018,7 @@ class ci extends So {
|
|
|
4018
4018
|
}
|
|
4019
4019
|
}
|
|
4020
4020
|
const Ca = new Ae();
|
|
4021
|
-
class wa extends
|
|
4021
|
+
class wa extends ui {
|
|
4022
4022
|
interpolate_(e, t, n, s) {
|
|
4023
4023
|
const i = super.interpolate_(e, t, n, s);
|
|
4024
4024
|
return Ca.fromArray(i).normalize().toArray(i), i;
|
|
@@ -4039,16 +4039,16 @@ const ve = {
|
|
|
4039
4039
|
5123: Uint16Array,
|
|
4040
4040
|
5125: Uint32Array,
|
|
4041
4041
|
5126: Float32Array
|
|
4042
|
-
}, Dn = {
|
|
4043
|
-
9728: Ws,
|
|
4044
|
-
9729: rs,
|
|
4045
|
-
9984: Xn,
|
|
4046
|
-
9985: qn,
|
|
4047
|
-
9986: Vn,
|
|
4048
|
-
9987: Gs
|
|
4049
4042
|
}, On = {
|
|
4050
|
-
|
|
4051
|
-
|
|
4043
|
+
9728: Gs,
|
|
4044
|
+
9729: rs,
|
|
4045
|
+
9984: Vn,
|
|
4046
|
+
9985: Yn,
|
|
4047
|
+
9986: qn,
|
|
4048
|
+
9987: Bs
|
|
4049
|
+
}, Rn = {
|
|
4050
|
+
33071: Kn,
|
|
4051
|
+
33648: Zn,
|
|
4052
4052
|
10497: it
|
|
4053
4053
|
}, vs = {
|
|
4054
4054
|
SCALAR: 1,
|
|
@@ -4078,22 +4078,22 @@ const ve = {
|
|
|
4078
4078
|
CUBICSPLINE: void 0,
|
|
4079
4079
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
4080
4080
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
4081
|
-
LINEAR:
|
|
4082
|
-
STEP:
|
|
4081
|
+
LINEAR: Xs,
|
|
4082
|
+
STEP: Xn
|
|
4083
4083
|
}, Ms = {
|
|
4084
4084
|
OPAQUE: "OPAQUE",
|
|
4085
4085
|
MASK: "MASK",
|
|
4086
4086
|
BLEND: "BLEND"
|
|
4087
4087
|
};
|
|
4088
4088
|
function Ma(r) {
|
|
4089
|
-
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new
|
|
4089
|
+
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new $n({
|
|
4090
4090
|
color: 16777215,
|
|
4091
4091
|
emissive: 0,
|
|
4092
4092
|
metalness: 1,
|
|
4093
4093
|
roughness: 1,
|
|
4094
4094
|
transparent: !1,
|
|
4095
4095
|
depthTest: !0,
|
|
4096
|
-
side:
|
|
4096
|
+
side: ti
|
|
4097
4097
|
})), r.DefaultMaterial;
|
|
4098
4098
|
}
|
|
4099
4099
|
function $e(r, e, t) {
|
|
@@ -4442,7 +4442,7 @@ class Pa {
|
|
|
4442
4442
|
if (A && A !== u) {
|
|
4443
4443
|
const I = Math.floor(g / A), w = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + I + ":" + s.count;
|
|
4444
4444
|
let h = t.cache.get(w);
|
|
4445
|
-
h || (m = new c(a, I * A, s.count * A / d), h = new
|
|
4445
|
+
h || (m = new c(a, I * A, s.count * A / d), h = new Jn(m, A / d), t.cache.add(w, h)), p = new _n(h, l, g % A / d, b);
|
|
4446
4446
|
} else
|
|
4447
4447
|
a === null ? m = new c(s.count * l) : m = new c(a, g, s.count * l), p = new De(m, l, b);
|
|
4448
4448
|
if (s.sparse !== void 0) {
|
|
@@ -4480,7 +4480,7 @@ class Pa {
|
|
|
4480
4480
|
const c = this.loadImageSource(t, n).then(function(d) {
|
|
4481
4481
|
d.flipY = !1, d.name = o.name || a.name || "", d.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (d.name = a.uri);
|
|
4482
4482
|
const g = (i.samplers || {})[o.sampler] || {};
|
|
4483
|
-
return d.magFilter =
|
|
4483
|
+
return d.magFilter = On[g.magFilter] || rs, d.minFilter = On[g.minFilter] || Bs, d.wrapS = Rn[g.wrapS] || it, d.wrapT = Rn[g.wrapT] || it, d.generateMipmaps = !d.isCompressedTexture && d.minFilter !== Gs && d.minFilter !== rs, s.associations.set(d, { textures: e }), d;
|
|
4484
4484
|
}).catch(function() {
|
|
4485
4485
|
return null;
|
|
4486
4486
|
});
|
|
@@ -4504,7 +4504,7 @@ class Pa {
|
|
|
4504
4504
|
return new Promise(function(g, A) {
|
|
4505
4505
|
let b = g;
|
|
4506
4506
|
t.isImageBitmapLoader === !0 && (b = function(m) {
|
|
4507
|
-
const p = new
|
|
4507
|
+
const p = new en(m);
|
|
4508
4508
|
p.needsUpdate = !0, g(p);
|
|
4509
4509
|
}), t.load(Tt.resolveURL(u, i.path), b, void 0, A);
|
|
4510
4510
|
});
|
|
@@ -4571,7 +4571,7 @@ class Pa {
|
|
|
4571
4571
|
e.material = n;
|
|
4572
4572
|
}
|
|
4573
4573
|
getMaterialType() {
|
|
4574
|
-
return
|
|
4574
|
+
return $n;
|
|
4575
4575
|
}
|
|
4576
4576
|
/**
|
|
4577
4577
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -4599,7 +4599,7 @@ class Pa {
|
|
|
4599
4599
|
return g.extendMaterialParams && g.extendMaterialParams(e, a);
|
|
4600
4600
|
})));
|
|
4601
4601
|
}
|
|
4602
|
-
i.doubleSided === !0 && (a.side =
|
|
4602
|
+
i.doubleSided === !0 && (a.side = Ws);
|
|
4603
4603
|
const d = i.alphaMode || Ms.OPAQUE;
|
|
4604
4604
|
if (d === Ms.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === Ms.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== nt && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new ue(1, 1), i.normalTexture.scale !== void 0)) {
|
|
4605
4605
|
const u = i.normalTexture.scale;
|
|
@@ -4638,7 +4638,7 @@ class Pa {
|
|
|
4638
4638
|
const t = this, n = this.extensions, s = this.primitiveCache;
|
|
4639
4639
|
function i(a) {
|
|
4640
4640
|
return n[V.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(l) {
|
|
4641
|
-
return
|
|
4641
|
+
return Pn(l, a, t);
|
|
4642
4642
|
});
|
|
4643
4643
|
}
|
|
4644
4644
|
const o = [];
|
|
@@ -4648,7 +4648,7 @@ class Pa {
|
|
|
4648
4648
|
o.push(u.promise);
|
|
4649
4649
|
else {
|
|
4650
4650
|
let g;
|
|
4651
|
-
c.extensions && c.extensions[V.KHR_DRACO_MESH_COMPRESSION] ? g = i(c) : g =
|
|
4651
|
+
c.extensions && c.extensions[V.KHR_DRACO_MESH_COMPRESSION] ? g = i(c) : g = Pn(new rt(), c, t), s[d] = { primitive: c, promise: g }, o.push(g);
|
|
4652
4652
|
}
|
|
4653
4653
|
}
|
|
4654
4654
|
return Promise.all(o);
|
|
@@ -4673,7 +4673,7 @@ class Pa {
|
|
|
4673
4673
|
let I;
|
|
4674
4674
|
const w = c[A];
|
|
4675
4675
|
if (p.mode === ve.TRIANGLES || p.mode === ve.TRIANGLE_STRIP || p.mode === ve.TRIANGLE_FAN || p.mode === void 0)
|
|
4676
|
-
I = i.isSkinnedMesh === !0 ? new Eo(m, w) : new L(m, w), I.isSkinnedMesh === !0 && I.normalizeSkinWeights(), p.mode === ve.TRIANGLE_STRIP ? I.geometry =
|
|
4676
|
+
I = i.isSkinnedMesh === !0 ? new Eo(m, w) : new L(m, w), I.isSkinnedMesh === !0 && I.normalizeSkinWeights(), p.mode === ve.TRIANGLE_STRIP ? I.geometry = Tn(I.geometry, Qn) : p.mode === ve.TRIANGLE_FAN && (I.geometry = Tn(I.geometry, Ps));
|
|
4677
4677
|
else if (p.mode === ve.LINES)
|
|
4678
4678
|
I = new Ss(m, w);
|
|
4679
4679
|
else if (p.mode === ve.LINE_STRIP)
|
|
@@ -4714,7 +4714,7 @@ class Pa {
|
|
|
4714
4714
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
4715
4715
|
return;
|
|
4716
4716
|
}
|
|
4717
|
-
return n.type === "perspective" ? t = new
|
|
4717
|
+
return n.type === "perspective" ? t = new ei(Pt.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : n.type === "orthographic" && (t = new Wn(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), n.name && (t.name = this.createUniqueName(n.name)), He(t, n), Promise.resolve(t);
|
|
4718
4718
|
}
|
|
4719
4719
|
/**
|
|
4720
4720
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -4871,7 +4871,7 @@ class Pa {
|
|
|
4871
4871
|
const c = (d) => {
|
|
4872
4872
|
const u = /* @__PURE__ */ new Map();
|
|
4873
4873
|
for (const [g, A] of s.associations)
|
|
4874
|
-
(g instanceof Et || g instanceof
|
|
4874
|
+
(g instanceof Et || g instanceof en) && u.set(g, A);
|
|
4875
4875
|
return d.traverse((g) => {
|
|
4876
4876
|
const A = s.associations.get(g);
|
|
4877
4877
|
A != null && u.set(g, A);
|
|
@@ -4889,29 +4889,29 @@ class Pa {
|
|
|
4889
4889
|
let d;
|
|
4890
4890
|
switch (qe[i.path]) {
|
|
4891
4891
|
case qe.weights:
|
|
4892
|
-
d =
|
|
4892
|
+
d = sn;
|
|
4893
4893
|
break;
|
|
4894
4894
|
case qe.rotation:
|
|
4895
|
-
d =
|
|
4895
|
+
d = nn;
|
|
4896
4896
|
break;
|
|
4897
4897
|
case qe.translation:
|
|
4898
4898
|
case qe.scale:
|
|
4899
|
-
d =
|
|
4899
|
+
d = tn;
|
|
4900
4900
|
break;
|
|
4901
4901
|
default:
|
|
4902
4902
|
switch (n.itemSize) {
|
|
4903
4903
|
case 1:
|
|
4904
|
-
d =
|
|
4904
|
+
d = sn;
|
|
4905
4905
|
break;
|
|
4906
4906
|
case 2:
|
|
4907
4907
|
case 3:
|
|
4908
4908
|
default:
|
|
4909
|
-
d =
|
|
4909
|
+
d = tn;
|
|
4910
4910
|
break;
|
|
4911
4911
|
}
|
|
4912
4912
|
break;
|
|
4913
4913
|
}
|
|
4914
|
-
const u = s.interpolation !== void 0 ? va[s.interpolation] :
|
|
4914
|
+
const u = s.interpolation !== void 0 ? va[s.interpolation] : Xs, g = this._getArrayFromAccessor(n);
|
|
4915
4915
|
for (let A = 0, b = l.length; A < b; A++) {
|
|
4916
4916
|
const m = new d(
|
|
4917
4917
|
l[A] + "." + qe[i.path],
|
|
@@ -4935,7 +4935,7 @@ class Pa {
|
|
|
4935
4935
|
}
|
|
4936
4936
|
_createCubicSplineTrackInterpolant(e) {
|
|
4937
4937
|
e.createInterpolant = function(n) {
|
|
4938
|
-
const s = this instanceof
|
|
4938
|
+
const s = this instanceof nn ? wa : ui;
|
|
4939
4939
|
return new s(this.times, this.values, this.getValueSize() / 3, n);
|
|
4940
4940
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
4941
4941
|
}
|
|
@@ -4981,7 +4981,7 @@ function Sa(r, e, t) {
|
|
|
4981
4981
|
const o = new No();
|
|
4982
4982
|
s.getCenter(o.center), o.radius = s.min.distanceTo(s.max) / 2, r.boundingSphere = o;
|
|
4983
4983
|
}
|
|
4984
|
-
function
|
|
4984
|
+
function Pn(r, e, t) {
|
|
4985
4985
|
const n = e.attributes, s = [];
|
|
4986
4986
|
function i(o, a) {
|
|
4987
4987
|
return t.getDependency("accessor", o).then(function(l) {
|
|
@@ -5009,13 +5009,13 @@ function La(r) {
|
|
|
5009
5009
|
const Se = ts({
|
|
5010
5010
|
scripts: []
|
|
5011
5011
|
});
|
|
5012
|
-
function
|
|
5012
|
+
function di() {
|
|
5013
5013
|
return "s_" + Math.random().toString(36).slice(2, 10) + Date.now().toString(36).slice(-4);
|
|
5014
5014
|
}
|
|
5015
5015
|
function Na(r) {
|
|
5016
5016
|
var t;
|
|
5017
5017
|
const e = {
|
|
5018
|
-
id:
|
|
5018
|
+
id: di(),
|
|
5019
5019
|
name: ((t = r == null ? void 0 : r.name) == null ? void 0 : t.trim()) ?? "",
|
|
5020
5020
|
code: r == null ? void 0 : r.code
|
|
5021
5021
|
};
|
|
@@ -5027,7 +5027,7 @@ function Ha(r) {
|
|
|
5027
5027
|
}
|
|
5028
5028
|
function ka(r) {
|
|
5029
5029
|
Se.scripts = (r || []).map((e) => ({
|
|
5030
|
-
id: (e == null ? void 0 : e.id) ||
|
|
5030
|
+
id: (e == null ? void 0 : e.id) || di(),
|
|
5031
5031
|
name: (e == null ? void 0 : e.name) ?? "",
|
|
5032
5032
|
code: (e == null ? void 0 : e.code) ?? ""
|
|
5033
5033
|
}));
|
|
@@ -5049,7 +5049,7 @@ function Fa(r) {
|
|
|
5049
5049
|
}
|
|
5050
5050
|
}
|
|
5051
5051
|
}
|
|
5052
|
-
function
|
|
5052
|
+
function fi(r) {
|
|
5053
5053
|
var e;
|
|
5054
5054
|
return !!r && ((e = r.name) == null ? void 0 : e.trim()) === "初始化";
|
|
5055
5055
|
}
|
|
@@ -5093,7 +5093,7 @@ let ks = [], Vt = [], Nt = !0, ot = null, Te = null, $t = null, Ke = [];
|
|
|
5093
5093
|
const lt = /* @__PURE__ */ new Map();
|
|
5094
5094
|
let Ht, es = null, Ot = null, Rt = null;
|
|
5095
5095
|
async function Wa(r, e = "edit", t) {
|
|
5096
|
-
C.container = r, C.mode = e, Ba(), Va(), Ya(), t && (await wl(t.scene, e, t.dataPanels, t.waters, t.textures, t.ambientLight, t.scripts), t != null && t.camera && (C.defaultMainCamera = t.camera,
|
|
5096
|
+
C.container = r, C.mode = e, Ba(), Va(), Ya(), t && (await wl(t.scene, e, t.dataPanels, t.waters, t.textures, t.ambientLight, t.scripts), t != null && t.camera && (C.defaultMainCamera = t.camera, hi(!0))), Za(), Ka(), Ht && C.orbitControls && (C.orbitControls.target.fromArray(Ht), C.orbitControls.update()), Xa(), js(), Ai(), Ot = (n) => $a(n), Rt = () => Ja(), e === "edit" && r.addEventListener("click", Ot), window.addEventListener("resize", Rt), t || Qa(), e === "edit" && qa(), yl();
|
|
5097
5097
|
}
|
|
5098
5098
|
function Ga() {
|
|
5099
5099
|
return window.devicePixelRatio;
|
|
@@ -5128,7 +5128,7 @@ function Ya() {
|
|
|
5128
5128
|
const r = C.container, e = r.clientWidth / r.clientHeight, t = new R.PerspectiveCamera(45, e, 0.1, 1e3);
|
|
5129
5129
|
t.position.set(0, 6, 15), t.lookAt(0, 0, 0), C.camera = t;
|
|
5130
5130
|
}
|
|
5131
|
-
function
|
|
5131
|
+
function hi(r = !1) {
|
|
5132
5132
|
if (!C.defaultMainCamera) return;
|
|
5133
5133
|
const e = C.defaultMainCamera;
|
|
5134
5134
|
if (r) {
|
|
@@ -5143,7 +5143,7 @@ function fi(r = !1) {
|
|
|
5143
5143
|
), C.camera.updateProjectionMatrix(), Ht = e.target;
|
|
5144
5144
|
return;
|
|
5145
5145
|
} else
|
|
5146
|
-
|
|
5146
|
+
yi(""), cs();
|
|
5147
5147
|
if (!C.camera || !C.orbitControls) return;
|
|
5148
5148
|
const t = C.camera.position.clone(), n = C.orbitControls.target.clone(), s = new R.Vector3(
|
|
5149
5149
|
e.position[0],
|
|
@@ -5202,7 +5202,7 @@ function Za() {
|
|
|
5202
5202
|
}
|
|
5203
5203
|
}), C.scene.add(r.getHelper()), C.transformControls = r;
|
|
5204
5204
|
}
|
|
5205
|
-
function
|
|
5205
|
+
function pi(r = C.scene) {
|
|
5206
5206
|
if (!r || r.children.some((t) => t.type === "AmbientLight")) return null;
|
|
5207
5207
|
const e = new R.AmbientLight(
|
|
5208
5208
|
bl,
|
|
@@ -5211,11 +5211,11 @@ function hi(r = C.scene) {
|
|
|
5211
5211
|
return e.name = "环境光", r.add(e), e;
|
|
5212
5212
|
}
|
|
5213
5213
|
function Qa() {
|
|
5214
|
-
|
|
5214
|
+
pi(C.scene);
|
|
5215
5215
|
}
|
|
5216
|
-
function
|
|
5216
|
+
function Ai() {
|
|
5217
5217
|
var e, t;
|
|
5218
|
-
es = requestAnimationFrame(
|
|
5218
|
+
es = requestAnimationFrame(Ai), de.update(), (e = C.orbitControls) == null || e.update(), C.mode === "run" && Ye && C.scene && C.camera ? Ye.render() : (t = C.renderer) == null || t.render(C.scene, C.camera), C.scene && C.camera && Mr(C.scene, C.camera), Nt && C.scene && (Vt = [], C.scene.traverse((n) => {
|
|
5219
5219
|
n.userData.isWater && n.type === "Mesh" && Vt.push(n);
|
|
5220
5220
|
}), Nt = !1);
|
|
5221
5221
|
for (let n = 0; n < Vt.length; n++) {
|
|
@@ -5242,7 +5242,7 @@ function ds(r) {
|
|
|
5242
5242
|
if (e.isTransformControlsRoot) return;
|
|
5243
5243
|
e = e.parent;
|
|
5244
5244
|
}
|
|
5245
|
-
C.selectedObject !== r && (C.selectedObject && C.transformControls.detach(), C.selectedObject = r, C.transformControls.attach(r), C.transformControls.setMode(C.transformControlsMode), C.transformControls.showX = !0, C.transformControls.showY = !0, C.transformControls.showZ = !0,
|
|
5245
|
+
C.selectedObject !== r && (C.selectedObject && C.transformControls.detach(), C.selectedObject = r, C.transformControls.attach(r), C.transformControls.setMode(C.transformControlsMode), C.transformControls.showX = !0, C.transformControls.showY = !0, C.transformControls.showZ = !0, gi(r), ot == null || ot(r));
|
|
5246
5246
|
}
|
|
5247
5247
|
let xe = null;
|
|
5248
5248
|
function _a(r) {
|
|
@@ -5251,10 +5251,10 @@ function _a(r) {
|
|
|
5251
5251
|
function Es(r) {
|
|
5252
5252
|
xe == null || xe(r);
|
|
5253
5253
|
}
|
|
5254
|
-
function
|
|
5254
|
+
function mi(r) {
|
|
5255
5255
|
C.transformControlsMode = r, C.transformControls && C.transformControls.setMode(C.transformControlsMode);
|
|
5256
5256
|
}
|
|
5257
|
-
function
|
|
5257
|
+
function gi(r) {
|
|
5258
5258
|
if (C.mode !== "edit") {
|
|
5259
5259
|
cs();
|
|
5260
5260
|
return;
|
|
@@ -5274,10 +5274,10 @@ function cs() {
|
|
|
5274
5274
|
r.parent && r.parent.remove(r), r.geometry.dispose(), r.material.dispose();
|
|
5275
5275
|
ks = [];
|
|
5276
5276
|
}
|
|
5277
|
-
function
|
|
5277
|
+
function Ys() {
|
|
5278
5278
|
C.selectedObject && (cs(), C.transformControls.detach(), C.selectedObject = null, ot == null || ot(null));
|
|
5279
5279
|
}
|
|
5280
|
-
function
|
|
5280
|
+
function yi(r) {
|
|
5281
5281
|
let e = null;
|
|
5282
5282
|
lt.forEach((t) => {
|
|
5283
5283
|
t.userData.id == r && (e = t), t.children && t.children.forEach((n) => {
|
|
@@ -5285,8 +5285,8 @@ function gi(r) {
|
|
|
5285
5285
|
});
|
|
5286
5286
|
}), e && (e.children.forEach((t) => {
|
|
5287
5287
|
t.name && t.name.startsWith("DataPanel_") && (t.visible = !0);
|
|
5288
|
-
}),
|
|
5289
|
-
|
|
5288
|
+
}), gi(e), C.selectedObject = e, setTimeout(() => {
|
|
5289
|
+
bi(e);
|
|
5290
5290
|
}, 500));
|
|
5291
5291
|
}
|
|
5292
5292
|
function $a(r) {
|
|
@@ -5295,7 +5295,7 @@ function $a(r) {
|
|
|
5295
5295
|
return;
|
|
5296
5296
|
}
|
|
5297
5297
|
const e = el(r);
|
|
5298
|
-
e ? ds(e) :
|
|
5298
|
+
e ? ds(e) : Ys();
|
|
5299
5299
|
}
|
|
5300
5300
|
function el(r) {
|
|
5301
5301
|
const e = C.renderer.domElement.getBoundingClientRect(), t = new R.Vector2(
|
|
@@ -5310,13 +5310,13 @@ function el(r) {
|
|
|
5310
5310
|
const o = n.intersectObjects(s);
|
|
5311
5311
|
if (o.length === 0) return null;
|
|
5312
5312
|
for (const a of o) {
|
|
5313
|
-
const l =
|
|
5313
|
+
const l = Sn(a.object);
|
|
5314
5314
|
if (l !== C.selectedObject)
|
|
5315
5315
|
return l;
|
|
5316
5316
|
}
|
|
5317
|
-
return
|
|
5317
|
+
return Sn(o[0].object);
|
|
5318
5318
|
}
|
|
5319
|
-
function
|
|
5319
|
+
function Sn(r) {
|
|
5320
5320
|
var t;
|
|
5321
5321
|
let e = r;
|
|
5322
5322
|
for (; e; ) {
|
|
@@ -5339,7 +5339,7 @@ function Pn(r) {
|
|
|
5339
5339
|
}
|
|
5340
5340
|
return r;
|
|
5341
5341
|
}
|
|
5342
|
-
function
|
|
5342
|
+
function bi(r, e = 500) {
|
|
5343
5343
|
if (!C.camera || !C.orbitControls) {
|
|
5344
5344
|
console.warn(
|
|
5345
5345
|
"[focusOnObject] 编辑器尚未初始化或已销毁,无法执行聚焦操作。请确保已调用 initEditor()"
|
|
@@ -5408,7 +5408,7 @@ function il(r) {
|
|
|
5408
5408
|
}
|
|
5409
5409
|
});
|
|
5410
5410
|
}
|
|
5411
|
-
function
|
|
5411
|
+
function xi(r) {
|
|
5412
5412
|
var n, s;
|
|
5413
5413
|
const e = (n = C.scene) == null ? void 0 : n.environment;
|
|
5414
5414
|
if (!e) return;
|
|
@@ -5424,14 +5424,14 @@ function bi(r) {
|
|
|
5424
5424
|
});
|
|
5425
5425
|
}
|
|
5426
5426
|
function Be(r, e = !1) {
|
|
5427
|
-
C.scene.add(r),
|
|
5428
|
-
}
|
|
5429
|
-
function xi(r) {
|
|
5430
|
-
C.selectedObject === r && qs(), Nt = !0, il(r), sl(r), r.userData.helper && C.scene.remove(r.userData.helper), r.parent ? r.parent.remove(r) : C.scene.remove(r), rl(r), fs();
|
|
5427
|
+
C.scene.add(r), xi(r), Nt = !0, r.userData.isMovable && (ol(r), fs()), e && C.mode === "edit" && ds(r);
|
|
5431
5428
|
}
|
|
5432
5429
|
function Ii(r) {
|
|
5430
|
+
C.selectedObject === r && Ys(), Nt = !0, il(r), sl(r), r.userData.helper && C.scene.remove(r.userData.helper), r.parent ? r.parent.remove(r) : C.scene.remove(r), rl(r), fs();
|
|
5431
|
+
}
|
|
5432
|
+
function Ci(r) {
|
|
5433
5433
|
const e = C.scene.getObjectByProperty("uuid", r);
|
|
5434
|
-
e &&
|
|
5434
|
+
e && Ii(e);
|
|
5435
5435
|
}
|
|
5436
5436
|
function ol(r) {
|
|
5437
5437
|
r.userData.isMovable && r.parent === C.scene && (Ke.includes(r) || Ke.push(r));
|
|
@@ -5440,7 +5440,7 @@ function rl(r) {
|
|
|
5440
5440
|
const e = Ke.indexOf(r);
|
|
5441
5441
|
e !== -1 && Ke.splice(e, 1);
|
|
5442
5442
|
}
|
|
5443
|
-
function
|
|
5443
|
+
function js() {
|
|
5444
5444
|
const r = [];
|
|
5445
5445
|
C.scene.children.forEach((e) => {
|
|
5446
5446
|
e.userData.isMovable && r.push(e);
|
|
@@ -5461,7 +5461,7 @@ function cl(r) {
|
|
|
5461
5461
|
function wi() {
|
|
5462
5462
|
return Ke;
|
|
5463
5463
|
}
|
|
5464
|
-
function
|
|
5464
|
+
function Fs() {
|
|
5465
5465
|
return C.selectedObject;
|
|
5466
5466
|
}
|
|
5467
5467
|
function ul(r, e, t) {
|
|
@@ -5472,13 +5472,13 @@ function ul(r, e, t) {
|
|
|
5472
5472
|
s && s.updateItemByCode(e, t);
|
|
5473
5473
|
}
|
|
5474
5474
|
}
|
|
5475
|
-
function
|
|
5475
|
+
function Ln() {
|
|
5476
5476
|
return C.scene;
|
|
5477
5477
|
}
|
|
5478
|
-
function
|
|
5478
|
+
function Us() {
|
|
5479
5479
|
return C.camera;
|
|
5480
5480
|
}
|
|
5481
|
-
function
|
|
5481
|
+
function Nn() {
|
|
5482
5482
|
return C.renderer;
|
|
5483
5483
|
}
|
|
5484
5484
|
const vi = {
|
|
@@ -5491,15 +5491,15 @@ const vi = {
|
|
|
5491
5491
|
"back.out": de.Easing.Back.Out,
|
|
5492
5492
|
"elastic.out": de.Easing.Elastic.Out,
|
|
5493
5493
|
"bounce.out": de.Easing.Bounce.Out
|
|
5494
|
-
},
|
|
5494
|
+
}, zs = /* @__PURE__ */ new WeakMap();
|
|
5495
5495
|
function Mi(r) {
|
|
5496
|
-
let e =
|
|
5496
|
+
let e = zs.get(r);
|
|
5497
5497
|
return e || (e = {
|
|
5498
5498
|
position: /* @__PURE__ */ new Set(),
|
|
5499
5499
|
rotation: /* @__PURE__ */ new Set(),
|
|
5500
5500
|
scale: /* @__PURE__ */ new Set(),
|
|
5501
5501
|
opacity: /* @__PURE__ */ new Set()
|
|
5502
|
-
},
|
|
5502
|
+
}, zs.set(r, e)), e;
|
|
5503
5503
|
}
|
|
5504
5504
|
function dl(r, e, t, n) {
|
|
5505
5505
|
const s = Mi(r);
|
|
@@ -5512,9 +5512,9 @@ function dl(r, e, t, n) {
|
|
|
5512
5512
|
i(), n == null || n();
|
|
5513
5513
|
}), e.onStop(i);
|
|
5514
5514
|
}
|
|
5515
|
-
function
|
|
5515
|
+
function Ks(r, e = []) {
|
|
5516
5516
|
if (!r) return;
|
|
5517
|
-
const t =
|
|
5517
|
+
const t = zs.get(r);
|
|
5518
5518
|
if (!t) return;
|
|
5519
5519
|
const n = e.length > 0 ? e : ["position", "rotation", "scale", "opacity"];
|
|
5520
5520
|
for (const s of n)
|
|
@@ -5527,7 +5527,7 @@ function hs(r, e = {}) {
|
|
|
5527
5527
|
if (!r)
|
|
5528
5528
|
return console.warn("[脚本动画] 目标对象为空,无法执行动画"), null;
|
|
5529
5529
|
const t = e.duration ?? 1e3, n = vi[e.easing ?? "quad.inout"] ?? de.Easing.Quadratic.InOut, s = [], i = {};
|
|
5530
|
-
e.position && (s.push("position"), i.position = e.position), e.rotation && (s.push("rotation"), i.rotation = e.rotation), e.scale && (s.push("scale"), i.scale = e.scale),
|
|
5530
|
+
e.position && (s.push("position"), i.position = e.position), e.rotation && (s.push("rotation"), i.rotation = e.rotation), e.scale && (s.push("scale"), i.scale = e.scale), Ks(r, s);
|
|
5531
5531
|
const o = new de.Tween(r).to(i, t).easing(n).onUpdate(() => {
|
|
5532
5532
|
r === C.selectedObject && (Te == null || Te(r));
|
|
5533
5533
|
}).start();
|
|
@@ -5556,7 +5556,7 @@ function ml(r, e, t = 1e3, n, s) {
|
|
|
5556
5556
|
}), i.size === 0)
|
|
5557
5557
|
return console.warn("[脚本动画] 目标及其子节点没有材质,无法执行透明度动画:", r.name), null;
|
|
5558
5558
|
const o = t ?? 1e3, a = vi[n ?? "quad.inout"] ?? de.Easing.Quadratic.InOut, l = Math.min(1, Math.max(0, e)), c = l <= 0.01;
|
|
5559
|
-
c || (r.visible = !0),
|
|
5559
|
+
c || (r.visible = !0), Ks(r, ["opacity"]);
|
|
5560
5560
|
const d = [...i];
|
|
5561
5561
|
d.forEach((A) => {
|
|
5562
5562
|
A.transparent = !0, A.needsUpdate = !0;
|
|
@@ -5574,29 +5574,29 @@ function ml(r, e, t = 1e3, n, s) {
|
|
|
5574
5574
|
function gl() {
|
|
5575
5575
|
return {
|
|
5576
5576
|
THREE: R,
|
|
5577
|
-
scene:
|
|
5578
|
-
camera:
|
|
5579
|
-
renderer:
|
|
5580
|
-
selectedObject:
|
|
5581
|
-
getScene:
|
|
5582
|
-
getCamera:
|
|
5583
|
-
getRenderer:
|
|
5584
|
-
getSelectedObject:
|
|
5577
|
+
scene: Ln(),
|
|
5578
|
+
camera: Us(),
|
|
5579
|
+
renderer: Nn(),
|
|
5580
|
+
selectedObject: Fs(),
|
|
5581
|
+
getScene: Ln,
|
|
5582
|
+
getCamera: Us,
|
|
5583
|
+
getRenderer: Nn,
|
|
5584
|
+
getSelectedObject: Fs,
|
|
5585
5585
|
getSceneObjects: wi,
|
|
5586
5586
|
addModel: Be,
|
|
5587
|
-
removeModel:
|
|
5588
|
-
removeModelById:
|
|
5587
|
+
removeModel: Ii,
|
|
5588
|
+
removeModelById: Ci,
|
|
5589
5589
|
selectObject: ds,
|
|
5590
5590
|
updateDataPanelValue: ul,
|
|
5591
|
-
setTransformMode:
|
|
5592
|
-
focusOnObject:
|
|
5591
|
+
setTransformMode: mi,
|
|
5592
|
+
focusOnObject: bi,
|
|
5593
5593
|
// ── 动画 API(供脚本使用)──
|
|
5594
5594
|
animateTo: hs,
|
|
5595
5595
|
moveTo: hl,
|
|
5596
5596
|
rotateTo: pl,
|
|
5597
5597
|
scaleTo: Al,
|
|
5598
5598
|
fadeTo: ml,
|
|
5599
|
-
stopAnimations:
|
|
5599
|
+
stopAnimations: Ks,
|
|
5600
5600
|
degToRad: fl,
|
|
5601
5601
|
console,
|
|
5602
5602
|
window,
|
|
@@ -5647,12 +5647,12 @@ function Ti(r) {
|
|
|
5647
5647
|
La(Ti);
|
|
5648
5648
|
function yl() {
|
|
5649
5649
|
for (const r of Se.scripts)
|
|
5650
|
-
|
|
5650
|
+
fi(r) && (console.log("[初始化] 自动执行脚本:", r.name), Ti(r));
|
|
5651
5651
|
}
|
|
5652
5652
|
const bl = 16777215, xl = 1;
|
|
5653
5653
|
async function Il() {
|
|
5654
5654
|
var f, v, D, O;
|
|
5655
|
-
xe == null || xe(!0), await new Promise((T) => setTimeout(T, 50)),
|
|
5655
|
+
xe == null || xe(!0), await new Promise((T) => setTimeout(T, 50)), Ys();
|
|
5656
5656
|
const r = C.scene;
|
|
5657
5657
|
if (!r)
|
|
5658
5658
|
return xe == null || xe(!1), {
|
|
@@ -5841,13 +5841,13 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5841
5841
|
var l, c, d, u, g, A, b;
|
|
5842
5842
|
const a = Cl(r);
|
|
5843
5843
|
if (a) {
|
|
5844
|
-
const m = await new
|
|
5844
|
+
const m = await new li().parseAsync(a, ""), p = m.scene || ((l = m.scenes) == null ? void 0 : l[0]), I = (c = C.scene) == null ? void 0 : c.environment;
|
|
5845
5845
|
if (C.scene = p, !p.children.some((f) => f.type === "AmbientLight"))
|
|
5846
5846
|
if (i) {
|
|
5847
5847
|
const f = new R.AmbientLight(i.color, i.intensity);
|
|
5848
5848
|
f.name = i.name || "环境光", f.visible = i.visible ?? !0, i.position && f.position.fromArray(i.position), p.add(f);
|
|
5849
5849
|
} else
|
|
5850
|
-
|
|
5850
|
+
pi(p);
|
|
5851
5851
|
if (I)
|
|
5852
5852
|
C.scene.environment = I, C.scene.environmentIntensity = 1;
|
|
5853
5853
|
else if (C.renderer) {
|
|
@@ -5858,10 +5858,8 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5858
5858
|
const f = Jt(C.renderer);
|
|
5859
5859
|
f ? (C.scene.environment = f, C.scene.environmentIntensity = 1, console.warn("[导入] 原环境贴图不可用,已重新生成")) : console.error("[导入] 环境贴图生成失败,场景将没有 IBL 间接光照,模型会偏暗");
|
|
5860
5860
|
}
|
|
5861
|
-
|
|
5862
|
-
const w = p.children.find(
|
|
5863
|
-
(f) => f.type === "Group" && f.name === "sl_scene"
|
|
5864
|
-
);
|
|
5861
|
+
xi(p);
|
|
5862
|
+
const w = p.children.find((f) => f.name === "sl_scene");
|
|
5865
5863
|
if (w) {
|
|
5866
5864
|
w.updateMatrixWorld();
|
|
5867
5865
|
const v = w.matrixWorld.elements.every((O, T) => Math.abs(O - (T % 5 === 0 ? 1 : 0)) < 1e-6), D = w.matrixWorld.clone();
|
|
@@ -5872,11 +5870,11 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5872
5870
|
const h = (f) => {
|
|
5873
5871
|
if (f.isTransformControlsRoot || f.isLine || f.isLineSegments || f.type === "AmbientLight" || f.userData.type === "lightHelper" || f.userData.type === "initFloor")
|
|
5874
5872
|
return;
|
|
5875
|
-
f.isMesh && (f.userData.isMovable = !0);
|
|
5873
|
+
(f.isMesh || f.type === "Group" && f.parent === p) && (f.userData.isMovable = !0);
|
|
5876
5874
|
const v = f.material;
|
|
5877
5875
|
f.userData.isWater && v && !v.uniforms && !f.userData.waterSpeed && (f.userData.waterSpeed = { x: 5e-4, y: 5e-4 }), f.children.forEach(h);
|
|
5878
5876
|
};
|
|
5879
|
-
h(p);
|
|
5877
|
+
h(p), js();
|
|
5880
5878
|
} else {
|
|
5881
5879
|
const m = typeof r == "string" ? JSON.parse(r) : r, I = new R.ObjectLoader().parse(m);
|
|
5882
5880
|
if (I.type === "Scene") {
|
|
@@ -5898,7 +5896,7 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5898
5896
|
title: I.title,
|
|
5899
5897
|
items: I.items
|
|
5900
5898
|
});
|
|
5901
|
-
w.attachTo(m), w.visible = !1, I.width && w.setWidth(I.width), I.fontSize && w.setFontSize(I.fontSize), I.offsetY !== void 0 && w.setOffsetY(I.offsetY), I.offsetX !== void 0 && w.setOffsetX(I.offsetX), I.offsetZ !== void 0 && w.setOffsetZ(I.offsetZ),
|
|
5899
|
+
w.attachTo(m), w.visible = !1, I.width && w.setWidth(I.width), I.fontSize && w.setFontSize(I.fontSize), I.offsetY !== void 0 && w.setOffsetY(I.offsetY), I.offsetX !== void 0 && w.setOffsetX(I.offsetX), I.offsetZ !== void 0 && w.setOffsetZ(I.offsetZ), ii(m, w);
|
|
5902
5900
|
}
|
|
5903
5901
|
})), n && n.length > 0 && Promise.resolve().then(() => Nl).then(({ addWater: m, addWaterCylinder: p }) => {
|
|
5904
5902
|
for (const I of n) {
|
|
@@ -5918,7 +5916,7 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5918
5916
|
scale: 4
|
|
5919
5917
|
}), h.position.fromArray(I.position), h.rotation.set(I.rotation[0], I.rotation[1], I.rotation[2]), h.scale.fromArray(I.scale), h.name = I.name, h.userData.waterTimeScale = I.timeScale ?? 0.05, h.userData.isWater = !0, h.userData.isMovable = !0, I.alpha !== void 0 && h.material.uniforms && h.material.uniforms.alpha && (h.material.uniforms.alpha.value = I.alpha), Nt = !0;
|
|
5920
5918
|
}
|
|
5921
|
-
|
|
5919
|
+
js();
|
|
5922
5920
|
}), s) {
|
|
5923
5921
|
const m = new R.TextureLoader();
|
|
5924
5922
|
(A = C.scene) == null || A.traverse((p) => {
|
|
@@ -5974,7 +5972,7 @@ function Ei(r) {
|
|
|
5974
5972
|
function vl() {
|
|
5975
5973
|
es !== null && (cancelAnimationFrame(es), es = null), Ot && C.container && (C.container.removeEventListener("click", Ot), Ot = null), Rt && (window.removeEventListener("resize", Rt), Rt = null), C.orbitControls && (C.orbitControls.dispose(), C.orbitControls = null), C.transformControls && (C.transformControls.dispose(), C.transformControls = null), Ye && (Ye.dispose(), Ye = null), C.scene && (Ei(C.scene), C.scene = null), C.renderer && (C.renderer.dispose(), C.renderer.domElement && C.container && C.container.removeChild(C.renderer.domElement), C.renderer = null), Er(), C.camera = null, C.gridHelper = null, C.selectedObject = null, C.container = null, C.mode = "", C.defaultMainCamera = null, Ht = void 0, Ke = [], lt.clear(), fs(), ja(), _t = !1, at = !1;
|
|
5976
5974
|
}
|
|
5977
|
-
const Ml = /^[og]\s*(.+)?/, Tl = /^mtllib /, El = /^usemtl /, Dl = /^usemap /,
|
|
5975
|
+
const Ml = /^[og]\s*(.+)?/, Tl = /^mtllib /, El = /^usemtl /, Dl = /^usemap /, Hn = /\s+/, kn = new P(), Ds = new P(), jn = new P(), Fn = new P(), we = new P(), qt = new le();
|
|
5978
5976
|
function Ol() {
|
|
5979
5977
|
const r = {
|
|
5980
5978
|
objects: [],
|
|
@@ -6084,7 +6082,7 @@ function Ol() {
|
|
|
6084
6082
|
},
|
|
6085
6083
|
addFaceNormal: function(e, t, n) {
|
|
6086
6084
|
const s = this.vertices, i = this.object.geometry.normals;
|
|
6087
|
-
|
|
6085
|
+
kn.fromArray(s, e), Ds.fromArray(s, t), jn.fromArray(s, n), we.subVectors(jn, Ds), Fn.subVectors(kn, Ds), we.cross(Fn), we.normalize(), i.push(we.x, we.y, we.z), i.push(we.x, we.y, we.z), i.push(we.x, we.y, we.z);
|
|
6088
6086
|
},
|
|
6089
6087
|
addColor: function(e, t, n) {
|
|
6090
6088
|
const s = this.colors, i = this.object.geometry.colors;
|
|
@@ -6135,7 +6133,7 @@ function Ol() {
|
|
|
6135
6133
|
};
|
|
6136
6134
|
return r.startObject("", !1), r;
|
|
6137
6135
|
}
|
|
6138
|
-
class Rl extends
|
|
6136
|
+
class Rl extends Vs {
|
|
6139
6137
|
/**
|
|
6140
6138
|
* Constructs a new OBJ loader.
|
|
6141
6139
|
*
|
|
@@ -6193,7 +6191,7 @@ class Rl extends Xs {
|
|
|
6193
6191
|
const d = c.charAt(0);
|
|
6194
6192
|
if (d !== "#")
|
|
6195
6193
|
if (d === "v") {
|
|
6196
|
-
const u = c.split(
|
|
6194
|
+
const u = c.split(Hn);
|
|
6197
6195
|
switch (u[0]) {
|
|
6198
6196
|
case "v":
|
|
6199
6197
|
t.vertices.push(
|
|
@@ -6222,7 +6220,7 @@ class Rl extends Xs {
|
|
|
6222
6220
|
break;
|
|
6223
6221
|
}
|
|
6224
6222
|
} else if (d === "f") {
|
|
6225
|
-
const g = c.slice(1).trim().split(
|
|
6223
|
+
const g = c.slice(1).trim().split(Hn), A = [];
|
|
6226
6224
|
for (let m = 0, p = g.length; m < p; m++) {
|
|
6227
6225
|
const I = g[m];
|
|
6228
6226
|
if (I.length > 0) {
|
|
@@ -6327,7 +6325,7 @@ class Rl extends Xs {
|
|
|
6327
6325
|
}
|
|
6328
6326
|
}
|
|
6329
6327
|
const Os = /* @__PURE__ */ new WeakMap();
|
|
6330
|
-
class Pl extends
|
|
6328
|
+
class Pl extends Vs {
|
|
6331
6329
|
/**
|
|
6332
6330
|
* Constructs a new Draco loader.
|
|
6333
6331
|
*
|
|
@@ -6442,8 +6440,8 @@ class Pl extends Xs {
|
|
|
6442
6440
|
if (o === a)
|
|
6443
6441
|
c = new De(i, o);
|
|
6444
6442
|
else {
|
|
6445
|
-
const d = new
|
|
6446
|
-
c = new
|
|
6443
|
+
const d = new Jn(i, a);
|
|
6444
|
+
c = new _n(d, o, 0);
|
|
6447
6445
|
}
|
|
6448
6446
|
s === "color" && (this._assignVertexColorSpace(c, l), c.normalized = !(i instanceof Float32Array)), t.setAttribute(s, c);
|
|
6449
6447
|
}
|
|
@@ -6631,11 +6629,11 @@ class Ll extends L {
|
|
|
6631
6629
|
*/
|
|
6632
6630
|
constructor(e, t = {}) {
|
|
6633
6631
|
super(e), this.isWater = !0;
|
|
6634
|
-
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, d = t.sunDirection !== void 0 ? t.sunDirection : new P(0.70707, 0.70707, 0), u = new le(t.sunColor !== void 0 ? t.sunColor : 16777215), g = new le(t.waterColor !== void 0 ? t.waterColor : 8355711), A = t.eye !== void 0 ? t.eye : new P(0, 0, 0), b = t.distortionScale !== void 0 ? t.distortionScale : 20, m = t.side !== void 0 ? t.side :
|
|
6632
|
+
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, d = t.sunDirection !== void 0 ? t.sunDirection : new P(0.70707, 0.70707, 0), u = new le(t.sunColor !== void 0 ? t.sunColor : 16777215), g = new le(t.waterColor !== void 0 ? t.waterColor : 8355711), A = t.eye !== void 0 ? t.eye : new P(0, 0, 0), b = t.distortionScale !== void 0 ? t.distortionScale : 20, m = t.side !== void 0 ? t.side : ti, p = t.fog !== void 0 ? t.fog : !1, I = new zn(), w = new P(), h = new P(), f = new P(), v = new Ce(), D = new P(0, 0, -1), O = new on(), T = new P(), Y = new P(), $ = new on(), se = new Ce(), ne = new ei(), J = new Gn(s, i, { type: Bn }), Z = {
|
|
6635
6633
|
name: "MirrorShader",
|
|
6636
6634
|
uniforms: is.merge([
|
|
6637
|
-
|
|
6638
|
-
|
|
6635
|
+
rn.fog,
|
|
6636
|
+
rn.lights,
|
|
6639
6637
|
{
|
|
6640
6638
|
normalSampler: { value: null },
|
|
6641
6639
|
mirrorSampler: { value: null },
|
|
@@ -6874,11 +6872,11 @@ function Hi(r) {
|
|
|
6874
6872
|
m.rotation.x = -Math.PI / 2, m.position.y = 0, m.name = "水面(标准材质)", m.userData.isWater = !0, m.userData.isMovable = !0, m.userData.waterSpeed = { x: c, y: d }, Be(m);
|
|
6875
6873
|
}
|
|
6876
6874
|
function ki(r) {
|
|
6877
|
-
const e =
|
|
6875
|
+
const e = Fs();
|
|
6878
6876
|
if (!e)
|
|
6879
6877
|
return console.warn("请先选中一个模型,再添加数据面板"), null;
|
|
6880
6878
|
const t = jt(e);
|
|
6881
|
-
t && (t.dispose(),
|
|
6879
|
+
t && (t.dispose(), oi(e));
|
|
6882
6880
|
const n = [
|
|
6883
6881
|
{ label: "温度", value: "30", unit: "℃" },
|
|
6884
6882
|
{ label: "湿度", value: "65", unit: "%" },
|
|
@@ -6888,7 +6886,7 @@ function ki(r) {
|
|
|
6888
6886
|
title: (r == null ? void 0 : r.title) || "数据面板",
|
|
6889
6887
|
items: (r == null ? void 0 : r.items) || n
|
|
6890
6888
|
});
|
|
6891
|
-
return s.attachTo(e),
|
|
6889
|
+
return s.attachTo(e), ii(e, s), nl(e), s;
|
|
6892
6890
|
}
|
|
6893
6891
|
function ji(r) {
|
|
6894
6892
|
return Es(!0), new Promise((e, t) => {
|
|
@@ -6902,7 +6900,7 @@ function ji(r) {
|
|
|
6902
6900
|
a.setDecoderPath(
|
|
6903
6901
|
"https://www.gstatic.com/draco/versioned/decoders/1.5.7/"
|
|
6904
6902
|
);
|
|
6905
|
-
const l = new
|
|
6903
|
+
const l = new li();
|
|
6906
6904
|
l.setDRACOLoader(a), i = l;
|
|
6907
6905
|
} else {
|
|
6908
6906
|
t(new Error("不支持的文件格式,请使用 .obj, .gltf, .glb"));
|
|
@@ -6962,7 +6960,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6962
6960
|
addWaterPlane: Hi,
|
|
6963
6961
|
getDataPanel: jt,
|
|
6964
6962
|
importModelFromFile: ji,
|
|
6965
|
-
removeDataPanel:
|
|
6963
|
+
removeDataPanel: oi
|
|
6966
6964
|
}, Symbol.toStringTag, { value: "Module" })), Hl = {
|
|
6967
6965
|
key: 1,
|
|
6968
6966
|
class: "toggle-placeholder"
|
|
@@ -7332,7 +7330,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7332
7330
|
}
|
|
7333
7331
|
});
|
|
7334
7332
|
}
|
|
7335
|
-
function
|
|
7333
|
+
function Zs(E, x) {
|
|
7336
7334
|
const M = new le(x);
|
|
7337
7335
|
E.traverse((S) => {
|
|
7338
7336
|
if (S.type === "Mesh") {
|
|
@@ -7349,16 +7347,16 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7349
7347
|
}
|
|
7350
7348
|
});
|
|
7351
7349
|
}
|
|
7352
|
-
function
|
|
7350
|
+
function Qs() {
|
|
7353
7351
|
t.selectedObject && Ui(t.selectedObject, ze.value);
|
|
7354
7352
|
}
|
|
7355
7353
|
function zi(E) {
|
|
7356
7354
|
const M = E.target.value;
|
|
7357
|
-
Le.value = M, t.selectedObject &&
|
|
7355
|
+
Le.value = M, t.selectedObject && Zs(t.selectedObject, M);
|
|
7358
7356
|
}
|
|
7359
7357
|
function Wi(E) {
|
|
7360
7358
|
let M = E.target.value.trim();
|
|
7361
|
-
M.startsWith("#") || (M = "#" + M), /^#[0-9a-fA-F]{6}$/.test(M) && (Le.value = M, t.selectedObject &&
|
|
7359
|
+
M.startsWith("#") || (M = "#" + M), /^#[0-9a-fA-F]{6}$/.test(M) && (Le.value = M, t.selectedObject && Zs(t.selectedObject, M));
|
|
7362
7360
|
}
|
|
7363
7361
|
return Me(
|
|
7364
7362
|
() => t.selectedObject,
|
|
@@ -7780,7 +7778,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7780
7778
|
max: "1",
|
|
7781
7779
|
step: "0.01",
|
|
7782
7780
|
"onUpdate:modelValue": x[16] || (x[16] = (M) => ze.value = M),
|
|
7783
|
-
onInput:
|
|
7781
|
+
onInput: Qs
|
|
7784
7782
|
}, null, 544), [
|
|
7785
7783
|
[
|
|
7786
7784
|
W,
|
|
@@ -7795,7 +7793,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7795
7793
|
max: "1",
|
|
7796
7794
|
step: "0.01",
|
|
7797
7795
|
"onUpdate:modelValue": x[17] || (x[17] = (M) => ze.value = M),
|
|
7798
|
-
onInput:
|
|
7796
|
+
onInput: Qs,
|
|
7799
7797
|
class: "intensity-input"
|
|
7800
7798
|
}, null, 544), [
|
|
7801
7799
|
[
|
|
@@ -7925,7 +7923,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7925
7923
|
function w() {
|
|
7926
7924
|
const h = e.selectedObject;
|
|
7927
7925
|
if (!h) return;
|
|
7928
|
-
const f =
|
|
7926
|
+
const f = Us();
|
|
7929
7927
|
f && (h.userData.closeUpView = {
|
|
7930
7928
|
x: f.position.x,
|
|
7931
7929
|
y: f.position.y,
|
|
@@ -8562,8 +8560,8 @@ function myFunc() {
|
|
|
8562
8560
|
console.log("scene GLB 字节数:", m.scene.byteLength), console.log("camera:", m.camera), console.log("dataPanels:", m.dataPanels), console.log("waters:", m.waters), console.log("textures:", m.textures), console.log("ambientLight:", m.ambientLight);
|
|
8563
8561
|
}, A = () => {
|
|
8564
8562
|
if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
|
|
8565
|
-
|
|
8566
|
-
}, b = () =>
|
|
8563
|
+
yi(localStorage.getItem("test_id"));
|
|
8564
|
+
}, b = () => hi();
|
|
8567
8565
|
return (m, p) => (H(), k("div", Uu, [
|
|
8568
8566
|
y("div", zu, [
|
|
8569
8567
|
y("div", {
|
|
@@ -8706,7 +8704,7 @@ function myFunc() {
|
|
|
8706
8704
|
_a((h) => {
|
|
8707
8705
|
t.value = h;
|
|
8708
8706
|
});
|
|
8709
|
-
const n =
|
|
8707
|
+
const n = Js(null), s = ts({
|
|
8710
8708
|
position: { x: 0, y: 0, z: 0 },
|
|
8711
8709
|
rotation: { x: 0, y: 0, z: 0 },
|
|
8712
8710
|
scale: { x: 1, y: 1, z: 1 }
|
|
@@ -8739,17 +8737,17 @@ function myFunc() {
|
|
|
8739
8737
|
} catch (f) {
|
|
8740
8738
|
console.error("导入失败:", f), alert("导入失败:" + f.message);
|
|
8741
8739
|
}
|
|
8742
|
-
}, d =
|
|
8740
|
+
}, d = Js([]);
|
|
8743
8741
|
cl((h) => {
|
|
8744
8742
|
d.value = h;
|
|
8745
8743
|
});
|
|
8746
8744
|
const u = () => {
|
|
8747
8745
|
const h = wi();
|
|
8748
8746
|
h && (d.value = h);
|
|
8749
|
-
}, g = (h) => ds(h), A = (h) =>
|
|
8750
|
-
|
|
8747
|
+
}, g = (h) => ds(h), A = (h) => Ci(h.uuid), b = (h) => {
|
|
8748
|
+
mi(h);
|
|
8751
8749
|
}, m = (h) => Fa(h), p = tt(
|
|
8752
|
-
() => Se.scripts.filter((h) => !
|
|
8750
|
+
() => Se.scripts.filter((h) => !fi(h))
|
|
8753
8751
|
), I = G(null), w = async () => {
|
|
8754
8752
|
I.value && await Wa(I.value, e.mode, e.sceneData), u();
|
|
8755
8753
|
};
|
|
@@ -8819,32 +8817,32 @@ export {
|
|
|
8819
8817
|
vl as destroyEditor,
|
|
8820
8818
|
Er as disposeCSS2DRenderer,
|
|
8821
8819
|
Il as exportSceneToJSON,
|
|
8822
|
-
|
|
8820
|
+
bi as focusOnObject,
|
|
8823
8821
|
od as getCSS2DRenderer,
|
|
8824
|
-
|
|
8822
|
+
Us as getCamera,
|
|
8825
8823
|
jt as getDataPanel,
|
|
8826
|
-
|
|
8827
|
-
|
|
8824
|
+
Nn as getRenderer,
|
|
8825
|
+
Ln as getScene,
|
|
8828
8826
|
wi as getSceneObjects,
|
|
8829
|
-
|
|
8827
|
+
Fs as getSelectedObject,
|
|
8830
8828
|
ji as importModelFromFile,
|
|
8831
|
-
|
|
8829
|
+
hi as initDefaultMainCamera,
|
|
8832
8830
|
Wa as initEditor,
|
|
8833
8831
|
wl as loadSceneFromJSON,
|
|
8834
8832
|
cl as onSceneObjectsChangeCallback,
|
|
8835
8833
|
nl as registerModelDataPanel,
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8834
|
+
oi as removeDataPanel,
|
|
8835
|
+
Ii as removeModel,
|
|
8836
|
+
Ci as removeModelById,
|
|
8839
8837
|
Mr as renderCSS2D,
|
|
8840
8838
|
Tr as resizeCSS2DRenderer,
|
|
8841
|
-
|
|
8839
|
+
yi as selectModelHandle,
|
|
8842
8840
|
ds as selectObject,
|
|
8843
8841
|
Es as setLoading,
|
|
8844
8842
|
_a as setLoadingCallback,
|
|
8845
8843
|
al as setSelectedObjectCallback,
|
|
8846
8844
|
ll as setTransformChangeCallback,
|
|
8847
|
-
|
|
8845
|
+
mi as setTransformMode,
|
|
8848
8846
|
ul as updateDataPanelValue,
|
|
8849
8847
|
xu as useTreeExpand
|
|
8850
8848
|
};
|