diff --git a/client/src/lib/Dashboard/Visualization/Scene.svelte b/client/src/lib/Dashboard/Visualization/Scene.svelte index af70e0e..be0ab7e 100644 --- a/client/src/lib/Dashboard/Visualization/Scene.svelte +++ b/client/src/lib/Dashboard/Visualization/Scene.svelte @@ -85,6 +85,20 @@ } } + let gridFadeDistance = 30 + + const fadeGridIn = (delta: number) => { + if (gridFadeDistance < 100) { + gridFadeDistance += delta * 40 + } + } + + const fadeGridOut = (delta: number) => { + if (gridFadeDistance > 30) { + gridFadeDistance -= delta * 40 + } + } + useTask(delta => { /* TODO: standardize a scale (meters : grid lengths) so we can have accurate positioning of sensor detected objects */ @@ -95,6 +109,12 @@ $telemetryReadonlyStore['chassis-x-speed'] * delta * SPEED_MULTIPLIER $mesh.rotation.y = $telemetryReadonlyStore.orientation * DEG2RAD + if ($cameraState.mode === 'orbit') { + fadeGridOut(delta) + } else { + fadeGridIn(delta) + } + // run the follow function follow(delta) }) @@ -126,7 +146,7 @@