1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-13 16:25:44 +02:00
This commit is contained in:
syuilo
2026-03-26 22:20:34 +09:00
parent 9ffd8d777e
commit 9bc0d7b361
4 changed files with 26 additions and 5 deletions

View File

@@ -1402,9 +1402,14 @@ export class RoomObjectPreviewEngine {
gridMaterial.opacity = 0.5;
gridMaterial.gridRatio = 10/*cm*/;
this.zGridPreviewPlane = BABYLON.MeshBuilder.CreatePlane('zGridPreviewPlane', { width: 1000/*cm*/, height: 1000/*cm*/ }, this.scene);
this.zGridPreviewPlane.material = gridMaterial;
this.zGridPreviewPlane.rotation = new BABYLON.Vector3(Math.PI / 2, 0, 0);
//this.zGridPreviewPlane = BABYLON.MeshBuilder.CreatePlane('zGridPreviewPlane', { width: 1000/*cm*/, height: 1000/*cm*/ }, this.scene);
//this.zGridPreviewPlane.material = gridMaterial;
//this.zGridPreviewPlane.rotation = new BABYLON.Vector3(Math.PI / 2, 0, 0);
//this.scene.fogMode = BABYLON.Scene.FOGMODE_LINEAR;
//this.scene.fogStart = 100/*cm*/;
//this.scene.fogEnd = 110/*cm*/;
//this.scene.fogColor = new BABYLON.Color3(0.0, 0.0, 0.0);
}
public async init() {

View File

@@ -16,11 +16,16 @@ export const cupNoodle = defineObject({
},
placement: 'top',
createInstance: ({ scene, root }) => {
let yugeDispose: (() => void) | null = null;
return {
onInited: () => {
yuge(scene, root, new BABYLON.Vector3(0, 10/*cm*/, 0));
yugeDispose = yuge(scene, root, new BABYLON.Vector3(0, 10/*cm*/, 0));
},
interactions: {},
dispose: () => {
yugeDispose?.();
},
};
},
});

View File

@@ -16,11 +16,16 @@ export const mug = defineObject({
},
placement: 'top',
createInstance: ({ scene, root }) => {
let yugeDispose: (() => void) | null = null;
return {
onInited: () => {
yuge(scene, root, new BABYLON.Vector3(0, 5/*cm*/, 0));
yugeDispose = yuge(scene, root, new BABYLON.Vector3(0, 5/*cm*/, 0));
},
interactions: {},
dispose: () => {
yugeDispose?.();
},
};
},
});

View File

@@ -30,6 +30,12 @@ export function yuge(scene: BABYLON.Scene, mesh: BABYLON.Mesh, offset: BABYLON.V
ps.colorDead = new BABYLON.Color4(1, 1, 1, 0);
ps.preWarmCycles = Math.random() * 1000;
ps.start();
// dispose
return () => {
ps.stop();
emitter.dispose();
};
}
const _assumedFramesPerSecond = 60;