1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-18 15:25:36 +02:00
This commit is contained in:
syuilo
2026-04-29 20:07:34 +09:00
parent 1427d887dd
commit 0f69a284c6
2 changed files with 44 additions and 4 deletions

View File

@@ -79,6 +79,7 @@ export class SimpleHeyaManager extends HeyaManager<SimpleHeyaOptions> {
w: BABYLON.PBRMaterial;
e: BABYLON.PBRMaterial;
} | null = null;
private ceilingMaterial: BABYLON.PBRMaterial | null = null;
constructor(onMeshUpdatedCallback?: ((meshes: BABYLON.AbstractMesh[]) => void) | null) {
super(onMeshUpdatedCallback);
@@ -144,6 +145,8 @@ export class SimpleHeyaManager extends HeyaManager<SimpleHeyaOptions> {
}
}
this.ceilingMaterial = findMaterial(this.meshes[0], '__X_CEILING__');
await this.applyOptions(options);
}
@@ -203,6 +206,24 @@ export class SimpleHeyaManager extends HeyaManager<SimpleHeyaOptions> {
}
}
{
this.ceilingMaterial.unfreeze();
this.ceilingMaterial.albedoColor = new BABYLON.Color3(...options.ceiling.color);
const texPath = options.ceiling.material === 'wood' ? '/client-assets/room/wall-textures/wood.png'
: options.ceiling.material === 'concrete' ? '/client-assets/room/wall-textures/concrete.png'
: null;
if (texPath != null) {
const tex = new BABYLON.Texture(texPath, this.meshes[0].getScene(), false, false);
this.ceilingMaterial.albedoTexture = tex;
} else {
this.ceilingMaterial.albedoTexture = null;
}
this.ceilingMaterial.freeze();
}
this.onMeshUpdatedCallback?.(this.meshes);
}