Hi, I’m using version 4.2 of the Minie library and I noticed that PhysicsSpace.addAll doesn’t seem to add joints.I tried the TestRagDoll code with both standard bullet libraries (works fine) and Minie 4.2 (doesn’t connect the limbs).
I looked thought the list of known issues, and couldn’t find this, so apologies if it’s a duplicate.
Also, calling PhysicsSpace.add on the individual joints works fine, so there is an easy workaround.
Looking at the code for Minie 4.2, only spatials are added:
This is a known incompatibility between jme3-jbullet and Minie. It dates back to April 2019.
In jme3-jbullet, the semantics of addAll(Spatial) and removeAll(Spatial) are problematic because there might be double-ended joints that have one end included in the Spatial tree while the other end isn’t. In that situation, it’s not clear what addAll() and removeAll() should do.
If you need to add joints, you can write your own code to do that.
Thanks, sorry for wasting your time with something you already knew about.
I know you probably have a million and one things to do (i.e making all this awesome software freely available), but if anyone has the time it might be worth updating the examples since it wasn’t immediately obvious (as a newbie) why things literally went to pieces on me!
So, if I understand correctly, the new behaviour is by design because if two spatials are connected by a joint it’s problematic to infer which of them the joint actually belongs to?
Not an example, strictly speaking, but TestRagDoll is what I used for reference.
It’s difficult with the semantics, since this is the kind of thing I always agonise over (and usually change back and forth several times). But if physicsspace.add accept both joints and spatials, it seems a bit counter-intuitive that addall doesn’t. Would it make sense to separate them out into addSpatial and addJoint (and addAllSpatials and addAllJoints)? Obviously this is proposed without any understanding of the wider issues, and with all the naivety of someone who’s been using JME for just over a week, but I thought I’d share anyway!
But if physicsspace.add accept both joints and spatials, it seems a bit counter-intuitive that addall doesn’t. Would it make sense to separate them out into addSpatial and addJoint (and addAllSpatials and addAllJoints)?
I see how the PhysicsSpace.add() method accepting spatials is a source of confusion. Physics spaces don’t actually contain spatials, only collision objects and joints.
As indicated in MInie’s javadoc, add() and addAll() are provided for compatibility with jme3-bullet, which has had those methods since before 2014. In my own projects, I try to avoid “for compatibility” methods in favor of more specific ones like addCollisionObject() and addJoint().
Perhaps it’s time to start deprecating the “for compatibility” methods in Minie.