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