mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-15 20:55:46 +02:00
wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -46,6 +46,7 @@ import { openedCardboardBox } from './objects/openedCardboardBox.js';
|
||||
import { pachira } from './objects/pachira.js';
|
||||
import { pc } from './objects/pc.js';
|
||||
import { petBottle } from './objects/petBottle.js';
|
||||
import { piano } from './objects/piano.js';
|
||||
import { pictureFrame } from './objects/pictureFrame.js';
|
||||
import { plant } from './objects/plant.js';
|
||||
import { plant2 } from './objects/plant2.js';
|
||||
@@ -114,6 +115,7 @@ export const OBJECT_DEFS = [
|
||||
pachira,
|
||||
pc,
|
||||
petBottle,
|
||||
piano,
|
||||
pictureFrame,
|
||||
plant,
|
||||
plant2,
|
||||
|
||||
41
packages/frontend/src/utility/room/objects/piano.ts
Normal file
41
packages/frontend/src/utility/room/objects/piano.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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 piano = defineObject({
|
||||
id: 'piano',
|
||||
name: 'Piano',
|
||||
options: {
|
||||
schema: {
|
||||
bodyColor: {
|
||||
type: 'color',
|
||||
label: 'bodyColor',
|
||||
},
|
||||
},
|
||||
default: {
|
||||
bodyColor: [0, 0, 0],
|
||||
},
|
||||
},
|
||||
placement: 'floor',
|
||||
createInstance: ({ options, model }) => {
|
||||
const bodyMaterial = model.findMaterial('__X_BODY__');
|
||||
|
||||
const applyBodyColor = () => {
|
||||
const [r, g, b] = options.bodyColor;
|
||||
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
};
|
||||
|
||||
applyBodyColor();
|
||||
|
||||
return {
|
||||
onOptionsUpdated: ([k, v]) => {
|
||||
applyBodyColor();
|
||||
},
|
||||
interactions: {},
|
||||
};
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user