mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-25 05:04:08 +02: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 { a4Case } from './objects/a4Case.js';
|
||||||
import { aircon } from './objects/aircon.js';
|
import { aircon } from './objects/aircon.js';
|
||||||
import { aquarium } from './objects/aquarium.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 { banknote } from './objects/banknote.js';
|
||||||
import { bed } from './objects/bed.js';
|
import { bed } from './objects/bed.js';
|
||||||
import { blind } from './objects/blind.js';
|
import { blind } from './objects/blind.js';
|
||||||
@@ -27,6 +27,7 @@ import { letterCase } from './objects/letterCase.js';
|
|||||||
import { milk } from './objects/milk.js';
|
import { milk } from './objects/milk.js';
|
||||||
import { mixer } from './objects/mixer.js';
|
import { mixer } from './objects/mixer.js';
|
||||||
import { monitor } from './objects/monitor.js';
|
import { monitor } from './objects/monitor.js';
|
||||||
|
import { monitorSpeaker } from './objects/monitorSpeaker.js';
|
||||||
import { monstera } from './objects/monstera.js';
|
import { monstera } from './objects/monstera.js';
|
||||||
import { mug } from './objects/mug.js';
|
import { mug } from './objects/mug.js';
|
||||||
import { openedCardboardBox } from './objects/openedCardboardBox.js';
|
import { openedCardboardBox } from './objects/openedCardboardBox.js';
|
||||||
@@ -53,7 +54,7 @@ export const OBJECT_DEFS = [
|
|||||||
a4Case,
|
a4Case,
|
||||||
aircon,
|
aircon,
|
||||||
aquarium,
|
aquarium,
|
||||||
aromaReadDiffuser,
|
aromaReedDiffuser,
|
||||||
banknote,
|
banknote,
|
||||||
bed,
|
bed,
|
||||||
blind,
|
blind,
|
||||||
@@ -74,6 +75,7 @@ export const OBJECT_DEFS = [
|
|||||||
milk,
|
milk,
|
||||||
mixer,
|
mixer,
|
||||||
monitor,
|
monitor,
|
||||||
|
monitorSpeaker,
|
||||||
monstera,
|
monstera,
|
||||||
mug,
|
mug,
|
||||||
openedCardboardBox,
|
openedCardboardBox,
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
import * as BABYLON from '@babylonjs/core';
|
import * as BABYLON from '@babylonjs/core';
|
||||||
import { defineObject } from '../engine.js';
|
import { defineObject } from '../engine.js';
|
||||||
|
|
||||||
export const aromaReadDiffuser = defineObject({
|
export const aromaReedDiffuser = defineObject({
|
||||||
id: 'aromaReadDiffuser',
|
id: 'aromaReedDiffuser',
|
||||||
name: 'Aroma Read Diffuser',
|
name: 'Aroma Reed Diffuser',
|
||||||
options: {
|
options: {
|
||||||
schema: {
|
schema: {
|
||||||
bottleColor: {
|
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',
|
name: 'Speaker',
|
||||||
options: {
|
options: {
|
||||||
schema: {
|
schema: {
|
||||||
color: {
|
outerColor: {
|
||||||
type: 'color',
|
type: 'color',
|
||||||
label: 'Color',
|
label: 'Outer Color',
|
||||||
|
},
|
||||||
|
innerColor: {
|
||||||
|
type: 'color',
|
||||||
|
label: 'Inner Color',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: {
|
default: {
|
||||||
color: [0, 0, 0],
|
outerColor: [0.45, 0.8, 0],
|
||||||
|
innerColor: [0, 0, 0],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
createInstance: ({ options, root }) => {
|
createInstance: ({ options, root }) => {
|
||||||
const bodyMesh = root.getChildMeshes().find(m => m.name.includes('__X_BODY__')) as BABYLON.Mesh;
|
const outerMesh = root.getChildMeshes().find(m => m.name.includes('__X_COVER__')) as BABYLON.Mesh;
|
||||||
const bodyMaterial = bodyMesh.material as BABYLON.PBRMaterial;
|
const outerMaterial = outerMesh.material as BABYLON.PBRMaterial;
|
||||||
|
|
||||||
const applyColor = () => {
|
const innerMesh = root.getChildMeshes().find(m => m.name.includes('__X_BODY__')) as BABYLON.Mesh;
|
||||||
const [r, g, b] = options.color;
|
const innerMaterial = innerMesh.material as BABYLON.PBRMaterial;
|
||||||
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
|
||||||
|
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 {
|
return {
|
||||||
onOptionsUpdated: ([k, v]) => {
|
onOptionsUpdated: ([k, v]) => {
|
||||||
applyColor();
|
applyOuterColor();
|
||||||
|
applyInnerColor();
|
||||||
},
|
},
|
||||||
interactions: {},
|
interactions: {},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user