	

//////////////////////////////////////

// 	 

//	Cam_sys Class

//	

//////////////////////////////////////



CONST INT AI_TYPE_ANY			=	0;
CONST INT AI_TYPE_SWITCH		= 	1;
CONST INT AI_TYPE_WARP			= 	2;
CONST INT AI_TYPE_WARP_AND_ROTATE	= 	4;
CONST INT AI_TYPE_SPLINES		= 	8;
CONST INT AI_TYPE_ANY_WO_SWITCH		= 	256;
CONST INT AI_TYPE_CHECK_PLAYER_HIDES_FOCUS= 	512;


CONST INT AI_TYPE_MELEE			= 	AI_TYPE_ANY;
CONST INT AI_TYPE_RANGED		= 	AI_TYPE_CHECK_PLAYER_HIDES_FOCUS | AI_TYPE_ANY;
CONST INT AI_TYPE_DIALOG		= 	AI_TYPE_CHECK_PLAYER_HIDES_FOCUS | AI_TYPE_ANY;
CONST INT AI_TYPE_MULT_POI		= 	AI_TYPE_ANY;


CONST INT BESTAZI_MODE_NONE		=	0;
CONST INT BESTAZI_MODE_ZTRANS		=	1;
CONST INT BESTAZI_MODE_DELAY		=	2;

CLASS CCamSys {
	// angles -180 to 180 
	VAR FLOAT bestRange;
	VAR FLOAT minRange;
	VAR FLOAT maxRange;
	VAR FLOAT bestElevation;
	VAR FLOAT minElevation;
	VAR FLOAT maxElevation;
	VAR FLOAT bestAzimuth;
	VAR FLOAT minAzimuth;
	VAR FLOAT maxAzimuth;
	VAR FLOAT bestRotZ;
	VAR FLOAT minRotZ;
	VAR FLOAT maxRotZ;
	VAR FLOAT rotOffsetX;
	VAR FLOAT rotOffsetY;
	VAR FLOAT rotOffsetZ;
	VAR FLOAT targetOffsetX;
	VAR FLOAT targetOffsetY;
	VAR FLOAT targetOffsetZ;

	// dynamic

	VAR FLOAT timePosChange;		// secs needed to reach ideal pos after start

	// warp related

	VAR FLOAT warpTime;		  	// time to reach endpoint (sec) while warping (camera-fahrt)

	// trägheit

	VAR FLOAT indolenceTrans;
	VAR FLOAT indolenceHead;

	// Collision / AI related

	VAR FLOAT   maxErrorRotX;
	VAR FLOAT   maxErrorRotY;               // max allowed deg. if leaving angle boundaries
	VAR FLOAT   maxErrorRange;
	VAR INT	    bestAziMode;  	
	VAR FLOAT   bestAziDelay;
	VAR FLOAT   maxLOSBlockTime;
	VAR INT	    seekPlayerPOI;
	VAR INT	    allowEvasionSearch;	    // flag if AI should search for evasions when switching to this camsys
	VAR INT	    translate;			    // translate relative to target, 1: on, 0: off
	VAR INT	    rotate;			    // rotate around target, 1: on, 0:off
	VAR INT	    collision;			// disable collision for this mode (ideal pos must be near player)
	VAR INT	    aiType;		    // 0: Any suitable, 1:Switches, 2:Straight rays, 3: Rotation & Range, 4: Splines, 5: AI1, 6:AI2 etc.

	// script- /auto - cam
	VAR INT	followTarget;  		// evtl. Heading / Transl. unterscheiden
	VAR FLOAT autoCamRange;
	VAR INT	autoCamCheckLOS;

};





PROTOTYPE CCamSys_Def(CCamSys) {

	bestRange 			= 2.0 ; 

	minRange  			= 1.99 ; 

	maxRange  			= 2.01 ; 

	bestElevation			= 0.0 ;

	minElevation			= 0.0;

	maxElevation			= 90.0; 

	bestAzimuth			= 0.0;  

	minAzimuth			= -90.0;

	maxAzimuth			= 90.0; 

	bestRotZ			= 0.0;  

	minRotZ				= 0.0;  

	maxRotZ				= 0.0;  

	rotOffsetX			= 20.0; 

	rotOffsetY			= 0.0;  

	rotOffsetZ			= 0.0;  

	targetOffsetX			= 0.0;
	targetOffsetY			= 0.0;
	targetOffsetZ			= 0.0;
	timePosChange			= 3;  

	warpTime			= 1.0;  

	indolenceTrans			= 0.02;    

	indolenceHead			= 0.0;    

	maxErrorRotX			= 0.0;  

	maxErrorRotY			= 180.0;

	maxErrorRange			= 0.0;  

	seekPlayerPOI			= 1;
	allowEvasionSearch		= 0;

	bestAziMode			= BESTAZI_MODE_NONE;

	bestAziDelay			= 2.0;

	maxLOSBlockTime			= 1.0;

	translate			= 1;    // translate to target, 1: on, 0: off

	rotate				= 1;    // rotate around target, 1: on, 0:off

	collision			= 1;	// disable collision for this mode (ideal pos must be near player)

	aiType		    	    	= AI_TYPE_ANY;    

	followTarget			= 1;    

	autoCamRange			= 0;    

	autoCamCheckLOS			= 0;    



};









