This is kind of a general question around a specific problem. I have a level format which is effectively a 2D grid with various squares filled in to represent the structure of the level and some supporting data. I use the level format to generate both collision objects (boxes) and the display objects as well. What I'd like to be able to do is merge contiguous boxes into a single box shape reduce the number of collision objects generated.
My first implentation was very simple , it scans the level data row by row and every filled in square in the grid became an individual collision box. This was then improved slightly so that contiguous horizontal objects were merged into a single box.
What I was wondering was if there were any recommended approaches for applying this to testing both directions, to produce the smallest possible number of individual boxes that can represent the same data (i'd like to keep the collision shapes as boxes rather then merging them into more complex concave shapes)?
xexuxjyMember Since 19 Sep 2012
Offline Last Active Today, 09:29 AM
- Group Members
- Active Posts 18
- Profile Views 557
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
xexuxjy hasn't added any contacts yet.
22 Nov 2012 - 10:07