In this episode of Koding in #Kotlin:#KorGE
We tried to fix what was not fixed the last time: collision trajectory. Igor found an algorithm on Wikipedia and implemented it! Collision even started looking better, but… still incorrect. It turns out one can't just use 2 1-dimensional vector change formulas to replace 1 2-dimensional… Well, at least now we can see perfect elastic collisions between particles and 95% perfect collisions between particles and walls!
00:00 Intro and recap. Planning what have we done wrong last time, what are we going to do this time
03:30 Adding mass to our gas particles
22:20 Okay, we really have to have hashmaps it seems
32:40 Making 1D collisions
37:00 Pretending 2D collisions is just two 1D collisions (also writing terrible code)
57:45 Adding sticky walls so that particles slow down on collision with them
01:05:02 Realizing our collisions are still wrong and constructing counter-example
01:10:50 Wrapping up and discussing differences between JS and Kotlin implementation