mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-14 19:15:52 +02:00
wip
This commit is contained in:
@@ -8,19 +8,34 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<div class="_gaps">
|
<div class="_gaps">
|
||||||
<MkFolder>
|
<MkFolder>
|
||||||
<template #label>Wall N</template>
|
<template #label>Wall N</template>
|
||||||
<XWallOption :options="options.walls.n" @update="v => { emit('update', { ...options, walls: { ...options.walls, n: v } }); }"></XWallOption>
|
<XWallOption :options="options.walls.n" @update="v => { update({ walls: { ...options.walls, n: v } }); }"></XWallOption>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
<MkFolder>
|
<MkFolder>
|
||||||
<template #label>Wall S</template>
|
<template #label>Wall S</template>
|
||||||
<XWallOption :options="options.walls.s" @update="v => { emit('update', { ...options, walls: { ...options.walls, s: v } }); }"></XWallOption>
|
<XWallOption :options="options.walls.s" @update="v => { update({ walls: { ...options.walls, s: v } }); }"></XWallOption>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
<MkFolder>
|
<MkFolder>
|
||||||
<template #label>Wall W</template>
|
<template #label>Wall W</template>
|
||||||
<XWallOption :options="options.walls.w" @update="v => { emit('update', { ...options, walls: { ...options.walls, w: v } }); }"></XWallOption>
|
<XWallOption :options="options.walls.w" @update="v => { update({ walls: { ...options.walls, w: v } }); }"></XWallOption>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
<MkFolder>
|
<MkFolder>
|
||||||
<template #label>Wall E</template>
|
<template #label>Wall E</template>
|
||||||
<XWallOption :options="options.walls.e" @update="v => { emit('update', { ...options, walls: { ...options.walls, e: v } }); }"></XWallOption>
|
<XWallOption :options="options.walls.e" @update="v => { update({ walls: { ...options.walls, e: v } }); }"></XWallOption>
|
||||||
|
</MkFolder>
|
||||||
|
<MkFolder>
|
||||||
|
<template #label>Ceiling</template>
|
||||||
|
<MkSelect
|
||||||
|
:items="[
|
||||||
|
{ label: 'None', value: null },
|
||||||
|
{ label: 'Wood', value: 'wood' },
|
||||||
|
{ label: 'Concrete', value: 'concrete' },
|
||||||
|
]" :modelValue="options.ceiling.material" @update:modelValue="v => { update({ ceiling: { ...options.ceiling, material: v } }); }"
|
||||||
|
>
|
||||||
|
<template #label>wallpaper</template>
|
||||||
|
</MkSelect>
|
||||||
|
<MkInput :modelValue="getHex(options.ceiling.color)" type="color" @update:modelValue="v => { const c = getRgb(v); if (c != null) update({ ceiling: { ...options.ceiling, color: c } }); }">
|
||||||
|
<template #label>color</template>
|
||||||
|
</MkInput>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -48,6 +63,10 @@ const props = defineProps<{
|
|||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'update', v: SimpleHeyaOptions): void;
|
(ev: 'update', v: SimpleHeyaOptions): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
function update(v: Partial<SimpleHeyaOptions>) {
|
||||||
|
emit('update', { ...props.options, ...v });
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ export class SimpleHeyaManager extends HeyaManager<SimpleHeyaOptions> {
|
|||||||
w: BABYLON.PBRMaterial;
|
w: BABYLON.PBRMaterial;
|
||||||
e: BABYLON.PBRMaterial;
|
e: BABYLON.PBRMaterial;
|
||||||
} | null = null;
|
} | null = null;
|
||||||
|
private ceilingMaterial: BABYLON.PBRMaterial | null = null;
|
||||||
|
|
||||||
constructor(onMeshUpdatedCallback?: ((meshes: BABYLON.AbstractMesh[]) => void) | null) {
|
constructor(onMeshUpdatedCallback?: ((meshes: BABYLON.AbstractMesh[]) => void) | null) {
|
||||||
super(onMeshUpdatedCallback);
|
super(onMeshUpdatedCallback);
|
||||||
@@ -144,6 +145,8 @@ export class SimpleHeyaManager extends HeyaManager<SimpleHeyaOptions> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.ceilingMaterial = findMaterial(this.meshes[0], '__X_CEILING__');
|
||||||
|
|
||||||
await this.applyOptions(options);
|
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);
|
this.onMeshUpdatedCallback?.(this.meshes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user