mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-27 08:24:26 +02:00
wip
This commit is contained in:
@@ -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: {},
|
||||
};
|
||||
},
|
||||
|
||||
@@ -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: {},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user