This commit is contained in:
syuilo
2026-02-21 15:18:31 +09:00
parent 460f79d5cf
commit 8bdf773a2b
8 changed files with 40 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -1102,19 +1102,29 @@ export class RoomEngine {
}
}
private createGhost(mesh: BABYLON.Mesh) {
private createGhost(mesh: BABYLON.Mesh): BABYLON.Mesh {
const ghost = mesh.clone('ghost', null, false)!;
ghost.metadata = { isGhost: true };
const materials = new WeakMap<BABYLON.Material, BABYLON.Material>();
for (const m of ghost.getChildMeshes()) {
m.metadata = { isGhost: true };
if (m.material) {
const mat = m.material.clone(`${m.material.name}_ghost`);
mat.alpha = 0.3;
mat.transparencyMode = BABYLON.Material.MATERIAL_ALPHABLEND;
m.material = mat;
}
m.checkCollisions = false;
if (m.material) {
if (materials.has(m.material)) {
m.material = materials.get(m.material)!;
} else {
const mat = m.material.clone(`${m.material.name}_ghost`);
mat.alpha = 0.3;
mat.transparencyMode = BABYLON.Material.MATERIAL_ALPHABLEND;
materials.set(m.material, mat);
m.material = mat;
}
}
}
return ghost;
}

View File

@@ -23,6 +23,7 @@ import { keyboard } from './objects/keyboard.js';
import { lavaLamp } from './objects/lavaLamp.js';
import { letterCase } from './objects/letterCase.js';
import { milk } from './objects/milk.js';
import { mixer } from './objects/mixer.js';
import { monitor } from './objects/monitor.js';
import { monstera } from './objects/monstera.js';
import { mug } from './objects/mug.js';
@@ -64,6 +65,7 @@ export const OBJECT_DEFS = [
lavaLamp,
letterCase,
milk,
mixer,
monitor,
monstera,
mug,

View File

@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { defineObject } from '../engine.js';
export const mixer = defineObject({
id: 'mixer',
name: 'Mixer',
options: {
schema: {},
default: {},
},
placement: 'top',
createInstance: () => {
return {
interactions: {},
};
},
});