@kimap/indoor-positioning-sdk-vue2 4.0.0 → 4.0.1
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 +9 -1
- package/src/KimapCore.js +18 -2
package/package.json
CHANGED
package/src/KimapCore.browser.js
CHANGED
|
@@ -623,6 +623,7 @@
|
|
|
623
623
|
// 根据材质名称判断元素类型,设置对应的PBR参数
|
|
624
624
|
var roughness = 0.15; // 家具默认
|
|
625
625
|
var metalness = 0;
|
|
626
|
+
var finalColor = mtlColor;
|
|
626
627
|
|
|
627
628
|
if (child.material.name.startsWith('Area_')) {
|
|
628
629
|
roughness = 0.5;
|
|
@@ -635,11 +636,18 @@
|
|
|
635
636
|
child.material.name.startsWith('Stair_')) {
|
|
636
637
|
roughness = 0.25;
|
|
637
638
|
metalness = 0;
|
|
639
|
+
// Shape图形设置透明度0.6,与3D绘制平台一致
|
|
640
|
+
opacity = 0.6;
|
|
641
|
+
transparent = true;
|
|
642
|
+
// 让颜色更浅一点(混合白色)
|
|
643
|
+
var color = new THREE.Color(mtlColor);
|
|
644
|
+
color.lerp(new THREE.Color(0xffffff), 0.3); // 混合30%白色
|
|
645
|
+
finalColor = color.getHex();
|
|
638
646
|
}
|
|
639
647
|
|
|
640
648
|
// 创建新的PBR材质
|
|
641
649
|
child.material = new THREE.MeshStandardMaterial({
|
|
642
|
-
color:
|
|
650
|
+
color: finalColor,
|
|
643
651
|
opacity: opacity,
|
|
644
652
|
transparent: transparent,
|
|
645
653
|
roughness: roughness,
|
package/src/KimapCore.js
CHANGED
|
@@ -604,6 +604,7 @@ SceneCore.prototype.loadMap = function(OBJLoader, MTLLoader) {
|
|
|
604
604
|
// 根据材质名称判断元素类型,设置对应的PBR参数
|
|
605
605
|
var roughness = 0.15; // 家具默认
|
|
606
606
|
var metalness = 0;
|
|
607
|
+
var finalColor = mtlColor;
|
|
607
608
|
|
|
608
609
|
if (child.material.name.startsWith('Area_')) {
|
|
609
610
|
roughness = 0.5;
|
|
@@ -616,11 +617,18 @@ SceneCore.prototype.loadMap = function(OBJLoader, MTLLoader) {
|
|
|
616
617
|
child.material.name.startsWith('Stair_')) {
|
|
617
618
|
roughness = 0.25;
|
|
618
619
|
metalness = 0;
|
|
620
|
+
// Shape图形设置透明度0.6,与3D绘制平台一致
|
|
621
|
+
opacity = 0.6;
|
|
622
|
+
transparent = true;
|
|
623
|
+
// 让颜色更浅一点(混合白色)
|
|
624
|
+
var color = new THREE.Color(mtlColor);
|
|
625
|
+
color.lerp(new THREE.Color(0xffffff), 0.3); // 混合30%白色
|
|
626
|
+
finalColor = color.getHex();
|
|
619
627
|
}
|
|
620
628
|
|
|
621
629
|
// 创建新的PBR材质
|
|
622
630
|
child.material = new THREE.MeshStandardMaterial({
|
|
623
|
-
color:
|
|
631
|
+
color: finalColor,
|
|
624
632
|
opacity: opacity,
|
|
625
633
|
transparent: transparent,
|
|
626
634
|
roughness: roughness,
|
|
@@ -783,6 +791,7 @@ SceneCore.prototype.loadMap = function(OBJLoader, MTLLoader) {
|
|
|
783
791
|
|
|
784
792
|
var roughness = 0.15; // 家具默认
|
|
785
793
|
var metalness = 0;
|
|
794
|
+
var finalColor = mtlColor;
|
|
786
795
|
|
|
787
796
|
if (child.material.name.startsWith('Area_')) {
|
|
788
797
|
roughness = 0.5;
|
|
@@ -795,10 +804,17 @@ SceneCore.prototype.loadMap = function(OBJLoader, MTLLoader) {
|
|
|
795
804
|
child.material.name.startsWith('Stair_')) {
|
|
796
805
|
roughness = 0.25;
|
|
797
806
|
metalness = 0;
|
|
807
|
+
// Shape图形设置透明度0.6,与3D绘制平台一致
|
|
808
|
+
opacity = 0.6;
|
|
809
|
+
transparent = true;
|
|
810
|
+
// 让颜色更浅一点(混合白色)
|
|
811
|
+
var color = new THREE.Color(mtlColor);
|
|
812
|
+
color.lerp(new THREE.Color(0xffffff), 0.3); // 混合30%白色
|
|
813
|
+
finalColor = color.getHex();
|
|
798
814
|
}
|
|
799
815
|
|
|
800
816
|
child.material = new THREE.MeshStandardMaterial({
|
|
801
|
-
color:
|
|
817
|
+
color: finalColor,
|
|
802
818
|
opacity: opacity,
|
|
803
819
|
transparent: transparent,
|
|
804
820
|
roughness: roughness,
|