This commit is contained in:
syuilo
2026-03-05 12:00:14 +09:00
parent bdc34305be
commit ed4e3a51fd
2 changed files with 66 additions and 4 deletions

View File

@@ -204,8 +204,70 @@ function onWheel(ev: WheelEvent) {
}
}
const data = localStorage.getItem('roomData') != null ? JSON.parse(localStorage.getItem('roomData')!) : {
roomType: 'default',
const data = localStorage.getItem('roomData') != null ? { ...JSON.parse(localStorage.getItem('roomData')!), ...{
heya: {
type: 'simple',
options: {
dimension: [300, 300],
window: 'demado',
wallN: {
material: null,
color: [0.9, 0.9, 0.9],
},
wallE: {
material: null,
color: [0.9, 0.9, 0.9],
},
wallS: {
material: null,
color: [0.9, 0.9, 0.9],
},
wallW: {
material: null,
color: [0.9, 0.9, 0.9],
},
flooring: {
material: 'wood',
color: [0.9, 0.9, 0.9],
},
ceiling: {
material: null,
color: [0.9, 0.9, 0.9],
},
},
},
} } : {
heya: {
type: 'simple',
options: {
dimension: [300, 300],
window: 'demado',
wallN: {
material: null,
color: [0.9, 0.9, 0.9],
},
wallE: {
material: null,
color: [0.9, 0.9, 0.9],
},
wallS: {
material: null,
color: [0.9, 0.9, 0.9],
},
wallW: {
material: null,
color: [0.9, 0.9, 0.9],
},
flooring: {
material: 'wood',
color: [0.9, 0.9, 0.9],
},
ceiling: {
material: null,
color: [0.9, 0.9, 0.9],
},
},
},
installedObjects: [{
id: 'a',
type: 'cardboardBox',

View File

@@ -56,7 +56,7 @@ type SimpleHeyaWallBase = {
type Heya = {
type: 'simple';
options: {
size: [number, number];
dimension: [number, number];
window: 'none' | 'kosidakamado' | 'demado' | 'hakidasimado';
wallN: SimpleHeyaWallBase;
wallE: SimpleHeyaWallBase;
@@ -542,7 +542,7 @@ export class RoomEngine {
}
public async init() {
await this.loadRoomModel(this.roomState.roomType);
await this.loadRoomModel(this.roomState.heya.type);
await this.loadEnvModel();
await Promise.all(this.roomState.installedObjects.map(o => this.loadObject({
id: o.id,