3 ms·
Note that this book talks about static collision detection. In games you'll be better off calculating the function of distance between the two objects over tim
by Tade0 3y ago
Note that this book talks about static collision detection.
In games you'll be better off calculating the function of distance between the two objects over time and registering a hit if it reaches zero.
For instance, the square of distance between two circles moving at a constant speed is a parabola, so it's enough to sample it at three points in time to get its coefficients.
- arketyp 3y agoKinetic triangulation problems are formulated similar to this. I've written an algorithm for a specific kind of triangulation schema [1] where collision events are sorted as quadratic inequalities. The math becomes quite involved when robustness is required and floating point representation is avoided. You have to treat the irrational time points of collision events as existing but expressed implicitly, as in a sort of unevaluated symbolic form. Kind of like imaginary numbers. [1] https://github.com/mpihlstrom/femton https://github.com/mpihlstrom/femton