@kimap/indoor-positioning-sdk-vue2 6.0.2 → 6.0.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": "6.0.2",
3
+ "version": "6.0.3",
4
4
  "description": "Vue2自包含室内定位SDK - 完全兼容Webpack3+Babel6 | Vue2 Self-Contained Indoor Positioning SDK",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -797,7 +797,7 @@ KimapSDK.prototype.showAllFloors = function() {
797
797
  };
798
798
 
799
799
  /**
800
- * 多楼层:相机动画飞到能看到所有楼层的位置(ALL 外景视角,从侧方斜俯视,俯角约 45°)
800
+ * 多楼层:相机动画飞到能看到所有楼层的位置(ALL 外景视角,从侧方斜俯视,俯角35°,拉远)
801
801
  * @private
802
802
  */
803
803
  KimapSDK.prototype._zoomToShowAllFloors = function() {
@@ -821,10 +821,10 @@ KimapSDK.prototype._zoomToShowAllFloors = function() {
821
821
  box.getSize(size);
822
822
  var maxSize = Math.max(size.x, size.z);
823
823
 
824
- // ALL侧方斜俯视:方位角-45°,俯角45°,模型占屏幕80%
824
+ // ALL侧方斜俯视:方位角-45°,俯角35°(polar≈55°),模型占屏幕60%(拉远)
825
825
  var azimuthDeg = -45;
826
- var pitchDeg = 45;
827
- var screenFillFactor = 0.8;
826
+ var pitchDeg = 35;
827
+ var screenFillFactor = 0.6;
828
828
  var aspect = (this.core.camera && this.core.camera.aspect) || (window.innerWidth / window.innerHeight);
829
829
  var fovRad = (this.core.camera && this.core.camera.fov) ? this.core.camera.fov * Math.PI / 180 : (60 * Math.PI / 180);
830
830
  var hDist = maxSize / 2 / screenFillFactor / Math.tan(Math.atan(Math.tan(fovRad / 2) / aspect));
@@ -510,11 +510,15 @@ SceneCore.prototype._adjustCameraToAllFloors = function() {
510
510
  box.getSize(size);
511
511
  var maxSize = Math.max(size.x, size.z);
512
512
 
513
- // 从侧方斜俯视:方位角 -45°(侧方),俯角 45°(polar≈60°,与调试值对应)
514
- var pitchDeg = 45;
513
+ // 从侧方斜俯视:方位角-45°,俯角35°(polar≈55°),模型占屏幕60%(拉远)
514
+ var pitchDeg = 35;
515
515
  var azimuthDeg = -45;
516
- var baseDistance = maxSize > 0 ? maxSize * 0.8 : 10;
517
- var distance = baseDistance;
516
+ var screenFillFactor = 0.6;
517
+ var aspect = this.camera ? this.camera.aspect : (this.container.clientWidth / this.container.clientHeight);
518
+ var fovRad = this.camera ? this.camera.fov * Math.PI / 180 : (60 * Math.PI / 180);
519
+ var hDist = maxSize / 2 / screenFillFactor / Math.tan(Math.atan(Math.tan(fovRad / 2) / aspect));
520
+ var vDist = maxSize / 2 / screenFillFactor / Math.tan(fovRad / 2);
521
+ var distance = Math.max(hDist, vDist);
518
522
 
519
523
  var pitchRad = pitchDeg * Math.PI / 180;
520
524
  var azimuthRad = azimuthDeg * Math.PI / 180;