#ifndef DEF_MOTIONS
 #define DEF_MOTIONS
//------------------------------------------//
//	TKA4 CEngine and basis Graph classes	//
//				19. 04. 2007				//
//------------------------------------------//


//--- Includes
#include <windows.h>
#include <stdio.h>
#include <math.h>

#include "TX_Engine.h"
//=== Includes 


//--- Pragma 
#pragma warning(disable:4305) 
//=== Pragma 

//--- Defines
#define H_STEP  3.0f
//=== Defines


//---------------------------------------------------------------------


//---  Camera Gradual Motion  ---//
class txObj_CameraGradualMotion : public txObject {
private :	
	
	//--- helper subroutine
	inline void interpolate(GLfloat *cot, GLfloat *ct) {
		for (int i = 0; i<3; i++)
			cot[i] = cot[i] + (ct[i]-cot[i])/H_STEP; 
	};

public :

	//--- txObj :: Execute Forward
	virtual void Execute_Forward()
	{
		GLTFrame *co = &World -> CameraOld, *c = &World -> Camera;

		//if (World->World_Time - local_time > H_STEP+1)

		interpolate(co -> vForward, c -> vForward);
		interpolate(co -> vLocation, c -> vLocation);
		interpolate(co -> vUp, c -> vUp);
		

		gltApplyCameraTransform(&World->CameraOld);	
	}

};


//------------------------- :: Functions :: ---------------------------


#endif



