Skip to content

Instantly share code, notes, and snippets.

@nyorain
nyorain / sat.cpp
Last active December 26, 2023 23:14
Small Separating Axis Theorem implementation in C++
#include <nytl/vec.hpp>
#include <nytl/vecOps.hpp>
#include <vector>
#include <limits>
using Polygon = std::vector<nytl::Vec2f>;
/// Returns whether the two given convex polygons intersect using the
/// separating axis theorem. The given polygons can be in clockwise or