1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-06-21 19:34:52 +02:00

update ceiling-fan-light

This commit is contained in:
syuilo
2026-06-07 16:59:09 +09:00
parent 004ef368c2
commit cc8e6a2e92
7 changed files with 25 additions and 2 deletions

View File

@@ -3700,6 +3700,7 @@ _miRoom:
ceilingFanLight: "シーリングファンライト"
_ceilingFanLight:
shadeMat: "シェードの素材"
bodyMat: "本体の素材"
chair: "椅子"
_chair:
primaryMat: "メインの素材"

View File

@@ -4,8 +4,8 @@
*/
import * as BABYLON from '@babylonjs/core/pure.js';
import { defineFuniture } from '../furniture.js';
import { ceilingFanLight_schema } from 'misskey-world/src/room/furnitures/ceilingFanLight.schema.js';
import { defineFuniture } from '../furniture.js';
export const ceilingFanLight = defineFuniture(ceilingFanLight_schema, {
createInstance: ({ options, sr, scene, model }) => {
@@ -19,7 +19,17 @@ export const ceilingFanLight = defineFuniture(ceilingFanLight_schema, {
applyShadeMat();
const rotor = model.findMesh('Rotor');
const bodyMaterial = model.findMaterial('__X_BODY__');
const applyBodyMat = () => {
bodyMaterial.albedoColor = new BABYLON.Color3(options.bodyMat.color[0], options.bodyMat.color[1], options.bodyMat.color[2]);
bodyMaterial.roughness = options.bodyMat.roughness;
bodyMaterial.metallic = options.bodyMat.metallic;
};
applyBodyMat();
const rotor = model.findMesh('__X_ROTOR__');
model.bakeExcludeMeshes = [rotor, ...rotor.getChildMeshes()];
let animationObserver: BABYLON.Observer<BABYLON.Scene>;
@@ -41,6 +51,7 @@ export const ceilingFanLight = defineFuniture(ceilingFanLight_schema, {
onOptionsUpdated: ([k, v]) => {
switch (k) {
case 'shadeMat': applyShadeMat(); break;
case 'bodyMat': applyBodyMat(); break;
}
},
interactions: {},

View File

@@ -13,5 +13,8 @@ export const ceilingFanLight_ui = defineFurnitureUi<typeof ceilingFanLight_schem
shadeMat: {
label: i18n.ts._miRoom._furnitures._ceilingFanLight.shadeMat,
},
bodyMat: {
label: i18n.ts._miRoom._furnitures._ceilingFanLight.bodyMat,
},
},
});

View File

@@ -13782,6 +13782,10 @@ export interface Locale extends ILocale {
* シェードの素材
*/
"shadeMat": string;
/**
* 本体の素材
*/
"bodyMat": string;
};
/**
* 椅子

View File

@@ -11,9 +11,13 @@ export const ceilingFanLight_schema = defineFurnitureSchema({
shadeMat: {
type: 'material',
},
bodyMat: {
type: 'material',
},
},
default: {
shadeMat: { color: [0.8, 0.19, 0], roughness: 0.5, metallic: 0 },
bodyMat: { color: [0.9, 0.9, 0.9], roughness: 0, metallic: 1 },
},
},
placement: 'ceiling',