three-base 2.0.39 → 2.0.41

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/ThreeBase.js CHANGED
@@ -247,11 +247,11 @@ export default class ThreeBase extends EventDispatcher {
247
247
  // 重置控制器的位置
248
248
  resetLookAt({ position = this.perspectiveCamera.position, center = this.controls.target, }) {
249
249
  // 停止控制器的惯性
250
- this.controls.enableDamping = false;
250
+ const originEnableDamping = this.controls.enableDamping;
251
251
  this.controls.saveState();
252
252
  this.controls.update();
253
253
  this.controls.reset();
254
- this.controls.enableDamping = true;
254
+ this.controls.enableDamping = originEnableDamping;
255
255
  this.controlsDistance.reset({ distance: new Vector3(position.x, position.y, position.z).distanceTo(new Vector3(center.x, center.y, center.z)) });
256
256
  position && this.controlsPosition.reset({ x: position.x, y: position.y, z: position.z });
257
257
  center && this.controlsCenter.reset({ x: center.x, y: center.y, z: center.z });
package/ThreeBase.ts CHANGED
@@ -297,11 +297,11 @@ export default class ThreeBase extends EventDispatcher {
297
297
  }: { position: Vector3, center: Vector3 }) {
298
298
 
299
299
  // 停止控制器的惯性
300
- this.controls.enableDamping = false;
300
+ const originEnableDamping = this.controls.enableDamping;
301
301
  this.controls.saveState();
302
302
  this.controls.update();
303
303
  this.controls.reset();
304
- this.controls.enableDamping = true;
304
+ this.controls.enableDamping = originEnableDamping;
305
305
 
306
306
  this.controlsDistance.reset({ distance: new Vector3(position.x, position.y, position.z).distanceTo(new Vector3(center.x, center.y, center.z)) });
307
307
  position && this.controlsPosition.reset({ x: position.x, y: position.y, z: position.z });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-base",
3
- "version": "2.0.39",
3
+ "version": "2.0.41",
4
4
  "description": "three 3d three-base",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
package/threeUtils.js CHANGED
@@ -33,7 +33,7 @@ class ThreeUtils extends EventDispatcher {
33
33
  work && work();
34
34
  setTimeout(() => {
35
35
  this.requestAnimationFrame();
36
- }, 45 - this._clock.getDelta());
36
+ }, 30 - this._clock.getDelta());
37
37
  }
38
38
  // 需要保持宽高比的元素列表
39
39
  _keepZoomDoms = [];
package/threeUtils.ts CHANGED
@@ -47,7 +47,7 @@ class ThreeUtils extends EventDispatcher {
47
47
 
48
48
  setTimeout(() => {
49
49
  this.requestAnimationFrame();
50
- }, 45 - this._clock.getDelta());
50
+ }, 30 - this._clock.getDelta());
51
51
  }
52
52
 
53
53
  // 需要保持宽高比的元素列表