#if !defined(__CINEINFO_H__)
#define __CINEINFO_H__
 
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
 
#include "GAM/Header.h"
 
#undef EXTERN
#undef extern
#if !defined(D_CineInfo_VariableDefine)
#define EXTERN extern
#else
#define EXTERN
#endif /* D_CineInfo_VariableDefine */
 
#if defined(__cplusplus)
extern "C"
{
#endif /* __cplusplus */
 
 
/*
 **************************************************************************************************
 **************************************************************************************************
	 FOR CAMERA CONSTANTS
 **************************************************************************************************
 **************************************************************************************************
 */
 
 
 
	
typedef struct CAM_tdstCameraConstants_
{
/* never change the order of those members !!!*/
/* always add new members at the end of the structure !!!*/
	
	MTH_tdxReal		xRayCameraSphereToGo1;				/* Ray of camera sphere to determin if camera can go to a given position (source and dest) */
	MTH_tdxReal		xRayCameraSphereToGo2;
	MTH_tdxReal		xRayCameraSphereToSee1;				/* Ray of camera sphere to determin if camera can see a given position (source and dest) */
	MTH_tdxReal		xRayCameraSphereToSee2;
 
/* never change the order of those members !!!*/
/* always add new members at the end of the structure !!!*/
	MTH_tdxReal		xBaseAngleComputePosNormal;			/* Min angle for choosing a new good position in normal mode */
	MTH_tdxReal		xBaseAngleComputePosFailure;		/* Min angle for choosing a new good position in case of failure */
 
/* never change the order of those members !!!*/
/* always add new members at the end of the structure !!!*/
	MTH_tdxReal		xAverageForComputePos;				/* Window time to compute position of targeted perso */
	MTH_tdxReal		xAverageForComputeLinearSpeed;		/* Window time to compute linear speed of targeted perso */
 
/* never change the order of those members !!!*/
/* always add new members at the end of the structure !!!*/
	MTH_tdxReal		xMinLinearSpeedCamera;				/* Below, camera is considered not move... */
	MTH_tdxReal		xMinLinearSpeedTgtPerso;			/* Below, is considered not move... */
	MTH_tdxReal		xMinAngularSpeedTgtPerso;			/* Below, is considered not turn... */
 
/* never change the order of those members !!!*/
/* always add new members at the end of the structure !!!*/
	MTH_tdxReal		xEpsilonDynTgtAngle;				/* Dyn target compute if greate than... */
	MTH_tdxReal		xEpsilonDynTgtFocalAngle;			/* Perso must be in focal with that epsilon */
	MTH_tdxReal		xEpsilonForEqualVectors;			/* Two vectors are considered to be equal with that tolerance */
 
/* never change the order of those members !!!*/
/* always add new members at the end of the structure !!!*/
	MTH_tdxReal		xOffsetMinDistPerso;				/* Minimum distance of camera to targeted perso depending on BoundDistMin */
	MTH_tdxReal		xDistanceForNoCut;					/* When visibility failure, no cut if new pos at this distance of camera */
 
/* never change the order of those members !!!*/
/* always add new members at the end of the structure !!!*/
	short			xNumRayCameraCanGo;					/* Number of ray to determin if camera can go to a given point */
	short			xNumRayCameraCanSee;				/* Number of ray to determin if camera can see a given point */
 
/* never change the order of those members !!!*/
/* always add new members at the end of the structure !!!*/
	short			xTickTestVisibility;				/* Every n trames, we test visibility */
	short			xTickFindBetterPos;					/* Every n trames, we try to find a better position if we are not at the first ideal one */
	short			xTickFindBetterPosIfNoMove;			/* The same but force if the camera is not moving */
	short			xTickFailureCantSee;				/* If camera can't see target during n trames, failure */
	
/* never change the order of those members !!!*/
/* always add new members at the end of the structure !!!*/
	/* For dynamic speed */
	MTH_tdxReal		xDynSpeed_LinearFactNorm;
	MTH_tdxReal		xDynSpeed_LinearMax;
	MTH_tdxReal		xDynSpeed_LinearMulPerso;
	MTH_tdxReal		xDynSpeed_AngularFactNorm;
	MTH_tdxReal		xDynSpeed_AngularMax;
	MTH_tdxReal		xDynSpeed_AngularMulPerso;
	MTH_tdxReal		xDynSpeed_TargetFactNorm;
	MTH_tdxReal		xDynSpeed_TargetMax;
	MTH_tdxReal		xDynSpeed_TargetMulPerso;
 
/* never change the order of those members !!!*/
/* always add new members at the end of the structure !!!*/
	MTH_tdxReal		xBaseCutAngle;						/* To cut angles */
	MTH_tdxReal		xCutAngleFactorPos;
	MTH_tdxReal		xCutAngleFactorTgt;
 
/* never change the order of those members !!!*/
/* always add new members at the end of the structure !!!*/
	short			wFlags;								/* Some flags */
 
/* new members here !	*/
	short			wAlign;
 
} CAM_tdstCameraConstants;
 
extern CAM_tdstCameraConstants	CAM_g_stCameraConstants;
extern CAM_tdstCameraConstants	CAM_g_stCopyCameraConstants;
 
 
#define		CAM_C_xRayCameraSphereToGo1							(CAM_g_stCameraConstants.xRayCameraSphereToGo1)
#define		CAM_C_xRayCameraSphereToGo2							(CAM_g_stCameraConstants.xRayCameraSphereToGo2)
#define		CAM_C_xRayCameraSphereToSee1						(CAM_g_stCameraConstants.xRayCameraSphereToSee1)
#define		CAM_C_xRayCameraSphereToSee2						(CAM_g_stCameraConstants.xRayCameraSphereToSee2)
 
#define		CAM_C_xBaseAngleComputePosNormal					(CAM_g_stCameraConstants.xBaseAngleComputePosNormal)
#define		CAM_C_xBaseAngleComputePosFailure					(CAM_g_stCameraConstants.xBaseAngleComputePosFailure)
#define		CAM_C_xBaseCutAngle									(CAM_g_stCameraConstants.xBaseCutAngle)
 
#define		CAM_C_xAverageForComputePos							(CAM_g_stCameraConstants.xAverageForComputePos)
#define		CAM_C_xAverageForComputeLinearSpeed					(CAM_g_stCameraConstants.xAverageForComputeLinearSpeed)
 
#define		CAM_C_xMinLinearSpeedCamera							(CAM_g_stCameraConstants.xMinLinearSpeedCamera)
#define		CAM_C_xMinLinearSpeedTgtPerso 						(CAM_g_stCameraConstants.xMinLinearSpeedTgtPerso)
#define		CAM_C_xMinAngularSpeedTgtPerso 						(CAM_g_stCameraConstants.xMinAngularSpeedTgtPerso)
 
#define		CAM_C_xEpsilonDynTgtAngle							(CAM_g_stCameraConstants.xEpsilonDynTgtAngle)
#define		CAM_C_xEpsilonDynTgtFocalAngle						(CAM_g_stCameraConstants.xEpsilonDynTgtFocalAngle)
#define		CAM_C_xEpsilonForEqualVectors						(CAM_g_stCameraConstants.xEpsilonForEqualVectors)
 
#define		CAM_C_xMinDistPerso									(_p_stStruct->hCineinfoWork->xBoundDistMin)
#define		CAM_C_xMinDistPersoToComputePos						(MTH_M_xAdd(CAM_C_xMinDistPerso, CAM_g_stCameraConstants.xOffsetMinDistPerso))
#define		CAM_C_xDistanceForNoCut								(CAM_g_stCameraConstants.xDistanceForNoCut)
 
#define		CAM_C_xDynSpeed_LinearFactNorm						(CAM_g_stCameraConstants.xDynSpeed_LinearFactNorm)
#define		CAM_C_xDynSpeed_LinearMax							(CAM_g_stCameraConstants.xDynSpeed_LinearMax)
#define		CAM_C_xDynSpeed_LinearMulPerso						(CAM_g_stCameraConstants.xDynSpeed_LinearMulPerso)
#define		CAM_C_xDynSpeed_AngularFactNorm						(CAM_g_stCameraConstants.xDynSpeed_AngularFactNorm)
#define		CAM_C_xDynSpeed_AngularMax							(CAM_g_stCameraConstants.xDynSpeed_AngularMax)
#define		CAM_C_xDynSpeed_AngularMulPerso						(CAM_g_stCameraConstants.xDynSpeed_AngularMulPerso)
#define		CAM_C_xDynSpeed_TargetFactNorm						(CAM_g_stCameraConstants.xDynSpeed_TargetFactNorm)
#define		CAM_C_xDynSpeed_TargetMax							(CAM_g_stCameraConstants.xDynSpeed_TargetMax)
#define		CAM_C_xDynSpeed_TargetMulPerso						(CAM_g_stCameraConstants.xDynSpeed_TargetMulPerso)
 
#define		CAM_C_xNumRayCameraCanGo							(CAM_g_stCameraConstants.xNumRayCameraCanGo)
#define		CAM_C_xNumRayCameraCanSee							(CAM_g_stCameraConstants.xNumRayCameraCanSee)
 
#define		CAM_C_xTickTestVisibility							(CAM_g_stCameraConstants.xTickTestVisibility)
#define		CAM_C_xTickFindBetterPos							(CAM_g_stCameraConstants.xTickFindBetterPos)
#define		CAM_C_xTickFindBetterPosIfNoMove					(CAM_g_stCameraConstants.xTickFindBetterPosIfNoMove)
#define		CAM_C_xTickFailureCantSee    						(CAM_g_stCameraConstants.xTickFailureCantSee)
 
#define		CAM_C_xCutAngleFactorPos							(CAM_g_stCameraConstants.xCutAngleFactorPos)
#define		CAM_C_xCutAngleFactorTgt							(CAM_g_stCameraConstants.xCutAngleFactorTgt)

#define		CAM_C_xTickTimeTestVisibility						(MTH_M_xMul(MTH_M_xFloatToReal(CAM_g_stCameraConstants.xTickTestVisibility*1000.0f),g_stEngineStructure.stEngineTimer.xFrameLength))
#define		CAM_C_xTickTimeFindBetterPos						(MTH_M_xMul(MTH_M_xFloatToReal(CAM_g_stCameraConstants.xTickFindBetterPos*1000.0f),g_stEngineStructure.stEngineTimer.xFrameLength))
#define		CAM_C_xTickTimeFindBetterPosIfNoMove				(MTH_M_xMul(MTH_M_xFloatToReal(CAM_g_stCameraConstants.xTickFindBetterPosIfNoMove*1000.0f),g_stEngineStructure.stEngineTimer.xFrameLength))
#define		CAM_C_xTickTimeFailureCantSee    					(MTH_M_xMul(MTH_M_xFloatToReal(CAM_g_stCameraConstants.xTickFailureCantSee*1000.0f),g_stEngineStructure.stEngineTimer.xFrameLength))
 
 
/*
 **************************************************************************************************
 **************************************************************************************************
	 DEFINITION FOR SCRIPT
 **************************************************************************************************
 **************************************************************************************************
 */
 
 
#define C_SectionCineinfoDescription		"Cineinfo"
 
#define	C_CAM_EntryShiftTarget				"ShiftTarget"
#define	C_CAM_EntryShiftPos					"ShiftPos"
#define	C_CAM_EntryDistance					"Distance"
#define	C_CAM_EntryAlpha					"Alpha"
#define	C_CAM_EntryTheta					"Theta"
#define	C_CAM_EntryLinearSpeed				"LinearSpeed"
#define	C_CAM_EntryAngularSpeed				"AngularSpeed"
#define	C_CAM_EntryTargetSpeed				"TargetSpeed"
#define	C_CAM_EntryDNMFlags					"DNMFlags"
#define	C_CAM_EntryIAFlags					"IAFlags"
#define	C_CAM_EntryFocal					"Focal"
#define	C_CAM_EntryZMinMax					"ZMinMax"
#define	C_CAM_EntryViewport					"Viewport"
#define	C_CAM_EntryChannel					"Channel"
#define	C_CAM_EntryActivation				"Activation"
 
 
/*
 **************************************************************************************************
 **************************************************************************************************
	 DEFINITION FOR IA Flags
	 IA Flags are stored in wIAFLags member of CineInfo structure
	 and is reinitialized for each trame
 **************************************************************************************************
 **************************************************************************************************
 */
 
/*
 *	Flags that can be change in IA (uwIAFlags).
 */
#define C_IAFlags_NoDynamicTarget					0x0001
#define C_IAFlags_NoAverageMoveTgtPerso				0x0002
#define C_IAFlags_NoParseCutAngle 					0x0004
#define C_IAFlags_NoVisibility						0x0008
#define C_IAFlags_NoVisibilityWithDynHie			0x0010
#define C_IAFlags_NoDynChangeTheta					0x0020
#define C_IAFlags_NoShiftUntilPosReached			0x0040
#define C_IAFlags_NoDynSpeed						0x0080
#define C_IAFlags_User								0x0FFF
 
/*
 *	Can't change that flags. They are in internal cineinfo just to change them temporary
 *	(by changing them in cineinfo work).
 */
#define C_IAFlags_TargetIsAlreadyComputed			0x1000
#define C_IAFlags_PositionIsAlreadyComputed			0x2000
#define C_IAFlags_RefAxisIsAlreadyComputed			0x4000
 
/*
 *	Private flags.
 *	Erased at each trame (ucVolatileIAFlags).
 */
#define C_VolIAFlags_CurrentAlreadyCopiedInWork		0x01
#define C_VolIAFlags_InitJustCopiedInCurrent		0x02
#define C_VolIAFlags_CameraNotMove					0x04
 
/*
 *	Private flags.
 *	Persistent (ucPersistentIAFlags).
 */
#define C_PerIAFlags_ShowInfo						0x01
#define C_PerIAFlags_VisibilityCopied				0x02
#define C_PerIAFlags_NoShift						0x04
#define C_PerIAFlags_ConstraintMoveVisFailure		0x08
#define C_PerIAFlags_PosIsForced					0x10
 
 
/*
 **************************************************************************************************
 **************************************************************************************************
	CINEINFO STRUCTURE DEFINITION
	=> Internal
	=> General
 **************************************************************************************************
 **************************************************************************************************
 */
 
 
#if defined(D_CineInfo_StructureDefine)
 
struct tdstInternalStructurCineinfo_
{
	/* Offset to add to the position of the new position. This is the point looked by the camera. */
	MTH3D_tdstVector			stShiftTarget;
 
	/* Offset to add to the position of the target */
	MTH3D_tdstVector			stShiftPos;
 
	/* Define distance */
	MTH_tdxReal					xDistMin;
	MTH_tdxReal					xDistMax;
	MTH_tdxReal					xBoundDistMin;
	MTH_tdxReal					xBoundDistMax;
 
	/* Angle Alpha (axe rotation around axis Z) */
	MTH_tdxReal					xAngleAlpha;
	MTH_tdxReal					xAngleShiftAlpha;
 
	/* Angle Theta (axe rotation around axis X) */
	MTH_tdxReal					xAngleTheta;
	MTH_tdxReal					xAngleShiftTheta;
 
	/* Datas of Camera Linear Speed  */
	MTH_tdxReal					xLinearSpeed;
	MTH_tdxReal					xLinearIncreaseSpeed;
	MTH_tdxReal					xLinearDecreaseSpeed;
 
	/* Datas of Camera Angular Speed */
	MTH_tdxReal					xAngularSpeed;
	MTH_tdxReal					xAngularIncreaseSpeed;
	MTH_tdxReal					xAngularDecreaseSpeed;
 
	/* Datas of Camera Angular Speed */
	MTH_tdxReal					xTargetSpeed;
	MTH_tdxReal					xTargetIncreaseSpeed;
	MTH_tdxReal					xTargetDecreaseSpeed;
 
	/* Focal */
	MTH_tdxReal					xFocal;
 
	/* Camera Altitude */
	MTH_tdxReal					xZMin;
	MTH_tdxReal					xZMax;
 
	/* Super object targeted by camera */
	HIE_tdxHandleToSuperObject	hSuperObjectTargeted;
	HIE_tdxHandleToSuperObject	hSecondSuperObjectTargeted;
 
	/* Flags of camera */
	unsigned short				uwDNMFlags;	/* For mechanics */
	unsigned short				uwIAFlags;  /* For IA */
 
	/*
	 *	0 :  pas de viewport associe
	 *	1 :  viewport principal
	 *	2 :  viewport secondaire
	 */
	enum e_ucListViewport_		eTypeOfViewport;
 
	/*
	 *	Number of channel
	 */
	char						cChannel;
 
	/* Activity */
	ACP_tdxBool					bIsActive;
};
 
/*
 *=================================================================================================
 *=================================================================================================
 */
/* ANNECY MT - 25/08/98 {*/
#define C_ucNbOfCheckedSpeeds 8
 
typedef struct tdstAveragePosition_
{
	struct MTH3D_tdstVector_ a_CheckedSpeed[C_ucNbOfCheckedSpeeds];
	struct MTH3D_tdstVector_ a_CheckedPos[C_ucNbOfCheckedSpeeds];
	MTH_tdxReal a_CheckedTime[C_ucNbOfCheckedSpeeds];
}tdstAveragePosition;
 
typedef struct tdstSightAxisSystem_
{
	struct MTH3D_tdstVector_ SightAxis;
	struct MTH3D_tdstVector_ FirstComplementaryAxis;
	struct MTH3D_tdstVector_ SecondComplementaryAxis;
}tdstSightAxisSystem;
/* END ANNECY MT }*/
 
/*
 *=================================================================================================
 *=================================================================================================
 */
struct tdstCineinfo_
{
	/******************************************/
	/* Internal structures					  */
	/******************************************/
 
	struct tdstInternalStructurCineinfo_	*hInit;
 	struct tdstInternalStructurCineinfo_	*hCurrent;
	struct tdstInternalStructurCineinfo_	*hVisibility;
	struct tdstInternalStructurCineinfo_	*hWork;
 
	/******************************************/
	/* Fields only accessibles by programmers */
	/******************************************/
 
 
	/*
	 *	For visibility.
	 */
	MTH3D_tdstVector						stLastFailedOrigin;
	MTH3D_tdstVector						stLastFailedWanted;
 
	/*
	 * To force targeted point, or camera position.
	 */
	MTH3D_tdstVector						stForceTarget;
	MTH3D_tdstVector						stForcePosition;
	MTH3D_tdstVector						stForceRefAxisY;
	MTH3D_tdstVector						stForceRefAxisZ;
 
	/*
	 * When a second super object is defined.
	 */
	MTH_tdxReal								xApexRatio;
 
	/*
	 * To save delta angle when cutting.
	 */
	MTH_tdxReal								xLastDeltaCut;
 
	/*
	 * State
	 */
	enum e_ucCameraStates_					eState;
 
	/*
	 * Counters.
	 * 1 : To test better pos
	 * 2 : To test visibility
	 * 3 : Failure if we can't see target during this number of trames
	 * 4 : To count the time the camera is not moving.
	 */

/* ANNECY MT - 03/08/99 { */
	/*
	short									wCounter1;
	short									wCounter2;
	short									wCounter3;
	short									wCounter4;
	*/
	MTH_tdxReal								xCounter1;
	MTH_tdxReal								xCounter2;
	MTH_tdxReal								xCounter3;
	MTH_tdxReal								xCounter4;
/* END ANNECY MT } */

	/*
	 * Private flags of camera.
	 */
	unsigned char							ucVolIAFlags;
	unsigned char							ucPerIAFlags;
 
	/* When cutting angles */
	char									cLastCutAngleSens;
 
/* ANNECY MT - 25/08/98 {*/
	/*arrays on positions and speeds on the character*/
	struct tdstAveragePosition_ AveragePosition;
	/*list on the used requests*/
	struct tdstSightAxisSystem_ stSightAxisSystem;
/* END ANNECY MT }*/
	ACP_tdxBool								bCanDoBestPos;
};
#endif /* D_CineInfo_StructureDefine */
 
 
/*
 **************************************************************************************************
 **************************************************************************************************
	Handle define
 **************************************************************************************************
 **************************************************************************************************
 */
 
 
typedef struct tdstInternalStructurCineinfo_	*MS_tdxHandleToInternalCineinfo;
typedef struct tdstCineinfo_					*MS_tdxHandleToCineinfo;
typedef struct tdstAveragePosition_				*MS_tdxHandleToAveragePosition;
typedef struct tdstSightAxisSystem_				*MS_tdxHandleToSightAxisSystem;
 
/*
 * macro to get internal cine info from camera super object
 */
#define M_GetCineinfo(_p_stSuperObject_, _Name_)\
(\
	(MS_tdxHandleToInternalCineinfo)\
		(\
			(\
				M_GetMSHandle(_p_stSuperObject_,Cineinfo)\
			)\
			->h##_Name_\
		)\
)
 
/*
 * macro to get internal cineinfo from cineinfo struct
 */
#define M_GetInternalCineinfo(_hCineinfo_, _Name_)\
(\
	(MS_tdxHandleToInternalCineinfo)\
		(\
			(\
			(MS_tdxHandleToCineinfo)(_hCineinfo_)\
			)\
			->h##_Name_\
		)\
)
 
 
/*
 **************************************************************************************************
 **************************************************************************************************
	Access Functions for fields in the internal structure
 **************************************************************************************************
 **************************************************************************************************
 */
 
 
extern CPA_EXPORT MTH3D_tdstVector			*CAM_fn_p_stCineInfoGetShiftTarget(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetShiftTarget(MS_tdxHandleToInternalCineinfo _hIntCineinfo, MTH3D_tdstVector *_p_stLookVertex);
 
extern CPA_EXPORT MTH3D_tdstVector			*CAM_fn_p_stCineInfoGetShiftPos(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetShiftPos(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH3D_tdstVector *_p_stShiftPerso);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetDistMin(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetDistMin(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xDistance);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetDistMax(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetDistMax(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xDistance);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetBoundDistMin(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetBoundDistMin(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xDistance);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetBoundDistMax(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetBoundDistMax(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xDistance);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetAngleAlpha(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetAngleAlpha(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xAngle);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetAngleShiftAlpha(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetAngleShiftAlpha(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xAngle);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetAngleTheta(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetAngleTheta(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xAngle);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetAngleShiftTheta(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetAngleShiftTheta(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xAngle);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetLinearSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetLinearSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xSpeed);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetLinearIncreaseSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetLinearIncreaseSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xInertia);
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetLinearDecreaseSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetLinearDecreaseSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xInertia);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetAngularSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetAngularSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xAngle);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetAngularIncreaseSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetAngularIncreaseSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xInertia);
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetAngularDecreaseSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetAngularDecreaseSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xInertia);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetTargetSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetTargetSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xSpeed);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetTargetIncreaseSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetTargetIncreaseSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xInertia);
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetTargetDecreaseSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetTargetDecreaseSpeed(MS_tdxHandleToInternalCineinfo _hIntCineinfo,MTH_tdxReal _xInertia);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetFocal(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetFocal(MS_tdxHandleToInternalCineinfo _hIntCineinfo, MTH_tdxReal _xAngle);
 
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetZMin(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetZMin(MS_tdxHandleToInternalCineinfo _hIntCineinfo, MTH_tdxReal _xZ);
extern CPA_EXPORT MTH_tdxReal				CAM_fn_xCineInfoGetZMax(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetZMax(MS_tdxHandleToInternalCineinfo _hIntCineinfo, MTH_tdxReal _xZ);
 
extern CPA_EXPORT HIE_tdxHandleToSuperObject CAM_fn_hCineInfoGetSuperObjectTargeted(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						 CAM_fn_vCineInfoSetSuperObjectTargeted( MS_tdxHandleToInternalCineinfo _hIntCineinfo, HIE_tdxHandleToSuperObject _hSuperObject );
 
extern CPA_EXPORT unsigned short			CAM_fn_uwCineInfoGetDNMFlags(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetDNMFlags(MS_tdxHandleToInternalCineinfo _hIntCineinfo,unsigned short _uwFlag);
 
extern CPA_EXPORT unsigned short			CAM_fn_uwCineInfoGetIAFlags(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetIAFlags(MS_tdxHandleToInternalCineinfo _hIntCineinfo,unsigned short _uwFlag);
 
extern CPA_EXPORT enum e_ucCameraStates_	CAM_fn_eCineInfoGetState(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetState(MS_tdxHandleToInternalCineinfo _hIntCineinfo,enum e_ucCameraStates_ _eState);
 
extern CPA_EXPORT enum e_ucListViewport_	CAM_fn_eCineInfoGetTypeOfViewport(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetTypeOfViewport(MS_tdxHandleToInternalCineinfo _hIntCineinfo,enum e_ucListViewport_ _eType);
 
extern CPA_EXPORT ACP_tdxBool				CAM_fn_bCineInfoGetIsActive(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetIsActive(MS_tdxHandleToInternalCineinfo _hIntCineinfo,ACP_tdxBool _bIsActive);
 
extern CPA_EXPORT char						CAM_fn_cCineInfoGetChannel(MS_tdxHandleToInternalCineinfo _hIntCineinfo);
extern CPA_EXPORT void						CAM_fn_vCineInfoSetChannel(MS_tdxHandleToInternalCineinfo _hIntCineinfo,char _cChannel);
 
 
/*
 **************************************************************************************************
 **************************************************************************************************
	Base functions
 **************************************************************************************************
 **************************************************************************************************
 */
 
 
extern CPA_EXPORT void								CAM_fn_vInitCompleteCineinfo(MS_tdxHandleToCineinfo _hCineinfo);
 
#if !defined(U64)
extern CPA_EXPORT SCR_tde_Anl_ReturnValue			CAM_fn_eCineinfoScriptCallBack(SCR_tdst_File_Description *_p_stFile,char *_p_szName,char *_ap_szParams[],SCR_tde_Anl_Action	_eAction);
#endif /* U64 */
 
extern CPA_EXPORT unsigned long						CAM_fn_ulCineinfoSizeOf( void );
extern CPA_EXPORT unsigned long						CAM_fn_ulCineinfoInternalSizeOf( void );
extern CPA_EXPORT void								CAM_fn_vCineinfoAlloc(struct tdstEngineObject_ *_p_stObject);
extern CPA_EXPORT MS_tdxHandleToCineinfo			CAM_fn_hCineinfoRealAlloc( void );
extern CPA_EXPORT MS_tdxHandleToInternalCineinfo	CAM_fn_hCineinfoInternalRealAlloc( void );
extern CPA_EXPORT void								CAM_fn_vCineinfoFree(struct tdstEngineObject_ *_p_stObject);
extern CPA_EXPORT void								CAM_fn_vCineinfoInit(struct tdstEngineObject_ *_p_stObject,enum tdeObjectTreeInit_ _eObjectInit);
extern CPA_EXPORT void								CAM_fn_vCineinfoDesinit(struct tdstEngineObject_ *_p_stObject,enum tdeObjectTreeInit_ _eObjectInit);
extern CPA_EXPORT void								CAM_fn_vCineinfoCopyClone(struct tdstEngineObject_ *_p_stObjectDest,struct tdstEngineObject_ *_p_stObjectSrc);
extern CPA_EXPORT void                              fn_vGetPersoSightAxisSystem(MS_tdxHandleToCineinfo _hCineinfo,MTH3D_tdstVector *_p_stSightAxis,MTH3D_tdstVector *_p_stFirstComplementaryAxis,MTH3D_tdstVector *_p_stSecondComplementaryAxis);
 
extern CPA_EXPORT void								Cineinfo_fn_vReadBinaryBloc(unsigned long _ulStructAddress, char* _p_cDestBuffer);
extern CPA_EXPORT unsigned long						IntStrCineInfo_fn_ulWriteBinaryBloc(unsigned long _ulStructAddress, char* _p_cDestBuffer);
extern CPA_EXPORT unsigned long						Cineinfo_fn_ulWriteBinaryBloc(unsigned long _ulStructAddress, char* _p_cDestBuffer);
 
 
/*
 **************************************************************************************************
 **************************************************************************************************
	Special	functions
 **************************************************************************************************
 **************************************************************************************************
 */
 
 
extern CPA_EXPORT HIE_tdxHandleToSuperObject	CAM_fn_hGetMainActiveCamera(HIE_tdxHandleToSuperObject	hSuperObject);
extern void										CAM_fn_vLoadCameraConstants(void);
 
extern CPA_EXPORT void							CAM_fn_vSetCameraInList(HIE_tdxHandleToSuperObject	_hSupObjectCamera);
extern CPA_EXPORT void							CAM_fn_vDeleteCameraInList(HIE_tdxHandleToSuperObject	_hSupObjectCamera);
 
/*extern CPA_EXPORT void							CAM_fn_vCameraActivedByEditor(HIE_tdxHandleToSuperObject _hSuperObject);*/
/*extern CPA_EXPORT void							CAM_fn_vCameraDesactivedByEditor(HIE_tdxHandleToSuperObject _hSuperObject);*/
 
extern CPA_EXPORT void							CAM_fn_vSetCineinfoCurrentFromInit(MS_tdxHandleToCineinfo _hCineinfo);
extern CPA_EXPORT void							CAM_fn_vSetCineinfoWorkFromCurrent(MS_tdxHandleToCineinfo _hCineinfo);
extern CPA_EXPORT void							CAM_fn_vSetCineinfoVisibilityFromCurrent(MS_tdxHandleToCineinfo _hCineinfo);
extern CPA_EXPORT void							CAM_fn_vSetCineinfoCurrentFromVisibility(MS_tdxHandleToCineinfo _hCineinfo);
extern CPA_EXPORT void							CAM_fn_vSetCineinfoWorkFromVisibility(MS_tdxHandleToCineinfo _hCineinfo);
 
/*
 **************************************************************************************************
 **************************************************************************************************
 */
/* ANNECY MT 26/08/98 {*/
/*extern CPA_EXPORT void fn_vCineinfoSetCheckedSpeed				(MS_tdxHandleToCineinfo _hCineinfo,unsigned long _ul,struct MTH3D_tdstVector_*p_Speed);*/
/*extern CPA_EXPORT void fn_vCineinfoSetCheckedPos				(MS_tdxHandleToCineinfo _hCineinfo,unsigned long _ul,struct MTH3D_tdstVector_*p_Pos);*/
/*extern CPA_EXPORT void fn_vCineinfoSetCheckedTime				(MS_tdxHandleToCineinfo _hCineinfo,unsigned long _ul,MTH_tdxReal _dt);*/
extern CPA_EXPORT void fn_vCineinfoSetSightAxis					(MS_tdxHandleToCineinfo _hCineinfo,struct MTH3D_tdstVector_*p_stVector);
extern CPA_EXPORT void fn_vCineinfoSetFirstComplementaryAxis	(MS_tdxHandleToCineinfo _hCineinfo,struct MTH3D_tdstVector_*p_stVector);
extern CPA_EXPORT void fn_vCineinfoSetSecondComplementaryAxis	(MS_tdxHandleToCineinfo _hCineinfo,struct MTH3D_tdstVector_*p_stVector);
extern CPA_EXPORT void fn_vCineinfoSetSightAxisSystem			(MS_tdxHandleToCineinfo _hCineinfo,struct tdstSightAxisSystem_ *p_stAxisSystem);
 
/*extern CPA_EXPORT MTH3D_tdstVector *fn_p_CineinfoGetCheckedSpeed(MS_tdxHandleToCineinfo _hCineinfo,unsigned long _ul);*/
/*extern CPA_EXPORT MTH_tdxReal       fn_xCineinfoGetCheckedTime  (MS_tdxHandleToCineinfo _hCineinfo,unsigned long _ul);*/
/*extern CPA_EXPORT MTH3D_tdstVector *fn_p_CineinfoGetCheckedPos  (MS_tdxHandleToCineinfo _hCineinfo,unsigned long _ul);*/
 
extern CPA_EXPORT void CAM_fn_vRemindSpeed  (MS_tdxHandleToCineinfo _hCineinfo,MTH_tdstMove *_p_Speed);
extern CPA_EXPORT void CAM_fn_vRemindPos    (MS_tdxHandleToCineinfo _hCineinfo,MTH_tdstMove *_p_Pos);
extern CPA_EXPORT void CAM_fn_vRemindTime   (MS_tdxHandleToCineinfo _hCineinfo,MTH_tdxReal _dt);
 
extern CPA_EXPORT void CAM_fn_vAverageSpeed     (MS_tdxHandleToCineinfo _hCineinfo,MTH_tdxReal xTimeWindow,MTH3D_tdstVector *p_result);
extern CPA_EXPORT void CAM_fn_vAveragePosition  (MS_tdxHandleToCineinfo _hCineinfo,MTH_tdxReal xTimeWindow,MTH3D_tdstVector *p_result);
 
extern CPA_EXPORT void CAM_fn_vUpdateTargetPosition(MS_tdxHandleToCineinfo _hCineinfo);
/* END ANNECY MT }*/
#if defined(__cplusplus)
}
#endif /* __cplusplus */
 
#endif /* __CINEINFO_H__ */
 
