1
This commit is contained in:
@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 创建点平面的具体实现
|
||||
|
||||
Reference in New Issue
Block a user