mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-18 15:25:36 +02:00
wip
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user