1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-27 08:24:26 +02:00
This commit is contained in:
syuilo
2026-02-22 09:08:50 +09:00
parent dcae3ccaaa
commit c5eaf0f7af
8 changed files with 134 additions and 103 deletions

View File

@@ -3,18 +3,37 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import * as BABYLON from '@babylonjs/core';
import { defineObject } from '../engine.js';
export const petBottle = defineObject({
id: 'petBottle',
name: 'PET Bottle',
options: {
schema: {},
default: {},
schema: {
withCap: {
type: 'boolean',
label: 'With Cap',
},
},
default: {
withCap: true,
},
},
placement: 'top',
createInstance: () => {
createInstance: ({ root, options }) => {
const capMesh = root.getChildMeshes().find(m => m.name.includes('__X_CAP__')) as BABYLON.Mesh;
const applyWithCap = () => {
capMesh.setEnabled(options.withCap);
};
applyWithCap();
return {
onOptionsUpdated: ([k, v]) => {
applyWithCap();
},
interactions: {},
};
},

View File

@@ -3,7 +3,9 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import * as BABYLON from '@babylonjs/core';
import { defineObject } from '../engine.js';
import { initTv } from '../utility.js';
export const tv = defineObject({
id: 'tv',
@@ -13,7 +15,12 @@ export const tv = defineObject({
default: {},
},
placement: 'top',
createInstance: () => {
createInstance: ({ room, root }) => {
const screenMesh = root.getChildMeshes().find(m => m.name.includes('__TV_SCREEN__')) as BABYLON.Mesh;
screenMesh.markVerticesDataAsUpdatable(BABYLON.VertexBuffer.UVKind, true);
initTv(room, screenMesh);
return {
interactions: {},
};