[SOLVED] Failed to use physics implementation

  1. I'm using SVN version of both JME and Physics2 in Netbeans.
  2. I added as library all possible jars I found in both directories (includes: odejava-jni.jar).
  3. In VMOptions I have:



    -Djava.library.path="/usr/local/share/games/jme/jmesvn/lib/lwjgl/native/linux/:/usr/local/share/games/jme/jmephysics/impl/ode/lib/"


  4. There are no files with errors
  5. I run file: Lesson1.java and a screen appears for a second and then this error (window is closed):


Oct 3, 2009 1:46:30 PM com.jmex.physics.PhysicsSpace scanAvailableImplementations
WARNING: Failed to use physics implementation 'com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory' due to Exception/Error: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:169)
       at com.jmex.physics.PhysicsSpace.scanAvailableImplementations(PhysicsSpace.java:360)
       at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:340)
       at com.jmex.physics.util.SimplePhysicsGame.initSystem(SimplePhysicsGame.java:91)
       at com.jme.app.BaseGame.start(BaseGame.java:70)
       at com.jmetest.physicstut.Lesson1.main(Lesson1.java:99)
Caused by: java.lang.RuntimeException: Uncompilable source code - package org.odejava.ode does not exist
       at com.jmex.physics.impl.ode.OdePhysicsSpace$OdeFactory.<clinit>(OdePhysicsSpace.java:54)
       ... 7 more
Oct 3, 2009 1:46:30 PM com.jmex.physics.PhysicsSpace scanAvailableImplementations
WARNING: Failed to use physics implementation 'com.jmex.physics.impl.jbullet.JBulletPhysicsSpace$JBulletFactory' due to Exception/Error: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:169)
       at com.jmex.physics.PhysicsSpace.scanAvailableImplementations(PhysicsSpace.java:360)
       at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:340)
       at com.jmex.physics.util.SimplePhysicsGame.initSystem(SimplePhysicsGame.java:91)
       at com.jme.app.BaseGame.start(BaseGame.java:70)
       at com.jmetest.physicstut.Lesson1.main(Lesson1.java:99)
Caused by: java.lang.RuntimeException: Uncompilable source code - package com.bulletphysics.collision.broadphase does not exist
       at com.jmex.physics.impl.jbullet.JBulletPhysicsSpace$JBulletFactory.<clinit>(JBulletPhysicsSpace.java:9)
       ... 7 more
Oct 3, 2009 1:46:30 PM class com.jmetest.physicstut.Lesson1 start()
SEVERE: Exception in game loop
java.lang.IllegalStateException: No physics implementation was registered nor found!
       at com.jmex.physics.PhysicsSpace.create(PhysicsSpace.java:348)
       at com.jmex.physics.util.SimplePhysicsGame.initSystem(SimplePhysicsGame.java:91)
       at com.jme.app.BaseGame.start(BaseGame.java:70)
       at com.jmetest.physicstut.Lesson1.main(Lesson1.java:99)
BUILD SUCCESSFUL (total time: 1 second)


It said: "package org.odejava.ode does not exist", so I suppose it is related to the classpath or the library path... What am I missing here?

Thank you.

I think I solved following the suggestions in this thread:



http://www.jmonkeyengine.com/forum/index.php?topic=10991.0



Thank you.

I hope you use ODEJava just for testing. It is not stable.

Hi JackNeil,

If it is not ODEJava, which other options we have?

What features do you need?



When your use-cases are very restricted and can be described by a couple of special rules, the best option may be to write the code by yourself. That worked fine for Mad Skills Motocross and Grappling Hook.



When you need only 2D-Physics the Java port of the Box2D engine may be an option:

http://jbox2d.sourceforge.net/



In any other case the best option may be to encourage Falken224 to work faster on the jBullets-integration: http://www.jmonkeyengine.com/forum/index.php?topic=12033.0

I don't know the status of the integration. Maybe Falken224 can give a comment?


Hi JackNeil , I'm feeling I will owe you a lot once the game its finished  8)

I really appreciate all your comments!



These libraries looks really interesting, I need to spend more time playing with them. So, you wrote your own physics codes in Grappling Hook? I like physics, but I'm not that good applying them… mainly if they are 3D.



My idea is to develop a sport game, volleyball or baskeball… so, in that situation I think a 3d physics library would be the way to go? I think there will be some movements where simple 2D physics may be enough… but I'm not sure… what I know for sure is that I can't just leave the ball to move freely as it pleases… somehow I will have to control its movement (to make it easier to play).



Thank you.

Hi Christian,



After watching the physics examples, I though it might save me a lot of time in some operations, for example, if the ball hits  the basketball rim, the resulting movement should be unexpected in some sense. I thought it could be easier just to leave the physics do its job in that part… However, I agree with your comment, and now I think the physics will be not that difficult after all… I just need to restudy 3D vector forces and I think I will be on my way… It can be fun…  :stuck_out_tongue:



Meanwhile I have to get a new video card… 



My intention is not to play in the same court with EA Sports, but create an easy-to-play-and-fun game.



The force be with you,



Lepe