@kimap/indoor-positioning-sdk-vue2 6.0.8 → 6.0.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 +14 -4
- package/src/core/SceneCore.js +18 -3
package/package.json
CHANGED
package/src/core/KimapSDK.js
CHANGED
|
@@ -924,8 +924,11 @@ KimapSDK.prototype._fadeInAllModeBuildings = function(duration) {
|
|
|
924
924
|
|
|
925
925
|
// 初始透明度设为0
|
|
926
926
|
this.core._allModeBuildings.forEach(function(mesh) {
|
|
927
|
-
if (mesh.material
|
|
928
|
-
mesh.material.
|
|
927
|
+
if (mesh.material) {
|
|
928
|
+
mesh.material.transparent = true;
|
|
929
|
+
if (mesh.material.opacity !== undefined) {
|
|
930
|
+
mesh.material.opacity = 0;
|
|
931
|
+
}
|
|
929
932
|
}
|
|
930
933
|
});
|
|
931
934
|
|
|
@@ -936,8 +939,15 @@ KimapSDK.prototype._fadeInAllModeBuildings = function(duration) {
|
|
|
936
939
|
var progress = Math.min(elapsed / duration, 1);
|
|
937
940
|
|
|
938
941
|
self.core._allModeBuildings.forEach(function(mesh) {
|
|
939
|
-
if (mesh.material
|
|
940
|
-
|
|
942
|
+
if (mesh.material) {
|
|
943
|
+
// 主体灰色半透明,描边和顶部标记淡蓝色
|
|
944
|
+
if (mesh.name && mesh.name.startsWith('__build__edges')) {
|
|
945
|
+
mesh.material.opacity = 0.8 * progress;
|
|
946
|
+
} else if (mesh.name && mesh.name.startsWith('__build__tip')) {
|
|
947
|
+
mesh.material.opacity = progress;
|
|
948
|
+
} else {
|
|
949
|
+
mesh.material.opacity = 0.3 * progress;
|
|
950
|
+
}
|
|
941
951
|
}
|
|
942
952
|
});
|
|
943
953
|
|
package/src/core/SceneCore.js
CHANGED
|
@@ -607,10 +607,12 @@ SceneCore.prototype._addAllModeBuildings = function() {
|
|
|
607
607
|
heights.forEach(function(h, i) {
|
|
608
608
|
var o = offsets[i];
|
|
609
609
|
var geo = new THREE.BoxGeometry(o.w, h, o.d);
|
|
610
|
+
|
|
611
|
+
// 灰色半透明主体
|
|
610
612
|
var mat = new THREE.MeshBasicMaterial({
|
|
611
|
-
color:
|
|
613
|
+
color: 0x888888,
|
|
612
614
|
transparent: true,
|
|
613
|
-
opacity: 0.
|
|
615
|
+
opacity: 0.3,
|
|
614
616
|
depthWrite: false
|
|
615
617
|
});
|
|
616
618
|
var mesh = new THREE.Mesh(geo, mat);
|
|
@@ -621,7 +623,20 @@ SceneCore.prototype._addAllModeBuildings = function() {
|
|
|
621
623
|
self.scene.add(mesh);
|
|
622
624
|
self._allModeBuildings.push(mesh);
|
|
623
625
|
|
|
624
|
-
//
|
|
626
|
+
// 淡蓝色描边
|
|
627
|
+
var edgesGeo = new THREE.EdgesGeometry(geo);
|
|
628
|
+
var edgesMat = new THREE.LineBasicMaterial({
|
|
629
|
+
color: 0x4fc3f7,
|
|
630
|
+
transparent: true,
|
|
631
|
+
opacity: 0.8
|
|
632
|
+
});
|
|
633
|
+
var edges = new THREE.LineSegments(edgesGeo, edgesMat);
|
|
634
|
+
edges.position.copy(mesh.position);
|
|
635
|
+
edges.name = '__build__edges' + i;
|
|
636
|
+
self.scene.add(edges);
|
|
637
|
+
self._allModeBuildings.push(edges);
|
|
638
|
+
|
|
639
|
+
// 顶部标记(淡蓝色)
|
|
625
640
|
var tipGeo = new THREE.BoxGeometry(o.w * 0.3, 0.1, o.d * 0.3);
|
|
626
641
|
var tipMat = new THREE.MeshBasicMaterial({ color: 0x4fc3f7 });
|
|
627
642
|
var tip = new THREE.Mesh(tipGeo, tipMat);
|