@needle-tools/engine 4.8.0-next.9de3f45 → 4.8.0-next.d64b390

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.
Files changed (40) hide show
  1. package/dist/gltf-progressive-43ba_8ZL.min.js +8 -0
  2. package/dist/gltf-progressive-BrzbysCn.umd.cjs +8 -0
  3. package/dist/gltf-progressive-DtAMqRsU.js +1385 -0
  4. package/dist/loader.worker-D5fjeWJO.js +27 -0
  5. package/dist/needle-engine.bundle-B23O7jqK.js +42600 -0
  6. package/dist/needle-engine.bundle-BFJMdMtI.min.js +1607 -0
  7. package/dist/needle-engine.bundle-DiXKsIfg.umd.cjs +1607 -0
  8. package/dist/needle-engine.d.ts +15 -15
  9. package/dist/needle-engine.js +591 -592
  10. package/dist/needle-engine.min.js +1 -1
  11. package/dist/needle-engine.umd.cjs +1 -1
  12. package/dist/{postprocessing-BzY0H7ry.min.js → postprocessing-ChsrvDkI.min.js} +54 -54
  13. package/dist/{postprocessing-vKBVFpSz.js → postprocessing-DElbMQgB.js} +479 -483
  14. package/dist/{postprocessing-Dw2OCMp4.umd.cjs → postprocessing-DtxaELce.umd.cjs} +66 -66
  15. package/dist/{three-examples-DUcCNw9s.umd.cjs → three-examples-BhQvv1B9.umd.cjs} +11 -11
  16. package/dist/{three-examples-tvuhV8Ne.js → three-examples-CM6Iip03.js} +23 -27
  17. package/dist/{three-examples-BMOhDaYR.min.js → three-examples-D2zemuAM.min.js} +12 -12
  18. package/dist/{three-mesh-ui-CxuWt7m-.js → three-mesh-ui-D6Mz5Yl7.js} +799 -810
  19. package/dist/three-mesh-ui-DWcMuyQ_.min.js +406 -0
  20. package/dist/three-mesh-ui-tt0buEDC.umd.cjs +406 -0
  21. package/dist/{vendor-BmYIgaS1.js → vendor-ClB-U1Hn.js} +10 -10
  22. package/dist/{vendor-Cavtu3CP.umd.cjs → vendor-bOWOWClg.umd.cjs} +1 -1
  23. package/lib/engine/engine_serialization_builtin_serializer.js +1 -1
  24. package/lib/engine/engine_serialization_builtin_serializer.js.map +1 -1
  25. package/lib/engine/extensions/extensions.js +1 -1
  26. package/lib/engine/extensions/extensions.js.map +1 -1
  27. package/package.json +3 -3
  28. package/plugins/vite/dependencies.js +28 -19
  29. package/plugins/vite/dependency-watcher.js +6 -1
  30. package/src/engine/engine_serialization_builtin_serializer.ts +1 -1
  31. package/src/engine/extensions/extensions.ts +1 -1
  32. package/dist/gltf-progressive-Bz6FXMZ1.min.js +0 -8
  33. package/dist/gltf-progressive-DAdiYt1v.js +0 -1392
  34. package/dist/gltf-progressive-D_S7mZaT.umd.cjs +0 -8
  35. package/dist/loader.worker-qHzhYKEC.js +0 -1
  36. package/dist/needle-engine.bundle-C5vAAuK3.js +0 -43849
  37. package/dist/needle-engine.bundle-fg0LG9Pa.umd.cjs +0 -1607
  38. package/dist/needle-engine.bundle-tepIih-J.min.js +0 -1607
  39. package/dist/three-mesh-ui-B3p3gyUz.min.js +0 -406
  40. 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
- const l = (h = _e.get(a.ID)) == null ? void 0 : h.parents;
5605
- l == null || l.forEach(function(g) {
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 == null || e.parents.forEach(function(o) {
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 = (c = e.metalnessMap) != null && c.image ? e.metalnessMap : void 0, r = (l = e.roughnessMap) != null && l.image ? e.roughnessMap : void 0;
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 p = this.buildMetalRoughTexture(o, r), m = {
8505
- index: this.processTexture(p),
8506
- channel: p.channel
8500
+ const c = this.buildMetalRoughTexture(o, r), l = {
8501
+ index: this.processTexture(c),
8502
+ channel: c.channel
8507
8503
  };
8508
- this.applyTextureTransform(m, p), n.pbrMetallicRoughness.metallicRoughnessTexture = m;
8504
+ this.applyTextureTransform(l, c), n.pbrMetallicRoughness.metallicRoughnessTexture = l;
8509
8505
  }
8510
8506
  if (e.map) {
8511
- const p = {
8507
+ const c = {
8512
8508
  index: this.processTexture(e.map),
8513
8509
  texCoord: e.map.channel
8514
8510
  };
8515
- this.applyTextureTransform(p, e.map), n.pbrMetallicRoughness.baseColorTexture = p;
8511
+ this.applyTextureTransform(c, e.map), n.pbrMetallicRoughness.baseColorTexture = c;
8516
8512
  }
8517
8513
  if (e.emissive) {
8518
- const p = e.emissive;
8519
- if (Math.max(p.r, p.g, p.b) > 0 && (n.emissiveFactor = e.emissive.toArray()), (h = e.emissiveMap) != null && h.image) {
8520
- const I = {
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(I, e.emissiveMap), n.emissiveTexture = I;
8520
+ this.applyTextureTransform(h, e.emissiveMap), n.emissiveTexture = h;
8525
8521
  }
8526
8522
  }
8527
- if ((g = e.normalMap) != null && g.image) {
8528
- const p = {
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 && (p.scale = e.normalScale.x), this.applyTextureTransform(p, e.normalMap), n.normalTexture = p;
8528
+ e.normalScale && e.normalScale.x !== 1 && (c.scale = e.normalScale.x), this.applyTextureTransform(c, e.normalMap), n.normalTexture = c;
8533
8529
  }
8534
- if ((d = e.aoMap) != null && d.image) {
8535
- const p = {
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 && (p.strength = e.aoMapIntensity), this.applyTextureTransform(p, e.aoMap), n.occlusionTexture = p;
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(p) {
8542
- p.writeMaterial && p.writeMaterial(e, n);
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;