This project is a work in progress aimed at simulating collision detection and response through sequential impulse in 3D. C++, OpenGL are used in this project.
Currently the code detects collision using the gjk algorithm. Another great interactive demo of the gjk (and minkowski difference) is located at this page.
Originally I started this project in Jai, check it out at this link.
From the images above you can see that when the red tetrahedron collides with the blue cube, the green simplex appears. The gjk algorithmn relies on a support function that generates the points that would lie on the minkowski difference of the two colliding objects. These points make up the green simplex, and if this simplex contains the origin, then that means the two objects are colliding! (The black cube being the origin in this case)
You can run the demo by running the following command at the base of the project:
.\run.bat| Input | Action |
|---|---|
| Mouse | Aim Camera |
| W/A/S/D | Camera Movement |
| Left/Right/Up/Down Arrow Keys | Move the tetrahedron around |
| Backspace | Exit program |
(Backspace because of my keyboard :D)
- Visual Studio along with the
Desktop development with C++module - You may need to edit the vcvarsall path in
vcvars.batfile.- It might already set to the correct path but if not, you will need to find where your
vcvars64.batis located. - If it's not under the current set directory, it maybe under
C:\Program Files\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat
- It might already set to the correct path but if not, you will need to find where your
After that is setup, you build with simply by running the command.
.\build.bat

