1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-15 17:26:02 +02:00
This commit is contained in:
syuilo
2026-04-19 13:32:08 +09:00
parent 664ca528fe
commit f8e093466d
2 changed files with 11 additions and 2 deletions

View File

@@ -104,12 +104,20 @@ export const tabletopDigitalClock = defineObject({
const onMeshes = get7segMeshesOfCurrentTime(segmentMeshes);
for (const mesh of Object.values(segmentMeshes)) {
mesh.isVisible = onMeshes.includes(mesh);
const isVisible = onMeshes.includes(mesh);
// 本当ならisVisibleで制御したいが、snapshot renderingではvisibilityはupdateMeshを呼んだとしても反映されないので、メッシュをめっちゃ縮めることで非表示を実現する(メッシュをめっちゃ遠くに飛ばすことも試みたけど、シーン全体の影のレンダリングがおかしくなるため断念。あとバウンディングボックスが大きくなるから不都合が出そう)
//mesh.isVisible = isVisible;
mesh.scaling.y = isVisible ? 1 : 0;
}
for (const mesh of colonMeshes) {
mesh.isVisible = Date.now() % 2000 < 1000;
const isVisible = Date.now() % 2000 < 1000;
// 本当ならisVisibleで制御したいが、snapshot renderingではvisibilityはupdateMeshを呼んだとしても反映されないので、メッシュをめっちゃ縮めることで非表示を実現する(メッシュをめっちゃ遠くに飛ばすことも試みたけど、シーン全体の影のレンダリングがおかしくなるため断念。あとバウンディングボックスが大きくなるから不都合が出そう)
//mesh.isVisible = isVisible;
mesh.scaling.y = isVisible ? 1 : 0;
}
room?.sr.updateMesh([...Object.values(segmentMeshes), ...colonMeshes]);
}, 1000));
},
onOptionsUpdated: ([k, v]) => {

View File

@@ -47,6 +47,7 @@ export const wallClock = defineObject({
const mAngle = -(minutes / 60) * Math.PI * 2;
hourHand.rotation = new BABYLON.Vector3(0, 0, hAngle);
minuteHand.rotation = new BABYLON.Vector3(0, 0, mAngle);
room?.sr.updateMesh([hourHand, minuteHand]);
}, 1000));
},
onOptionsUpdated: ([k, v]) => {