#include "model_test.h"

#include "scenenode.h"

#include <glm/gtx/transform.hpp>
// glm::perspective
#include <glm/gtc/matrix_projection.hpp>
// glm::translate, glm::rotate, glm::scale
#include <glm/gtc/matrix_transform.hpp>
// glm::value_ptr
#include <glm/gtc/type_ptr.hpp> 

#include "transformation_node.h"
#include <time.h>

using namespace std;

model_test::model_test()
{}


model_test::~model_test()
{}


bool model_test::init()
{

	//wavefront object model setup
	//if(object_model.loadMod("../../models/quad.obj"))
	//{
	//	cout << "object model loading failed\n";
	//	//cube.obj, cauldron_Scene
	//	return false;
	//}	

	
	cout << "in init() " << endl;

	//glm::vec3 p1 = glm::vec3(0.0f, 0.0f, 0.0f);
	//glm::vec3 p2 = glm::vec3(1.0f, 0.0f, 0.0f);
	//glm::vec3 p3 = glm::vec3(1.0f, 1.0f, 0.0f);
	//glm::vec3 p4 = glm::vec3(1.0f, 1.0f, 1.0f);

	//glm::vec3 t2 = (p4-p2);
	//t2.x = t2.x * 0.5;
	//t2.y = t2.y * 0.5;
	//t2.z = t2.z * 0.5;
	//cout << t2.x << "/" << t2.y << "/" << t2.z << endl;

	//KORREKT
	spline.load_cam_positions("../../camerapoints.txt");

	//clock_t  begin;
	//begin = clock() * CLK_TCK;
	//cout << begin << endl;
	//begin = clock() *CLK_TCK;
	//cout << begin << endl;
	//float start = clock() * CLK_TCK;
	//float end = clock() * CLK_TCK;

	//float milli = (end - start)/1000;
	//cout << milli << endl;
	//float sec = milli/1000;
	//cout << sec << endl;

	//SYSTEMTIME systemTime;
	//GetSystemTime( &systemTime );

	//FILETIME fileTime;
	//SystemTimeToFileTime( &systemTime, &fileTime );

	//ULARGE_INTEGER uli;
	//uli.LowPart = fileTime.dwLowDateTime; // could use memcpy here!
	//uli.HighPart = fileTime.dwHighDateTime;

	// ULONGLONG systemTimeIn_ms( uli.QuadPart/10000 );

	//std::cout << "System time in ms since 1 January 1601 (UTC): "
 //          << systemTimeIn_ms << '\n';

	return true;
}


void model_test::cleanup()
{
	//at the moment, do nothing
}