1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-23 02:53:58 +02:00
This commit is contained in:
syuilo
2026-05-04 09:14:58 +09:00
parent 49ee15dd9a
commit 015e6d1c81
15 changed files with 50 additions and 26 deletions

View File

@@ -6,6 +6,7 @@
import * as BABYLON from '@babylonjs/core';
import { defineObject } from '../object.js';
import { cm, WORLD_SCALE, createPlaneUvMapper } from '../../utility.js';
import { getLightRangeFactorByGraphicsQuality } from '../utility.js';
export const allInOnePc = defineObject({
id: 'allInOnePc',
@@ -47,7 +48,7 @@ export const allInOnePc = defineObject({
},
placement: 'top',
hasTexture: true,
createInstance: async ({ room, scene, options, model }) => {
createInstance: async ({ room, scene, options, model, graphicsQuality }) => {
const matrix = model.root.getWorldMatrix(true);
const scale = new BABYLON.Vector3();
matrix.decompose(scale);
@@ -55,7 +56,7 @@ export const allInOnePc = defineObject({
const light = new BABYLON.SpotLight('', new BABYLON.Vector3(cm(0), cm(30) / Math.abs(scale.y), 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 = cm(100);
light.range = cm(100) * getLightRangeFactorByGraphicsQuality(graphicsQuality);
light.radius = cm(20);
if (room?.lightContainer != null) room.lightContainer.addLight(light);