17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-31 03:09:58 +01:00

Let the smoke leave the exhaust as a widening jet that fades in

This commit is contained in:
2026-10-20 18:00:51 +02:00
parent abbdca4773
commit cf36b24e8d
8 changed files with 42 additions and 6 deletions

View File

@@ -37,6 +37,9 @@ bool advance(inout smoke_particle_s particle, smoke_source_s source, float secon
if (particle.state.x <= 0.0)
return false;
particle.velocity.w = clamp(particle.velocity.w + source.sizechange.x * seconds, source.sizechange.y, source.sizechange.z);
// the jet widens with the way it goes
if (source.sizechange.w > 0.0)
particle.velocity.w = min(particle.velocity.w + source.sizechange.w * length(particle.velocity.xyz) * seconds, source.sizechange.z);
if (source.settling.z > 0.5)
{
// the drag of the air takes the particle towards the velocity it settles at