2 ms·
I'm in the process of learning about GJK but Vatti's clipping algorithm [0] is a way to polynomially do Boolean operations on arbitrary 2d polygons (convex, con
by abetusk 5y ago
I'm in the process of learning about GJK but Vatti's clipping algorithm [0] is a way to polynomially do Boolean operations on arbitrary 2d polygons (convex, concave, etc.). From Boolean operations, you can get collision detection.
Angus Johnson's ClipperLib [1] is a library that implements this in C++ and other languages and there are Javascript ports available [2] [3].
[0] https://en.wikipedia.org/wiki/Vatti_clipping_algorithm https://en.wikipedia.org/wiki/Vatti_clipping_algorithm
[1] http://www.angusj.com/delphi/clipper.php http://www.angusj.com/delphi/clipper.php
[2] https://github.com/junmer/clipper-lib https://github.com/junmer/clipper-lib
[3] http://jsclipper.sourceforge.net/6.2.1.0/main_demo.html http://jsclipper.sourceforge.net/6.2.1.0/main_demo.html