The new jar you gave me fixed the problem with regards to PhysicsObjects syncing with dynamic Geometry.
However, I have a new problem. I have my ship and I have a box. I just want basic regular old collision detection between the two. Unfortunately the ship is able to fly through about half the box before it collides with anything. From the other direction the ship collides with nothing. It’s almost as though the physical box used for collision detection is shifted a little to the left. Here’s the relavant code.
protected void simpleInitGame() {
//Create PhysicsWorld
PhysicsWorld.create();
//Set up the PhysicsWorld. It's set with default values, e.g. Earths
// gravity.
PhysicsWorld.getInstance().setGravity(new Vector3f(0,0,0));
// 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 = faster animation. A step size of 2/UPS (updates/sec)
// seem to give a rather nice simulation/result.
PhysicsWorld.getInstance().setStepSize(2/100f);
//Create our Geometry
//ShipModel simply extends TriMesh
ShipModel ship = new ShipModel("My Ship");
//Since ship is a trimesh it needs a bounding volume (or at least it complains when I don't have it)
ship.setModelBound(new BoundingBox());
ship.updateModelBound();
Box box = new Box("box",new Vector3f(0,-2,0),new Vector3f(4,4,4)); // Make a box
box.setLocalTranslation(new Vector3f(-10,0,0));
// Create our Physics Objects
shipObj = new PhysicsObject(ship, 50f);
PhysicsObject boxObj = new PhysicsObject(box);
// Add the graphical representations to the rootNode. You can also get
// a reference to it by calling PhysicsObject.getjMEGeometry().
rootNode.attachChild(ship);
rootNode.attachChild(box);
// And the physical representations to the PhysicsWorld.
PhysicsWorld.getInstance().addObject(shipObj);
PhysicsWorld.getInstance().addObject(boxObj);
//Pass a reference to the ship to the input handlers so they can manipulate the geometry and forces
shipMovementInput.init(shipObj);
lightState.setEnabled(false);
}
Once again thank you for all your help. By the way, when the ship hit the box it spun all around in circles and everything. It was awesome to look at hehe.