This commit is contained in:
syuilo
2026-03-02 13:00:43 +09:00
parent 3f0c4b0577
commit 01385575fd
4 changed files with 31 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ import { allInOnePc } from './objects/allInOnePc.js';
import { aquarium } from './objects/aquarium.js';
import { aromaReedDiffuser } from './objects/aromaReedDiffuser.js';
import { banknote } from './objects/banknote.js';
import { beamLamp } from './objects/beamLamp.js';
import { bed } from './objects/bed.js';
import { blind } from './objects/blind.js';
import { book } from './objects/book.js';
@@ -62,6 +63,7 @@ export const OBJECT_DEFS = [
aquarium,
aromaReedDiffuser,
banknote,
beamLamp,
bed,
blind,
book,

View File

@@ -0,0 +1,29 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import * as BABYLON from '@babylonjs/core';
import { defineObject } from '../engine.js';
export const beamLamp = defineObject({
id: 'beamLamp',
name: 'Beam Lamp',
options: {
schema: {},
default: {},
},
placement: 'top',
createInstance: ({ root, room }) => {
return {
onInited: () => {
const light = new BABYLON.PointLight('beamLampLight', new BABYLON.Vector3(0, 10/*cm*/, 0), room.scene);
light.parent = root;
light.diffuse = new BABYLON.Color3(1.0, 0.5, 0.2);
light.intensity = 300;
light.range = 100/*cm*/;
},
interactions: {},
};
},
});