Physics walk direction and frame rate?

I’m using the default solution for movement.

 @Override
    public void simpleUpdate(float tpf) {
        camDir.set(cam.getDirection()).multLocal(0.6f);
        camLeft.set(cam.getLeft()).multLocal(0.4f);
        walkDirection.set(0, 0, 0);
        if (left) {
            walkDirection.addLocal(camLeft);
        }
        if (right) {
            walkDirection.addLocal(camLeft.negate());
        }
        if (up) {
            walkDirection.addLocal(camDir);
        }
        if (down) {
            walkDirection.addLocal(camDir.negate());
        }
        player.setWalkDirection(walkDirection);
        cam.setLocation(player.getPhysicsLocation());
    }
}

I was under the impression you didn’t need to apply tpf to the walk direction as the physics class handled it. I noticed my speed drop severely when my frame rate does. Is this true or I have I been doing it wrong all along ?

No you don’t need to apply tpf. For your issue look at the javadoc of PhysicsSpace.setMaxSubSteps

Here: http://docs.jmonkeyengine.org/advanced/walking_character.html
it says:

walkDirection.multLocal(25f).multLocal(tpf);
// The use of the first multLocal here is to control the rate of movement multiplier for character walk speed. The second one is to make sure the character walks the same speed no matter what the frame rate is.

character.setWalkDirection(walkDirection);
// THIS IS WHERE THE WALKING HAPPENS

Thanks for the pointer. I was going through my physics set up when I found this.

bulletAppState.getPhysicsSpace().setAccuracy(1/80f);

I was playing with the accuracy because I couldn’t get rigid bodies to collide. Commenting that out fixed the problem. That seemed to be lagging out the physics engine.

This is actually wrong, as you see its not in the actual code. Momoko_Fan falsely “corrected” the code at some point to include tpf which was also when Zathras did the documentation.