coalesce notes (now with numbers)

So the Mac version begins to experience slowdown at around 50 objects (on my computer, at least). The Windows version: 13. What the hell? It’s got me stumped. What the hell? Spending most of its time in some directx_unlock fn. I don’t know what that does. I should probably post a plea for help on allegro.cc.


m1v1 + m2v2 = m1v1f + m2v2f I know the momentum & stuff is conserved, but how do I figure it out? I’m looking for 2 variables! Say m1 & m2 are both 1. v1 + v2 = v1f + v2f 2 + -2 = 0 + 0

2 + -2

-2 + 2 seems this is “right” That’s if it’s head-on, however. I’m not sure about otherwise

I need to add the vectors somehow. But which vectors is key – it’s not velocity. Momentum. But momentum needs to be conserved.

So if they have the same mass, the velocities just switch. Different masses, though?

m1v1 + m2v2 = m1v1f + m2v2f

m1v12/2 + m2v22/2 = m1v1f2/2 + m2v2f2/2

v1 + v1f = v2 + v2f or v1 - v2 = v2f - v1f v1f = v1(m1 - m2)/(m1 + m2) + v2(2m2)/m1 + m2)

v2f = v1(2m1)/(m1 + m2) + v2(m2 - m1)/(m2 + m1) </strong> sm = m1 + m2

But that’s only good for head-on collisions. “scattering” is more complicated.

v2 = v((2m1) / (m1 + m2))cosΘ v11 = v …