CollisionListener not detecting

I'm trying to use jbullet-jme and I decided to start with a simple collision detection. Unfortunately, I'm running into a problem. I create a sphere and box and set them up with an applied force so that the box will collide with the sphere. When I run my application, I see the box collide with the sphere and then start pushing the sphere forward. However, my CollisionListener never gets notified.

      Sphere sphere=new Sphere("physicssphere",16,16,1f);

      //Create physics sphere from it
      PhysicsNode physicsSphere=new PhysicsNode(sphere, CollisionShape.ShapeTypes.SPHERE);
      physicsSphere.setLocalTranslation(new Vector3f(0,0,33));
      physicsSphere.applyContinuousForce(true, new Vector3f(0,0,-4));

      //Add sphere to jme scenegraph

      //Add sphere to physics space
      Box box = new Box("box", new Vector3f(0,0,0),1,1,1);
      //Create physics box from it
      PhysicsNode physicsBox=new PhysicsNode(box, CollisionShape.ShapeTypes.BOX);
      physicsBox.setLocalTranslation(new Vector3f(0,0,10));
      physicsBox.applyContinuousForce(true, new Vector3f(0,0,100));

      //Add sphere to jme scenegraph

      //Add sphere to physics space

I should also note that I do register a listener with physicsSpace:

      physicsSpace = PhysicsSpace.getPhysicsSpace();
      physicsSpace.setGravity(new Vector3f(0,0,0));

Any help is greatly appreciated.

The PhysicsSpace has to be created on the same thread it is updated, please see this thread about this problem.



Thanks, that did the trick!