mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-13 15:15:45 +02:00
wip
This commit is contained in:
BIN
packages/frontend/assets/room/object-thumbs/aquarium.png
Normal file
BIN
packages/frontend/assets/room/object-thumbs/aquarium.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
BIN
packages/frontend/assets/room/object-thumbs/cuboid.png
Normal file
BIN
packages/frontend/assets/room/object-thumbs/cuboid.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
BIN
packages/frontend/assets/room/object-thumbs/plant2.png
Normal file
BIN
packages/frontend/assets/room/object-thumbs/plant2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
packages/frontend/assets/room/object-thumbs/rolled-up-poster.png
Normal file
BIN
packages/frontend/assets/room/object-thumbs/rolled-up-poster.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
BIN
packages/frontend/assets/room/object-thumbs/tv.png
Normal file
BIN
packages/frontend/assets/room/object-thumbs/tv.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -103,7 +103,6 @@ export const OBJECT_DEFS = [
|
||||
beamLamp,
|
||||
bed,
|
||||
blind,
|
||||
book,
|
||||
books,
|
||||
boxWallShelf,
|
||||
cactusS,
|
||||
@@ -184,7 +183,6 @@ export const OBJECT_DEFS = [
|
||||
woodRingFloorLamp,
|
||||
woodRingsPendantLight,
|
||||
woodSoundAbsorbingPanel,
|
||||
debugHipoly,
|
||||
];
|
||||
|
||||
export function getObjectDef(type: string): typeof OBJECT_DEFS[number] {
|
||||
|
||||
@@ -33,7 +33,7 @@ export const tv = defineObject({
|
||||
placement: 'top',
|
||||
hasCollisions: true,
|
||||
hasTexture: true,
|
||||
createInstance: ({ options, room, model, scene }) => {
|
||||
createInstance: ({ options, room, model, scene, timer }) => {
|
||||
const matrix = model.root.getWorldMatrix(true);
|
||||
const scale = new BABYLON.Vector3();
|
||||
matrix.decompose(scale);
|
||||
@@ -52,7 +52,7 @@ export const tv = defineObject({
|
||||
|
||||
const screenMaterial = model.findMaterial('__X_SCREEN__');
|
||||
|
||||
const { dispose: disposeTv } = initTv(room, screenMesh);
|
||||
const { dispose: disposeTv } = initTv(scene, screenMesh, timer);
|
||||
|
||||
//const videoTexture = new BABYLON.VideoTexture('', 'http://syu-win.local:3000/files/97986924-b99e-4fe1-993d-9caf010cca59', room.scene, false, true); ;
|
||||
//screenMaterial.emissiveTexture = videoTexture;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { applyMorphTargetsToMesh, cm, getPlaneUvIndexes } from '../utility.js';
|
||||
import { applyMorphTargetsToMesh, cm, getPlaneUvIndexes, Timer } from '../utility.js';
|
||||
import type { RoomEngine } from './engine.js';
|
||||
|
||||
export const SYSTEM_MESH_NAMES = ['__TOP__', '__SIDE__', '__PICK__', '__COLLISION__'];
|
||||
@@ -104,14 +104,14 @@ const TV_PROGRAMS = {
|
||||
timeline: [index: number, duration: number][];
|
||||
}>;
|
||||
|
||||
export function initTv(room: RoomEngine, screenMesh: BABYLON.Mesh) {
|
||||
export function initTv(scene: BABYLON.Scene, screenMesh: BABYLON.Mesh, timer: Timer) {
|
||||
const tvProgramId = 'shopping';
|
||||
const tvProgram = TV_PROGRAMS[tvProgramId];
|
||||
const tvScreenMaterial = screenMesh.material as BABYLON.PBRMaterial;
|
||||
tvScreenMaterial.albedoColor = new BABYLON.Color3(0, 0, 0);
|
||||
tvScreenMaterial.ambientColor = new BABYLON.Color3(0, 0, 0);
|
||||
tvScreenMaterial.roughness = 1;
|
||||
tvScreenMaterial.emissiveTexture = new BABYLON.Texture(`/client-assets/room/tv/${tvProgramId}/${tvProgramId}.png`, room.scene, false, false);
|
||||
tvScreenMaterial.emissiveTexture = new BABYLON.Texture(`/client-assets/room/tv/${tvProgramId}/${tvProgramId}.png`, scene, false, false);
|
||||
tvScreenMaterial.emissiveTexture.level = 1.0;
|
||||
tvScreenMaterial.emissiveColor = new BABYLON.Color3(0.5, 0.5, 0.5);
|
||||
|
||||
@@ -147,7 +147,7 @@ export function initTv(room: RoomEngine, screenMesh: BABYLON.Mesh) {
|
||||
uvs[uvIndexes[3] + 1] = dy;
|
||||
screenMesh.updateVerticesData(BABYLON.VertexBuffer.UVKind, uvs);
|
||||
|
||||
room.timer.setTimeout(() => {
|
||||
timer.setTimeout(() => {
|
||||
applyTvTexture((tlIndex + 1) % tvProgram.timeline.length);
|
||||
}, duration);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user