mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-28 17:04:37 +02:00
update directory structure
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* 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 aromaReedDiffuser = defineObject({
|
||||
id: 'aromaReedDiffuser',
|
||||
name: 'Aroma Reed Diffuser',
|
||||
options: {
|
||||
schema: {
|
||||
bottleColor: {
|
||||
type: 'color',
|
||||
label: 'Bottle Color',
|
||||
},
|
||||
oilColor: {
|
||||
type: 'color',
|
||||
label: 'Oil Color',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
bottleColor: [1, 0.83, 0.48],
|
||||
oilColor: [1, 0.4, 0],
|
||||
},
|
||||
},
|
||||
placement: 'top',
|
||||
hasCollisions: false,
|
||||
hasTexture: true,
|
||||
canPreMeshesMerging: true,
|
||||
createInstance: ({ options, model }) => {
|
||||
const bottleMaterial = model.findMaterial('__X_BOTTLE__');
|
||||
const oilMaterial = model.findMaterial('__X_OIL__');
|
||||
|
||||
const applyBottleColor = () => {
|
||||
const [r, g, b] = options.bottleColor;
|
||||
bottleMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
const applyOilColor = () => {
|
||||
const [r, g, b] = options.oilColor;
|
||||
oilMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyBottleColor();
|
||||
applyOilColor();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
applyBottleColor();
|
||||
applyOilColor();
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user