1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-19 22:55:29 +02:00
This commit is contained in:
syuilo
2026-04-05 17:15:19 +09:00
parent bd0e6f3268
commit 07d57b0edd
5 changed files with 21 additions and 7 deletions

View File

@@ -4,7 +4,7 @@
*/
import * as BABYLON from '@babylonjs/core';
import { defineObject } from '../engine.js';
import { defineObject, WORLD_SCALE } from '../engine.js';
import { createPlaneUvMapper } from '../utility.js';
export const allInOnePc = defineObject({
@@ -46,7 +46,13 @@ export const allInOnePc = defineObject({
},
},
placement: 'top',
createInstance: async ({ scene, options, model }) => {
createInstance: async ({ room, scene, options, model }) => {
const light = new BABYLON.SpotLight('', new BABYLON.Vector3(0/*cm*/, 30/*cm*/ / WORLD_SCALE, 0), new BABYLON.Vector3(0, 0, 1), Math.PI / 1, 2, scene, room?.lightContainer != null);
light.parent = model.root;
light.diffuse = new BABYLON.Color3(1.0, 1.0, 1.0);
light.range = 999/*cm*/;
if (room?.lightContainer != null) room.lightContainer.addLight(light);
const screenMesh = model.findMesh('__X_SCREEN__');
const bodyMaterial = model.findMaterial('__X_BODY__');
@@ -96,6 +102,7 @@ export const allInOnePc = defineObject({
const applyScreenBrightness = () => {
const b = options.screenBrightness;
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
light.intensity = 50000 * b;
};
applyScreenBrightness();