Reducing AABB by combining tiles
Recently I make a terrible mistake, create AABB collision rectangle for each tile, in my wip game. The collision system contains 3941 object and takes 63% of execution time. The debug draw looks like a spider web: The most straightforward method is merging small tiles into larger rectangle to reduce total collision object number. This problems is very similar to Algorithm for “healing” multiple rectangles into a smaller number of rectangles . The algorithm has to step: for each row combine continuous tiles into stripe shape…