mattrdowney / planetaria

A Unity framework for Euclidean 2-sphere games (e.g. 2D virtual reality games) [quasi-MIT license]
Other
10 stars 2 forks source link

GeometryVisitor does not work on corners with negative extrusions #93

Closed mattrdowney closed 6 years ago

mattrdowney commented 6 years ago

One possible (albeit convoluted) solution:

The fix is to move to a tuple/pair<bool convex, Arc>.

The logic for using one or the other becomes:

if (convex ^ extrusion < 0) return convex_visitor(); else return concave_iterator(); // does not work with edges, though '-'

(Exists no longer makes sense.)

The only other change that needs to happen is the corner constructor and Shape's Arc generation, which will probably be far more tangled than I expect.

There's also some weirdness with non-closed Shapes.

mattrdowney commented 6 years ago

I'm pretty sure edges don't work either.

Ultimately, intersection code and Arc.contains() also affect behavior and need to be fixed accordingly.

mattrdowney commented 6 years ago

Done as of a42aff3df200b9d44650491522817aeb93f9cafa