three-base 2.0.39 → 2.0.40
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 +2 -2
- package/ThreeBase.ts +2 -2
- package/package.json +1 -1
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
|
|
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 =
|
|
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
|
|
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 =
|
|
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 });
|