diff options
Diffstat (limited to 'android-app/app/src/main')
| -rw-r--r-- | android-app/app/src/main/kotlin/org/terst/nav/ui/map/ParticleWindView.kt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/android-app/app/src/main/kotlin/org/terst/nav/ui/map/ParticleWindView.kt b/android-app/app/src/main/kotlin/org/terst/nav/ui/map/ParticleWindView.kt index 26d9ea2..746efb5 100644 --- a/android-app/app/src/main/kotlin/org/terst/nav/ui/map/ParticleWindView.kt +++ b/android-app/app/src/main/kotlin/org/terst/nav/ui/map/ParticleWindView.kt @@ -21,7 +21,7 @@ import kotlin.random.Random * tail segment, then advance the position by the wind vector. * * Speed is scaled to the visible viewport so the animation looks consistent at any - * zoom level: a particle at reference wind (10 kt) crosses ~30% of the screen in + * zoom level: a particle at reference wind (10 kt) crosses ~100% of the screen in * MAX_AGE seconds. * * Longitude arithmetic is done in a west-relative [0, lonSpan] coordinate space @@ -103,8 +103,8 @@ class ParticleWindView @JvmOverloads constructor( // Span wraps around antimeridian when lonEast < lonWest (e.g. Pacific viewport) val lonSpan = if (lonEast >= lonWest) lonEast - lonWest else lonEast - lonWest + 360f - // Speed scale: at 10kt a particle crosses 30% of viewport in MAX_AGE seconds. - val speedScale = latRange * 0.03f / MAX_AGE + // Speed scale: at 10kt a particle crosses 100% of viewport in MAX_AGE seconds. + val speedScale = latRange * 0.1f / MAX_AGE // Geographic travel direction: opposite of the FROM direction. val travelRad = Math.toRadians((windDirFromDeg + 180.0) % 360.0) @@ -139,7 +139,9 @@ class ParticleWindView @JvmOverloads constructor( var newLon = lonWest + Random.nextFloat() * lonSpan if (newLon > 180f) newLon -= 360f particleLon[i] = newLon - particleAge[i] = Random.nextFloat() * MAX_AGE + // Start fresh so each particle gets a full lifetime to drift across the viewport. + // A tiny stagger (0–2 s) desynchronises bursts of simultaneous respawns. + particleAge[i] = Random.nextFloat() * 2f continue } |
