The math can be made a lot easier. When you’re at s\Delta t = ||P_b + V_b \Delta t – P_a||, you can solve the absolute by solving for s\Delta t = (P_b + V_b \Delta t – P_a) and s\Delta t = -(P_b + V_b \Delta t – P_a) separately. No squares needed at all. (also no substitutions at the end, which makes it a lot cleaner).

And yeah, that’s the ‘shortcut’ you forgot about ;)

Hope it helps someone out there.

– Alex

Thanks for sharing this, I see how math can come to the rescue when trying to get some behaviour done. I remember when I have to get all objects between two and had to use inverse linear functions and so. On the other hand, I believe it can make people scared by the math level it can be required.

Best regards,

Alonso G. ]]>