Hi there! I don’t know if this question belongs here or in Performance tunning… But I’ll leave it here.
I’m making some terrain using a Quadtree and I’d like to add collision to the terrain.
Although I know some ways of doing if (query the quadtree that is the terraing with an object AABB + collision check with interscetion on narrow phase), I would like to use a physics engine instead. I’m planing to use this terrain technique with libgdx and box2d (and leave it opensource).
The main issue I’m thinking will be the method to generate bodies effectively. I could sweep the tree and try to generate a poligon around the filled areas but that would be expensive (http://en.wikipedia.org/wiki/Convex_hull_algorithms).
A was reading through google and I found out that another technique was to relax the merging rules of the quad-tree and merge rectangles like crazy to reduce to the max the amount of rectangles. Than use the filled rectangles to generate static bodies. I have no idea how to do this. I’ll be thinking about this for the next days, but I wanted to share the question here to discuss this with you masters!
Thanks for reading up to here.
And here.
Something like this:
I5_WBPBQ6kE
I have this
http://lucasmontec.github.io/TerrainGeneration/