diff -r 1a4342d80de7 -r 654661eab7f3 src/geometry.h --- a/src/geometry.h Wed Jun 08 20:41:21 2022 +0300 +++ b/src/geometry.h Wed Jun 08 22:29:44 2022 +0300 @@ -1,6 +1,32 @@ #pragma once #include -#include "basics.h" +#include +#include + +enum Winding +{ + NoWinding, + Anticlockwise, + Clockwise, +}; + +//! \brief XOR operator for winding +constexpr Winding operator^(Winding one, Winding other) +{ + if (one == NoWinding or other == NoWinding) { + return NoWinding; + } + else { + const int xored = static_cast(one) ^ static_cast(other); + return static_cast(xored); + } +} + +constexpr Winding& operator^=(Winding& one, Winding other) +{ + one = one ^ other; + return one; +} struct Plane {