How to make jointed things collide with themselves?

I'm  playing around with physics, and I'm trying to get 2 objects that are jointed together to behave like they should…



I put a box on top of another box and dropped them onto a plane. They fell and bounced off of each other.



Then I added a joint between them. They fell, and moved through each other (even though the joint was working just fine and holding them together.)



Do I have to limit the joint so that collisions aren't possible?

Currently there is no option to collide joint nodes with each other. It is prevented in the C++ part of ODEJava. The joints would need an option for it… it's on the todo list, but no eta, yet, sorry.



Depending on your case you can restrict joint angles as a workaround, yes.

hey, luckily we needed exactly this feature at work today :slight_smile:

You can call

joint.setCollisionEnabled(true);


now.

odejava-jni natives need to be compiled for linux and mac before you can use it, though (currently only the dll is up to date).

Edit: Hehe, just realized that it even was the same day you were asking for it - quite a coincidence 8)

I'll try to update the mac binary this afternoon.

cool



linux 32 is there now

I'm secretly your boss.



Thanks Irrisor!

Well, you've probably seen this question before but… I can't get physics to run now.



In an effort to gain access to that method …

I totally deleted the jme physics and jme projects and got them again from CVS, just to be safe :confused:

I wish I had read a little further so I'd have known about the team->update option, but too late for that now.



Redid the setup in eclipse tutorials.



I got JME to work again,

but with physics I get:


Native code library (32 and 64 bit library) failed to load: java.lang.UnsatisfiedLinkError: C:myprojectsjMEPhysics2implodelibodejava.dll: Can't find dependent libraries
java.lang.UnsatisfiedLinkError: C:myprojectsjMEPhysics2implodelibodejava.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.odejava.Odejava.<clinit>(Odejava.java:88)
at com.jmex.physics.impl.ode.OdePhysicsSpace.<init>(OdePhysicsSpace.java:309)
at com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory.create(OdePhysicsSpace.java:198)
at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:330)
at com.jmex.physics.util.SimplePhysicsGame.initSystem(SimplePhysicsGame.java:90)
at com.jme.app.BaseGame.start(BaseGame.java:65)
at com.jmetest.physics.TestGenerateGeometry.main(TestGenerateGeometry.java:152)
Oct 18, 2007 11:07:38 PM class com.jmetest.physics.TestGenerateGeometry start()
SEVERE: Exception in game loop
java.lang.UnsupportedOperationException: Failed to load natives
at org.odejava.Odejava.init(Odejava.java:125)
at com.jmex.physics.impl.ode.OdePhysicsSpace.<init>(OdePhysicsSpace.java:309)
at com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory.create(OdePhysicsSpace.java:198)
at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:330)
at com.jmex.physics.util.SimplePhysicsGame.initSystem(SimplePhysicsGame.java:90)
at com.jme.app.BaseGame.start(BaseGame.java:65)
at com.jmetest.physics.TestGenerateGeometry.main(TestGenerateGeometry.java:152)
Caused by: java.lang.UnsatisfiedLinkError: C:myprojectsjMEPhysics2implodelibodejava.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.odejava.Odejava.<clinit>(Odejava.java:88)
... 6 more



I've redone it about 3 times so I don't know what's wrong.  Sorry to bug you with newb questions.

Strange enough, the dll cannot be loaded as required dlls are missing… what should that be? Tthe odejava.dll requires kernel32.dll and user32.dll, only. Can you use this tool (simply open the odejava.dll with it) to find the missing dlls, please?

Hi, i got the same error as Brownmonk so i have used DependencyWalker on odejava.dll due to irrisor's advice, and it wrote that ode.dll is missing… so i have downloaded it from ode.org, copied to impl/ode/lib folder and it works! So thank you very much, Irrisor  :slight_smile:

Interesting. But then it's the wrong odejava.dll, I'll see what I can do about it.

ok, found it - should be fixed now (ode.dll not needed any more).

Thanks again! Works fine now.