@perceptimagery/dita-configurator-staging 0.1.7302 → 0.1.7410

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 (2) hide show
  1. package/dist/index.js +25 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -111,7 +111,7 @@ var __publicField = (obj, key, value) => {
111
111
  host: "https://api.sprie.io"
112
112
  };
113
113
  const config = Object.freeze(Config$1);
114
- const version$1 = "0.1.7302";
114
+ const version$1 = "0.1.7410";
115
115
  function modifyLensArr(arr, element) {
116
116
  const index = arr.findIndex((e) => e["sku"] === element["sku"]);
117
117
  if (index !== -1) {
@@ -41462,8 +41462,9 @@ bool bvhIntersectFirstHit(
41462
41462
  }
41463
41463
  async intialize() {
41464
41464
  var _a;
41465
- const newWidth = document.querySelector("canvas.sprie-config-webgl").clientWidth;
41466
- const newHeight = document.querySelector("canvas.sprie-config-webgl").clientHeight;
41465
+ const canvas = document.querySelector("canvas.sprie-config-webgl");
41466
+ const newWidth = canvas.clientWidth;
41467
+ const newHeight = canvas.clientHeight;
41467
41468
  this.camera = new PerspectiveCamera(
41468
41469
  12,
41469
41470
  newWidth / newHeight,
@@ -41477,8 +41478,7 @@ bool bvhIntersectFirstHit(
41477
41478
  alpha: true,
41478
41479
  antialias: true
41479
41480
  });
41480
- this.renderer.setSize(newWidth, newHeight);
41481
- this.renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
41481
+ this.resizeRenderer();
41482
41482
  const rgbeLoader = new RGBELoader();
41483
41483
  rgbeLoader.load(
41484
41484
  "https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_desaturated.hdr",
@@ -41489,6 +41489,7 @@ bool bvhIntersectFirstHit(
41489
41489
  );
41490
41490
  rgbeLoader.load(
41491
41491
  "https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_gemstones.hdr",
41492
+ // "/environment_gemstones.hdr",
41492
41493
  (reflectionMap) => {
41493
41494
  reflectionMap.mapping = EquirectangularReflectionMapping;
41494
41495
  diamondMaterial.uniforms.envMap.value = reflectionMap;
@@ -41516,6 +41517,17 @@ bool bvhIntersectFirstHit(
41516
41517
  temp5.FAST_CHROMA = "";
41517
41518
  diamondMaterial.defines = temp5;
41518
41519
  }
41520
+ resizeRenderer() {
41521
+ var _a;
41522
+ const pixelRatio = Math.min(window.devicePixelRatio, 2);
41523
+ const resoWidth = Math.floor(this.canvas.clientWidth * pixelRatio);
41524
+ const resoHeight = Math.floor(this.canvas.clientHeight * pixelRatio);
41525
+ const needResize = this.canvas.width !== resoWidth || this.canvas.height !== resoHeight;
41526
+ if (needResize) {
41527
+ (_a = this.renderer) == null ? void 0 : _a.setSize(resoWidth, resoHeight, false);
41528
+ }
41529
+ return needResize;
41530
+ }
41519
41531
  cleanUp() {
41520
41532
  if (this.renderer) {
41521
41533
  this.renderer.dispose();
@@ -41678,7 +41690,7 @@ bool bvhIntersectFirstHit(
41678
41690
  lensMaterial.needsUpdate = true;
41679
41691
  }
41680
41692
  }
41681
- if (node.material && node.name === "Diamonds") {
41693
+ if (node.material && node.name.toLowerCase().includes("diamond")) {
41682
41694
  diamondMaterial.uniforms.bvh.value = new MeshBVHUniformStruct();
41683
41695
  diamondMaterial.uniforms.bvh.value.updateFrom(
41684
41696
  new MeshBVH(node.geometry.clone().toNonIndexed(), { strategy: SAH })
@@ -41961,6 +41973,7 @@ bool bvhIntersectFirstHit(
41961
41973
  -0.2564218846390263
41962
41974
  );
41963
41975
  const rendererSize = this.renderer.getSize(new Vector2());
41976
+ console.log(rendererSize);
41964
41977
  if (rendererSize.x > rendererSize.y) {
41965
41978
  this.camera.position.set(
41966
41979
  2.2,
@@ -41977,7 +41990,7 @@ bool bvhIntersectFirstHit(
41977
41990
  12
41978
41991
  );
41979
41992
  controls.minDistance = 3;
41980
- controls.maxDistance = 16;
41993
+ controls.maxDistance = 14;
41981
41994
  controls.rotateSpeed = 0.8;
41982
41995
  }
41983
41996
  controls.enableDamping = true;
@@ -42089,7 +42102,12 @@ bool bvhIntersectFirstHit(
42089
42102
  composer.addPass(renderPass);
42090
42103
  composer.addPass(outputPass);
42091
42104
  const animate = () => {
42105
+ var _a;
42092
42106
  controls.update();
42107
+ if (this.resizeRenderer()) {
42108
+ this.camera.aspect = this.canvas.clientWidth / this.canvas.clientHeight;
42109
+ (_a = this.camera) == null ? void 0 : _a.updateProjectionMatrix();
42110
+ }
42093
42111
  const initialBackground = this.scene.background;
42094
42112
  this.scene.background = null;
42095
42113
  this.scene.overrideMaterial = depthMaterial;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perceptimagery/dita-configurator-staging",
3
- "version": "0.1.7302",
3
+ "version": "0.1.7410",
4
4
  "author": "Rohan Satpute <rohan@perceptimagery.com>",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",