I'm trying to display the actual bodies/shapes in my world in C++ with openGL ES 2.0 but I'm having trouble working out how to do it; I can grab the vertex points and normals from a shape with:
btVector3** vertices= myShape->getVertices();//myShape is a btBox2dShape
btVector3**normals = myShape->getNormals();
but there is no way to grab the indices to tell opengl which order to draw the vertex points in! Is there a way to get these? Or is it possible to programmatically calculate the indices?
You can just either send vertices without indices if you don't care about perfomance ( which you shouldn't really since this is just for debugging) or , as you mentioned, you can calculate indices programatically.
For polyhedral convex shapes (such as box, convex hull shapes and a few others), you can make Bullet calculate the indices for you (see btPolyhedralConvexShape::initializePolyhedralFeatures() and the classes btPolyhedralConvexShape.h and btConvexPolyhedron.h).
You can also use btShapeHull and btConvexHullComputer (inside LinearMath) to perform the same task (btConvexHullComputer gives better results).
For other shapes (sphere, capsule, cylinder, multisphere, cone) you can't use this method and you should draw them manually using the shape parameters (radius, height, etc.).
However, as warmi said, this kind of drawing shapes is usually done just for debugging: in real applications you want to display real meshes instead of the "default shapes": that's why some people could think of just relying on the debug drawer (that can do some "raw" wireframe rendering (inaccurate for some shapes like multisphere)) or raycast screenshots, without writing any code for displaying shapes.
Additionally, even if you target openGLES, for problems related to the mesh topology you can still take a look at the code in libOpenGLSupport (the basic brick of all the Bullet demos).
P.S: I usually calculate the normals myself from the vetices/indices, but if you're able to obtain them in some other way it might work as well.
Thanks for the pointers guys, as you both pointed out I should have looked at the debugging functionality in the first place, I've created my own DebugDraw class (implementing the btIDebugDraw interface) and have it drawing my wireframe physics world correctly