Mercurial > lbo > hg > collisions
changeset 5:9f42b712cc2a
Add illuminating comments
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sun, 15 Nov 2020 19:34:01 +0100 |
parents | 1606d1cd0c45 |
children | c10eeaf4015d |
files | src/main.rs |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main.rs Sun Nov 15 19:31:41 2020 +0100 +++ b/src/main.rs Sun Nov 15 19:34:01 2020 +0100 @@ -299,10 +299,12 @@ continue; } - // Still valid? + // Events still valid - only if participating particles have not collided otherwise + // in the meantime. match next.typ { EventType::HorizWall(p) | EventType::VertWall(p) => { if self.particle_for(p).coll > next.coll { + // Important to not allow particles to leave the box. self.predict_collisions(p, limit); continue; }