mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-05 17:34:10 +02:00
pc
This commit is contained in:
Binary file not shown.
BIN
packages/frontend/assets/room/objects/desktop-pc/desktop-pc.glb
Normal file
BIN
packages/frontend/assets/room/objects/desktop-pc/desktop-pc.glb
Normal file
Binary file not shown.
@@ -22,6 +22,7 @@ import { colorBox } from './objects/colorBox.js';
|
|||||||
import { cupNoodle } from './objects/cupNoodle.js';
|
import { cupNoodle } from './objects/cupNoodle.js';
|
||||||
import { debugHipoly } from './objects/debugHipoly.js';
|
import { debugHipoly } from './objects/debugHipoly.js';
|
||||||
import { desk } from './objects/desk.js';
|
import { desk } from './objects/desk.js';
|
||||||
|
import { desktopPc } from './objects/desktopPc.js';
|
||||||
import { ductTape } from './objects/ductTape.js';
|
import { ductTape } from './objects/ductTape.js';
|
||||||
import { emptyBento } from './objects/emptyBento.js';
|
import { emptyBento } from './objects/emptyBento.js';
|
||||||
import { energyDrink } from './objects/energyDrink.js';
|
import { energyDrink } from './objects/energyDrink.js';
|
||||||
@@ -83,6 +84,7 @@ export const OBJECT_DEFS = [
|
|||||||
colorBox,
|
colorBox,
|
||||||
cupNoodle,
|
cupNoodle,
|
||||||
desk,
|
desk,
|
||||||
|
desktopPc,
|
||||||
ductTape,
|
ductTape,
|
||||||
emptyBento,
|
emptyBento,
|
||||||
energyDrink,
|
energyDrink,
|
||||||
|
|||||||
85
packages/frontend/src/utility/room/objects/desktopPc.ts
Normal file
85
packages/frontend/src/utility/room/objects/desktopPc.ts
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
/*
|
||||||
|
* 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 desktopPc = defineObject({
|
||||||
|
id: 'desktopPc',
|
||||||
|
name: 'Desktop PC',
|
||||||
|
options: {
|
||||||
|
schema: {
|
||||||
|
bodyColor: {
|
||||||
|
type: 'color',
|
||||||
|
label: 'Body color',
|
||||||
|
},
|
||||||
|
coverColor: {
|
||||||
|
type: 'color',
|
||||||
|
label: 'Cover color',
|
||||||
|
},
|
||||||
|
innerColor: {
|
||||||
|
type: 'color',
|
||||||
|
label: 'Inner color',
|
||||||
|
},
|
||||||
|
ledColor: {
|
||||||
|
type: 'color',
|
||||||
|
label: 'LED color',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: {
|
||||||
|
bodyColor: [0.05, 0.05, 0.05],
|
||||||
|
coverColor: [0.5, 0.9, 0],
|
||||||
|
innerColor: [1, 1, 1],
|
||||||
|
ledColor: [0.5, 0.9, 0],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
placement: 'top',
|
||||||
|
createInstance: ({ options, model }) => {
|
||||||
|
const bodyMaterial = model.findMaterial('__X_BODY__');
|
||||||
|
const coverMaterial = model.findMaterial('__X_COVER__');
|
||||||
|
const innerMaterial = model.findMaterial('__X_INNER__');
|
||||||
|
const ledMaterial = model.findMaterial('__X_LED__');
|
||||||
|
|
||||||
|
ledMaterial.emissiveIntensity = 10;
|
||||||
|
|
||||||
|
const applyBodyColor = () => {
|
||||||
|
const [r, g, b] = options.bodyColor;
|
||||||
|
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||||
|
};
|
||||||
|
|
||||||
|
applyBodyColor();
|
||||||
|
|
||||||
|
const applyCoverColor = () => {
|
||||||
|
const [r, g, b] = options.coverColor;
|
||||||
|
coverMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||||
|
};
|
||||||
|
|
||||||
|
applyCoverColor();
|
||||||
|
|
||||||
|
const applyInnerColor = () => {
|
||||||
|
const [r, g, b] = options.innerColor;
|
||||||
|
innerMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||||
|
};
|
||||||
|
|
||||||
|
applyInnerColor();
|
||||||
|
|
||||||
|
const applyLedColor = () => {
|
||||||
|
const [r, g, b] = options.ledColor;
|
||||||
|
ledMaterial.emissiveColor = new BABYLON.Color3(r, g, b);
|
||||||
|
};
|
||||||
|
|
||||||
|
applyLedColor();
|
||||||
|
|
||||||
|
return {
|
||||||
|
onOptionsUpdated: ([k, v]) => {
|
||||||
|
applyBodyColor();
|
||||||
|
applyCoverColor();
|
||||||
|
applyInnerColor();
|
||||||
|
applyLedColor();
|
||||||
|
},
|
||||||
|
interactions: {},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user