mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-15 04:35:34 +02:00
wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -3,18 +3,53 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
|
||||
export const woodRingFloorLamp = defineObject({
|
||||
id: 'woodRingFloorLamp',
|
||||
name: 'Wood Ring Floor Lamp',
|
||||
options: {
|
||||
schema: {},
|
||||
default: {},
|
||||
schema: {
|
||||
shadeColor: {
|
||||
type: 'color',
|
||||
label: 'Shade color',
|
||||
},
|
||||
bodyColor: {
|
||||
type: 'color',
|
||||
label: 'Body color',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
shadeColor: [0.21, 0.04, 0],
|
||||
bodyColor: [0.05, 0.05, 0.05],
|
||||
},
|
||||
},
|
||||
placement: 'floor',
|
||||
createInstance: () => {
|
||||
createInstance: ({ options, findMaterial }) => {
|
||||
const shadeMaterial = findMaterial('__X_SHADE__');
|
||||
|
||||
const applyShadeColor = () => {
|
||||
const [r, g, b] = options.shadeColor;
|
||||
shadeMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyShadeColor();
|
||||
|
||||
const bodyMaterial = findMaterial('__X_BODY__');
|
||||
|
||||
const applyBodyColor = () => {
|
||||
const [r, g, b] = options.bodyColor;
|
||||
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyBodyColor();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
applyShadeColor();
|
||||
applyBodyColor();
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user