1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-27 06:04:35 +02:00
This commit is contained in:
syuilo
2026-02-26 14:24:58 +09:00
parent a8456a45ab
commit 4d37ada54d
9 changed files with 100 additions and 4 deletions

View File

@@ -3,18 +3,38 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import * as BABYLON from '@babylonjs/core';
import { defineObject } from '../engine.js';
export const desk = defineObject({
id: 'desk',
name: 'Desk',
options: {
schema: {},
default: {},
schema: {
topColor: {
type: 'color',
label: 'Top color',
},
},
default: {
topColor: [0, 0, 0],
},
},
placement: 'floor',
createInstance: () => {
createInstance: ({ options, findMaterial }) => {
const topMaterial = findMaterial('__X_BODY__');
const applyTopColor = () => {
const [r, g, b] = options.topColor;
topMaterial.albedoColor = new BABYLON.Color3(r, g, b);
};
applyTopColor();
return {
onOptionsUpdated: ([k, v]) => {
applyTopColor();
},
interactions: {},
};
},