none
Predictive Passing

When you're rewriting a game from scratch, you will often end up re-implementing certain functionality while taking peeks at the current implementation. In the case of passing a ball from one player to another, the current implementation was made out of about 8 lines of code. However small, those 8 lines of code were pure mathematical magic to me; there was no documentation whatsoever about the thought process that was behind these equations. I didn't have the slightest clue what was actually happening, and could imagine all kind of cases if not implemented properly.

Ofcourse, I could simply ask the implementer how he came up with solution, but in order to solve any further questions about the mechanism once and for all, I decided to just re-invent the passing mechanism myself, and write it all out in a nice little article. This didn't take much time, and as it turned out, with some simple high school algebra, I derived an almost identical solution in comparison with the current implementation. Thus, the following article will explain the math behind the passing, such that the passing ball has a constant velocity, regardless of the speed of both shooter and receiver.

Predictive Passing