@Override
    public void simpleUpdate(float tpf) {
        Vector3f camDir = cam.getDirection().clone().multLocal(0.1f);
        Vector3f camLeft = cam.getLeft().clone().multLocal(0.1f);
        camDir.y = 0;
        camLeft.y = 0;
        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());
        }
        if (!character.onGround()) {
            airTime = airTime + tpf;
        } else {
            airTime = 0;
        }

        Action action = composer.getCurrentAction("walkingLayer");
        if (walkDirection.length() == 0f) {
            if (action != standAction) {
                composer.setCurrentAction("stand", "walkingLayer");
            }
        } else {
            character.setViewDirection(walkDirection);
            if (airTime > 0.3f) {
                if (action != standAction) {
                    composer.setCurrentAction("stand", "walkingLayer");
                }
            } else if (action != walkAction) {
                composer.setCurrentAction("Walk", "walkingLayer");
            }
        }
        character.setWalkDirection(walkDirection);
    }
A walking animated character followed by a 3rd person camera on a terrain with LOD.
@author normenhansen
jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java