From 7650df6b52ff92a576d894cf395ccef54dac5811 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 22 Apr 2026 17:02:28 +0200 Subject: [PATCH] auto-git: [change] src/runtime-three/runtime-host.ts --- src/runtime-three/runtime-host.ts | 34 ++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/runtime-three/runtime-host.ts b/src/runtime-three/runtime-host.ts index af163a9c..e1ad8af8 100644 --- a/src/runtime-three/runtime-host.ts +++ b/src/runtime-three/runtime-host.ts @@ -3129,13 +3129,33 @@ export class RuntimeHost { } private updateUnderwaterSceneFog() { - const fogState = - this.activeController === this.firstPersonController - ? resolveUnderwaterFogState( - this.runtimeScene, - this.currentPlayerControllerTelemetry - ) - : null; + const fogTelemetry = + this.activeRuntimeCameraRig !== null + ? { + cameraSubmerged: + this.resolvePlayerVolumeState({ + x: this.camera.position.x, + y: this.camera.position.y, + z: this.camera.position.z + }).waterSurfaceHeight !== null && + resolveWaterContact( + { + x: this.camera.position.x, + y: this.camera.position.y, + z: this.camera.position.z + }, + this.runtimeScene?.volumes.water ?? [] + ) !== null, + eyePosition: { + x: this.camera.position.x, + y: this.camera.position.y, + z: this.camera.position.z + } + } + : this.activeController === this.firstPersonController + ? this.currentPlayerControllerTelemetry + : null; + const fogState = resolveUnderwaterFogState(this.runtimeScene, fogTelemetry); if (fogState === null) { this.underwaterSceneFog.density = 0;