endset_three_editor 0.9.8 → 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/three-editor.cjs.js +17 -17
- package/dist/three-editor.cjs.js.map +1 -1
- package/dist/three-editor.es.js +128 -119
- package/dist/three-editor.es.js.map +1 -1
- package/package.json +1 -1
package/dist/three-editor.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var mi = Object.defineProperty;
|
|
2
2
|
var gi = (r, e, t) => e in r ? mi(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var Ve = (r, e, t) => gi(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { toRaw as
|
|
4
|
+
import { toRaw as ns, defineComponent as Xe, ref as W, inject as yi, computed as ot, watchEffect as bi, resolveComponent as xi, openBlock as N, createElementBlock as U, createElementVNode as b, normalizeClass as Te, withModifiers as xs, unref as Ii, toDisplayString as de, Fragment as Le, renderList as is, createBlock as bt, createCommentVNode as ue, reactive as Is, watch as ve, withDirectives as F, vModelText as Y, createTextVNode as rs, withKeys as rt, vModelCheckbox as Ci, toRef as wi, provide as Mi, createVNode as as, vShow as Qe, shallowRef as Fs, onMounted as vi, onBeforeUnmount as Ti } from "vue";
|
|
5
5
|
import * as P from "three";
|
|
6
|
-
import { Controls as wn, Vector3 as R, MOUSE as ct, TOUCH as at, Quaternion as pe, Spherical as Us, Vector2 as ce, Ray as Ei, Plane as Mn, MathUtils as Tt, Raycaster as Di, Object3D as dt, MeshBasicMaterial as Je, LineBasicMaterial as xt, CylinderGeometry as me, BoxGeometry as fe, BufferGeometry as et, Float32BufferAttribute as Se, Mesh as S, OctahedronGeometry as Lt, Line as je, TorusGeometry as ht, SphereGeometry as Pi, Euler as Ri, Matrix4 as xe, PlaneGeometry as Oi, DoubleSide as Ps, OrthographicCamera as vn, ShaderMaterial as
|
|
6
|
+
import { Controls as wn, Vector3 as R, MOUSE as ct, TOUCH as at, Quaternion as pe, Spherical as Us, Vector2 as ce, Ray as Ei, Plane as Mn, MathUtils as Tt, Raycaster as Di, Object3D as dt, MeshBasicMaterial as Je, LineBasicMaterial as xt, CylinderGeometry as me, BoxGeometry as fe, BufferGeometry as et, Float32BufferAttribute as Se, Mesh as S, OctahedronGeometry as Lt, Line as je, TorusGeometry as ht, SphereGeometry as Pi, Euler as Ri, Matrix4 as xe, PlaneGeometry as Oi, DoubleSide as Ps, OrthographicCamera as vn, ShaderMaterial as Cs, UniformsUtils as Qt, WebGLRenderTarget as Tn, HalfFloatType as En, NoBlending as Si, Timer as Li, Color as re, RawShaderMaterial as Ni, ColorManagement as Jt, SRGBTransfer as Hi, LinearToneMapping as ki, ReinhardToneMapping as ji, CineonToneMapping as Fi, ACESFilmicToneMapping as Ui, AgXToneMapping as zi, NeutralToneMapping as Gi, CustomToneMapping as Wi, BufferAttribute as we, REVISION as Bi, CompressedTexture as ls, Source as Xi, NoColorSpace as qi, RGBAFormat as Vi, ImageUtils as Yi, PropertyBinding as Et, InterpolateDiscrete as Dn, Scene as zs, SRGBColorSpace as Ne, NearestFilter as Rs, NearestMipmapNearestFilter as Pn, NearestMipmapLinearFilter as Rn, LinearFilter as _t, LinearMipmapNearestFilter as On, LinearMipmapLinearFilter as Os, ClampToEdgeWrapping as Sn, RepeatWrapping as _e, MirroredRepeatWrapping as Ln, InterpolateLinear as Ss, TrianglesDrawMode as Ki, TriangleFanDrawMode as ws, TriangleStripDrawMode as Nn, Loader as Ls, LoaderUtils as It, FileLoader as Dt, MeshPhysicalMaterial as ke, LinearSRGBColorSpace as He, SpotLight as Zi, PointLight as Qi, DirectionalLight as Ji, InstancedMesh as _i, InstancedBufferAttribute as $i, TextureLoader as Wt, ImageBitmapLoader as eo, InterleavedBuffer as Hn, InterleavedBufferAttribute as kn, PointsMaterial as mt, Material as Ct, MeshStandardMaterial as jn, SkinnedMesh as to, LineSegments as Ms, LineLoop as so, Points as Bt, Group as Xt, PerspectiveCamera as Fn, Skeleton as no, AnimationClip as io, Bone as oo, Texture as Gs, VectorKeyframeTrack as Ws, NumberKeyframeTrack as Bs, QuaternionKeyframeTrack as Xs, FrontSide as Un, Interpolant as ro, Box3 as ao, Sphere as lo, MeshPhongMaterial as co, Vector4 as qs, UniformsLib as Vs } from "three";
|
|
7
7
|
import Pt from "@tweenjs/tween.js";
|
|
8
8
|
const Ys = { type: "change" }, Ns = { type: "start" }, zn = { type: "end" }, Nt = new Ei(), Ks = new Mn(), uo = Math.cos(70 * Tt.DEG2RAD), ae = new R(), ge = 2 * Math.PI, $ = {
|
|
9
9
|
NONE: -1,
|
|
@@ -14,7 +14,7 @@ const Ys = { type: "change" }, Ns = { type: "start" }, zn = { type: "end" }, Nt
|
|
|
14
14
|
TOUCH_PAN: 4,
|
|
15
15
|
TOUCH_DOLLY_PAN: 5,
|
|
16
16
|
TOUCH_DOLLY_ROTATE: 6
|
|
17
|
-
},
|
|
17
|
+
}, cs = 1e-6;
|
|
18
18
|
class ho extends wn {
|
|
19
19
|
/**
|
|
20
20
|
* Constructs a new controls instance.
|
|
@@ -172,7 +172,7 @@ class ho extends wn {
|
|
|
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) >
|
|
175
|
+
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > cs || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > cs || this._lastTargetPosition.distanceToSquared(this.target) > cs ? (this.dispatchEvent(Ys), 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 ? ge / 60 * this.autoRotateSpeed * e : ge / 60 / 60 * this.autoRotateSpeed;
|
|
@@ -516,7 +516,7 @@ const Ye = new Di(), he = new R(), ze = new R(), se = new pe(), Zs = {
|
|
|
516
516
|
X: new R(1, 0, 0),
|
|
517
517
|
Y: new R(0, 1, 0),
|
|
518
518
|
Z: new R(0, 0, 1)
|
|
519
|
-
},
|
|
519
|
+
}, us = { type: "change" }, Qs = { type: "mouseDown", mode: null }, Js = { type: "mouseUp", mode: null }, _s = { type: "objectChange" };
|
|
520
520
|
class vo extends wn {
|
|
521
521
|
/**
|
|
522
522
|
* Constructs a new controls instance.
|
|
@@ -540,7 +540,7 @@ class vo extends wn {
|
|
|
540
540
|
return w !== void 0 ? w : h;
|
|
541
541
|
},
|
|
542
542
|
set: function(E) {
|
|
543
|
-
w !== E && (w = E, i[I] = E, s[I] = E, o.dispatchEvent({ type: I + "-changed", value: E }), o.dispatchEvent(
|
|
543
|
+
w !== E && (w = E, i[I] = E, s[I] = E, o.dispatchEvent({ type: I + "-changed", value: E }), o.dispatchEvent(us));
|
|
544
544
|
}
|
|
545
545
|
}), o[I] = h, i[I] = h, s[I] = h;
|
|
546
546
|
}
|
|
@@ -566,13 +566,13 @@ class vo extends wn {
|
|
|
566
566
|
pointerHover(e) {
|
|
567
567
|
if (this.object === void 0 || this.dragging === !0) return;
|
|
568
568
|
e !== null && Ye.setFromCamera(e, this.camera);
|
|
569
|
-
const t =
|
|
569
|
+
const t = ds(this._gizmo.picker[this.mode], Ye);
|
|
570
570
|
t ? this.axis = t.object.name : this.axis = null;
|
|
571
571
|
}
|
|
572
572
|
pointerDown(e) {
|
|
573
573
|
if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
|
|
574
574
|
e !== null && Ye.setFromCamera(e, this.camera);
|
|
575
|
-
const t =
|
|
575
|
+
const t = ds(this._plane, Ye, !0);
|
|
576
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, Qs.mode = this.mode, this.dispatchEvent(Qs);
|
|
577
577
|
}
|
|
578
578
|
}
|
|
@@ -581,7 +581,7 @@ class vo extends wn {
|
|
|
581
581
|
let i = this.space;
|
|
582
582
|
if (n === "scale" ? i = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (i = "world"), s === void 0 || t === null || this.dragging === !1 || e !== null && e.button !== -1) return;
|
|
583
583
|
e !== null && Ye.setFromCamera(e, this.camera);
|
|
584
|
-
const o =
|
|
584
|
+
const o = ds(this._plane, Ye, !0);
|
|
585
585
|
if (o) {
|
|
586
586
|
if (this.pointEnd.copy(o.point).sub(this.worldPositionStart), n === "translate")
|
|
587
587
|
this._offset.copy(this.pointEnd).sub(this.pointStart), i === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), i === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), s.position.copy(this._offset).add(this._positionStart), this.translationSnap && (i === "local" && (s.position.applyQuaternion(se.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (s.position.x = Math.round(s.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (s.position.y = Math.round(s.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (s.position.z = Math.round(s.position.z / this.translationSnap) * this.translationSnap), s.position.applyQuaternion(this._quaternionStart)), i === "world" && (s.parent && s.position.add(he.setFromMatrixPosition(s.parent.matrixWorld)), t.search("X") !== -1 && (s.position.x = Math.round(s.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (s.position.y = Math.round(s.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (s.position.z = Math.round(s.position.z / this.translationSnap) * this.translationSnap), s.parent && s.position.sub(he.setFromMatrixPosition(s.parent.matrixWorld)))), s.position.x = Math.max(this.minX, Math.min(this.maxX, s.position.x)), s.position.y = Math.max(this.minY, Math.min(this.maxY, s.position.y)), s.position.z = Math.max(this.minZ, Math.min(this.maxZ, s.position.z));
|
|
@@ -598,7 +598,7 @@ class vo extends wn {
|
|
|
598
598
|
let l = !1;
|
|
599
599
|
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(he.copy(this.rotationAxis).cross(this.eye)) * a) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(Zs[t]), he.copy(Zs[t]), i === "local" && he.applyQuaternion(this.worldQuaternion), he.cross(this.eye), he.length() === 0 ? l = !0 : this.rotationAngle = this._offset.dot(he.normalize()) * a), (t === "E" || l) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), i === "local" && t !== "E" && t !== "XYZE" ? (s.quaternion.copy(this._quaternionStart), s.quaternion.multiply(se.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), s.quaternion.copy(se.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), s.quaternion.multiply(this._quaternionStart).normalize());
|
|
600
600
|
}
|
|
601
|
-
this.dispatchEvent(
|
|
601
|
+
this.dispatchEvent(us), this.dispatchEvent(_s);
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
pointerUp(e) {
|
|
@@ -628,7 +628,7 @@ class vo extends wn {
|
|
|
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(
|
|
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(us), this.dispatchEvent(_s), 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
|
|
@@ -742,7 +742,7 @@ function Po(r) {
|
|
|
742
742
|
function Ro(r) {
|
|
743
743
|
this.enabled && (this.domElement.releasePointerCapture(r.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(r)));
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function ds(r, e, t) {
|
|
746
746
|
const n = e.intersectObject(r, !0);
|
|
747
747
|
for (let s = 0; s < n.length; s++)
|
|
748
748
|
if (n[s].object.visible || t)
|
|
@@ -1210,7 +1210,7 @@ class Fo extends Ot {
|
|
|
1210
1210
|
* the read buffer.
|
|
1211
1211
|
*/
|
|
1212
1212
|
constructor(e, t = "tDiffuse") {
|
|
1213
|
-
super(), this.textureID = t, this.uniforms = null, this.material = null, e instanceof
|
|
1213
|
+
super(), this.textureID = t, this.uniforms = null, this.material = null, e instanceof Cs ? (this.uniforms = e.uniforms, this.material = e) : e && (this.uniforms = Qt.clone(e.uniforms), this.material = new Cs({
|
|
1214
1214
|
name: e.name !== void 0 ? e.name : "unspecified",
|
|
1215
1215
|
defines: Object.assign({}, e.defines),
|
|
1216
1216
|
uniforms: this.uniforms,
|
|
@@ -1544,7 +1544,7 @@ class Wo extends Ot {
|
|
|
1544
1544
|
* Constructs a new output pass.
|
|
1545
1545
|
*/
|
|
1546
1546
|
constructor() {
|
|
1547
|
-
super(), this.isOutputPass = !0, this.uniforms =
|
|
1547
|
+
super(), this.isOutputPass = !0, this.uniforms = Qt.clone(Ft.uniforms), this.material = new Ni({
|
|
1548
1548
|
name: Ft.name,
|
|
1549
1549
|
uniforms: this.uniforms,
|
|
1550
1550
|
vertexShader: Ft.vertexShader,
|
|
@@ -1563,7 +1563,7 @@ class Wo extends Ot {
|
|
|
1563
1563
|
* @param {boolean} maskActive - Whether masking is active or not.
|
|
1564
1564
|
*/
|
|
1565
1565
|
render(e, t, n) {
|
|
1566
|
-
this.uniforms.tDiffuse.value = n.texture, this.uniforms.toneMappingExposure.value = e.toneMappingExposure, (this._outputColorSpace !== e.outputColorSpace || this._toneMapping !== e.toneMapping) && (this._outputColorSpace = e.outputColorSpace, this._toneMapping = e.toneMapping, this.material.defines = {},
|
|
1566
|
+
this.uniforms.tDiffuse.value = n.texture, this.uniforms.toneMappingExposure.value = e.toneMappingExposure, (this._outputColorSpace !== e.outputColorSpace || this._toneMapping !== e.toneMapping) && (this._outputColorSpace = e.outputColorSpace, this._toneMapping = e.toneMapping, this.material.defines = {}, Jt.getTransfer(this._outputColorSpace) === Hi && (this.material.defines.SRGB_TRANSFER = ""), this._toneMapping === ki ? this.material.defines.LINEAR_TONE_MAPPING = "" : this._toneMapping === ji ? this.material.defines.REINHARD_TONE_MAPPING = "" : this._toneMapping === Fi ? this.material.defines.CINEON_TONE_MAPPING = "" : this._toneMapping === Ui ? this.material.defines.ACES_FILMIC_TONE_MAPPING = "" : this._toneMapping === zi ? this.material.defines.AGX_TONE_MAPPING = "" : this._toneMapping === Gi ? this.material.defines.NEUTRAL_TONE_MAPPING = "" : this._toneMapping === Wi && (this.material.defines.CUSTOM_TONE_MAPPING = ""), this.material.needsUpdate = !0), this.renderToScreen === !0 ? (e.setRenderTarget(null), this._fsQuad.render(e)) : (e.setRenderTarget(t), this.clear && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), this._fsQuad.render(e));
|
|
1567
1567
|
}
|
|
1568
1568
|
/**
|
|
1569
1569
|
* Frees the GPU-related resources allocated by this instance. Call this
|
|
@@ -1911,18 +1911,18 @@ const Ut = {
|
|
|
1911
1911
|
}
|
|
1912
1912
|
};
|
|
1913
1913
|
Ve(lt, "_breathInjected", !1);
|
|
1914
|
-
let
|
|
1915
|
-
const
|
|
1914
|
+
let $t = lt;
|
|
1915
|
+
const es = /* @__PURE__ */ new WeakMap();
|
|
1916
1916
|
function Wn(r, e) {
|
|
1917
|
-
const t =
|
|
1918
|
-
|
|
1917
|
+
const t = ns(r);
|
|
1918
|
+
es.set(t, e), t.userData._hasDataPanel = !0;
|
|
1919
1919
|
}
|
|
1920
1920
|
function St(r) {
|
|
1921
|
-
return
|
|
1921
|
+
return es.get(ns(r)) || null;
|
|
1922
1922
|
}
|
|
1923
1923
|
function Bn(r) {
|
|
1924
|
-
const e =
|
|
1925
|
-
t && (t.dispose(),
|
|
1924
|
+
const e = ns(r), t = es.get(e);
|
|
1925
|
+
t && (t.dispose(), es.delete(e)), e.userData._hasDataPanel = void 0;
|
|
1926
1926
|
}
|
|
1927
1927
|
let ie = null;
|
|
1928
1928
|
function $o(r) {
|
|
@@ -1971,7 +1971,7 @@ function nr() {
|
|
|
1971
1971
|
const g = new P.Mesh(e, l(100));
|
|
1972
1972
|
return g.position.set(0, 20, 0), g.scale.set(1, 0.1, 1), r.add(g), r;
|
|
1973
1973
|
}
|
|
1974
|
-
function
|
|
1974
|
+
function Vt(r) {
|
|
1975
1975
|
try {
|
|
1976
1976
|
const e = new P.PMREMGenerator(r), t = nr(), n = e.fromScene(t).texture;
|
|
1977
1977
|
return t.traverse((s) => {
|
|
@@ -2132,11 +2132,11 @@ const X = {
|
|
|
2132
2132
|
CLAMP_TO_EDGE: 33071,
|
|
2133
2133
|
MIRRORED_REPEAT: 33648,
|
|
2134
2134
|
REPEAT: 10497
|
|
2135
|
-
},
|
|
2135
|
+
}, hs = "KHR_mesh_quantization", be = {};
|
|
2136
2136
|
be[Rs] = X.NEAREST;
|
|
2137
2137
|
be[Pn] = X.NEAREST_MIPMAP_NEAREST;
|
|
2138
2138
|
be[Rn] = X.NEAREST_MIPMAP_LINEAR;
|
|
2139
|
-
be[
|
|
2139
|
+
be[_t] = X.LINEAR;
|
|
2140
2140
|
be[On] = X.LINEAR_MIPMAP_NEAREST;
|
|
2141
2141
|
be[Os] = X.LINEAR_MIPMAP_LINEAR;
|
|
2142
2142
|
be[Sn] = X.CLAMP_TO_EDGE;
|
|
@@ -2174,7 +2174,7 @@ function dr(r, e, t) {
|
|
|
2174
2174
|
function Xn(r) {
|
|
2175
2175
|
return Math.ceil(r / 4) * 4;
|
|
2176
2176
|
}
|
|
2177
|
-
function
|
|
2177
|
+
function fs(r, e = 0) {
|
|
2178
2178
|
const t = Xn(r.byteLength);
|
|
2179
2179
|
if (t !== r.byteLength) {
|
|
2180
2180
|
const n = new Uint8Array(t);
|
|
@@ -2243,9 +2243,9 @@ 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 A = new FileReader();
|
|
2245
2245
|
A.readAsArrayBuffer(c), A.onloadend = function() {
|
|
2246
|
-
const p =
|
|
2246
|
+
const p = fs(A.result), g = new DataView(new ArrayBuffer(dn));
|
|
2247
2247
|
g.setUint32(0, p.byteLength, !0), g.setUint32(4, lr, !0);
|
|
2248
|
-
const f =
|
|
2248
|
+
const f = fs(cr(JSON.stringify(o)), 32), m = new DataView(new ArrayBuffer(dn));
|
|
2249
2249
|
m.setUint32(0, f.byteLength, !0), m.setUint32(4, ar, !0);
|
|
2250
2250
|
const y = new ArrayBuffer(un), v = new DataView(y);
|
|
2251
2251
|
v.setUint32(0, or, !0), v.setUint32(4, rr, !0);
|
|
@@ -2356,7 +2356,7 @@ class fr {
|
|
|
2356
2356
|
return f;
|
|
2357
2357
|
};
|
|
2358
2358
|
}
|
|
2359
|
-
e instanceof
|
|
2359
|
+
e instanceof ls && (e = await this.decompressTextureAsync(e)), t instanceof ls && (t = await this.decompressTextureAsync(t));
|
|
2360
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 = hn();
|
|
2361
2361
|
l.width = o, l.height = a;
|
|
2362
2362
|
const c = l.getContext("2d", {
|
|
@@ -2450,7 +2450,7 @@ class fr {
|
|
|
2450
2450
|
return n.bufferViews || (n.bufferViews = []), new Promise(function(s) {
|
|
2451
2451
|
const i = new FileReader();
|
|
2452
2452
|
i.readAsArrayBuffer(e), i.onloadend = function() {
|
|
2453
|
-
const o =
|
|
2453
|
+
const o = fs(i.result), a = {
|
|
2454
2454
|
buffer: t.processBuffer(o),
|
|
2455
2455
|
byteOffset: t.byteOffset,
|
|
2456
2456
|
byteLength: o.byteLength
|
|
@@ -2572,7 +2572,7 @@ class fr {
|
|
|
2572
2572
|
async processTextureAsync(e) {
|
|
2573
2573
|
const n = this.options, s = this.cache, i = this.json;
|
|
2574
2574
|
if (s.textures.has(e)) return s.textures.get(e);
|
|
2575
|
-
i.textures || (i.textures = []), e instanceof
|
|
2575
|
+
i.textures || (i.textures = []), e instanceof ls && (e = await this.decompressTextureAsync(e, n.maxTextureSize));
|
|
2576
2576
|
const o = e.userData.mimeType, a = this.processImage(e.image, e.format, e.flipY, o), l = {
|
|
2577
2577
|
sampler: this.processSampler(e)
|
|
2578
2578
|
};
|
|
@@ -2753,7 +2753,7 @@ class fr {
|
|
|
2753
2753
|
* @param {THREE.BufferAttribute} attribute
|
|
2754
2754
|
*/
|
|
2755
2755
|
detectMeshQuantization(e, t) {
|
|
2756
|
-
if (this.extensionsUsed[
|
|
2756
|
+
if (this.extensionsUsed[hs]) return;
|
|
2757
2757
|
let n;
|
|
2758
2758
|
switch (t.array.constructor) {
|
|
2759
2759
|
case Int8Array:
|
|
@@ -2773,7 +2773,7 @@ class fr {
|
|
|
2773
2773
|
}
|
|
2774
2774
|
t.normalized && (n += " normalized");
|
|
2775
2775
|
const s = e.split("_", 1)[0];
|
|
2776
|
-
ln[s] && ln[s].includes(n) && (this.extensionsUsed[
|
|
2776
|
+
ln[s] && ln[s].includes(n) && (this.extensionsUsed[hs] = !0, this.extensionsRequired[hs] = !0);
|
|
2777
2777
|
}
|
|
2778
2778
|
/**
|
|
2779
2779
|
* Process camera
|
|
@@ -3293,7 +3293,7 @@ wt.Utils = {
|
|
|
3293
3293
|
function fn(r, e) {
|
|
3294
3294
|
if (e === Ki)
|
|
3295
3295
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), r;
|
|
3296
|
-
if (e ===
|
|
3296
|
+
if (e === ws || e === Nn) {
|
|
3297
3297
|
let t = r.getIndex();
|
|
3298
3298
|
if (t === null) {
|
|
3299
3299
|
const o = [], a = r.getAttribute("position");
|
|
@@ -3305,7 +3305,7 @@ function fn(r, e) {
|
|
|
3305
3305
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), r;
|
|
3306
3306
|
}
|
|
3307
3307
|
const n = t.count - 2, s = [];
|
|
3308
|
-
if (e ===
|
|
3308
|
+
if (e === ws)
|
|
3309
3309
|
for (let o = 1; o <= n; o++)
|
|
3310
3310
|
s.push(t.getX(0)), s.push(t.getX(o)), s.push(t.getX(o + 1));
|
|
3311
3311
|
else
|
|
@@ -4041,7 +4041,7 @@ const Ce = {
|
|
|
4041
4041
|
5126: Float32Array
|
|
4042
4042
|
}, mn = {
|
|
4043
4043
|
9728: Rs,
|
|
4044
|
-
9729:
|
|
4044
|
+
9729: _t,
|
|
4045
4045
|
9984: Pn,
|
|
4046
4046
|
9985: On,
|
|
4047
4047
|
9986: Rn,
|
|
@@ -4050,7 +4050,7 @@ const Ce = {
|
|
|
4050
4050
|
33071: Sn,
|
|
4051
4051
|
33648: Ln,
|
|
4052
4052
|
10497: _e
|
|
4053
|
-
},
|
|
4053
|
+
}, ps = {
|
|
4054
4054
|
SCALAR: 1,
|
|
4055
4055
|
VEC2: 2,
|
|
4056
4056
|
VEC3: 3,
|
|
@@ -4080,7 +4080,7 @@ const Ce = {
|
|
|
4080
4080
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
4081
4081
|
LINEAR: Ss,
|
|
4082
4082
|
STEP: Dn
|
|
4083
|
-
},
|
|
4083
|
+
}, As = {
|
|
4084
4084
|
OPAQUE: "OPAQUE",
|
|
4085
4085
|
MASK: "MASK",
|
|
4086
4086
|
BLEND: "BLEND"
|
|
@@ -4152,12 +4152,12 @@ function sa(r, e) {
|
|
|
4152
4152
|
function na(r) {
|
|
4153
4153
|
let e;
|
|
4154
4154
|
const t = r.extensions && r.extensions[B.KHR_DRACO_MESH_COMPRESSION];
|
|
4155
|
-
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" +
|
|
4155
|
+
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + ms(t.attributes) : e = r.indices + ":" + ms(r.attributes) + ":" + r.mode, r.targets !== void 0)
|
|
4156
4156
|
for (let n = 0, s = r.targets.length; n < s; n++)
|
|
4157
|
-
e += ":" +
|
|
4157
|
+
e += ":" + ms(r.targets[n]);
|
|
4158
4158
|
return e;
|
|
4159
4159
|
}
|
|
4160
|
-
function
|
|
4160
|
+
function ms(r) {
|
|
4161
4161
|
let e = "";
|
|
4162
4162
|
const t = Object.keys(r).sort();
|
|
4163
4163
|
for (let n = 0, s = t.length; n < s; n++)
|
|
@@ -4432,12 +4432,12 @@ class ra {
|
|
|
4432
4432
|
loadAccessor(e) {
|
|
4433
4433
|
const t = this, n = this.json, s = this.json.accessors[e];
|
|
4434
4434
|
if (s.bufferView === void 0 && s.sparse === void 0) {
|
|
4435
|
-
const o =
|
|
4435
|
+
const o = ps[s.type], a = ut[s.componentType], l = s.normalized === !0, c = new a(s.count * o);
|
|
4436
4436
|
return Promise.resolve(new we(c, o, l));
|
|
4437
4437
|
}
|
|
4438
4438
|
const i = [];
|
|
4439
4439
|
return s.bufferView !== void 0 ? i.push(this.getDependency("bufferView", s.bufferView)) : i.push(null), s.sparse !== void 0 && (i.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(i).then(function(o) {
|
|
4440
|
-
const a = o[0], l =
|
|
4440
|
+
const a = o[0], l = ps[s.type], c = ut[s.componentType], d = c.BYTES_PER_ELEMENT, u = d * l, A = s.byteOffset || 0, p = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, g = s.normalized === !0;
|
|
4441
4441
|
let f, m;
|
|
4442
4442
|
if (p && p !== u) {
|
|
4443
4443
|
const y = Math.floor(A / p), v = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + y + ":" + s.count;
|
|
@@ -4446,7 +4446,7 @@ class ra {
|
|
|
4446
4446
|
} else
|
|
4447
4447
|
a === null ? f = new c(s.count * l) : f = new c(a, A, s.count * l), m = new we(f, l, g);
|
|
4448
4448
|
if (s.sparse !== void 0) {
|
|
4449
|
-
const y =
|
|
4449
|
+
const y = ps.SCALAR, v = ut[s.sparse.indices.componentType], I = s.sparse.indices.byteOffset || 0, h = s.sparse.values.byteOffset || 0, w = new v(o[1], I, s.sparse.count * y), E = new c(o[2], h, s.sparse.count * l);
|
|
4450
4450
|
a !== null && (m = new we(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
|
|
4451
4451
|
for (let M = 0, H = w.length; M < H; M++) {
|
|
4452
4452
|
const ne = w[M];
|
|
@@ -4480,7 +4480,7 @@ class ra {
|
|
|
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 A = (i.samplers || {})[o.sampler] || {};
|
|
4483
|
-
return d.magFilter = mn[A.magFilter] ||
|
|
4483
|
+
return d.magFilter = mn[A.magFilter] || _t, d.minFilter = mn[A.minFilter] || Os, d.wrapS = gn[A.wrapS] || _e, d.wrapT = gn[A.wrapT] || _e, d.generateMipmaps = !d.isCompressedTexture && d.minFilter !== Rs && d.minFilter !== _t, s.associations.set(d, { textures: e }), d;
|
|
4484
4484
|
}).catch(function() {
|
|
4485
4485
|
return null;
|
|
4486
4486
|
});
|
|
@@ -4600,8 +4600,8 @@ class ra {
|
|
|
4600
4600
|
})));
|
|
4601
4601
|
}
|
|
4602
4602
|
i.doubleSided === !0 && (a.side = Ps);
|
|
4603
|
-
const d = i.alphaMode ||
|
|
4604
|
-
if (d ===
|
|
4603
|
+
const d = i.alphaMode || As.OPAQUE;
|
|
4604
|
+
if (d === As.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === As.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== Je && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new ce(1, 1), i.normalTexture.scale !== void 0)) {
|
|
4605
4605
|
const u = i.normalTexture.scale;
|
|
4606
4606
|
a.normalScale.set(u, u);
|
|
4607
4607
|
}
|
|
@@ -4673,9 +4673,9 @@ class ra {
|
|
|
4673
4673
|
let y;
|
|
4674
4674
|
const v = c[p];
|
|
4675
4675
|
if (m.mode === Ce.TRIANGLES || m.mode === Ce.TRIANGLE_STRIP || m.mode === Ce.TRIANGLE_FAN || m.mode === void 0)
|
|
4676
|
-
y = i.isSkinnedMesh === !0 ? new to(f, v) : new S(f, v), y.isSkinnedMesh === !0 && y.normalizeSkinWeights(), m.mode === Ce.TRIANGLE_STRIP ? y.geometry = fn(y.geometry, Nn) : m.mode === Ce.TRIANGLE_FAN && (y.geometry = fn(y.geometry,
|
|
4676
|
+
y = i.isSkinnedMesh === !0 ? new to(f, v) : new S(f, v), y.isSkinnedMesh === !0 && y.normalizeSkinWeights(), m.mode === Ce.TRIANGLE_STRIP ? y.geometry = fn(y.geometry, Nn) : m.mode === Ce.TRIANGLE_FAN && (y.geometry = fn(y.geometry, ws));
|
|
4677
4677
|
else if (m.mode === Ce.LINES)
|
|
4678
|
-
y = new
|
|
4678
|
+
y = new Ms(f, v);
|
|
4679
4679
|
else if (m.mode === Ce.LINE_STRIP)
|
|
4680
4680
|
y = new je(f, v);
|
|
4681
4681
|
else if (m.mode === Ce.LINE_LOOP)
|
|
@@ -4998,7 +4998,7 @@ function yn(r, e, t) {
|
|
|
4998
4998
|
});
|
|
4999
4999
|
s.push(o);
|
|
5000
5000
|
}
|
|
5001
|
-
return
|
|
5001
|
+
return Jt.workingColorSpace !== He && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Jt.workingColorSpace}" not supported.`), Oe(r, e), aa(r, e, t), Promise.all(s).then(function() {
|
|
5002
5002
|
return e.targets !== void 0 ? ta(r, e.targets, t) : r;
|
|
5003
5003
|
});
|
|
5004
5004
|
}
|
|
@@ -5026,13 +5026,13 @@ const C = {
|
|
|
5026
5026
|
/** 当前选中的物体 */
|
|
5027
5027
|
selectedObject: null
|
|
5028
5028
|
};
|
|
5029
|
-
let
|
|
5029
|
+
let Yt = !1, tt = !1, We = null;
|
|
5030
5030
|
const la = 16755200;
|
|
5031
|
-
let Es = [], zt = [], Rt = !0, $e = null, Ds = null,
|
|
5031
|
+
let Es = [], zt = [], Rt = !0, $e = null, Ds = null, Kt = null, Be = [];
|
|
5032
5032
|
const st = /* @__PURE__ */ new Map();
|
|
5033
|
-
let
|
|
5033
|
+
let ts, Zt = null, Mt = null, vt = null;
|
|
5034
5034
|
async function ca(r, e = "edit", t) {
|
|
5035
|
-
C.container = r, C.mode = e, da(), fa(), Aa(), t && (await Ba(t.scene, e, t.dataPanels, t.waters, t.textures, t.ambientLight), t != null && t.camera && (C.defaultMainCamera = t.camera, Zn(!0))), ga(), ma(),
|
|
5035
|
+
C.container = r, C.mode = e, da(), fa(), Aa(), t && (await Ba(t.scene, e, t.dataPanels, t.waters, t.textures, t.ambientLight), t != null && t.camera && (C.defaultMainCamera = t.camera, Zn(!0))), ga(), ma(), ts && C.orbitControls && (C.orbitControls.target.fromArray(ts), C.orbitControls.update()), ha(), ei(), Jn(), Mt = (n) => Ca(n), vt = () => ba(), e === "edit" && r.addEventListener("click", Mt), window.addEventListener("resize", vt), t || ya(), e === "edit" && pa();
|
|
5036
5036
|
}
|
|
5037
5037
|
function ua() {
|
|
5038
5038
|
return window.devicePixelRatio;
|
|
@@ -5059,8 +5059,12 @@ function ha() {
|
|
|
5059
5059
|
}
|
|
5060
5060
|
function fa() {
|
|
5061
5061
|
if (C.scene = new P.Scene(), C.scene.name = "sl_scene", C.renderer) {
|
|
5062
|
-
const r =
|
|
5063
|
-
r ? (C.scene.environment = r, C.scene.environmentIntensity = 1
|
|
5062
|
+
const r = Vt(C.renderer);
|
|
5063
|
+
r ? (C.scene.environment = r, C.scene.environmentIntensity = 1, console.log(
|
|
5064
|
+
"[初始化诊断] 环境贴图: 已生成",
|
|
5065
|
+
"environmentIntensity:",
|
|
5066
|
+
C.scene.environmentIntensity
|
|
5067
|
+
)) : console.warn("[初始化] 环境贴图生成失败,场景将没有 IBL 间接光照");
|
|
5064
5068
|
}
|
|
5065
5069
|
}
|
|
5066
5070
|
function pa() {
|
|
@@ -5083,10 +5087,10 @@ function Zn(r = !1) {
|
|
|
5083
5087
|
e.rotation[0],
|
|
5084
5088
|
e.rotation[1],
|
|
5085
5089
|
e.rotation[2]
|
|
5086
|
-
), C.camera.updateProjectionMatrix(),
|
|
5090
|
+
), C.camera.updateProjectionMatrix(), ts = e.target;
|
|
5087
5091
|
return;
|
|
5088
5092
|
} else
|
|
5089
|
-
$n(""),
|
|
5093
|
+
$n(""), ss();
|
|
5090
5094
|
if (!C.camera || !C.orbitControls) return;
|
|
5091
5095
|
const t = C.camera.position.clone(), n = C.orbitControls.target.clone(), s = new P.Vector3(
|
|
5092
5096
|
e.position[0],
|
|
@@ -5113,17 +5117,17 @@ function Zn(r = !1) {
|
|
|
5113
5117
|
).easing(Pt.Easing.Quadratic.InOut).onUpdate((o) => {
|
|
5114
5118
|
C.camera.position.set(o.x, o.y, o.z), C.orbitControls.target.set(o.tx, o.ty, o.tz), C.orbitControls.update();
|
|
5115
5119
|
}).onComplete(() => {
|
|
5116
|
-
|
|
5120
|
+
ts = e.target, C.orbitControls.enabled = !0;
|
|
5117
5121
|
}).start();
|
|
5118
5122
|
}
|
|
5119
5123
|
function ma() {
|
|
5120
5124
|
const r = new ho(C.camera, C.renderer.domElement);
|
|
5121
5125
|
r.minDistance = 0, r.maxDistance = 1 / 0, r.addEventListener("start", () => {
|
|
5122
|
-
|
|
5126
|
+
Yt = !1;
|
|
5123
5127
|
}), r.addEventListener("change", () => {
|
|
5124
|
-
|
|
5128
|
+
Yt = !0;
|
|
5125
5129
|
}), r.addEventListener("end", () => {
|
|
5126
|
-
|
|
5130
|
+
Yt && (tt = !0, setTimeout(() => {
|
|
5127
5131
|
tt = !1;
|
|
5128
5132
|
}, 200));
|
|
5129
5133
|
}), C.orbitControls = r;
|
|
@@ -5158,7 +5162,7 @@ function ya() {
|
|
|
5158
5162
|
}
|
|
5159
5163
|
function Jn() {
|
|
5160
5164
|
var e, t;
|
|
5161
|
-
|
|
5165
|
+
Zt = requestAnimationFrame(Jn), Pt.update(), (e = C.orbitControls) == null || e.update(), C.mode === "run" && We && C.scene && C.camera ? We.render() : (t = C.renderer) == null || t.render(C.scene, C.camera), C.scene && C.camera && er(C.scene, C.camera), Rt && C.scene && (zt = [], C.scene.traverse((n) => {
|
|
5162
5166
|
n.userData.isWater && n.type === "Mesh" && zt.push(n);
|
|
5163
5167
|
}), Rt = !1);
|
|
5164
5168
|
for (let n = 0; n < zt.length; n++) {
|
|
@@ -5186,7 +5190,7 @@ let ye = null;
|
|
|
5186
5190
|
function xa(r) {
|
|
5187
5191
|
ye = r;
|
|
5188
5192
|
}
|
|
5189
|
-
function
|
|
5193
|
+
function gs(r) {
|
|
5190
5194
|
ye == null || ye(r);
|
|
5191
5195
|
}
|
|
5192
5196
|
function Ia(r) {
|
|
@@ -5194,10 +5198,10 @@ function Ia(r) {
|
|
|
5194
5198
|
}
|
|
5195
5199
|
function _n(r) {
|
|
5196
5200
|
if (C.mode !== "edit") {
|
|
5197
|
-
|
|
5201
|
+
ss();
|
|
5198
5202
|
return;
|
|
5199
5203
|
}
|
|
5200
|
-
|
|
5204
|
+
ss(), r.traverse((e) => {
|
|
5201
5205
|
if (e.isMesh) {
|
|
5202
5206
|
const t = e, n = new P.EdgesGeometry(t.geometry), s = new P.LineBasicMaterial({
|
|
5203
5207
|
color: la,
|
|
@@ -5207,13 +5211,13 @@ function _n(r) {
|
|
|
5207
5211
|
}
|
|
5208
5212
|
});
|
|
5209
5213
|
}
|
|
5210
|
-
function
|
|
5214
|
+
function ss() {
|
|
5211
5215
|
for (const r of Es)
|
|
5212
5216
|
r.parent && r.parent.remove(r), r.geometry.dispose(), r.material.dispose();
|
|
5213
5217
|
Es = [];
|
|
5214
5218
|
}
|
|
5215
5219
|
function ks() {
|
|
5216
|
-
C.selectedObject && (
|
|
5220
|
+
C.selectedObject && (ss(), C.transformControls.detach(), C.selectedObject = null, $e == null || $e(null));
|
|
5217
5221
|
}
|
|
5218
5222
|
function $n(r) {
|
|
5219
5223
|
let e = null;
|
|
@@ -5341,10 +5345,10 @@ function Da(r) {
|
|
|
5341
5345
|
});
|
|
5342
5346
|
}
|
|
5343
5347
|
function nt(r, e = !1) {
|
|
5344
|
-
C.scene.add(r), Rt = !0, r.userData.isMovable && (Oa(r),
|
|
5348
|
+
C.scene.add(r), Rt = !0, r.userData.isMovable && (Oa(r), os()), e && C.mode === "edit" && Hs(r);
|
|
5345
5349
|
}
|
|
5346
5350
|
function Pa(r) {
|
|
5347
|
-
C.selectedObject === r && ks(), Rt = !0, Da(r), Ta(r), r.userData.helper && C.scene.remove(r.userData.helper), r.parent ? r.parent.remove(r) : C.scene.remove(r), Sa(r),
|
|
5351
|
+
C.selectedObject === r && ks(), Rt = !0, Da(r), Ta(r), r.userData.helper && C.scene.remove(r.userData.helper), r.parent ? r.parent.remove(r) : C.scene.remove(r), Sa(r), os();
|
|
5348
5352
|
}
|
|
5349
5353
|
function Ra(r) {
|
|
5350
5354
|
const e = C.scene.getObjectByProperty("uuid", r);
|
|
@@ -5361,10 +5365,10 @@ function ei() {
|
|
|
5361
5365
|
const r = [];
|
|
5362
5366
|
C.scene.children.forEach((e) => {
|
|
5363
5367
|
e.userData.isMovable && r.push(e);
|
|
5364
|
-
}), Be = r,
|
|
5368
|
+
}), Be = r, os();
|
|
5365
5369
|
}
|
|
5366
|
-
function
|
|
5367
|
-
|
|
5370
|
+
function os() {
|
|
5371
|
+
Kt == null || Kt([...Be]);
|
|
5368
5372
|
}
|
|
5369
5373
|
function La(r) {
|
|
5370
5374
|
$e = r;
|
|
@@ -5373,7 +5377,7 @@ function Na(r) {
|
|
|
5373
5377
|
Ds = r;
|
|
5374
5378
|
}
|
|
5375
5379
|
function Ha(r) {
|
|
5376
|
-
|
|
5380
|
+
Kt = r;
|
|
5377
5381
|
}
|
|
5378
5382
|
function ka() {
|
|
5379
5383
|
return Be;
|
|
@@ -5579,19 +5583,24 @@ async function Ba(r, e = "edit", t, n, s, i) {
|
|
|
5579
5583
|
h.name = i.name || "环境光", h.visible = i.visible ?? !0, i.position && h.position.fromArray(i.position), v.add(h);
|
|
5580
5584
|
} else
|
|
5581
5585
|
Qn(v);
|
|
5582
|
-
if (
|
|
5586
|
+
if (I)
|
|
5587
|
+
C.scene.environment = I, C.scene.environmentIntensity = 1;
|
|
5588
|
+
else if (C.renderer) {
|
|
5589
|
+
const h = Vt(C.renderer);
|
|
5590
|
+
h && (C.scene.environment = h, C.scene.environmentIntensity = 1);
|
|
5591
|
+
}
|
|
5592
|
+
if (!C.scene.environment && C.renderer) {
|
|
5593
|
+
const h = Vt(C.renderer);
|
|
5594
|
+
h ? (C.scene.environment = h, C.scene.environmentIntensity = 1, console.warn("[导入] 原环境贴图不可用,已重新生成")) : console.error("[导入] 环境贴图生成失败,场景将没有 IBL 间接光照,模型会偏暗");
|
|
5595
|
+
}
|
|
5596
|
+
console.log("[导入诊断] bin 环境光参数:", i), console.log("[导入诊断] 导入后渲染状态:", {
|
|
5583
5597
|
环境光: C.scene.children.filter((h) => h.type === "AmbientLight").map((h) => ({ color: "#" + h.color.getHexString(), intensity: h.intensity })),
|
|
5584
5598
|
有环境贴图: !!C.scene.environment,
|
|
5585
5599
|
环境贴图强度: C.scene.environmentIntensity,
|
|
5586
5600
|
toneMapping: (c = C.renderer) == null ? void 0 : c.toneMapping,
|
|
5587
5601
|
曝光: (d = C.renderer) == null ? void 0 : d.toneMappingExposure,
|
|
5588
5602
|
输出色彩空间: (u = C.renderer) == null ? void 0 : u.outputColorSpace
|
|
5589
|
-
})
|
|
5590
|
-
C.scene.environment = I, C.scene.environmentIntensity = 1;
|
|
5591
|
-
else if (C.renderer) {
|
|
5592
|
-
const h = Ms(C.renderer);
|
|
5593
|
-
h && (C.scene.environment = h, C.scene.environmentIntensity = 1);
|
|
5594
|
-
}
|
|
5603
|
+
});
|
|
5595
5604
|
} else {
|
|
5596
5605
|
const y = typeof r == "string" ? JSON.parse(r) : r, I = new P.ObjectLoader().parse(y);
|
|
5597
5606
|
if (I.type === "Scene") {
|
|
@@ -5599,7 +5608,7 @@ async function Ba(r, e = "edit", t, n, s, i) {
|
|
|
5599
5608
|
if (C.scene = I, h)
|
|
5600
5609
|
C.scene.environment = h, C.scene.environmentIntensity = 1;
|
|
5601
5610
|
else if (C.renderer) {
|
|
5602
|
-
const w =
|
|
5611
|
+
const w = Vt(C.renderer);
|
|
5603
5612
|
w && (C.scene.environment = w, C.scene.environmentIntensity = 1);
|
|
5604
5613
|
}
|
|
5605
5614
|
} else
|
|
@@ -5609,7 +5618,7 @@ async function Ba(r, e = "edit", t, n, s, i) {
|
|
|
5609
5618
|
const v = y.userData.id || y.userData._sourceUuid || y.uuid, I = t[v];
|
|
5610
5619
|
if (I && y.userData.isMovable) {
|
|
5611
5620
|
va(y);
|
|
5612
|
-
const h = new
|
|
5621
|
+
const h = new $t({
|
|
5613
5622
|
title: I.title,
|
|
5614
5623
|
items: I.items
|
|
5615
5624
|
});
|
|
@@ -5687,9 +5696,9 @@ function ti(r) {
|
|
|
5687
5696
|
ti(t);
|
|
5688
5697
|
}
|
|
5689
5698
|
function Xa() {
|
|
5690
|
-
|
|
5699
|
+
Zt !== null && (cancelAnimationFrame(Zt), Zt = null), Mt && C.container && (C.container.removeEventListener("click", Mt), Mt = null), vt && (window.removeEventListener("resize", vt), vt = null), C.orbitControls && (C.orbitControls.dispose(), C.orbitControls = null), C.transformControls && (C.transformControls.dispose(), C.transformControls = null), We && (We.dispose(), We = null), C.scene && (ti(C.scene), C.scene = null), C.renderer && (C.renderer.dispose(), C.renderer.domElement && C.container && C.container.removeChild(C.renderer.domElement), C.renderer = null), sr(), C.camera = null, C.gridHelper = null, C.selectedObject = null, C.container = null, C.mode = "", Be = [], st.clear(), os(), Yt = !1, tt = !1;
|
|
5691
5700
|
}
|
|
5692
|
-
const qa = /^[og]\s*(.+)?/, Va = /^mtllib /, Ya = /^usemtl /, Ka = /^usemap /, bn = /\s+/, xn = new R(),
|
|
5701
|
+
const qa = /^[og]\s*(.+)?/, Va = /^mtllib /, Ya = /^usemtl /, Ka = /^usemap /, bn = /\s+/, xn = new R(), ys = new R(), In = new R(), Cn = new R(), Ie = new R(), Gt = new re();
|
|
5693
5702
|
function Za() {
|
|
5694
5703
|
const r = {
|
|
5695
5704
|
objects: [],
|
|
@@ -5799,7 +5808,7 @@ function Za() {
|
|
|
5799
5808
|
},
|
|
5800
5809
|
addFaceNormal: function(e, t, n) {
|
|
5801
5810
|
const s = this.vertices, i = this.object.geometry.normals;
|
|
5802
|
-
xn.fromArray(s, e),
|
|
5811
|
+
xn.fromArray(s, e), ys.fromArray(s, t), In.fromArray(s, n), Ie.subVectors(In, ys), Cn.subVectors(xn, ys), Ie.cross(Cn), Ie.normalize(), i.push(Ie.x, Ie.y, Ie.z), i.push(Ie.x, Ie.y, Ie.z), i.push(Ie.x, Ie.y, Ie.z);
|
|
5803
5812
|
},
|
|
5804
5813
|
addColor: function(e, t, n) {
|
|
5805
5814
|
const s = this.colors, i = this.object.geometry.colors;
|
|
@@ -6027,9 +6036,9 @@ class Qa extends Ls {
|
|
|
6027
6036
|
const h = u[v];
|
|
6028
6037
|
f.addGroup(h.groupStart, h.groupCount, v);
|
|
6029
6038
|
}
|
|
6030
|
-
A ? y = new
|
|
6039
|
+
A ? y = new Ms(f, m) : p ? y = new Bt(f, m) : y = new S(f, m);
|
|
6031
6040
|
} else
|
|
6032
|
-
A ? y = new
|
|
6041
|
+
A ? y = new Ms(f, m[0]) : p ? y = new Bt(f, m[0]) : y = new S(f, m[0]);
|
|
6033
6042
|
y.name = c.name, i.add(y);
|
|
6034
6043
|
}
|
|
6035
6044
|
else if (t.vertices.length > 0) {
|
|
@@ -6041,7 +6050,7 @@ class Qa extends Ls {
|
|
|
6041
6050
|
return i;
|
|
6042
6051
|
}
|
|
6043
6052
|
}
|
|
6044
|
-
const
|
|
6053
|
+
const bs = /* @__PURE__ */ new WeakMap();
|
|
6045
6054
|
class Ja extends Ls {
|
|
6046
6055
|
/**
|
|
6047
6056
|
* Constructs a new Draco loader.
|
|
@@ -6128,8 +6137,8 @@ class Ja extends Ls {
|
|
|
6128
6137
|
}
|
|
6129
6138
|
decodeGeometry(e, t) {
|
|
6130
6139
|
const n = JSON.stringify(t);
|
|
6131
|
-
if (
|
|
6132
|
-
const l =
|
|
6140
|
+
if (bs.has(e)) {
|
|
6141
|
+
const l = bs.get(e);
|
|
6133
6142
|
if (l.key === n)
|
|
6134
6143
|
return l.promise;
|
|
6135
6144
|
if (e.byteLength === 0)
|
|
@@ -6143,7 +6152,7 @@ class Ja extends Ls {
|
|
|
6143
6152
|
}))).then((l) => this._createGeometry(l.geometry));
|
|
6144
6153
|
return a.catch(() => !0).then(() => {
|
|
6145
6154
|
s && i && this._releaseTask(s, i);
|
|
6146
|
-
}),
|
|
6155
|
+
}), bs.set(e, {
|
|
6147
6156
|
key: n,
|
|
6148
6157
|
promise: a
|
|
6149
6158
|
}), a;
|
|
@@ -6168,7 +6177,7 @@ class Ja extends Ls {
|
|
|
6168
6177
|
if (t !== Ne) return;
|
|
6169
6178
|
const n = new re();
|
|
6170
6179
|
for (let s = 0, i = e.count; s < i; s++)
|
|
6171
|
-
n.fromBufferAttribute(e, s),
|
|
6180
|
+
n.fromBufferAttribute(e, s), Jt.colorSpaceToWorking(n, Ne), e.setXYZ(s, n.r, n.g, n.b);
|
|
6172
6181
|
}
|
|
6173
6182
|
_loadLibrary(e, t) {
|
|
6174
6183
|
const n = new Dt(this.manager);
|
|
@@ -6348,7 +6357,7 @@ class $a extends S {
|
|
|
6348
6357
|
super(e), this.isWater = !0;
|
|
6349
6358
|
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, d = t.sunDirection !== void 0 ? t.sunDirection : new R(0.70707, 0.70707, 0), u = new re(t.sunColor !== void 0 ? t.sunColor : 16777215), A = new re(t.waterColor !== void 0 ? t.waterColor : 8355711), p = t.eye !== void 0 ? t.eye : new R(0, 0, 0), g = t.distortionScale !== void 0 ? t.distortionScale : 20, f = t.side !== void 0 ? t.side : Un, m = t.fog !== void 0 ? t.fog : !1, y = new Mn(), v = new R(), I = new R(), h = new R(), w = new xe(), E = new R(0, 0, -1), M = new qs(), H = new R(), ne = new R(), j = new qs(), J = new xe(), K = new Fn(), Z = new Tn(s, i, { type: En }), z = {
|
|
6350
6359
|
name: "MirrorShader",
|
|
6351
|
-
uniforms:
|
|
6360
|
+
uniforms: Qt.merge([
|
|
6352
6361
|
Vs.fog,
|
|
6353
6362
|
Vs.lights,
|
|
6354
6363
|
{
|
|
@@ -6469,9 +6478,9 @@ class $a extends S {
|
|
|
6469
6478
|
#include <fog_fragment>
|
|
6470
6479
|
}`
|
|
6471
6480
|
)
|
|
6472
|
-
}, L = new
|
|
6481
|
+
}, L = new Cs({
|
|
6473
6482
|
name: z.name,
|
|
6474
|
-
uniforms:
|
|
6483
|
+
uniforms: Qt.clone(z.uniforms),
|
|
6475
6484
|
vertexShader: z.vertexShader,
|
|
6476
6485
|
fragmentShader: z.fragmentShader,
|
|
6477
6486
|
lights: !0,
|
|
@@ -6599,14 +6608,14 @@ function ui(r) {
|
|
|
6599
6608
|
{ label: "湿度", value: "65", unit: "%" },
|
|
6600
6609
|
{ label: "压力", value: "101.3", unit: "kPa" },
|
|
6601
6610
|
{ label: "名称", value: e.name || "未命名" }
|
|
6602
|
-
], s = new
|
|
6611
|
+
], s = new $t({
|
|
6603
6612
|
title: (r == null ? void 0 : r.title) || "数据面板",
|
|
6604
6613
|
items: (r == null ? void 0 : r.items) || n
|
|
6605
6614
|
});
|
|
6606
6615
|
return s.attachTo(e), Wn(e, s), Ea(e), s;
|
|
6607
6616
|
}
|
|
6608
6617
|
function di(r) {
|
|
6609
|
-
return
|
|
6618
|
+
return gs(!0), new Promise((e, t) => {
|
|
6610
6619
|
var o;
|
|
6611
6620
|
const n = (o = r.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), s = URL.createObjectURL(r);
|
|
6612
6621
|
let i;
|
|
@@ -6631,11 +6640,11 @@ function di(r) {
|
|
|
6631
6640
|
u.userData.isMovable = !0, u.name || (u.name = u.type), u.type === "Mesh" && (u.frustumCulled = !0, u.castShadow = !0, u.receiveShadow = !0);
|
|
6632
6641
|
});
|
|
6633
6642
|
const d = new P.Box3().setFromObject(l).getCenter(new P.Vector3());
|
|
6634
|
-
l.position.sub(d), nt(l, !0),
|
|
6643
|
+
l.position.sub(d), nt(l, !0), gs(!1), e(l);
|
|
6635
6644
|
},
|
|
6636
6645
|
void 0,
|
|
6637
6646
|
(a) => {
|
|
6638
|
-
|
|
6647
|
+
gs(!1), t(a);
|
|
6639
6648
|
}
|
|
6640
6649
|
);
|
|
6641
6650
|
});
|
|
@@ -6731,17 +6740,17 @@ const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6731
6740
|
l.value ? (N(), U("span", {
|
|
6732
6741
|
key: 0,
|
|
6733
6742
|
class: "toggle-icon",
|
|
6734
|
-
onClick: m[0] || (m[0] =
|
|
6743
|
+
onClick: m[0] || (m[0] = xs((v) => Ii(o)(f.node.uuid), ["stop"]))
|
|
6735
6744
|
}, de(a.value ? "▼" : "▶"), 1)) : (N(), U("span", tl)),
|
|
6736
6745
|
b("span", sl, de(p(f.node)), 1),
|
|
6737
6746
|
b("span", nl, de(g(f.node)), 1),
|
|
6738
6747
|
b("button", {
|
|
6739
6748
|
class: "tree-delete",
|
|
6740
|
-
onClick:
|
|
6749
|
+
onClick: xs(A, ["stop"])
|
|
6741
6750
|
}, "×")
|
|
6742
6751
|
], 2),
|
|
6743
6752
|
a.value && l.value ? (N(), U("div", il, [
|
|
6744
|
-
(N(!0), U(Le, null,
|
|
6753
|
+
(N(!0), U(Le, null, is(c.value, (v) => (N(), bt(y, {
|
|
6745
6754
|
key: v.uuid,
|
|
6746
6755
|
node: v,
|
|
6747
6756
|
"selected-object": f.selectedObject,
|
|
@@ -6805,7 +6814,7 @@ const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6805
6814
|
},
|
|
6806
6815
|
emits: ["propertyChange"],
|
|
6807
6816
|
setup(r, { emit: e }) {
|
|
6808
|
-
const t = r, n = e, s = () => n("propertyChange"), i =
|
|
6817
|
+
const t = r, n = e, s = () => n("propertyChange"), i = Is({
|
|
6809
6818
|
color: 16777215,
|
|
6810
6819
|
metalness: 0,
|
|
6811
6820
|
roughness: 0.5,
|
|
@@ -6818,7 +6827,7 @@ const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6818
6827
|
let p = null;
|
|
6819
6828
|
const g = W(!1), f = W("");
|
|
6820
6829
|
let m = null;
|
|
6821
|
-
const y =
|
|
6830
|
+
const y = Is({
|
|
6822
6831
|
intensity: 1
|
|
6823
6832
|
});
|
|
6824
6833
|
function v() {
|
|
@@ -7346,7 +7355,7 @@ const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7346
7355
|
onChange: j,
|
|
7347
7356
|
class: "texture-file-input"
|
|
7348
7357
|
}, null, 32),
|
|
7349
|
-
x[34] || (x[34] =
|
|
7358
|
+
x[34] || (x[34] = rs(" + 选择 "))
|
|
7350
7359
|
]))
|
|
7351
7360
|
])
|
|
7352
7361
|
]),
|
|
@@ -7395,7 +7404,7 @@ const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7395
7404
|
onChange: _,
|
|
7396
7405
|
class: "texture-file-input"
|
|
7397
7406
|
}, null, 32),
|
|
7398
|
-
x[38] || (x[38] =
|
|
7407
|
+
x[38] || (x[38] = rs(" + 选择 "))
|
|
7399
7408
|
]))
|
|
7400
7409
|
])
|
|
7401
7410
|
]),
|
|
@@ -7444,7 +7453,7 @@ const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7444
7453
|
onChange: L,
|
|
7445
7454
|
class: "texture-file-input"
|
|
7446
7455
|
}, null, 32),
|
|
7447
|
-
x[42] || (x[42] =
|
|
7456
|
+
x[42] || (x[42] = rs(" + 选择 "))
|
|
7448
7457
|
]))
|
|
7449
7458
|
])
|
|
7450
7459
|
]),
|
|
@@ -7616,7 +7625,7 @@ const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7616
7625
|
"onUpdate:modelValue": h[1] || (h[1] = (w) => n.value = w),
|
|
7617
7626
|
placeholder: "值",
|
|
7618
7627
|
class: "ud-input ud-textarea",
|
|
7619
|
-
onKeyup: rt(
|
|
7628
|
+
onKeyup: rt(xs(u, ["prevent"]), ["enter"])
|
|
7620
7629
|
}, null, 40, ec), [
|
|
7621
7630
|
[Y, n.value]
|
|
7622
7631
|
]),
|
|
@@ -7627,7 +7636,7 @@ const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7627
7636
|
}, " + ")
|
|
7628
7637
|
]),
|
|
7629
7638
|
a.value.length > 0 ? (N(), U("div", tc, [
|
|
7630
|
-
(N(!0), U(Le, null,
|
|
7639
|
+
(N(!0), U(Le, null, is(a.value, (w, E) => (N(), U("div", {
|
|
7631
7640
|
key: w.key,
|
|
7632
7641
|
class: Te(["userdata-item", {
|
|
7633
7642
|
readonly: w.key === "isMovable",
|
|
@@ -7692,7 +7701,7 @@ const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7692
7701
|
let p = f(), g = !1;
|
|
7693
7702
|
function f() {
|
|
7694
7703
|
const I = e.selectedObject;
|
|
7695
|
-
return I ? St(
|
|
7704
|
+
return I ? St(ns(I)) : null;
|
|
7696
7705
|
}
|
|
7697
7706
|
ve(s, (I) => {
|
|
7698
7707
|
g || !p || (p.visible = I);
|
|
@@ -7891,7 +7900,7 @@ const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7891
7900
|
b("div", Pc, [
|
|
7892
7901
|
h[28] || (h[28] = b("span", { class: "dp-label-sm" }, "数据项", -1)),
|
|
7893
7902
|
b("div", Rc, [
|
|
7894
|
-
(N(!0), U(Le, null,
|
|
7903
|
+
(N(!0), U(Le, null, is(n.value, (w, E) => (N(), U("div", {
|
|
7895
7904
|
key: E,
|
|
7896
7905
|
class: "dp-item"
|
|
7897
7906
|
}, [
|
|
@@ -8042,7 +8051,7 @@ const zc = {
|
|
|
8042
8051
|
b("div", Gc, [
|
|
8043
8052
|
f[7] || (f[7] = b("label", null, "场景物体", -1)),
|
|
8044
8053
|
b("div", Wc, [
|
|
8045
|
-
(N(!0), U(Le, null,
|
|
8054
|
+
(N(!0), U(Le, null, is(g.treeData, (m) => (N(), bt(rl, {
|
|
8046
8055
|
key: m.uuid,
|
|
8047
8056
|
node: m,
|
|
8048
8057
|
"selected-object": g.selectedObject,
|
|
@@ -8089,17 +8098,17 @@ const zc = {
|
|
|
8089
8098
|
}, " 📊 数据面板 ", 2)) : ue("", !0)
|
|
8090
8099
|
])) : ue("", !0),
|
|
8091
8100
|
g.selectedObject ? (N(), U("div", Yc, [
|
|
8092
|
-
F(
|
|
8101
|
+
F(as(Ql, {
|
|
8093
8102
|
transform: g.transform,
|
|
8094
8103
|
"selected-object": g.selectedObject,
|
|
8095
8104
|
onPropertyChange: o
|
|
8096
8105
|
}, null, 8, ["transform", "selected-object"]), [
|
|
8097
8106
|
[Qe, a.value === "transform"]
|
|
8098
8107
|
]),
|
|
8099
|
-
F(
|
|
8108
|
+
F(as(hc, { "selected-object": g.selectedObject }, null, 8, ["selected-object"]), [
|
|
8100
8109
|
[Qe, a.value === "userdata"]
|
|
8101
8110
|
]),
|
|
8102
|
-
F(
|
|
8111
|
+
F(as(Fc, { "selected-object": g.selectedObject }, null, 8, ["selected-object"]), [
|
|
8103
8112
|
[Qe, a.value === "datapanel"]
|
|
8104
8113
|
])
|
|
8105
8114
|
])) : ue("", !0)
|
|
@@ -8263,7 +8272,7 @@ const zc = {
|
|
|
8263
8272
|
xa((y) => {
|
|
8264
8273
|
t.value = y;
|
|
8265
8274
|
});
|
|
8266
|
-
const n = Fs(null), s =
|
|
8275
|
+
const n = Fs(null), s = Is({
|
|
8267
8276
|
position: { x: 0, y: 0, z: 0 },
|
|
8268
8277
|
rotation: { x: 0, y: 0, z: 0 },
|
|
8269
8278
|
scale: { x: 1, y: 1, z: 1 }
|
|
@@ -8347,7 +8356,7 @@ const zc = {
|
|
|
8347
8356
|
}), Su = /* @__PURE__ */ qe(uu, [["__scopeId", "data-v-1be6406e"]]);
|
|
8348
8357
|
export {
|
|
8349
8358
|
au as BottomBar,
|
|
8350
|
-
|
|
8359
|
+
$t as DataPanel,
|
|
8351
8360
|
Su as DrawingBoard,
|
|
8352
8361
|
Qc as PropertyPanel,
|
|
8353
8362
|
iu as TopBar,
|
|
@@ -8386,7 +8395,7 @@ export {
|
|
|
8386
8395
|
tr as resizeCSS2DRenderer,
|
|
8387
8396
|
$n as selectModelHandle,
|
|
8388
8397
|
Hs as selectObject,
|
|
8389
|
-
|
|
8398
|
+
gs as setLoading,
|
|
8390
8399
|
xa as setLoadingCallback,
|
|
8391
8400
|
La as setSelectedObjectCallback,
|
|
8392
8401
|
Na as setTransformChangeCallback,
|