@kimap/indoor-positioning-sdk-vue2 5.9.0 → 5.9.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kimap/indoor-positioning-sdk-vue2",
3
- "version": "5.9.0",
3
+ "version": "5.9.3",
4
4
  "description": "Vue2自包含室内定位SDK - 完全兼容Webpack3+Babel6 | Vue2 Self-Contained Indoor Positioning SDK",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -669,10 +669,8 @@ KimapSDK.prototype.showSingleFloor = function(floorIndex) {
669
669
 
670
670
  this._currentShowingFloorIndex = floorIndex;
671
671
  self.core._lastSingleFloorIndex = floorIndex;
672
- // 退出 ALL 时:相机动画恢复到单楼层视角(保持当前位置,不重置)
673
- if (self.core.cameraPitchState === 1) {
674
- self.core.animateCameraToFloorView(600);
675
- }
672
+ // 始终触发动画(animateCameraToFloorView 内部判断 from/to 是否相同,相同则立即完成)
673
+ self.core.animateCameraToFloorView(600);
676
674
  };
677
675
 
678
676
  /**
@@ -291,9 +291,9 @@ SceneCore.prototype._loadMultiFloorMaps = function(OBJLoader, MTLLoader, objUrls
291
291
  return self._loadSingleMapWithFloorIndex(OBJLoader, MTLLoader, url, floorIndex++);
292
292
  });
293
293
  }, Promise.resolve()).then(function() {
294
- // 多楼层:相机默认以第一个楼层为准(之后切换 ALL 时再重新调整)
294
+ // 多楼层:相机默认以第一个楼层为准(showSingleFloor(0) 会触发动画,这里不再重复)
295
295
  if (self.floorGroups.length > 0) {
296
- self.adjustCameraToFloor(0);
296
+ self._lastSingleFloorIndex = 0;
297
297
  }
298
298
  });
299
299
  };
@@ -1355,12 +1355,13 @@ SceneCore.prototype.animateCameraToAllView = function(duration) {
1355
1355
  this.cameraPrePitchPos = this.camera.position.clone();
1356
1356
  this.cameraPrePitchTarget = this.controls ? this.controls.target.clone() : center.clone();
1357
1357
 
1358
- // ALL 外景俯角 -25°:camera.y - center.y = distance × sin(-25°) ≈ -distance × 0.423
1359
- // camera.z - center.z = distance × cos(-25°) ≈ distance × 0.906
1360
- var dist = maxSize * 2;
1358
+ // ALL 外景俯角 -20°:camera.y - center.y = distance × sin(-20°) ≈ -distance × 0.342
1359
+ // camera.z - center.z = distance × cos(-20°) ≈ distance × 0.940
1360
+ // 距离 2.5×,从建筑斜上方俯视,视角平缓舒适
1361
+ var dist = maxSize * 2.5;
1361
1362
  var fromPos = this.camera.position.clone();
1362
1363
  var fromTarget = this.controls ? this.controls.target.clone() : center.clone();
1363
- var toPos = new THREE.Vector3(center.x, center.y - dist * 0.423, center.z + dist * 0.906);
1364
+ var toPos = new THREE.Vector3(center.x, center.y - dist * 0.342, center.z + dist * 0.940);
1364
1365
  var toTarget = new THREE.Vector3(center.x, center.y, center.z);
1365
1366
 
1366
1367
  this.cameraPitchAnim = {
@@ -1436,7 +1437,8 @@ SceneCore.prototype.animateCameraToFloorView = function(duration) {
1436
1437
  fromPos: fromPos,
1437
1438
  toPos: toPos,
1438
1439
  fromTarget: fromTarget,
1439
- toTarget: toTarget
1440
+ toTarget: toTarget,
1441
+ targetState: 0 // 动画结束后 cameraPitchState 应为 0(单楼层状态)
1440
1442
  };
1441
1443
  this.cameraPitchState = 0;
1442
1444
  this.cameraPrePitchPos = null;