@d5techs/3dgs-lib 1.4.3 → 1.4.5
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/dist/3dgs-lib.cjs +15 -1
- package/dist/3dgs-lib.cjs.map +1 -1
- package/dist/3dgs-lib.js +15 -1
- package/dist/3dgs-lib.js.map +1 -1
- package/dist/App.d.ts +1 -0
- package/dist/interaction/HotspotManager.d.ts +7 -1
- package/package.json +1 -1
package/dist/3dgs-lib.js
CHANGED
|
@@ -13592,7 +13592,8 @@ class HotspotManager {
|
|
|
13592
13592
|
setHotspotLabel(hotspotIndex, text, position = "top", fontSize = 14, visible = true) {
|
|
13593
13593
|
if (hotspotIndex < 0 || hotspotIndex >= this.hotspots.length) return false;
|
|
13594
13594
|
const info = this.hotspots[hotspotIndex];
|
|
13595
|
-
|
|
13595
|
+
const normalizedPos = String(position).toLowerCase() || "top";
|
|
13596
|
+
info.label = { text, position: normalizedPos, fontSize, visible };
|
|
13596
13597
|
this.ensureLabelElement(info);
|
|
13597
13598
|
this.applyLabelStyle(info);
|
|
13598
13599
|
return true;
|
|
@@ -14375,6 +14376,16 @@ class HotspotManager {
|
|
|
14375
14376
|
getHotspotCount() {
|
|
14376
14377
|
return this.hotspots.length;
|
|
14377
14378
|
}
|
|
14379
|
+
/**
|
|
14380
|
+
* 更新热点的 placedScale,使 billboard 每帧重建矩阵时使用新值。
|
|
14381
|
+
* 解决编辑器侧通过 setHotspotScale 修改尺寸后,billboard 模式
|
|
14382
|
+
* 仍用旧 placedScale 覆盖的问题。
|
|
14383
|
+
*/
|
|
14384
|
+
setHotspotPlacedScale(hotspotIndex, newPlacedScale) {
|
|
14385
|
+
if (hotspotIndex < 0 || hotspotIndex >= this.hotspots.length) return false;
|
|
14386
|
+
this.hotspots[hotspotIndex].placedScale = newPlacedScale;
|
|
14387
|
+
return true;
|
|
14388
|
+
}
|
|
14378
14389
|
/**
|
|
14379
14390
|
* 通过 overlay mesh 起始索引找到对应的热点索引
|
|
14380
14391
|
*/
|
|
@@ -16724,6 +16735,9 @@ class App {
|
|
|
16724
16735
|
getHotspotBillboard(hotspotIndex) {
|
|
16725
16736
|
return this.hotspotManager.getHotspotBillboard(hotspotIndex);
|
|
16726
16737
|
}
|
|
16738
|
+
setHotspotPlacedScale(hotspotIndex, newPlacedScale) {
|
|
16739
|
+
return this.hotspotManager.setHotspotPlacedScale(hotspotIndex, newPlacedScale);
|
|
16740
|
+
}
|
|
16727
16741
|
getHotspotCount() {
|
|
16728
16742
|
return this.hotspotManager.getHotspotCount();
|
|
16729
16743
|
}
|