Left: bullet imported version, right: correct 3ds max version. It's somehow inverted. If you think that left part is just 180 degrees rotated you are wrong. Just rotate it yourself in paint and you'll see - they will be different.
What's wrong with the bullet importer?
Usage:
Code: Select all
var wo = new WavefrontObj();
int tcount = wo.LoadObj(path);
Vector3 localScaling = new Vector3(1, 1, 1) * 1f;
var vertices = wo.Vertices.Select(v => Vector3.Modulate(new Vector3(v.X, v.Y, v.Z), localScaling)).ToArray();
var indices = wo.Indices;
if (tcount > 0)
{
var trimesh = new TriangleMesh();
int i;
for (i = 0; i < tcount; i++)
{
int index0 = indices[i * 3];
int index1 = indices[i * 3 + 1];
int index2 = indices[i * 3 + 2];
Vector3 vertex0 = vertices[index0];
Vector3 vertex1 = vertices[index1];
Vector3 vertex2 = vertices[index2];
trimesh.AddTriangle(vertex0, vertex1, vertex2);
}
CollisionShape concaveShape = new BvhTriangleMeshShape(trimesh, false);
CreateRigidbody(transform.Position, transform.Rotation, concaveShape);
}