1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-13 15:15:45 +02:00
This commit is contained in:
syuilo
2026-03-26 20:27:10 +09:00
parent 7f5858a66f
commit 42c7a483a4
2 changed files with 5 additions and 5 deletions

View File

@@ -15,11 +15,11 @@ export const tv = defineObject({
default: {},
},
placement: 'top',
createInstance: ({ scene, root }) => {
createInstance: ({ room, root }) => {
const screenMesh = root.getChildMeshes().find(m => m.name.includes('__TV_SCREEN__')) as BABYLON.Mesh;
screenMesh.markVerticesDataAsUpdatable(BABYLON.VertexBuffer.UVKind, true);
initTv(scene, screenMesh);
initTv(room, screenMesh);
return {
interactions: {},

View File

@@ -278,15 +278,15 @@ const TV_PROGRAMS = {
let tvScreenMaterial: BABYLON.StandardMaterial | null = null;
export function initTv(scene: BABYLON.Scene, screenMesh: BABYLON.Mesh) {
export function initTv(room: RoomEngine, screenMesh: BABYLON.Mesh) {
const tvProgramId = 'shopping';
const tvProgram = TV_PROGRAMS[tvProgramId];
if (tvScreenMaterial == null) {
tvScreenMaterial = new BABYLON.StandardMaterial('tvScreenMaterial', scene);
tvScreenMaterial = new BABYLON.StandardMaterial('tvScreenMaterial', room.scene);
tvScreenMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0);
tvScreenMaterial.ambientColor = new BABYLON.Color3(0, 0, 0);
tvScreenMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
tvScreenMaterial.emissiveTexture = new BABYLON.Texture(`/client-assets/room/tv/${tvProgramId}/${tvProgramId}.png`, scene, false, false);
tvScreenMaterial.emissiveTexture = new BABYLON.Texture(`/client-assets/room/tv/${tvProgramId}/${tvProgramId}.png`, room.scene, false, false);
tvScreenMaterial.emissiveTexture.level = 0.5;
tvScreenMaterial.emissiveColor = new BABYLON.Color3(0.4, 0.4, 0.4);
tvScreenMaterial.freeze();