mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-13 18:45:35 +02:00
wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,20 +3,43 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../object.js';
|
||||
|
||||
export const monstera = defineObject({
|
||||
id: 'monstera',
|
||||
name: 'Monstera',
|
||||
options: {
|
||||
schema: {},
|
||||
default: {},
|
||||
schema: {
|
||||
potColor: {
|
||||
type: 'color',
|
||||
label: 'potColor',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
potColor: [0.5, 0.5, 0.5],
|
||||
},
|
||||
},
|
||||
placement: 'top',
|
||||
hasCollisions: false,
|
||||
hasTexture: true,
|
||||
createInstance: () => {
|
||||
canPreMeshesMerging: true,
|
||||
createInstance: ({ options, model }) => {
|
||||
const potMaterial = model.findMaterial('__X_POT__');
|
||||
|
||||
const applyPotColor = () => {
|
||||
const [r, g, b] = options.potColor;
|
||||
potMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyPotColor();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
switch (k) {
|
||||
case 'potColor': applyPotColor(); break;
|
||||
}
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
},
|
||||
|
||||
@@ -3,20 +3,43 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../object.js';
|
||||
|
||||
export const snakeplant = defineObject({
|
||||
id: 'snakeplant',
|
||||
name: 'Snake Plant',
|
||||
options: {
|
||||
schema: {},
|
||||
default: {},
|
||||
schema: {
|
||||
potColor: {
|
||||
type: 'color',
|
||||
label: 'potColor',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
potColor: [0.7, 0.7, 0.7],
|
||||
},
|
||||
},
|
||||
placement: 'top',
|
||||
hasCollisions: false,
|
||||
hasTexture: true,
|
||||
createInstance: () => {
|
||||
canPreMeshesMerging: true,
|
||||
createInstance: ({ options, model }) => {
|
||||
const potMaterial = model.findMaterial('__X_POT__');
|
||||
|
||||
const applyPotColor = () => {
|
||||
const [r, g, b] = options.potColor;
|
||||
potMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyPotColor();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
switch (k) {
|
||||
case 'potColor': applyPotColor(); break;
|
||||
}
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user