A physics simulation can be quite a loose cannon. Don't be surprised when physical objects jitter or are unceremoniously hurled out of the scene. Congratulations, you have created a physically impossible state! Most likely, you positioned two solid objects too close to each other. How do you find the source of the problem?
Activate the physics debug mode to visualize the actual collision shapes. Some dynamic objects receive
HullCollisionShapes
by default, which are not mesh-accurate. Make certain that no collision shapes overlap. You can render the (otherwise invisible) collision shapes as wireframes with the following command:bulletAppState.getPhysicsSpace().enableDebug(assetManager); // on bulletAppState.getPhysicsSpace().disableDebug() // off
Make sure you do not smash dynamic or static objects into one another by using
setLocalTranslation()
ormove()
instead of using a physics-aware method.Remember to check unintended overlaps with floor or...