@kimap/indoor-positioning-sdk-vue2 5.4.8 → 5.4.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 +1 -1
- package/src/core/KimapSDK.js +21 -8
- package/src/core/SceneCore.js +16 -25
package/package.json
CHANGED
package/src/core/KimapSDK.js
CHANGED
|
@@ -914,13 +914,13 @@ KimapSDK.prototype._zoomToShowAllFloors = function() {
|
|
|
914
914
|
box.getSize(size);
|
|
915
915
|
|
|
916
916
|
var maxSize = Math.max(size.x, size.z);
|
|
917
|
-
var distance = maxSize * 2;
|
|
917
|
+
var distance = maxSize * 1.2;
|
|
918
918
|
|
|
919
|
-
// 计算目标位置 -
|
|
920
|
-
// X
|
|
919
|
+
// 计算目标位置 - 从侧面-45度角看过去,镜头拉近
|
|
920
|
+
// X负方向偏移,Z方向也偏移,形成-45度角
|
|
921
921
|
var targetPosition = new THREE.Vector3(
|
|
922
|
-
center.x
|
|
923
|
-
center.y + distance * 0.
|
|
922
|
+
center.x - distance,
|
|
923
|
+
center.y + distance * 0.6,
|
|
924
924
|
center.z + distance
|
|
925
925
|
);
|
|
926
926
|
|
|
@@ -1199,6 +1199,8 @@ KimapSDK.prototype._createFallbackBuilding = function(x, z) {
|
|
|
1199
1199
|
|
|
1200
1200
|
var buildingGroup = new THREE.Group();
|
|
1201
1201
|
buildingGroup.position.set(x, 0, z);
|
|
1202
|
+
buildingGroup.castShadow = false;
|
|
1203
|
+
buildingGroup.receiveShadow = false;
|
|
1202
1204
|
|
|
1203
1205
|
// 主楼体 - 淡蓝色半透明
|
|
1204
1206
|
var geometry = new THREE.BoxGeometry(width, height, depth);
|
|
@@ -1212,11 +1214,15 @@ KimapSDK.prototype._createFallbackBuilding = function(x, z) {
|
|
|
1212
1214
|
transparent: true,
|
|
1213
1215
|
opacity: 0.7,
|
|
1214
1216
|
emissive: new THREE.Color(0x1e3d5c),
|
|
1215
|
-
emissiveIntensity: 0.3
|
|
1217
|
+
emissiveIntensity: 0.3,
|
|
1218
|
+
castShadow: false,
|
|
1219
|
+
receiveShadow: false
|
|
1216
1220
|
});
|
|
1217
1221
|
|
|
1218
1222
|
var building = new THREE.Mesh(geometry, material);
|
|
1219
1223
|
building.position.y = height / 2;
|
|
1224
|
+
building.castShadow = false;
|
|
1225
|
+
building.receiveShadow = false;
|
|
1220
1226
|
buildingGroup.add(building);
|
|
1221
1227
|
|
|
1222
1228
|
// 添加窗户细节(较亮)
|
|
@@ -1311,6 +1317,8 @@ KimapSDK.prototype._createTechGround = function() {
|
|
|
1311
1317
|
this.techGroundGroup = new THREE.Group();
|
|
1312
1318
|
this.techGroundGroup.name = 'techGround';
|
|
1313
1319
|
this.techGroundGroup.visible = false; // 默认隐藏
|
|
1320
|
+
this.techGroundGroup.castShadow = false;
|
|
1321
|
+
this.techGroundGroup.receiveShadow = false;
|
|
1314
1322
|
this.core.scene.add(this.techGroundGroup);
|
|
1315
1323
|
|
|
1316
1324
|
// 创建网格地面
|
|
@@ -1318,18 +1326,23 @@ KimapSDK.prototype._createTechGround = function() {
|
|
|
1318
1326
|
gridHelper.position.y = -0.1;
|
|
1319
1327
|
gridHelper.material.opacity = 0.3;
|
|
1320
1328
|
gridHelper.material.transparent = true;
|
|
1329
|
+
gridHelper.castShadow = false;
|
|
1330
|
+
gridHelper.receiveShadow = false;
|
|
1321
1331
|
this.techGroundGroup.add(gridHelper);
|
|
1322
1332
|
|
|
1323
|
-
// 创建地面平面
|
|
1333
|
+
// 创建地面平面 - 降低透明度,不遮挡光线
|
|
1324
1334
|
var groundGeometry = new THREE.PlaneGeometry(groundSize, groundSize);
|
|
1325
1335
|
var groundMaterial = new THREE.MeshBasicMaterial({
|
|
1326
1336
|
color: 0x0a1628,
|
|
1327
1337
|
transparent: true,
|
|
1328
|
-
opacity: 0.
|
|
1338
|
+
opacity: 0.4,
|
|
1339
|
+
depthWrite: false
|
|
1329
1340
|
});
|
|
1330
1341
|
var ground = new THREE.Mesh(groundGeometry, groundMaterial);
|
|
1331
1342
|
ground.rotation.x = -Math.PI / 2;
|
|
1332
1343
|
ground.position.y = -0.2;
|
|
1344
|
+
ground.castShadow = false;
|
|
1345
|
+
ground.receiveShadow = false;
|
|
1333
1346
|
this.techGroundGroup.add(ground);
|
|
1334
1347
|
};
|
|
1335
1348
|
|
package/src/core/SceneCore.js
CHANGED
|
@@ -183,27 +183,23 @@ SceneCore.prototype.initControls = function(OrbitControls) {
|
|
|
183
183
|
* 设置灯光
|
|
184
184
|
*/
|
|
185
185
|
SceneCore.prototype.setupLights = function() {
|
|
186
|
-
// 环境光
|
|
187
|
-
var ambientLight = new THREE.AmbientLight(0xffffff, 0.
|
|
186
|
+
// 环境光 - 提高亮度
|
|
187
|
+
var ambientLight = new THREE.AmbientLight(0xffffff, 0.8);
|
|
188
188
|
this.scene.add(ambientLight);
|
|
189
|
-
|
|
190
|
-
//
|
|
191
|
-
var directionalLight1 = new THREE.DirectionalLight(0xffffff, 0.
|
|
189
|
+
|
|
190
|
+
// 主光源(从上方)- 提高亮度
|
|
191
|
+
var directionalLight1 = new THREE.DirectionalLight(0xffffff, 0.6);
|
|
192
192
|
directionalLight1.position.set(10, 20, 10);
|
|
193
|
-
directionalLight1.castShadow =
|
|
194
|
-
directionalLight1.shadow.camera.left = -50;
|
|
195
|
-
directionalLight1.shadow.camera.right = 50;
|
|
196
|
-
directionalLight1.shadow.camera.top = 50;
|
|
197
|
-
directionalLight1.shadow.camera.bottom = -50;
|
|
193
|
+
directionalLight1.castShadow = false;
|
|
198
194
|
this.scene.add(directionalLight1);
|
|
199
|
-
|
|
200
|
-
// 辅助光源
|
|
201
|
-
var directionalLight2 = new THREE.DirectionalLight(0xffffff, 0);
|
|
195
|
+
|
|
196
|
+
// 辅助光源 - 提高亮度
|
|
197
|
+
var directionalLight2 = new THREE.DirectionalLight(0xffffff, 0.4);
|
|
202
198
|
directionalLight2.position.set(-10, 15, -10);
|
|
203
199
|
this.scene.add(directionalLight2);
|
|
204
|
-
|
|
205
|
-
// 半球光
|
|
206
|
-
var hemisphereLight = new THREE.HemisphereLight(0xffffff, 0x444444, 0.
|
|
200
|
+
|
|
201
|
+
// 半球光 - 提高亮度
|
|
202
|
+
var hemisphereLight = new THREE.HemisphereLight(0xffffff, 0x444444, 0.5);
|
|
207
203
|
this.scene.add(hemisphereLight);
|
|
208
204
|
};
|
|
209
205
|
|
|
@@ -1166,18 +1162,13 @@ SceneCore.prototype._processMaterial = function(child, materials, colorMap) {
|
|
|
1166
1162
|
roughness = 0.5;
|
|
1167
1163
|
metalness = 0.2;
|
|
1168
1164
|
transparent = true;
|
|
1169
|
-
//
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
if (self._areaOpacity[areaId]) {
|
|
1173
|
-
opacity = self._areaOpacity[areaId].opacity;
|
|
1174
|
-
transparent = opacity < 1.0;
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1165
|
+
// 强制设置区域透明度为0.3
|
|
1166
|
+
opacity = 0.3;
|
|
1167
|
+
transparent = opacity < 1.0;
|
|
1177
1168
|
// 添加轻微emissive提亮区域颜色
|
|
1178
1169
|
emissiveEnabled = true;
|
|
1179
1170
|
emissiveColor = mtlColor;
|
|
1180
|
-
emissiveIntensity = 0.
|
|
1171
|
+
emissiveIntensity = 0.2;
|
|
1181
1172
|
// 区域通常是高透明度的,关闭depthWrite避免与3D家具的深度冲突
|
|
1182
1173
|
depthWrite = false;
|
|
1183
1174
|
} else if (child.material.name.startsWith('Wall_')) {
|