Sub-frame sampled Collision Detection

Subscribers:
1,270
Published on ● Video Link: https://www.youtube.com/watch?v=K6S-pCtgGrc



Duration: 2:51
83 views
3


I am making a physics demo that uses ray tracing methods to find where the ball will collide with the lines, then gets the time that the collision will occur. Step forward in the simulation that amount and reflect the ball's velocity and subtract that time used from the remaining frametime. Keep repeating this until the remaining frametime is 0 and draw the frame. This allows me to have extraordinary velocity without tunneling through the walls. At very high velocities, there could be many thousands of collisions per frame. I keep track of the hit positions for each collision and add them to the draw list at the end of each frame to visualize how many collisions are actually occurring. I haven't tried to optimize the collision detection yet either.