You can support the development on the Github Sponsors page.


Tech > LIBRARY: SWEPT INTERSECTION BETWEEN LINES


test library to find intersection point and determinants between 2 line segments
made by atesin (atesin#gmail.com)
uploaded by atesin
added:
download cartridge
- CLICK TO PLAY -

0


imagine you control a ship that shoots bullets, that are faster than 1px/frame. so you need to calculate if your bullet intersects some other ship/asteroid/etc in its trajectory, the impact point, and the time proportion between frame; to decide to stop, bounce or cross your enemy, spawn an explosion at impact point, etc. all this before the frame were actually drawn, otherwise your bullet could "teleport" behind your enemy, fooling your collision detection system. this algorithm could be useful to calculate swept collisions


Post comment