Closed ChrisVilches closed 2 years ago
Almost fixed. Post here all my notes once it's finished. <---- IMPORTANT TODO
Explain how I refactored it, etc.
Only need to understand the "- pivot_vertex" bit now.
UPDATE: Done. It's just some arithmetic to obtain the final offset.
Some notes about how to obtain the offsets:
Put a vertex centered on (0, 0), and then slide it across the adjacent edge, while finding these things:
These are the two things my code does. It was refactored so that it's easier to see what it's doing.
kattis/maptiles.cpp
Method
generate_offsets
is a bit weird. It works and I don't know why. It also has some hard-coded heuristic numbers that shouldn't be there. Make it more exact.For example:
TILE_N / 2
if (p.x > 6 * tile_x || p.y > 6 * tile_y) return;
I think it's important to fully understand how the method works.
Also optimize it and implement the pruning correctly.