Collision Detection and Response Algorithms

Technical Skills:
| C++ | OpenGL | Brute-Force | Spatial Partitioning | Dynamic Quad-Tree | Minkowski's Difference | GJK Algorithm |
During the first term of the Object Oriented Programming with Data Structures and Algorithms MComp module, I was tasked with implementing three different collision detection and response algorithms into a particle simulation project we were building throughout the class tutorials. This project was programmed in C++ using OpenGL and featured 2D circles moving around a closed space. To achieve this, rudimentary physics and particle-platform collisions were added together as a class before working on the coursework individually.

The coursework itself required us to implement circle-circle collisions through the brute-force, spatial partitioning and quad-tree algorithms before evaluating their performance benefits in a presentation and report. I completed this task and included debug lines (shown below) to show which potential collisions are getting tested for the presentation

Expanding on this, I also completed optional, advanced work in order to access higher marks. For this, I replaced the circles with polygons. Creating and drawing a polygon class with OpenGL is simple enough, however collision detection between these require two further algorithms. First I needed to create a Minkowski Difference of two shapes before using the GJK algorithm to determine if they are touching.

I achieved a mark of 92 for this work.