I have a randomly generated series of EdgeShapes, as shown here:
My question is, how can I fill that bottom area with a texture in order to make it look like the ground?
As suggested by someone in IRC:
Create a polyon using OpenGL and then map it 1:1 onto the Box2D shape and texture the polygon.
From ancient memory, and looking at the code, this can't be done with edge shapes. You can chain them together, but even then there is no self-colision, which would allow the shape to overlap itself, and be . . . what? There are no normals created, nor centroid.
This is just a guess -- it has been a while since I used box2d -- but can you create a polygon instead? You would first create the N number of points in an array, and use that array as y-values along the top to simulate ground. Then you would make each point's y-value equal it's neighboring (left or right) point's y-value over time. As the points reach the end, they are moved off the array, and a new value is moved onto the other end of the array.
Can this be done, and would this adversely affect the contact points with other objects?