@kimap/indoor-positioning-sdk-vue2 4.2.8 → 4.2.9

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": "4.2.8",
3
+ "version": "4.2.9",
4
4
  "description": "Vue2自包含室内定位SDK - 完全兼容Webpack3+Babel6 | Vue2 Self-Contained Indoor Positioning SDK",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -1736,7 +1736,8 @@
1736
1736
  var scaleX = size.x > 0 ? furniture.targetSize.width / size.x : 1;
1737
1737
  var scaleY = size.y > 0 ? furniture.targetSize.height / size.y : 1;
1738
1738
  var scaleZ = size.z > 0 ? furniture.targetSize.depth / size.z : 1;
1739
- var uniformScale = (scaleX + scaleY + scaleZ) / 3;
1739
+ // 使用X和Z的平均值作为统一缩放(保持水平比例,与3D预览一致)
1740
+ var uniformScale = (scaleX + scaleZ) / 2;
1740
1741
 
1741
1742
  // 应用归一化缩放和用户缩放
1742
1743
  var finalScale = uniformScale * furniture.scale.x;
@@ -1744,9 +1745,10 @@
1744
1745
 
1745
1746
  console.log('🔧 家具模型缩放:', {
1746
1747
  type: furniture.type,
1747
- originalSize: { x: size.x.toFixed(3), y: size.y.toFixed(3), z: size.z.toFixed(3) },
1748
+ originalSize: { x: size.x.toFixed(3), y: size.y.toFixed(3), z: size.z.toFixed(3), unit: '模型单位' },
1748
1749
  targetSize: furniture.targetSize,
1749
- uniformScale: uniformScale.toFixed(3),
1750
+ scaleFactors: { x: scaleX.toFixed(3), y: scaleY.toFixed(3), z: scaleZ.toFixed(3) },
1751
+ uniformScale: uniformScale.toFixed(3) + ' (平均X和Z)',
1750
1752
  userScale: furniture.scale.x,
1751
1753
  finalScale: finalScale.toFixed(3)
1752
1754
  });
@@ -898,7 +898,8 @@ KimapSDK.prototype._loadSingleFurniture = function(furniture, serverUrl) {
898
898
  var scaleX = size.x > 0 ? furniture.targetSize.width / size.x : 1;
899
899
  var scaleY = size.y > 0 ? furniture.targetSize.height / size.y : 1;
900
900
  var scaleZ = size.z > 0 ? furniture.targetSize.depth / size.z : 1;
901
- var uniformScale = (scaleX + scaleY + scaleZ) / 3;
901
+ // 使用X和Z的平均值作为统一缩放(保持水平比例,与3D预览一致)
902
+ var uniformScale = (scaleX + scaleZ) / 2;
902
903
 
903
904
  // 应用归一化缩放和用户缩放
904
905
  var finalScale = uniformScale * furniture.scale.x;