mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-23 02:53:58 +02:00
wip
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user