I am trying to generate a BulletTriangleMeshShape from a .bam model file by using the following lines:
modelNP = loader.loadModel('path_to_model') geom = modelNP.findAllMatches('**/+GeomNode').getPath(0).node().getGeom(0) mesh = BulletTriangleMesh() shape = BulletTriangleMeshShape(mesh, dynamic=False)
and then adding the shape to a BulletRigidBodyNode. When using a sample .egg file it works fine, however when I try to use a .bam file, the TriangleMesh does not match the model at all (I just get a large sphere enclosing my visual model).
In the C++ API reference of the GeomNode class i found several functions concerning the BamReader (i.e register_with_read_factory()), but the Python API reference of the GeomNode class does not mention .bam files at all.
Does the code snippet above not work with .bam files in general, did I do something wrong or is there another way of generating colllision shapes from .bam files?
Thanks a lot in advance!