Jme crashes when I add DynamicPhysicsObject to PhysicsWorld


I have been trying to run a simple physics example involving a box and a floor, but I can't get it to work. The program refuses to run unless I have commented out


where boxPhysics is a DynamicPhysicsObject. The StaticPhysicsObject works fine.

Any ideas about what causes this or how to fix it?

The error message:

INFO: Child (Box) attached to this node (rootNode)
Jan 7, 2006 2:57:16 PM com.jmex.physics.PhysicsWorld addObject
INFO: Physics Object (Floor) has been added to the PhysicsWorld
Jan 7, 2006 2:57:16 PM com.jmex.physics.PhysicsWorld addObject
INFO: Physics Object (Box) has been added to the PhysicsWorld
java.lang.NoSuchMethodError: com.jme.math.Quaternion.set(Lcom/jme/math/Quaternion;)V
   at com.jmex.physics.PhysicsSynchronizer.update(
   at com.jme.scene.Spatial.updateWorldData(Unknown Source)
   at com.jme.scene.Spatial.updateGeometricState(Unknown Source)
   at com.jme.scene.Node.updateWorldData(Unknown Source)
   at com.jme.scene.Spatial.updateGeometricState(Unknown Source)
   at Source)
   at Source)
   at TestSphere.main(
Jan 7, 2006 2:57:16 PM cleanup
INFO: Cleaning up resources.
Jan 7, 2006 2:57:16 PM start
INFO: Application ending.
# An unexpected error has been detected by HotSpot Virtual Machine:
#  SIGSEGV (0xb) at pc=0xb1783198, pid=8364, tid=2978839472
# Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode, sharing)
# Problematic frame:
# C  0xb1783198

The code, "borrowed" from someone else on this forum

import org.odejava.Odejava;

import com.jme.math.Vector3f;
import com.jme.scene.shape.Box;
import com.jmex.physics.DynamicPhysicsObject;
import com.jmex.physics.PhysicsObject;
import com.jmex.physics.PhysicsWorld;
import com.jmex.physics.StaticPhysicsObject;

public class TestSphere extends SimpleGame {
   Box boxGraphics;
   DynamicPhysicsObject boxPhysics;
   protected void simpleInitGame() {
      display.setTitle("Simple Test");

      // Set up the PhysicsWorld. It's got a couple of default
      // values, e.g. Earths gravity.

      // Here we tell the PhysicsWorld how many times per second we would like
      // to update it. It'll make the PhysicsWorlds internal timer govern the
      // frequency of update calls, thus obtaining frame rate independance.
      // We set it to 100 updates per second - the default is no restriction.
     // PhysicsWorld.getInstance().setUpdateRate(100);

      // Here we tell the PhysicsWorld how much should change with each
      // update. A bigger value leads to a faster animation. A step size
      // of 2/UPS (updates/sec) seem to give a rather nice simulation/result.
//      PhysicsWorld.getInstance().setStepSize(2f/100f);

      // Creates the box that makes out the floor (graphics only).
      Box floorGraphics = new Box("Floor", new Vector3f(), 50, 1, 50);

      // We move it down 5 units, and away from the camera 10 units.
      floorGraphics.setLocalTranslation(new Vector3f(0, -5, 10));

      // Add the graphical representations to the rootNode. You could also get
      // references to them by calling PhysicsObject.getSpatial().

      // In order to add it to the PhysicsWorld we need to create a
      // PhysicsObject from it. Note that we don't pass a mass in the constructor.
      // This is because it's static.
      PhysicsObject floorPhysics = new StaticPhysicsObject(floorGraphics);

      // Creates the box that falls down on the floor.
      boxGraphics = new Box("Box", new Vector3f(), 1f, 1f, 1f);

      // We move it 10 units up, and 10 units away from the camera.
      boxGraphics.setLocalTranslation(new Vector3f(-10, 10, 10));
      // Attach the graphical representation to the scene.

      // Create a dynamic physics object from it. Because it is dynamic, we
      // need to provide it with a mass.
      boxPhysics = new DynamicPhysicsObject(boxGraphics, 1f);

      com.jme.math.Quaternion q = new com.jme.math.Quaternion();
     // PhysicsWorld.getInstance().addObject(boxPhysics);

   protected void cleanup() {
    * Gets called every frame.
   protected void simpleUpdate() {
      boxPhysics.setTorque(new Vector3f(0, 20f, 0));


   public static void main(String[] args) {
      TestSphere app = new TestSphere();

It looks as though there is a problem with the version of jME-Physics to jME you are running.  What version of each are you running?

Your problem will resolve itself if you update to the version of both in CVS.


I am running jme from cvs and jme-physics v0.4( I think) from . Still trying to check out jme-physics from


cvs -d :pserver:[username] login


cvs -d :pserver:[username] checkout -P jme-physics


See this page for correct commands:

And, yes,

haakon said:

I am running jme from cvs and jme-physics v0.4( I think)

that'd be the problem!

I need to update that source code. :o


Thanks guys

After several hours of doing battle with the sourceforge cvs server I finally managed to get the sources, and now my box is falling towards the floor as it should.