atmosphere: tweaking

This commit is contained in:
yuni 2024-11-27 03:42:43 +01:00
parent b1ce199aeb
commit 14d4305965

View file

@ -1151,12 +1151,14 @@ fn handle_atmosphere(
} else {
v.0
};
let friction = dv * (1.0 - height).powf(4.0) / 4.0;
let friction = dv * (1.0 - height).powf(16.0) * dt * 10.0;
v.0 -= friction;
if distance < atmo.r_inner {
let outward = (pos.0 - atmo_pos.0).normalize();
let buoyancy = outward * (atmo.r_inner - distance) * dt * 10.0;
// depth is 0.0 on "surface" and 1.0 at center
let depth = ((atmo.r_inner - distance) / atmo.r_inner).clamp(0.0, 1.0);
let buoyancy = outward * depth.powf(4.0) * dt * 100_000.0;
v.0 += buoyancy;
}