Uploaded March 2023 | Updated November 2026, 1 week ago
Simple idea I came up with pretty late at night for an algorithm that fills a map with a "navmesh" (really just lays parts on the ground in a manner similar to a navmesh).
The map's bounds are measured and then it splits the area into a 3d grid. Starting from the top-down, for each cell in the grid it checks if it's intersecting with any part in the map, and if so, it will set the value of that cell to 1. If the cell directly above the current one is not 1 (air), it's value is then set to 2.
For each 2 in the grid it creates a rectangle and merges it with suitable neighboring rectangles, then finally splits out all the parts as result of that.
Simple idea I came up with pretty late at night for an algorithm that fills a map with a "navmesh" (really just lays parts on the ground in a manner similar to a navmesh).
The map's bounds are measured and then it splits the area into a 3d grid. Starting from the top-down, for each cell in the grid it checks if it's intersecting with any part in the map, and if so, it will set the value of that cell to 1. If the cell directly above the current one is not 1 (air), it's value is then set to 2.
For each 2 in the grid it creates a rectangle and merges it with suitable neighboring rectangles, then finally splits out all the parts as result of that.










