three-cad-viewer 1.7.10 → 1.7.12

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.
@@ -52004,12 +52004,16 @@ class Display {
52004
52004
  setExplode = (e) => {
52005
52005
  const flag = !!e.target.checked;
52006
52006
  if (flag) {
52007
- this.viewer.backupAnimation();
52007
+ if (this.viewer.hasAnimation()) {
52008
+ this.viewer.backupAnimation();
52009
+ }
52008
52010
  this.viewer.explode();
52009
52011
  } else {
52010
- this.controlAnimationByName("stop");
52011
- this.viewer.clearAnimation();
52012
- this.viewer.restoreAnimation();
52012
+ if (this.viewer.hasAnimation()) {
52013
+ this.controlAnimationByName("stop");
52014
+ this.viewer.clearAnimation();
52015
+ this.viewer.restoreAnimation();
52016
+ }
52013
52017
  }
52014
52018
  };
52015
52019
 
@@ -57736,18 +57740,24 @@ class Camera {
57736
57740
  const aspect = width / height;
57737
57741
  const pSize = this.projectSize(distance, aspect);
57738
57742
 
57739
- this.oCamera.left = -pSize[0];
57740
- this.oCamera.right = pSize[0];
57741
- this.oCamera.top = pSize[1];
57742
- this.oCamera.bottom = -pSize[1];
57743
-
57744
- this.pCamera.aspect = aspect;
57743
+ if (this.oCamera){
57744
+ this.oCamera.left = -pSize[0];
57745
+ this.oCamera.right = pSize[0];
57746
+ this.oCamera.top = pSize[1];
57747
+ this.oCamera.bottom = -pSize[1];
57748
+ }
57745
57749
 
57746
- this.camera.updateProjectionMatrix();
57750
+ if (this.pCamera){
57751
+ this.pCamera.aspect = aspect;
57752
+ }
57753
+
57754
+ if (this.camera) {
57755
+ this.camera.updateProjectionMatrix();
57756
+ }
57747
57757
  }
57748
57758
  }
57749
57759
 
57750
- const version="1.7.10";
57760
+ const version="1.7.12";
57751
57761
 
57752
57762
  class Viewer {
57753
57763
  /**
@@ -58096,6 +58106,15 @@ class Viewer {
58096
58106
  this.display.resetAnimationSlider();
58097
58107
  }
58098
58108
 
58109
+
58110
+ /**
58111
+ * Check whether animation object exists
58112
+ */
58113
+ hasAnimation() {
58114
+ return !!this.animation.clipAction;
58115
+ }
58116
+
58117
+
58099
58118
  /**
58100
58119
  * Clear the animation obect and dispose dependent objects
58101
58120
  */
@@ -58184,17 +58203,17 @@ class Viewer {
58184
58203
  if (this.animation) {
58185
58204
  this.animation.update();
58186
58205
  }
58187
- }
58188
-
58189
- this.checkChanges(
58190
- {
58191
- zoom: this.camera.getZoom(),
58192
- position: this.camera.getPosition().toArray(),
58193
- quaternion: this.camera.getQuaternion().toArray(),
58194
- target: this.controls.getTarget().toArray(),
58195
- },
58196
- notify,
58197
- );
58206
+
58207
+ this.checkChanges(
58208
+ {
58209
+ zoom: this.camera.getZoom(),
58210
+ position: this.camera.getPosition().toArray(),
58211
+ quaternion: this.camera.getQuaternion().toArray(),
58212
+ target: this.controls.getTarget().toArray(),
58213
+ },
58214
+ notify,
58215
+ );
58216
+ }
58198
58217
  };
58199
58218
 
58200
58219
  /**
@@ -58310,6 +58329,7 @@ class Viewer {
58310
58329
 
58311
58330
  // dispose scene
58312
58331
  this.scene = null;
58332
+ this.ready = false;
58313
58333
  }
58314
58334
  }
58315
58335