@kimap/indoor-positioning-sdk-vue2 5.7.6 → 5.7.7
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/SceneCore.js +7 -5
package/package.json
CHANGED
package/src/core/SceneCore.js
CHANGED
|
@@ -421,7 +421,7 @@ SceneCore.prototype._processLoadedModelToGroup = function(object, materials, col
|
|
|
421
421
|
var box = new THREE.Box3().setFromObject(object);
|
|
422
422
|
var boxHeight = box.max.y - box.min.y;
|
|
423
423
|
|
|
424
|
-
//
|
|
424
|
+
// 逐层累积高度:计算该楼层在 ALL 模式下的世界 Y 偏移
|
|
425
425
|
var floorY = 0;
|
|
426
426
|
for (var i = 0; i < floorIndex; i++) {
|
|
427
427
|
var prevGroup = self.floorGroups[i];
|
|
@@ -431,11 +431,13 @@ SceneCore.prototype._processLoadedModelToGroup = function(object, materials, col
|
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
//
|
|
435
|
-
|
|
436
|
-
object.position.set(-box.min.x, floorY - box.min.y, -box.min.z);
|
|
434
|
+
// 所有楼层的 object 底部(box.min.y)对齐到本地 Y=0,统一基准
|
|
435
|
+
object.position.set(-box.min.x, -box.min.y, -box.min.z);
|
|
437
436
|
|
|
438
|
-
//
|
|
437
|
+
// ALL 模式时 floorGroup.position.y 持有累积偏移(含间隙)
|
|
438
|
+
floorGroup.position.y = floorY;
|
|
439
|
+
|
|
440
|
+
// 记录每个楼层的原始世界 Y 偏移(单层模式时用于将选中层拽回 Y=0)
|
|
439
441
|
self.floorOriginalY[floorIndex] = floorY;
|
|
440
442
|
|
|
441
443
|
// 复用 backup 的材质处理策略,不改渲染风格
|