Version 4.7.1 of the Minie physics library was released today (11 March).
If you have projects that use Minie, I recommend updating to the new release.
EDIT: v4.7.1 is no longer recommended due to issue 23. Use v4.8.1 instead.
The release adds new APIs related to rigid-body contacts, based on suggestions made by @qwq.
When Bullet Physics detects a collision between 2 rigid bodies, it generates a contact manifold that approximately describes the intersection of their shapes. Each manifold is composed of up to 4 contact points. Bullet uses contact manifolds and contact points to resolve rigid-body collisions by the end of the current physics step.
The old collision-detection mechanisms [
addOngoingCollisionListener()] generate a
PhysicsCollisionListener callback for every contact point. However, such callbacks don’t occur immediately (in the the midst of a physics step). Instead, the
PhysicsSpace queues up
PhysicsCollisionEvents and delivers them to the application during the next
BulletAppState.update(). This is convenient because
update() occurs on the render thread (which might be distinct from the physics thread), so it’s OK to modify the scene graph in a
The new mechanism [
addContactListener()] generates callbacks in the midst of a physics step. It is more efficient (because no event object is created). It also enables applications to modify contact points on the fly, which proves useful for simulating conveyor belts, as in a classic Bullet Physics example:
@qwq has kindly provided a JMonkeyEngine version of the conveyor-belt demo: Minie/ConveyorDemo.java at master · stephengold/Minie · GitHub
A possible downside is that the new callbacks occur on the physics thread. It isn’t always safe to modify the scene graph from such contexts. However, the old mechanisms are still available in case you need them.
The release also adds methods to enumerate (and count) all contact manifolds in a
PhysicsSpace. These methods are intended for debugging rigid-body contacts and may also prove useful for collision detection.
The release also fixes a couple minor bugs. (See the release log for details.)
It’s named “4.7.1” because the “4.7.0” release suffered a build failure. I apologize for any confusion or inconvenience caused by the numbering gap.