/* ***********************************************************************************/
/* * "a3x_int.h"																	**/
/* * Written by :	Sébastien Rubens												**/
/* * Tabulations :	4 char															**/
/* ***********************************************************************************/
#ifndef A3X_INT_H
#define A3X_INT_H
 
 
/* ***********************************************************************************/
enum	{ eQX, eQY, eQZ, eQW };
 
 
#ifndef	A3X_INT_C
/* ***********************************************************************************/
/*																Precalculations*/
 
extern	void			fn_v_InitSinTab( void );
extern	signed short	ax_SinTab[];
extern	tdxQuater4		a4_xQuater1;
 
 
 
/* ***********************************************************************************/
/*																Matrices tests*/
 
extern	unsigned short	fn_uw_IsDiagonale(		tdxMatrix33	_a3a3_xMtx );
extern	unsigned short	fn_uw_IsOrthogonale(	tdxMatrix33 _a3a3_xMtx );
extern	unsigned short	fn_uw_IsOrthonormee(	tdxMatrix33 _a3a3_xMtx );
extern	unsigned short	fn_uw_IsUnitQuat(		tdxQuater4  _a4_xQuat );
extern	unsigned short	fn_uw_AreSameMatrix(	tdxMatrix33 _a3a3_xMtx1,
												tdxMatrix33 _a3a3_xMtx2 );
extern	unsigned short	fn_uw_AreSameQuat(		tdxQuater4	_a4_xQuat1,
												tdxQuater4	_a4_xQuat2 );
extern	unsigned short	fn_uw_AreSameVect(		tdxVector3	_a3_xVect1,
												tdxVector3	_a3_xVect2 );
extern	unsigned short	fn_uw_CompQuat(			tdxQuater4	_a4_xQuat1,
												tdxQuater4	_a4_xQuat2 );
extern	unsigned short	fn_uw_CompVect(			tdxVector3	_a3_xVect1,
												tdxVector3	_a3_xVect2 );
 
 
/* ***********************************************************************************/
/*												Miscellaneous matrices operations*/
 
extern	void			fn_v_SetIdMatrix(		tdxMatrix33			_a3a3_xMatrix	);
extern	void			fn_v_SetZeroVector(		tdxVector3			_a3_xVector	);
extern	void			fn_v_SetOneVector(		tdxVector3			_a3_xVector	);
extern	void			fn_v_SetIdQuater(		tdxQuater4			_a4_xQuater	);
extern	void			fn_v_ExpandQuat(		tdxQuater4			_a4_xQuatD,
												tdxSShortQuater4	_a4_xQuatS	);
extern	void			fn_v_CopyQuat(			tdxQuater4			_a4_xQuatD,
												tdxQuater4			_a4_xQuatS	);
extern	void			fn_v_CopyVect(			tdxVector3			_a3_xVectD,
												tdxVector3			_a3_xVectS	);
extern	void			fn_v_CopyMatrix(		tdxMatrix33			_a3a3_xMtxD,
												tdxMatrix33			_a3a3_xMtxS	);
extern	void			fn_v_MatrixToVecDia(	tdxVector3			_a3_xVec,
												tdxMatrix33			_a3a3_xMtx );
extern	void			fn_v_TranMatrix(		tdxMatrix33			_a3a3_xMtxD,
												tdxMatrix33			_a3a3_xMtxS );
extern	void			fn_v_TranMatrixOne(		tdxMatrix33			_a3a3_xMtxD );
extern	unsigned short	fn_uw_AngleBetweenVect(	tdxVector3			_a3_xVec1,
												tdxVector3			_a3_xVec2 );
extern	unsigned short	fn_uw_AngleBetweenQuat(	tdxQuater4			_a4_xQuat1,
												tdxQuater4			_a4_xQuat2 );
extern	SEB_xReal		fn_x_VectorLength(		tdxVector3			_a3_xVect );
extern	void			fn_v_NormalizeVector(	tdxVector3			_a3_xVect );
extern	SEB_xReal		fn_x_NormalizeVector(	tdxVector3			_a3_xVect );
extern	SEB_xReal		fn_x_QuaterLength(		tdxQuater4			_a4_xQuat );
extern	SEB_xReal		fn_x_NormalizeQuater(	tdxQuater4			_a4_xQuat );
 
 
/* ***********************************************************************************/
/*														Matrices computations*/
 
extern	void			fn_v_MatrixByVector(	tdxVector3  _a3_xVecD,
												tdxMatrix33 _a3a3_xMtxS,
												tdxVector3  _a3_xVecS );
extern	void			fn_v_DiaByMatrix(		tdxVector3  _a3a3_xMtxD,
												tdxVector3  _a3_xVecS,
												tdxMatrix33 _a3a3_xMtxS );
extern	void			fn_v_MatrixByDia(		tdxMatrix33 _a3a3_xMtxD,
												tdxMatrix33 _a3a3_xMtxS,
												tdxVector3  _a3_xVecS	);
extern	void			fn_v_MultMatrix(		tdxMatrix33 _a3a3_xMtxR,
												tdxMatrix33 _a3a3_xMtx1,
												tdxMatrix33 _a3a3_xMtx2 );
extern	void			fn_v_InvRotDiaRot(		tdxMatrix33 _a3a3_xMtxD,
												tdxMatrix33 _a3a3_xMtxS,
												tdxVector3  _a3_xVecS );
 
 
/* ***********************************************************************************/
/*												Matrices / Quaternions conversions*/
 
extern	void			fn_v_QuatToMatrix(	tdxMatrix33 _a3a3_xMtx,
											tdxQuater4  _a4_xQuat );
extern	void			fn_v_MatrixToQuat(	tdxQuater4  _a4_xQuat,
											tdxMatrix33 _a3a3_xMtx );
 
 
/* ***********************************************************************************/
/*													Interpolations computations*/
 
extern	void			fn_v_InterpolVect(			tdxVector3				_a3_xVecD,
													tdxVector3				_a3_xVecS1,
													tdxVector3				_a3_xVecS2,
													register SEB_xReal		_xT );
extern	void			fn_v_InterpolQuat(			tdxQuater4				_a4_xQuatD,
													tdxQuater4				_a4_xQuatS1,
													tdxQuater4				_a4_xQuatS2,
													register SEB_xReal		_xT );
extern	void			fn_v_InterpolQuatWithOmega(	tdxQuater4				_a4_xQuatD,
													tdxQuater4				_a4_xQuatS1,
													tdxQuater4				_a4_xQuatS2,
													register SEB_xReal		_xT,
													register signed short	_swOmega );
 
 
 
/* ***********************************************************************************/
#endif
 
#endif
