mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-26 12:34:30 +02:00
wip
This commit is contained in:
@@ -15,11 +15,11 @@ export const tv = defineObject({
|
|||||||
default: {},
|
default: {},
|
||||||
},
|
},
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
createInstance: ({ scene, root }) => {
|
createInstance: ({ room, root }) => {
|
||||||
const screenMesh = root.getChildMeshes().find(m => m.name.includes('__TV_SCREEN__')) as BABYLON.Mesh;
|
const screenMesh = root.getChildMeshes().find(m => m.name.includes('__TV_SCREEN__')) as BABYLON.Mesh;
|
||||||
screenMesh.markVerticesDataAsUpdatable(BABYLON.VertexBuffer.UVKind, true);
|
screenMesh.markVerticesDataAsUpdatable(BABYLON.VertexBuffer.UVKind, true);
|
||||||
|
|
||||||
initTv(scene, screenMesh);
|
initTv(room, screenMesh);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
interactions: {},
|
interactions: {},
|
||||||
|
|||||||
@@ -278,15 +278,15 @@ const TV_PROGRAMS = {
|
|||||||
|
|
||||||
let tvScreenMaterial: BABYLON.StandardMaterial | null = null;
|
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 tvProgramId = 'shopping';
|
||||||
const tvProgram = TV_PROGRAMS[tvProgramId];
|
const tvProgram = TV_PROGRAMS[tvProgramId];
|
||||||
if (tvScreenMaterial == null) {
|
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.diffuseColor = new BABYLON.Color3(0, 0, 0);
|
||||||
tvScreenMaterial.ambientColor = new BABYLON.Color3(0, 0, 0);
|
tvScreenMaterial.ambientColor = new BABYLON.Color3(0, 0, 0);
|
||||||
tvScreenMaterial.specularColor = 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.emissiveTexture.level = 0.5;
|
||||||
tvScreenMaterial.emissiveColor = new BABYLON.Color3(0.4, 0.4, 0.4);
|
tvScreenMaterial.emissiveColor = new BABYLON.Color3(0.4, 0.4, 0.4);
|
||||||
tvScreenMaterial.freeze();
|
tvScreenMaterial.freeze();
|
||||||
|
|||||||
Reference in New Issue
Block a user