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));
physicsSphere.setMass(10);
//Add sphere to jme scenegraph
getRootNode().attachChild(physicsSphere);
physicsSphere.updateRenderState();
//Add sphere to physics space
physicsSpace.add(physicsSphere);
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));
physicsBox.setMass(10);
//Add sphere to jme scenegraph
getRootNode().attachChild(physicsBox);
physicsBox.updateRenderState();
//Add sphere to physics space
physicsSpace.add(physicsBox);
I should also note that I do register a listener with physicsSpace:
physicsSpace = PhysicsSpace.getPhysicsSpace();
physicsSpace.addCollisionListener(this);
physicsSpace.setGravity(new Vector3f(0,0,0));
Any help is greatly appreciated.