@needle-tools/engine 4.8.0-next.9de3f45 → 4.8.0-next.d716e0e
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/gltf-progressive-VTcU5sMu.min.js +8 -0
- package/dist/gltf-progressive-VXeY4K8o.js +1370 -0
- package/dist/gltf-progressive-_-uQwSK8.umd.cjs +8 -0
- package/dist/loader.worker-D5fjeWJO.js +27 -0
- package/dist/needle-engine.bundle-BYz57wrx.umd.cjs +1607 -0
- package/dist/needle-engine.bundle-CxDqrXwR.min.js +1607 -0
- package/dist/needle-engine.bundle-DNnYQtTS.js +42600 -0
- package/dist/needle-engine.d.ts +15 -15
- package/dist/needle-engine.js +591 -592
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-BzY0H7ry.min.js → postprocessing-ChsrvDkI.min.js} +54 -54
- package/dist/{postprocessing-vKBVFpSz.js → postprocessing-DElbMQgB.js} +479 -483
- package/dist/{postprocessing-Dw2OCMp4.umd.cjs → postprocessing-DtxaELce.umd.cjs} +66 -66
- package/dist/{three-examples-DUcCNw9s.umd.cjs → three-examples-BhQvv1B9.umd.cjs} +11 -11
- package/dist/{three-examples-tvuhV8Ne.js → three-examples-CM6Iip03.js} +23 -27
- package/dist/{three-examples-BMOhDaYR.min.js → three-examples-D2zemuAM.min.js} +12 -12
- package/dist/{three-mesh-ui-CxuWt7m-.js → three-mesh-ui-D6Mz5Yl7.js} +799 -810
- package/dist/three-mesh-ui-DWcMuyQ_.min.js +406 -0
- package/dist/three-mesh-ui-tt0buEDC.umd.cjs +406 -0
- package/dist/{vendor-BmYIgaS1.js → vendor-ClB-U1Hn.js} +10 -10
- package/dist/{vendor-Cavtu3CP.umd.cjs → vendor-bOWOWClg.umd.cjs} +1 -1
- package/package.json +3 -3
- package/plugins/vite/dependencies.js +28 -19
- package/plugins/vite/dependency-watcher.js +6 -1
- package/dist/gltf-progressive-Bz6FXMZ1.min.js +0 -8
- package/dist/gltf-progressive-DAdiYt1v.js +0 -1392
- package/dist/gltf-progressive-D_S7mZaT.umd.cjs +0 -8
- package/dist/loader.worker-qHzhYKEC.js +0 -1
- package/dist/needle-engine.bundle-C5vAAuK3.js +0 -43849
- package/dist/needle-engine.bundle-fg0LG9Pa.umd.cjs +0 -1607
- package/dist/needle-engine.bundle-tepIih-J.min.js +0 -1607
- package/dist/three-mesh-ui-B3p3gyUz.min.js +0 -406
- package/dist/three-mesh-ui-CQiIQIlA.umd.cjs +0 -406
|
@@ -5598,13 +5598,10 @@ class Dc {
|
|
|
5598
5598
|
ze = new on();
|
|
5599
5599
|
const n = this.parseModels(e.skeletons, t, s), i = se.Objects.Model, o = this;
|
|
5600
5600
|
n.forEach(function(a) {
|
|
5601
|
-
var h;
|
|
5602
5601
|
const c = i[a.ID];
|
|
5603
|
-
o.setLookAtProperties(a, c)
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
const d = n.get(g.ID);
|
|
5607
|
-
d !== void 0 && d.add(a);
|
|
5602
|
+
o.setLookAtProperties(a, c), _e.get(a.ID)?.parents?.forEach(function(h) {
|
|
5603
|
+
const g = n.get(h.ID);
|
|
5604
|
+
g !== void 0 && g.add(a);
|
|
5608
5605
|
}), a.parent === null && ze.add(a);
|
|
5609
5606
|
}), this.bindSkeleton(e.skeletons, t, n), this.addGlobalSceneSettings(), ze.traverse(function(a) {
|
|
5610
5607
|
if (a.userData.transformData) {
|
|
@@ -5654,7 +5651,7 @@ class Dc {
|
|
|
5654
5651
|
}
|
|
5655
5652
|
buildSkeleton(e, t, s, n) {
|
|
5656
5653
|
let i = null;
|
|
5657
|
-
return e
|
|
5654
|
+
return e?.parents.forEach(function(o) {
|
|
5658
5655
|
for (const r in t) {
|
|
5659
5656
|
const a = t[r];
|
|
5660
5657
|
a.rawBones.forEach(function(c, l) {
|
|
@@ -8489,7 +8486,6 @@ class Il {
|
|
|
8489
8486
|
* @return {Integer|null} Index of the processed material in the "materials" array
|
|
8490
8487
|
*/
|
|
8491
8488
|
processMaterial(e) {
|
|
8492
|
-
var c, l, h, g, d;
|
|
8493
8489
|
const t = this.cache, s = this.json;
|
|
8494
8490
|
if (t.materials.has(e)) return t.materials.get(e);
|
|
8495
8491
|
if (e.isShaderMaterial)
|
|
@@ -8499,47 +8495,47 @@ class Il {
|
|
|
8499
8495
|
e.isMeshStandardMaterial !== !0 && e.isMeshBasicMaterial !== !0 && console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");
|
|
8500
8496
|
const i = e.color.toArray().concat([e.opacity]);
|
|
8501
8497
|
Un(i, [1, 1, 1, 1]) || (n.pbrMetallicRoughness.baseColorFactor = i), e.isMeshStandardMaterial ? (n.pbrMetallicRoughness.metallicFactor = e.metalness, n.pbrMetallicRoughness.roughnessFactor = e.roughness) : (n.pbrMetallicRoughness.metallicFactor = 0.5, n.pbrMetallicRoughness.roughnessFactor = 0.5);
|
|
8502
|
-
const o =
|
|
8498
|
+
const o = e.metalnessMap?.image ? e.metalnessMap : void 0, r = e.roughnessMap?.image ? e.roughnessMap : void 0;
|
|
8503
8499
|
if (o || r) {
|
|
8504
|
-
const
|
|
8505
|
-
index: this.processTexture(
|
|
8506
|
-
channel:
|
|
8500
|
+
const c = this.buildMetalRoughTexture(o, r), l = {
|
|
8501
|
+
index: this.processTexture(c),
|
|
8502
|
+
channel: c.channel
|
|
8507
8503
|
};
|
|
8508
|
-
this.applyTextureTransform(
|
|
8504
|
+
this.applyTextureTransform(l, c), n.pbrMetallicRoughness.metallicRoughnessTexture = l;
|
|
8509
8505
|
}
|
|
8510
8506
|
if (e.map) {
|
|
8511
|
-
const
|
|
8507
|
+
const c = {
|
|
8512
8508
|
index: this.processTexture(e.map),
|
|
8513
8509
|
texCoord: e.map.channel
|
|
8514
8510
|
};
|
|
8515
|
-
this.applyTextureTransform(
|
|
8511
|
+
this.applyTextureTransform(c, e.map), n.pbrMetallicRoughness.baseColorTexture = c;
|
|
8516
8512
|
}
|
|
8517
8513
|
if (e.emissive) {
|
|
8518
|
-
const
|
|
8519
|
-
if (Math.max(
|
|
8520
|
-
const
|
|
8514
|
+
const c = e.emissive;
|
|
8515
|
+
if (Math.max(c.r, c.g, c.b) > 0 && (n.emissiveFactor = e.emissive.toArray()), e.emissiveMap?.image) {
|
|
8516
|
+
const h = {
|
|
8521
8517
|
index: this.processTexture(e.emissiveMap),
|
|
8522
8518
|
texCoord: e.emissiveMap.channel
|
|
8523
8519
|
};
|
|
8524
|
-
this.applyTextureTransform(
|
|
8520
|
+
this.applyTextureTransform(h, e.emissiveMap), n.emissiveTexture = h;
|
|
8525
8521
|
}
|
|
8526
8522
|
}
|
|
8527
|
-
if (
|
|
8528
|
-
const
|
|
8523
|
+
if (e.normalMap?.image) {
|
|
8524
|
+
const c = {
|
|
8529
8525
|
index: this.processTexture(e.normalMap),
|
|
8530
8526
|
texCoord: e.normalMap.channel
|
|
8531
8527
|
};
|
|
8532
|
-
e.normalScale && e.normalScale.x !== 1 && (
|
|
8528
|
+
e.normalScale && e.normalScale.x !== 1 && (c.scale = e.normalScale.x), this.applyTextureTransform(c, e.normalMap), n.normalTexture = c;
|
|
8533
8529
|
}
|
|
8534
|
-
if (
|
|
8535
|
-
const
|
|
8530
|
+
if (e.aoMap?.image) {
|
|
8531
|
+
const c = {
|
|
8536
8532
|
index: this.processTexture(e.aoMap),
|
|
8537
8533
|
texCoord: e.aoMap.channel
|
|
8538
8534
|
};
|
|
8539
|
-
e.aoMapIntensity !== 1 && (
|
|
8535
|
+
e.aoMapIntensity !== 1 && (c.strength = e.aoMapIntensity), this.applyTextureTransform(c, e.aoMap), n.occlusionTexture = c;
|
|
8540
8536
|
}
|
|
8541
|
-
e.transparent ? n.alphaMode = "BLEND" : e.alphaTest > 0 && (n.alphaMode = "MASK", n.alphaCutoff = e.alphaTest), e.side === gi && (n.doubleSided = !0), e.name !== "" && (n.name = e.name), this.serializeUserData(e, n), this._invokeAll(function(
|
|
8542
|
-
|
|
8537
|
+
e.transparent ? n.alphaMode = "BLEND" : e.alphaTest > 0 && (n.alphaMode = "MASK", n.alphaCutoff = e.alphaTest), e.side === gi && (n.doubleSided = !0), e.name !== "" && (n.name = e.name), this.serializeUserData(e, n), this._invokeAll(function(c) {
|
|
8538
|
+
c.writeMaterial && c.writeMaterial(e, n);
|
|
8543
8539
|
});
|
|
8544
8540
|
const a = s.materials.push(n) - 1;
|
|
8545
8541
|
return t.materials.set(e, a), a;
|