This is a demo of collision detection among 2D objects. We implemented the collision detection with the commonly used Gilbert-Johnson-Keerthi (GJK) algorithm. It originally intents to determine the distance between two convex shapes. It is popular for real time collision detection, especially in physics engines for video games or simulation system. We explain this algorithm in a computer science perspective and make it to be easy understand.
1. Select one of the six objects (point, line, triangles and rectangle) in the window below by mouse.
2. Move the selected object by dragging it.
3. When two objects overlap, a collision will be detected and both objects turn red.
4. It also detect collision in more than two objects.
Lee, Younhee, Lu, Qi and Lim, Woong. An Application of Mathematics to Computer Programming: Connecting Translation Vector, Minkowski Difference, and Collision Detection. Mathematics Teacher, 2018.
Qi Lu, Ph.D student, University of New Mexico, email: lukey11@unm.edu