mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-25 17:10:43 +00:00
icosahedron
This commit is contained in:
parent
822b567742
commit
2c8abf8239
4 changed files with 34 additions and 3 deletions
|
|
@ -3717,6 +3717,8 @@ _miRoom:
|
|||
width: "幅"
|
||||
hangingTShirt: "吊り下げTシャツ"
|
||||
icosahedron: "正二十面体"
|
||||
_icosahedron:
|
||||
mat: "素材"
|
||||
ironFrameShelf3: "アイアンフレームシェルフ 3段"
|
||||
ironFrameShelf4: "アイアンフレームシェルフ 4段"
|
||||
ironFrameShelf5: "アイアンフレームシェルフ 5段"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -3,6 +3,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../object.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
|
|
@ -10,13 +11,35 @@ export const icosahedron = defineObject({
|
|||
id: 'icosahedron',
|
||||
name: i18n.ts._miRoom._objects.icosahedron,
|
||||
options: {
|
||||
schema: {},
|
||||
default: {},
|
||||
schema: {
|
||||
mat: {
|
||||
type: 'material',
|
||||
label: i18n.ts._miRoom._objects._icosahedron.mat,
|
||||
},
|
||||
},
|
||||
default: {
|
||||
mat: { color: [0.32, 0.12, 0.05], metallic: 1, roughness: 0.5 },
|
||||
},
|
||||
},
|
||||
placement: 'top',
|
||||
hasCollisions: false,
|
||||
createInstance: () => {
|
||||
createInstance: ({ options, model }) => {
|
||||
const bodyMaterial = model.findMaterial('__X_BODY__');
|
||||
|
||||
const applyMat = () => {
|
||||
bodyMaterial.albedoColor = new BABYLON.Color3(options.mat.color[0], options.mat.color[1], options.mat.color[2]);
|
||||
bodyMaterial.roughness = options.mat.roughness;
|
||||
bodyMaterial.metallic = options.mat.metallic;
|
||||
};
|
||||
|
||||
applyMat();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
switch (k) {
|
||||
case 'mat': applyMat(); break;
|
||||
}
|
||||
},
|
||||
interactions: {},
|
||||
dispose: () => {},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13853,6 +13853,12 @@ export interface Locale extends ILocale {
|
|||
* 正二十面体
|
||||
*/
|
||||
"icosahedron": string;
|
||||
"_icosahedron": {
|
||||
/**
|
||||
* 素材
|
||||
*/
|
||||
"mat": string;
|
||||
};
|
||||
/**
|
||||
* アイアンフレームシェルフ 3段
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue