Sorry to trouble you all with what is hopefully just me doing something silly. When I feed a trimesh into into Bullet's HACD processor (code below) I get the following meshes in and out.
Clearly, something is wrong, but I am not sure how to go about diagnosing the problem. I'm using Bullet via BulletSharp. Anyone seen anything like this?
1) A simple cube turns into a triangle. High Res: http://i.imgur.com/TInxf.png
2) The classic table example. High Res: http://i.imgur.com/ld6Yv.png
3) A more pronounced example. High Res: http://i.imgur.com/rTUgf.png
// Create the HACD processor.
var pProcessor = new Hacd();
// Set the data.
// Other settings.
pProcessor.CompacityWeight = 0.1;
pProcessor.VolumeWeight = 0.0;
pProcessor.NClusters = 2;
pProcessor.VerticesPerConvexHull = 100;
pProcessor.Concavity = 100;
pProcessor.AddExtraDistPoints = false;
pProcessor.AddFacesPoints = false;
pProcessor.AddNeighboursDistPoints = false;
// Compute the mesh.
// Save the mesh.
The variables tVertices and tIndices contain the vertex and index buffer respectively.
Any ideas? I'm at a loss!