I just started implementing some physics in my game with Bullet Physics and I was just wondering how would i use bullet physics to load in meshes. For my for DirectX I load in x files into a ID3DXMesh. I'd like to know how do I create a mesh in bullet physics instead of using boxes and spheres. I can't seem to find a way to do this. It would be great if someone could help me out. Thank you.


1 Answer 1


You should get the mesh's vertex positions to create a btTriangleIndexVertexArray which is required by the btBvhTriangleMeshShape's constructor. You should look into the samples (demos) provided in the Bullet library for more.
Note that Bullet meshes can only be used as static colliders (terrain for instance), not for dynamic bodies. For that you should either use Convex Hulls and/or basic shapes to create bodies that resemble your mesh to some extent. Please see ConvexDecomposition demo for that.

  • 1
    \$\begingroup\$ Thank you, I was going to use it for my map but I'm sure i will need meshes in the future for characters when I get more advanced but thanks for the answer. \$\endgroup\$
    – MisterArch
    May 29, 2014 at 22:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .