@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());
    }
This is the main event loop--walking happens here.
We check in which direction the player is walking by interpreting
the camera direction forward (camDir) and to the side (camLeft).
The setWalkDirection() command is what lets a physics-controlled player walk.
We also make sure here that the camera moves with player.
jme3-examples/src/main/java/jme3test/helloworld/HelloTerrainCollision.java