This commit is contained in:
2026-04-24 11:20:27 +08:00
parent e7c1611f6b
commit 09359a1647
20 changed files with 1565 additions and 259 deletions

View File

@ -48,12 +48,12 @@ class HotSpot {
Point_Event(prams: HotspotPrams) {
const iconPath = prams.icon
// 为每个热点创建独立的材质
const texture = new Texture(iconPath, this.mainApp.appScene.object)
texture.hasAlpha = true
texture.getAlphaFromRGB = false
const material = new StandardMaterial(`hotspotMaterial_${Math.random()}`, this.mainApp.appScene.object)
material.diffuseTexture = texture
material.emissiveTexture = texture
@ -62,17 +62,12 @@ class HotSpot {
material.transparencyMode = 2 // ALPHABLEND 模式
material.disableLighting = true
material.backFaceCulling = false
// 检查纹理是否已加载
if (texture.isReady()) {
// 纹理已准备好,立即创建热点
this.createPointPlane(prams, material)
} else {
// 纹理未准备好,等待加载完成
texture.onLoadObservable.addOnce(() => {
this.createPointPlane(prams, material)
})
}
}
// 创建点平面的具体实现