I hope you paid attention when @jayfella advised dividing the world up into zones/chunks/sections. Just because your monster mesh is loadable in a test context doesn’t make it wise to load it all at once in a simulation/game context.
It’s possible that other parts of the driving simulator are consuming (or corrupting) some resource, causing collision-shape generation to crash. If it’s a resource consumption issue, dividing up the world is likely to help.
Note that both
jme3-jbullet are precompiled libraries. They offer very similar APIs, but the underlying implementations are different:
jme3-bullet uses Java Native Interface to interface with the official Bullet Physics Library, which is written in C++, open-source, and actively maintained.
jbullet.jar, a Java translation of the Bullet Physics Library from circa 2009, the source code to which is not easily found.
It seems to me that
CollisionShapeFactory.createBoxShape() generates a box shape for each geometry in the model. In the case of the “crash model” you uploaded, that would mean 341 boxes, not one. But unless the model was designed with box shapes in mind, that’s unlikely to work well.
It’s also possible to create custom collision shapes (without going through
CollisionShapeFactory) by invoking the various shape constructors (
HeightfieldCollisionShape() and so on) directly. But
CollisionShapeFactory.createMeshShape() provides a nice, simple solution for static objects like a chunk of a city.
jme3-bullet is part of the jMonkey Engine, for which v3.2.1 is the latest release. Many users build jMonkey Engine from the
master branch in JME’s public repository, which includes a few bug fixes that haven’t made it into an official release yet. Possibly worth a try, if you’re desperate.
And even the
master branch of JME doesn’t use the latest native Bullet libraries. (Like JME v3.2.1, JME’s
master branch still uses the Bullet v2.86.1 release, which is now 21 months old.) If you’re interested, I can help you substitute a library more recent than v2.86.1 . (I’m currently using one that’s only 11 days old.) This is relatively easy and is (in my opinion) more likely to provide a fix for your immediate issue.
As it happens, I’m currently working on a fork of
Minie that includes some bug fixes that seem difficult to integrate into JME. It’s not 100% compatible with
jme3-bullet however, so I worry it might be incompatible with OpenDS.