@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 +1 -1
- package/src/core/KimapSDK.js +2 -4
- package/src/core/SceneCore.js +9 -7
package/package.json
CHANGED
package/src/core/KimapSDK.js
CHANGED
|
@@ -669,10 +669,8 @@ KimapSDK.prototype.showSingleFloor = function(floorIndex) {
|
|
|
669
669
|
|
|
670
670
|
this._currentShowingFloorIndex = floorIndex;
|
|
671
671
|
self.core._lastSingleFloorIndex = floorIndex;
|
|
672
|
-
//
|
|
673
|
-
|
|
674
|
-
self.core.animateCameraToFloorView(600);
|
|
675
|
-
}
|
|
672
|
+
// 始终触发动画(animateCameraToFloorView 内部判断 from/to 是否相同,相同则立即完成)
|
|
673
|
+
self.core.animateCameraToFloorView(600);
|
|
676
674
|
};
|
|
677
675
|
|
|
678
676
|
/**
|
package/src/core/SceneCore.js
CHANGED
|
@@ -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
|
-
//
|
|
294
|
+
// 多楼层:相机默认以第一个楼层为准(showSingleFloor(0) 会触发动画,这里不再重复)
|
|
295
295
|
if (self.floorGroups.length > 0) {
|
|
296
|
-
self.
|
|
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 外景俯角 -
|
|
1359
|
-
// camera.z - center.z = distance × cos(-
|
|
1360
|
-
|
|
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.
|
|
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;
|