#include "CameraBase.h"

#include <GL/gl.h>
#include <GL/glu.h>

namespace Engine {

/*
 * Inherited Module functions
 */
int CameraBase::OnInit (int argc, char* argv[]) {
	LogDebug ("Camera Init");

	mEye[0] = 0.;
	mEye[1] = 1.;
	mEye[2] = 1.;

	mPointOfIntrest[0] = 0.;
	mPointOfIntrest[1] = 0.;
	mPointOfIntrest[2] = 0.;

	mUp[0] = 0.;
	mUp[1] = 1.;
	mUp[2] = 0.;

	mFOVY = 90.;

	return 0;
}

void CameraBase::OnDestroy () {
	LogDebug ("Camera Destroy");
}

/*
 * Module specific functions
 */
void CameraBase::Update () {
	glMatrixMode (GL_MODELVIEW);

	glLoadIdentity ();
	gluLookAt(mEye[0], mEye[1], mEye[2],
			mPointOfIntrest[0], mPointOfIntrest[1], mPointOfIntrest[2],
			mUp[0], mUp[1], mUp[2]);

}

}

