three-base 1.0.25 → 1.0.27

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/lib/ThreeBase.ts CHANGED
@@ -214,10 +214,7 @@ export default class ThreeBase extends EventDispatcher {
214
214
  }
215
215
 
216
216
  // 等待动画执行完成
217
- while (!this.controlsCenter.isDone() || !this.controlsPosition.isDone()) {
218
- await new Promise(resolve => setTimeout(resolve, 100));
219
- }
220
-
217
+ await new Promise(resolve => setTimeout(resolve, Math.max(this.controlsCenter._duration, this.controlsPosition._duration)));
221
218
  }
222
219
 
223
220
  // 获取控制的位置和朝向 保留3位小数
package/lib/Transition.ts CHANGED
@@ -186,9 +186,7 @@ export default class Transition {
186
186
  }
187
187
  threeUtils.addEventListener("requestAnimationFrame", this.runbindThis);
188
188
 
189
- while (!this._isDone) {
190
- await new Promise(resolve => setTimeout(resolve, 50));
191
- }
189
+ await new Promise(resolve => setTimeout(resolve, this._duration));
192
190
 
193
191
  return this;
194
192
  }
package/lib/threeUtils.ts CHANGED
@@ -52,7 +52,7 @@ class ThreeUtils extends EventDispatcher {
52
52
  this.box3.getSize(this.size);
53
53
  } else if (object3d instanceof BufferGeometry) {
54
54
  object3d.computeBoundingBox();
55
- object3d.boundingBox.getSize(this.size);
55
+ object3d.boundingBox!.getSize(this.size);
56
56
  }
57
57
 
58
58
  return this.size;
@@ -70,7 +70,7 @@ class ThreeUtils extends EventDispatcher {
70
70
  object3d.updateMatrixWorld(true);
71
71
  } else if (object3d instanceof BufferGeometry) {
72
72
  object3d.computeBoundingBox();
73
- object3d.translate(0, -object3d.boundingBox.min.y, 0);
73
+ object3d.translate(0, -object3d.boundingBox!.min.y, 0);
74
74
  }
75
75
  }
76
76
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-base",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "three 3d three-base",
5
5
  "keywords": [
6
6
  "three",