mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-07-30 01:34:37 +02:00
wip
This commit is contained in:
@@ -33,7 +33,7 @@ export class WorldEngine extends EngineBase<{
|
||||
private envMap: BABYLON.CubeTexture;
|
||||
public lightContainer: BABYLON.ClusteredLightContainer;
|
||||
public sr: BABYLON.SnapshotRenderingHelper;
|
||||
private gl: BABYLON.GlowLayer | null = null;
|
||||
public gl: BABYLON.GlowLayer | null = null;
|
||||
public timer: Timer = new Timer();
|
||||
public isSitting = false;
|
||||
private cameraHeight = cm(130);
|
||||
@@ -80,23 +80,9 @@ export class WorldEngine extends EngineBase<{
|
||||
|
||||
this.sr = new BABYLON.SnapshotRenderingHelper(this.scene);
|
||||
|
||||
const skybox = BABYLON.MeshBuilder.CreateBox('skybox', { size: cm(50000) }, this.scene);
|
||||
const skyboxMat = new BABYLON.StandardMaterial('skyboxMat', this.scene);
|
||||
skyboxMat.backFaceCulling = false;
|
||||
skyboxMat.disableLighting = true;
|
||||
skybox.material = skyboxMat;
|
||||
skybox.infiniteDistance = true;
|
||||
|
||||
this.time = TIME_MAP[new Date().getHours() as keyof typeof TIME_MAP];
|
||||
//this.time = TIME_MAP[12 as keyof typeof TIME_MAP];
|
||||
|
||||
if (this.time === 0) {
|
||||
skyboxMat.emissiveColor = new BABYLON.Color3(1, 1, 1);
|
||||
} else if (this.time === 1) {
|
||||
skyboxMat.emissiveColor = new BABYLON.Color3(0.7, 0.68, 0.66);
|
||||
} else {
|
||||
skyboxMat.emissiveColor = new BABYLON.Color3(0.48, 0.5, 0.6);
|
||||
}
|
||||
this.scene.ambientColor = new BABYLON.Color3(0.9, 0.9, 0.9);
|
||||
|
||||
this.envMap = BABYLON.CubeTexture.CreateFromPrefilteredData(this.time === 2 ? '/client-assets/room/outdoor-night.env' : '/client-assets/room/outdoor-day.env', this.scene);
|
||||
@@ -143,7 +129,6 @@ export class WorldEngine extends EngineBase<{
|
||||
blurKernelSize: 64,
|
||||
});
|
||||
this.gl.intensity = 0.5;
|
||||
this.gl.addExcludedMesh(skybox);
|
||||
this.scene.setRenderingAutoClearDepthStencil(this.gl.renderingGroupId, false);
|
||||
this.sr.updateMeshesForEffectLayer(this.gl);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export class LobbyEnvManager extends WorldEnvManager {
|
||||
this.skyboxMat.disableLighting = true;
|
||||
this.skybox.material = this.skyboxMat;
|
||||
this.skybox.infiniteDistance = true;
|
||||
this.engine.gl!.addExcludedMesh(this.skybox);
|
||||
if (this.engine.gl != null) this.engine.gl.addExcludedMesh(this.skybox);
|
||||
|
||||
const ambientLight1 = new BABYLON.HemisphericLight('ambientLight1', new BABYLON.Vector3(0, 1, 0), this.engine.scene);
|
||||
ambientLight1.diffuse = new BABYLON.Color3(1.0, 0.9, 0.8);
|
||||
@@ -431,6 +431,22 @@ export class LobbyEnvManager extends WorldEnvManager {
|
||||
});
|
||||
}, 3000);
|
||||
|
||||
const hourHands = this.meshes.filter(m => m.name.includes('__CLOCK_HAND_H__'));
|
||||
const minuteHands = this.meshes.filter(m => m.name.includes('__CLOCK_HAND_M__'));
|
||||
|
||||
this.timer.setInterval(() => {
|
||||
const now = new Date();
|
||||
const hours = now.getHours() % 12;
|
||||
const minutes = now.getMinutes();
|
||||
const hAngle = -(hours / 12) * Math.PI * 2 - (minutes / 60) * (Math.PI * 2 / 12);
|
||||
const mAngle = -(minutes / 60) * Math.PI * 2;
|
||||
|
||||
for (const hourHand of hourHands) hourHand.rotation = new BABYLON.Vector3(0, 0, hAngle);
|
||||
for (const minuteHand of minuteHands) minuteHand.rotation = new BABYLON.Vector3(0, 0, mAngle);
|
||||
|
||||
this.engine.sr.updateMesh([...hourHands, ...minuteHands], false);
|
||||
}, 1000);
|
||||
|
||||
const emitter = new BABYLON.TransformNode('emitter', this.engine.scene);
|
||||
emitter.position = new BABYLON.Vector3(0, cm(-1000), 0);
|
||||
const ps = new BABYLON.ParticleSystem('', 128, this.engine.scene);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user