atmosphere: tweaking
This commit is contained in:
parent
b1ce199aeb
commit
14d4305965
|
@ -1151,12 +1151,14 @@ fn handle_atmosphere(
|
||||||
} else {
|
} else {
|
||||||
v.0
|
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;
|
v.0 -= friction;
|
||||||
|
|
||||||
if distance < atmo.r_inner {
|
if distance < atmo.r_inner {
|
||||||
let outward = (pos.0 - atmo_pos.0).normalize();
|
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;
|
v.0 += buoyancy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue