@kimap/indoor-positioning-sdk-vue2 3.9.4 → 3.9.6
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/KimapCore.browser.js +19 -17
- package/src/KimapCore.js +29 -27
package/package.json
CHANGED
package/src/KimapCore.browser.js
CHANGED
|
@@ -378,12 +378,12 @@
|
|
|
378
378
|
};
|
|
379
379
|
|
|
380
380
|
SceneCore.prototype.setupLights = function() {
|
|
381
|
-
//
|
|
381
|
+
// 环境光(与3D预览保持一致)
|
|
382
382
|
var ambientLight = new THREE.AmbientLight(0xffffff, 0.6);
|
|
383
383
|
this.scene.add(ambientLight);
|
|
384
384
|
|
|
385
|
-
//
|
|
386
|
-
var directionalLight1 = new THREE.DirectionalLight(0xffffff, 0.
|
|
385
|
+
// 主光源(从上方,与3D预览保持一致)
|
|
386
|
+
var directionalLight1 = new THREE.DirectionalLight(0xffffff, 0.8);
|
|
387
387
|
directionalLight1.position.set(10, 20, 10);
|
|
388
388
|
directionalLight1.castShadow = true;
|
|
389
389
|
directionalLight1.shadow.camera.left = -50;
|
|
@@ -392,13 +392,13 @@
|
|
|
392
392
|
directionalLight1.shadow.camera.bottom = -50;
|
|
393
393
|
this.scene.add(directionalLight1);
|
|
394
394
|
|
|
395
|
-
//
|
|
396
|
-
var directionalLight2 = new THREE.DirectionalLight(0xffffff, 0.
|
|
395
|
+
// 辅助光源(与3D预览保持一致)
|
|
396
|
+
var directionalLight2 = new THREE.DirectionalLight(0xffffff, 0.4);
|
|
397
397
|
directionalLight2.position.set(-10, 15, -10);
|
|
398
398
|
this.scene.add(directionalLight2);
|
|
399
399
|
|
|
400
|
-
//
|
|
401
|
-
var hemisphereLight = new THREE.HemisphereLight(0xffffff, 0x444444, 0.
|
|
400
|
+
// 半球光(与3D预览保持一致)
|
|
401
|
+
var hemisphereLight = new THREE.HemisphereLight(0xffffff, 0x444444, 0.4);
|
|
402
402
|
this.scene.add(hemisphereLight);
|
|
403
403
|
};
|
|
404
404
|
|
|
@@ -619,20 +619,21 @@
|
|
|
619
619
|
var transparent = opacity < 1.0;
|
|
620
620
|
|
|
621
621
|
// 根据材质名称判断元素类型,设置对应的PBR参数
|
|
622
|
-
|
|
623
|
-
var
|
|
622
|
+
// 与3D预览保持一致:高粗糙度、低金属度,减少反光
|
|
623
|
+
var roughness = 0.95;
|
|
624
|
+
var metalness = 0;
|
|
624
625
|
|
|
625
626
|
if (child.material.name.startsWith('Area_')) {
|
|
626
|
-
roughness = 0.
|
|
627
|
-
metalness = 0
|
|
627
|
+
roughness = 0.95;
|
|
628
|
+
metalness = 0;
|
|
628
629
|
transparent = true; // 区域支持透明
|
|
629
630
|
} else if (child.material.name.startsWith('Wall_')) {
|
|
630
|
-
roughness = 0.
|
|
631
|
-
metalness = 0
|
|
631
|
+
roughness = 0.95;
|
|
632
|
+
metalness = 0;
|
|
632
633
|
} else if (child.material.name.startsWith('Shape_') ||
|
|
633
634
|
child.material.name.startsWith('Stair_')) {
|
|
634
|
-
roughness = 0.
|
|
635
|
-
metalness = 0
|
|
635
|
+
roughness = 0.95;
|
|
636
|
+
metalness = 0;
|
|
636
637
|
}
|
|
637
638
|
|
|
638
639
|
// 创建新的PBR材质
|
|
@@ -668,10 +669,11 @@
|
|
|
668
669
|
}
|
|
669
670
|
|
|
670
671
|
console.log('⚪ 创建默认材质 for', child.name || child.parent.name);
|
|
672
|
+
// 与3D预览保持一致:高粗糙度、低金属度
|
|
671
673
|
child.material = new THREE.MeshStandardMaterial({
|
|
672
674
|
color: meshColor,
|
|
673
|
-
roughness: 0.
|
|
674
|
-
metalness: 0
|
|
675
|
+
roughness: 0.95,
|
|
676
|
+
metalness: 0,
|
|
675
677
|
side: THREE.DoubleSide
|
|
676
678
|
});
|
|
677
679
|
}
|
package/src/KimapCore.js
CHANGED
|
@@ -403,12 +403,12 @@ SceneCore.prototype.initControls = function(OrbitControls) {
|
|
|
403
403
|
};
|
|
404
404
|
|
|
405
405
|
SceneCore.prototype.setupLights = function() {
|
|
406
|
-
//
|
|
406
|
+
// 环境光(与3D预览保持一致)
|
|
407
407
|
var ambientLight = new THREE.AmbientLight(0xffffff, 0.6);
|
|
408
408
|
this.scene.add(ambientLight);
|
|
409
409
|
|
|
410
|
-
//
|
|
411
|
-
var directionalLight1 = new THREE.DirectionalLight(0xffffff, 0.
|
|
410
|
+
// 主光源(从上方,与3D预览保持一致)
|
|
411
|
+
var directionalLight1 = new THREE.DirectionalLight(0xffffff, 0.8);
|
|
412
412
|
directionalLight1.position.set(10, 20, 10);
|
|
413
413
|
directionalLight1.castShadow = true;
|
|
414
414
|
directionalLight1.shadow.camera.left = -50;
|
|
@@ -417,13 +417,13 @@ SceneCore.prototype.setupLights = function() {
|
|
|
417
417
|
directionalLight1.shadow.camera.bottom = -50;
|
|
418
418
|
this.scene.add(directionalLight1);
|
|
419
419
|
|
|
420
|
-
//
|
|
421
|
-
var directionalLight2 = new THREE.DirectionalLight(0xffffff, 0.
|
|
420
|
+
// 辅助光源(与3D预览保持一致)
|
|
421
|
+
var directionalLight2 = new THREE.DirectionalLight(0xffffff, 0.4);
|
|
422
422
|
directionalLight2.position.set(-10, 15, -10);
|
|
423
423
|
this.scene.add(directionalLight2);
|
|
424
424
|
|
|
425
|
-
//
|
|
426
|
-
var hemisphereLight = new THREE.HemisphereLight(0xffffff, 0x444444, 0.
|
|
425
|
+
// 半球光(与3D预览保持一致)
|
|
426
|
+
var hemisphereLight = new THREE.HemisphereLight(0xffffff, 0x444444, 0.4);
|
|
427
427
|
this.scene.add(hemisphereLight);
|
|
428
428
|
};
|
|
429
429
|
|
|
@@ -602,20 +602,21 @@ SceneCore.prototype.loadMap = function(OBJLoader, MTLLoader) {
|
|
|
602
602
|
var transparent = opacity < 1.0;
|
|
603
603
|
|
|
604
604
|
// 根据材质名称判断元素类型,设置对应的PBR参数
|
|
605
|
-
|
|
606
|
-
var
|
|
605
|
+
// 与3D预览保持一致:高粗糙度、低金属度,减少反光
|
|
606
|
+
var roughness = 0.95;
|
|
607
|
+
var metalness = 0;
|
|
607
608
|
|
|
608
609
|
if (child.material.name.startsWith('Area_')) {
|
|
609
|
-
roughness = 0.
|
|
610
|
-
metalness = 0
|
|
610
|
+
roughness = 0.95;
|
|
611
|
+
metalness = 0;
|
|
611
612
|
transparent = true;
|
|
612
613
|
} else if (child.material.name.startsWith('Wall_')) {
|
|
613
|
-
roughness = 0.
|
|
614
|
-
metalness = 0
|
|
614
|
+
roughness = 0.95;
|
|
615
|
+
metalness = 0;
|
|
615
616
|
} else if (child.material.name.startsWith('Shape_') ||
|
|
616
617
|
child.material.name.startsWith('Stair_')) {
|
|
617
|
-
roughness = 0.
|
|
618
|
-
metalness = 0
|
|
618
|
+
roughness = 0.95;
|
|
619
|
+
metalness = 0;
|
|
619
620
|
}
|
|
620
621
|
|
|
621
622
|
// 创建新的PBR材质
|
|
@@ -641,11 +642,11 @@ SceneCore.prototype.loadMap = function(OBJLoader, MTLLoader) {
|
|
|
641
642
|
}
|
|
642
643
|
|
|
643
644
|
console.log('⚪ 创建默认材质 for', child.name || child.parent.name);
|
|
644
|
-
//
|
|
645
|
+
// 设置材质(与3D预览保持一致)
|
|
645
646
|
child.material = new THREE.MeshStandardMaterial({
|
|
646
647
|
color: meshColor,
|
|
647
|
-
roughness: 0.
|
|
648
|
-
metalness: 0
|
|
648
|
+
roughness: 0.95,
|
|
649
|
+
metalness: 0,
|
|
649
650
|
side: THREE.DoubleSide
|
|
650
651
|
});
|
|
651
652
|
}
|
|
@@ -781,17 +782,18 @@ SceneCore.prototype.loadMap = function(OBJLoader, MTLLoader) {
|
|
|
781
782
|
var opacity = child.material.opacity !== undefined ? child.material.opacity : 1.0;
|
|
782
783
|
var transparent = opacity < 1.0;
|
|
783
784
|
|
|
784
|
-
|
|
785
|
-
var
|
|
785
|
+
// 与3D预览保持一致:高粗糙度、低金属度,减少反光
|
|
786
|
+
var roughness = 0.95;
|
|
787
|
+
var metalness = 0;
|
|
786
788
|
|
|
787
789
|
if (child.material.name.startsWith('Area_')) {
|
|
788
|
-
roughness = 0.
|
|
789
|
-
metalness = 0
|
|
790
|
+
roughness = 0.95;
|
|
791
|
+
metalness = 0;
|
|
790
792
|
transparent = true;
|
|
791
793
|
} else if (child.material.name.startsWith('Shape_') ||
|
|
792
794
|
child.material.name.startsWith('Stair_')) {
|
|
793
|
-
roughness = 0.
|
|
794
|
-
metalness = 0
|
|
795
|
+
roughness = 0.95;
|
|
796
|
+
metalness = 0;
|
|
795
797
|
}
|
|
796
798
|
|
|
797
799
|
child.material = new THREE.MeshStandardMaterial({
|
|
@@ -803,11 +805,11 @@ SceneCore.prototype.loadMap = function(OBJLoader, MTLLoader) {
|
|
|
803
805
|
side: THREE.DoubleSide
|
|
804
806
|
});
|
|
805
807
|
} else {
|
|
806
|
-
//
|
|
808
|
+
// 设置默认材质(与3D预览保持一致)
|
|
807
809
|
child.material = new THREE.MeshStandardMaterial({
|
|
808
810
|
color: 0xdddddd,
|
|
809
|
-
roughness: 0.
|
|
810
|
-
metalness: 0
|
|
811
|
+
roughness: 0.95,
|
|
812
|
+
metalness: 0,
|
|
811
813
|
side: THREE.DoubleSide
|
|
812
814
|
});
|
|
813
815
|
}
|