mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-24 01:04:16 +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
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import * as BABYLON from '@babylonjs/core';
|
||||||
import { defineObject } from '../engine.js';
|
import { defineObject } from '../engine.js';
|
||||||
|
|
||||||
export const woodRingFloorLamp = defineObject({
|
export const woodRingFloorLamp = defineObject({
|
||||||
id: 'woodRingFloorLamp',
|
id: 'woodRingFloorLamp',
|
||||||
name: 'Wood Ring Floor Lamp',
|
name: 'Wood Ring Floor Lamp',
|
||||||
options: {
|
options: {
|
||||||
schema: {},
|
schema: {
|
||||||
default: {},
|
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',
|
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 {
|
return {
|
||||||
|
onOptionsUpdated: ([k, v]) => {
|
||||||
|
applyShadeColor();
|
||||||
|
applyBodyColor();
|
||||||
|
},
|
||||||
interactions: {},
|
interactions: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user