mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-23 00:34:14 +02:00
wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -3,21 +3,43 @@
|
|||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import * as BABYLON from '@babylonjs/core';
|
||||||
import { defineObject } from '../object.js';
|
import { defineObject } from '../object.js';
|
||||||
|
|
||||||
export const pachira = defineObject({
|
export const pachira = defineObject({
|
||||||
id: 'pachira',
|
id: 'pachira',
|
||||||
name: 'Pachira',
|
name: 'Pachira',
|
||||||
options: {
|
options: {
|
||||||
schema: {},
|
schema: {
|
||||||
default: {},
|
potColor: {
|
||||||
|
type: 'color',
|
||||||
|
label: 'potColor',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: {
|
||||||
|
potColor: [0.8, 0.8, 0.8],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
hasCollisions: true,
|
hasCollisions: false,
|
||||||
hasTexture: true,
|
hasTexture: true,
|
||||||
canPreMeshesMerging: true,
|
canPreMeshesMerging: true,
|
||||||
createInstance: () => {
|
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 {
|
return {
|
||||||
|
onOptionsUpdated: ([k, v]) => {
|
||||||
|
switch (k) {
|
||||||
|
case 'potColor': applyPotColor(); break;
|
||||||
|
}
|
||||||
|
},
|
||||||
interactions: {},
|
interactions: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user