Bullet triangle mesh scaling/multiple objects

Ok, got it. Thank you.

The floor.egg seems weired indeed. Just try this (Python) code:

np = loader.loadModel('floor.egg')
np.ls()
for geomNP in np.findAllMatches('**/+GeomNode'):
  geomNode = geomNP.node()
  print geomNP.getTransform(np)
  for geom in geomNode.getGeoms():
    print geom.getVertexData()

No Bullet stuff in here, just plain Panda3D. Anyway, the output will show vertices at (1,1,1), (-1,1,1) etc. Not what I would expect after looking at the .egg file. I can’t explain what is going on here. In order to get an explanation I think we need rdb or drwr.

But I know what helps: flatten light after loading

By the way, you don’t need a new shape for each geom. And if you are not using the Panda3D internal collision system you probably have no use for the contained Panda3D collision solids. You could try to export without the " { Polyset keep descend }". Maybe this way you can get rid of the in the .egg file (which causes this effect).

This is the code I used for loading. It’s Python, but I guess you can translate to C++:

np = loader.loadModel('floor.egg')
np.reparentTo(render)
np.flattenLight()

mesh = BulletTriangleMesh()
for geomNP in np.findAllMatches('**/+GeomNode'):
  geomNode = geomNP.node()
  ts = geomNP.getTransform(np)
  for geom in geomNode.getGeoms():
    mesh.addGeom(geom, ts)

shape = BulletTriangleMeshShape(mesh, False)
floor = BulletRigidBodyNode('floor')
floor.addShape(shape)
floorNP = render.attachNewNode(floor)
floorNP.setPos(0, 0, 0)
floorNP.setCollideMask(BitMask32.allOn())
world.attachRigidBody(floor)