private void updateCamera() {
Camera camera = config.getCamera();
Vec dir = camera.getDir();
Vec target = camera.getTarget();
Vec camX = camera.getX();
Vec camY = camera.getY();
Vec orig = camera.getOrig();
vsub(dir, target, orig);
vnorm(dir);
Vec up = Vec.create().setX(0).setY(1).setZ(0);
vxcross(camX, dir, up);
vnorm(camX);
vmul(camX, config.getWidth() * .5135f / config.getHeight(), camX);
vxcross(camY, camX, dir);