Code for my blog post on how to optimize line of sight tests.
There are two little benchmarks:
This one compares different techniques for line segment intersection.
g++ line_intersection.cpp util/*.cpp -std=c++14 -g0 -O3 -I./ -o line_intersection -flto -march=native
./line_intersection
This one compares different techniques for line of sight tests.
g++ line_of_sight.cpp util/*.cpp -std=c++14 -g0 -O3 -I./ -o line_of_sight -flto -march=native
./line_of_sight