Faster wind animation and wind gusts
This commit is contained in:
fraxle
2026-06-07 14:51:20 +01:00
parent a9d53eff46
commit 80dc28a13e
3 changed files with 15 additions and 5 deletions
+6 -5
View File
@@ -909,14 +909,15 @@ export function ScopeReticle({ value, cat, loading, elev = 0, dt = new Date(), g
const fx = fxRef.current; const fx = fxRef.current;
ctx.clearRect(0, 0, w, hgt); ctx.clearRect(0, 0, w, hgt);
// Wind — base speed with random gust pulses ramping up to gust speed. // Wind — base speed with random gust pulses ramping up to gust speed.
if (fx.wind > 3 && Math.random() < 0.006 + fx.wind * 0.0006) gustPulse = 1; // gustPulse snaps to 1 on trigger then decays quickly so gusts feel punchy.
gustPulse = Math.max(0, gustPulse - 0.012); if (fx.wind > 3 && Math.random() < 0.005 + fx.wind * 0.001) gustPulse = 1;
gustPulse = Math.max(0, gustPulse - 0.022);
const effWind = fx.wind + gustPulse * Math.max(0, fx.gust - fx.wind); const effWind = fx.wind + gustPulse * Math.max(0, fx.gust - fx.wind);
const hv = fx.windH * effWind * 0.22; // horizontal px/frame const hv = fx.windH * effWind * 0.5; // horizontal px/frame
// Wind particles — faint horizontal streaks drifting across the lens, // Wind particles — faint horizontal streaks drifting across the lens,
// stretching and brightening during gusts. // stretching and brightening during gusts.
const windTarget = fx.wind > 1.5 ? Math.min(4, Math.round(fx.wind * 0.35)) : 0; const windTarget = fx.wind > 1.5 ? Math.min(6, Math.round(fx.wind * 0.45)) : 0;
while (winds.length < windTarget) winds.push({ x: Math.random() * w, y: Math.random() * hgt, r: 1.4 + Math.random() * 1.2, spd: 0.7 + Math.random() * 0.6, ph: Math.random() * 6.28 }); while (winds.length < windTarget) winds.push({ x: Math.random() * w, y: Math.random() * hgt, r: 1.6 + Math.random() * 1.4, spd: 0.7 + Math.random() * 0.6, ph: Math.random() * 6.28 });
if (winds.length > windTarget) winds.length = windTarget; if (winds.length > windTarget) winds.length = windTarget;
if (winds.length) { if (winds.length) {
ctx.fillStyle = 'rgba(236,243,251,' + (0.22 + gustPulse * 0.22).toFixed(3) + ')'; ctx.fillStyle = 'rgba(236,243,251,' + (0.22 + gustPulse * 0.22).toFixed(3) + ')';
+1
View File
@@ -0,0 +1 @@
Deny from all
+8
View File
@@ -0,0 +1,8 @@
{
"2026-06-07": {
"visits": 1,
"profiles": {
"showall": 1
}
}
}