mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-18 16:35:30 +02:00
wip
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject, WORLD_SCALE } from '../engine.js';
|
||||
import { defineObject } from '../engine.js';
|
||||
import { createPlaneUvMapper } from '../utility.js';
|
||||
|
||||
export const allInOnePc = defineObject({
|
||||
@@ -47,7 +47,11 @@ export const allInOnePc = defineObject({
|
||||
},
|
||||
placement: 'top',
|
||||
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);
|
||||
const matrix = model.root.getWorldMatrix(true);
|
||||
const scale = new BABYLON.Vector3();
|
||||
matrix.decompose(scale);
|
||||
|
||||
const light = new BABYLON.SpotLight('', new BABYLON.Vector3(0/*cm*/, 30/*cm*/ / 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 = 100/*cm*/;
|
||||
|
||||
Reference in New Issue
Block a user