MattiaMontanari / openGJK

Fast and reliable implementation of the Gilbert-Johnson-Keerthi (GJK) algorithm for C, C#, Go, Matlab and Python
https://www.mattiamontanari.com/opengjk/
GNU General Public License v3.0
135 stars 37 forks source link
algorithm c collision convex-polytopes gilbert-johnson-keerthi gjk golang python

OpenGJK

A fast and robust C implementation of the Gilbert-Johnson-Keerthi (GJK) algorithm with interfaces for C#, Go, Matlab and Python. A Unity Plug-in is also available in another repository.

Useful links: API references, documentation and automated benchmarks.

Getting started

On Linux, Mac or Windows, install a basic C/C++ toolchain - for example: git, compiler and cmake.

Next, clone this repo:

git clone https://github.com/MattiaMontanari/openGJK

Then use these commands to build and run an example:

cmake -E make_directory build
cmake -E chdir build cmake -DCMAKE_BUILD_TYPE=Release .. 
cmake --build build 
cmake -E chdir build/examples/c ./example_lib_opengjk_ce

The successful output should be:

Distance between bodies 3.653650

However, if you do get an error - any error - please file a bug. Support requests are welcome.

Use OpenGJK in your project

The best source to learn how to use OpenGJK are the examples. They are listed here for C, C#, Go, Matlab and Python. I aim to publish few more for Julia.

Take a look at the examples folder in this repo and have fun. File a request if you wish to see more!

Contribute

You are very welcome to: