float camMinHeightPlayer = player.getWorldTranslation().y + 2f; if(camMinHeightPlayer < tb.getHeight(cam.getLocation())) { camMinHeightPlayer = tb.getHeight(cam.getLocation()) + 2;
if(cam.getLocation().y < (tb.getHeight(cam.getLocation())+2)) { cam.getLocation().y = tb.getHeight(cam.getLocation()) + 2; cam.update();
    protected void update(float interpolation) {        // update the time to get the framerate        timer.update();        interpolation = timer.getTimePerFrame();        //update the keyboard input (move the player around)        input.update(interpolation);        //update the chase camera to handle the player moving around.        chaser.update(interpolation);        fence.update(interpolation);                //we want to keep the skybox around our eyes, so move it with        //the camera        skybox.setLocalTranslation(cam.getLocation());                // if escape was pressed, we exit        if (KeyBindingManager.getKeyBindingManager().isValidCommand("exit")) {            finished = true;        }                //We don't want the chase camera to go below the world, so always keep         //it 2 units above the level.        float camMinHeightPlayer = player.getWorldTranslation().y + 2f;        if(camMinHeightPlayer < tb.getHeight(cam.getLocation())) {            camMinHeightPlayer = tb.getHeight(cam.getLocation()) + 2;        }        cam.getLocation().y = camMinHeightPlayer;        cam.update();               //make sure that if the player left the level we don't crash. When we add collisions,        //the fence will do its job and keep the player inside.        float characterMinHeight = tb.getHeight(player                .getLocalTranslation())+((BoundingBox)player.getWorldBound()).yExtent;        if (!Float.isInfinite(characterMinHeight) && !Float.isNaN(characterMinHeight)) {            player.getLocalTranslation().y = characterMinHeight;        }                //Because we are changing the scene (moving the skybox and player) we need to update        //the graph.        scene.updateGeometricState(interpolation, true);    }