@Videogamer555 (View Post) The velocity is a vector, so you can use that.
The exact code is https://github.com/simtr/The-Powder-Toy/blob/master/src/simulation/Simulation.cpp at line 4199 ish.
By a quick glance, I'd say Simulation::get_normal_interp has something to do with it. Haven't mustered the strength yet to make sense of the uncommented code.
@Videogamer555 (View Post) My guess is you can estimate that by taking the surrounding few pixels, get the height and width difference and estimate an average angle.