view3d-core 1.0.6 → 1.0.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.
@@ -1637,13 +1637,13 @@ function Zs(e4) {
1637
1637
  }
1638
1638
  });
1639
1639
  }
1640
- const Qs = { dracoPath: "/draco/", useDraco: true, autoBuildBVH: true, optimizeTextures: true };
1640
+ const Qs = { dracoPath: "/draco/gltf/", useDraco: true, autoBuildBVH: true, optimizeTextures: true };
1641
1641
  class $s extends st {
1642
1642
  constructor(e4) {
1643
1643
  super({ ...Qs, ...e4 }), this.name = "loader", this.fontCache = /* @__PURE__ */ new Map();
1644
1644
  }
1645
1645
  onInstall() {
1646
- this.dracoLoader = new Ee(), this.dracoLoader.setDecoderPath(this.config.dracoPath), this.gltfLoader = new Be(), this.config.useDraco && this.gltfLoader.setDRACOLoader(this.dracoLoader), this.fbxLoader = new ke(), this.objLoader = new Le(), this.mtlLoader = new He(), this.textureLoader = new _(), this.cubeTextureLoader = new w(), this.fontLoader = new Oe();
1646
+ this.dracoLoader = new Ee(), this.dracoLoader.setDecoderPath(this.config.dracoPath), this.dracoLoader.setDecoderConfig({ type: "js" }), this.gltfLoader = new Be(), this.config.useDraco && this.gltfLoader.setDRACOLoader(this.dracoLoader), this.fbxLoader = new ke(), this.objLoader = new Le(), this.mtlLoader = new He(), this.textureLoader = new _(), this.cubeTextureLoader = new w(), this.fontLoader = new Oe();
1647
1647
  }
1648
1648
  onUninstall() {
1649
1649
  this.dracoLoader.dispose(), this.fontCache.clear();
@@ -1667,6 +1667,7 @@ class $s extends st {
1667
1667
  loadGLTF(e4) {
1668
1668
  const t2 = { progress: () => {
1669
1669
  }, complete: () => {
1670
+ }, error: () => {
1670
1671
  } };
1671
1672
  return this.events.emit("load:start", { url: e4, type: "GLTF" }), this.gltfLoader.load(e4, (n2) => {
1672
1673
  const s2 = n2.scene;
@@ -1674,13 +1675,15 @@ class $s extends st {
1674
1675
  }, (n2) => {
1675
1676
  const s2 = n2.loaded / n2.total;
1676
1677
  t2.progress(s2, n2), this.events.emit("load:progress", { url: e4, loaded: n2.loaded, total: n2.total, percent: s2 });
1677
- }, (t3) => {
1678
- this.events.emit("load:error", { url: e4, error: t3 });
1678
+ }, (n2) => {
1679
+ const s2 = n2;
1680
+ t2.error?.(s2), this.events.emit("load:error", { url: e4, error: s2 });
1679
1681
  }), t2;
1680
1682
  }
1681
1683
  loadFBX(e4) {
1682
1684
  const t2 = { progress: () => {
1683
1685
  }, complete: () => {
1686
+ }, error: () => {
1684
1687
  } };
1685
1688
  return this.events.emit("load:start", { url: e4, type: "FBX" }), this.fbxLoader.load(e4, (n2) => {
1686
1689
  n2.traverse((e5) => {
@@ -1694,13 +1697,15 @@ class $s extends st {
1694
1697
  }, (n2) => {
1695
1698
  const s2 = n2.loaded / n2.total;
1696
1699
  t2.progress(s2, n2), this.events.emit("load:progress", { url: e4, loaded: n2.loaded, total: n2.total, percent: s2 });
1697
- }, (t3) => {
1698
- this.events.emit("load:error", { url: e4, error: t3 });
1700
+ }, (n2) => {
1701
+ const s2 = n2;
1702
+ t2.error?.(s2), this.events.emit("load:error", { url: e4, error: s2 });
1699
1703
  }), t2;
1700
1704
  }
1701
1705
  loadOBJ(e4) {
1702
1706
  const t2 = { progress: () => {
1703
1707
  }, complete: () => {
1708
+ }, error: () => {
1704
1709
  } };
1705
1710
  this.events.emit("load:start", { url: e4, type: "OBJ" });
1706
1711
  const n2 = e4.replace(".obj", ".mtl");
@@ -1710,8 +1715,9 @@ class $s extends st {
1710
1715
  }, (n4) => {
1711
1716
  const s2 = n4.loaded / n4.total;
1712
1717
  t2.progress(s2, n4), this.events.emit("load:progress", { url: e4, loaded: n4.loaded, total: n4.total, percent: s2 });
1713
- }, (t3) => {
1714
- this.events.emit("load:error", { url: e4, error: t3 });
1718
+ }, (n4) => {
1719
+ const s2 = n4;
1720
+ t2.error?.(s2), this.events.emit("load:error", { url: e4, error: s2 });
1715
1721
  });
1716
1722
  }, void 0, () => {
1717
1723
  this.objLoader.load(e4, (n3) => {
@@ -1719,8 +1725,9 @@ class $s extends st {
1719
1725
  }, (e5) => {
1720
1726
  const n3 = e5.loaded / e5.total;
1721
1727
  t2.progress(n3, e5);
1722
- }, (t3) => {
1723
- this.events.emit("load:error", { url: e4, error: t3 });
1728
+ }, (n3) => {
1729
+ const s2 = n3;
1730
+ t2.error?.(s2), this.events.emit("load:error", { url: e4, error: s2 });
1724
1731
  });
1725
1732
  }), t2;
1726
1733
  }
@@ -4739,4 +4746,4 @@ export {
4739
4746
  fo as y,
4740
4747
  go as z
4741
4748
  };
4742
- //# sourceMappingURL=SerializationPlugin-BnwkDxWe.js.map
4749
+ //# sourceMappingURL=SerializationPlugin-CzzJnMtS.js.map