1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-20 16:25:36 +02:00
This commit is contained in:
syuilo
2026-04-30 20:52:53 +09:00
parent 6d6ae6728c
commit 722d09b1ae
7 changed files with 75 additions and 28 deletions

View File

@@ -15,6 +15,7 @@ import type { ObjectDef, RoomStateObject } from './object.js';
import * as sound from '@/utility/sound.js';
import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
import { deepEqual } from '@/utility/deep-equal.js';
export type RoomControllerOptions = {
workerMode?: boolean;
@@ -142,6 +143,7 @@ export class RoomController {
});
engineEvents.on('changeRoomState', ({ roomState }) => {
if (deepEqual(this.roomState.value, roomState)) return; // vueのリアクティビティが反応して無限ループになることがあるため
this.roomState.value = roomState;
triggerRef(this.selected);
});

View File

@@ -313,7 +313,7 @@ export class RoomEngine extends EventEmitter {
//this.scene.activeCamera = this.camera;
this.roomLight = new BABYLON.SpotLight('roomLight', new BABYLON.Vector3(0, cm(249), 0), new BABYLON.Vector3(0, -1, 0), 16, 8, this.scene);
this.roomLight.diffuse = roomState.roomLightColor != null ? new BABYLON.Color3(...roomState.roomLightColor) : new BABYLON.Color3(1.0, 0.9, 0.8);
this.roomLight.diffuse = new BABYLON.Color3(...roomState.roomLightColor);
this.roomLight.shadowMinZ = cm(10);
this.roomLight.shadowMaxZ = cm(300);
this.roomLight.radius = cm(30);
@@ -1414,6 +1414,7 @@ export class RoomEngine extends EventEmitter {
}
public updateRoomLightColor(color: [number, number, number]) {
if (this.roomLight.diffuse.equalsFloats(...color)) return;
this.roomLight.diffuse = new BABYLON.Color3(...color);
this.roomState.roomLightColor = color;
this.ev('changeRoomState', { roomState: this.roomState });