@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 +1 -1
- package/src/core/KimapSDK.js +4 -4
- package/src/core/SceneCore.js +8 -4
package/package.json
CHANGED
package/src/core/KimapSDK.js
CHANGED
|
@@ -797,7 +797,7 @@ KimapSDK.prototype.showAllFloors = function() {
|
|
|
797
797
|
};
|
|
798
798
|
|
|
799
799
|
/**
|
|
800
|
-
* 多楼层:相机动画飞到能看到所有楼层的位置(ALL
|
|
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°,俯角
|
|
824
|
+
// ALL侧方斜俯视:方位角-45°,俯角35°(polar≈55°),模型占屏幕60%(拉远)
|
|
825
825
|
var azimuthDeg = -45;
|
|
826
|
-
var pitchDeg =
|
|
827
|
-
var screenFillFactor = 0.
|
|
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));
|
package/src/core/SceneCore.js
CHANGED
|
@@ -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
|
-
//
|
|
514
|
-
var pitchDeg =
|
|
513
|
+
// 从侧方斜俯视:方位角-45°,俯角35°(polar≈55°),模型占屏幕60%(拉远)
|
|
514
|
+
var pitchDeg = 35;
|
|
515
515
|
var azimuthDeg = -45;
|
|
516
|
-
var
|
|
517
|
-
var
|
|
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;
|