mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-03-21 03:30:42 +00:00
wip
This commit is contained in:
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,7 +6,7 @@
|
||||
import { a4Case } from './objects/a4Case.js';
|
||||
import { aircon } from './objects/aircon.js';
|
||||
import { aquarium } from './objects/aquarium.js';
|
||||
import { aromaReadDiffuser } from './objects/aromaReadDiffuser.js';
|
||||
import { aromaReedDiffuser } from './objects/aromaReedDiffuser.js';
|
||||
import { banknote } from './objects/banknote.js';
|
||||
import { bed } from './objects/bed.js';
|
||||
import { blind } from './objects/blind.js';
|
||||
@@ -27,6 +27,7 @@ import { letterCase } from './objects/letterCase.js';
|
||||
import { milk } from './objects/milk.js';
|
||||
import { mixer } from './objects/mixer.js';
|
||||
import { monitor } from './objects/monitor.js';
|
||||
import { monitorSpeaker } from './objects/monitorSpeaker.js';
|
||||
import { monstera } from './objects/monstera.js';
|
||||
import { mug } from './objects/mug.js';
|
||||
import { openedCardboardBox } from './objects/openedCardboardBox.js';
|
||||
@@ -53,7 +54,7 @@ export const OBJECT_DEFS = [
|
||||
a4Case,
|
||||
aircon,
|
||||
aquarium,
|
||||
aromaReadDiffuser,
|
||||
aromaReedDiffuser,
|
||||
banknote,
|
||||
bed,
|
||||
blind,
|
||||
@@ -74,6 +75,7 @@ export const OBJECT_DEFS = [
|
||||
milk,
|
||||
mixer,
|
||||
monitor,
|
||||
monitorSpeaker,
|
||||
monstera,
|
||||
mug,
|
||||
openedCardboardBox,
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
|
||||
export const aromaReadDiffuser = defineObject({
|
||||
id: 'aromaReadDiffuser',
|
||||
name: 'Aroma Read Diffuser',
|
||||
export const aromaReedDiffuser = defineObject({
|
||||
id: 'aromaReedDiffuser',
|
||||
name: 'Aroma Reed Diffuser',
|
||||
options: {
|
||||
schema: {
|
||||
bottleColor: {
|
||||
42
packages/frontend/src/utility/room/objects/monitorSpeaker.ts
Normal file
42
packages/frontend/src/utility/room/objects/monitorSpeaker.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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 monitorSpeaker = defineObject({
|
||||
id: 'monitorSpeaker',
|
||||
name: 'Monitor Speaker',
|
||||
options: {
|
||||
schema: {
|
||||
color: {
|
||||
type: 'color',
|
||||
label: 'Color',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
color: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
placement: 'top',
|
||||
createInstance: ({ options, root }) => {
|
||||
const bodyMesh = root.getChildMeshes().find(m => m.name.includes('__X_BODY__')) as BABYLON.Mesh;
|
||||
const bodyMaterial = bodyMesh.material as BABYLON.PBRMaterial;
|
||||
|
||||
const applyColor = () => {
|
||||
const [r, g, b] = options.color;
|
||||
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyColor();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
applyColor();
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
},
|
||||
});
|
||||
@@ -11,30 +11,45 @@ export const speaker = defineObject({
|
||||
name: 'Speaker',
|
||||
options: {
|
||||
schema: {
|
||||
color: {
|
||||
outerColor: {
|
||||
type: 'color',
|
||||
label: 'Color',
|
||||
label: 'Outer Color',
|
||||
},
|
||||
innerColor: {
|
||||
type: 'color',
|
||||
label: 'Inner Color',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
color: [0, 0, 0],
|
||||
outerColor: [0.45, 0.8, 0],
|
||||
innerColor: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
placement: 'top',
|
||||
createInstance: ({ options, root }) => {
|
||||
const bodyMesh = root.getChildMeshes().find(m => m.name.includes('__X_BODY__')) as BABYLON.Mesh;
|
||||
const bodyMaterial = bodyMesh.material as BABYLON.PBRMaterial;
|
||||
const outerMesh = root.getChildMeshes().find(m => m.name.includes('__X_COVER__')) as BABYLON.Mesh;
|
||||
const outerMaterial = outerMesh.material as BABYLON.PBRMaterial;
|
||||
|
||||
const applyColor = () => {
|
||||
const [r, g, b] = options.color;
|
||||
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
const innerMesh = root.getChildMeshes().find(m => m.name.includes('__X_BODY__')) as BABYLON.Mesh;
|
||||
const innerMaterial = innerMesh.material as BABYLON.PBRMaterial;
|
||||
|
||||
const applyOuterColor = () => {
|
||||
const [r, g, b] = options.outerColor;
|
||||
outerMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyColor();
|
||||
const applyInnerColor = () => {
|
||||
const [r, g, b] = options.innerColor;
|
||||
innerMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyOuterColor();
|
||||
applyInnerColor();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
applyColor();
|
||||
applyOuterColor();
|
||||
applyInnerColor();
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user