/*---------------------------------------------------------------------------*/
/* AITools.h : Some useful functions*/
/* author : Olivier Couvreur.*/
/* date   : 05/05/1996*/
/*---------------------------------------------------------------------------*/
#if !defined(__AITOOLS_H__)
#define __AITOOLS_H__
 
/* WARNING constant are bits */
#define DISTANCE_TO_ORIGIN                    0x00
#define DISTANCE_TO_CENTER_OF_BOUNDING_VOLUME 0x80
 
#define C_DISTANCE_X   1
#define C_DISTANCE_Y   2
#define C_DISTANCE_Z   4
#define C_DISTANCE_XY  3
#define C_DISTANCE_XZ  5
#define C_DISTANCE_YZ  6  
#define C_DISTANCE_XYZ 7
 
#define C_DISTANCE_MASK C_DISTANCE_XYZ
 
#if defined(U64)
#include "AIUseCPA.h"
#include "specif/AIOption.h"
#include "AIMacros.h"
#include "AI_Erm.h"
#include "WPWayPt.h"
#include "Strintel.h"
#endif
 
#include "GSParam.h"
 
/* CGHT*/
#if 0
/* MODIF YLG*/
ACP_tdxBool fn_bIsEndReached(MTH_tdxReal xStart,MTH_tdxReal xEnd,MTH_tdxReal xSpeed);
#endif
 
#ifdef ACTIVE_EDITOR
void fn_vCheckModuleAccess(HIE_tdxHandleToSuperObject hPerso, ACP_tdxBool _bNextArgIsAChannel, void *_p_vChannelOrModuleHandle);
#endif
 
char *fn_szGetStringFromTextOrStringParam(tdstGetSetParam *p_stValue);
 
MTH_tdxReal fn_xComputeDirectionAngle(struct MTH3D_tdstVector_ *p_stVector);
 
MTH_tdxReal fn_xComputeBestEcartDirectionAngle(MTH_tdxReal xAngleFollowed,MTH_tdxReal xAngleToFollow);
 
MTH_tdxReal fn_xDistanceBetweenPersoAndWP(HIE_tdxHandleToSuperObject p_SuperObjPerso, WP_tdhWayPoint hWP);
MTH_tdxReal fn_xDistanceBetweenPerso(HIE_tdxHandleToSuperObject p_SuperObjPerso1, HIE_tdxHandleToSuperObject p_SuperObjPerso2);
 
MTH_tdxReal fn_xExtendedDistanceBetweenPerso(HIE_tdxHandleToSuperObject p_SuperObjPerso1, HIE_tdxHandleToSuperObject p_SuperObjPerso2, unsigned char ucFlags);
MTH_tdxReal fn_xExtendedDistanceBetweenVertexAndPerso(MTH3D_tdstVector *p_stVertex1,HIE_tdxHandleToSuperObject p_SuperObjPerso2 , unsigned char ucFlags);
 
MTH_tdxReal fn_xRealModuloAround(MTH_tdxReal xFrom,MTH_tdxReal xModulus,MTH_tdxReal xValue);
void fn_vVectorModuloAround(MTH_tdxReal xFrom,MTH_tdxReal xModulus,struct MTH3D_tdstVector_ *p_stRotationVector);
 
/*void fn_vMakeAngularSpeedVectorPositive(struct MTH3D_tdstVector_ *p_stRotationVector,struct MTH3D_tdstVector_ *p_stAngleVector,struct MTH3D_tdstVector_ *p_stAimAngleVector);*/
 
struct stMACDPID *fn_p_stGetMACDPIDPointer(HIE_tdxHandleToSuperObject p_SuperObjPerso);
struct DNM_stReport *fn_pstGetDNMReport(HIE_tdxHandleToSuperObject p_SuperObjPerso);
 
unsigned char fn_ucIsThereFloatIfYesConvertItToInteger(struct tdstGetSetParam_ *p_stParam);
unsigned char fn_ucAreThereFloatIfYesConvertThem(struct tdstGetSetParam_ *p_stParam1,struct tdstGetSetParam_ *p_stParam2);
 
void fn_vGetCenterOfBoundingVolume(HIE_tdxHandleToSuperObject hPerso,struct MTH3D_tdstVector_ *p_stVertex);
 
void fn_vSetDontCheckNULLFlag(signed char _cValue);
unsigned char fn_ucGetDontCheckNULLFlag(void);
 
#if defined(__DEBUG_AI__)
char *fn_szGetPersoName(HIE_tdxHandleToSuperObject hPerso);
#endif
 
ACP_tdxBool fn_bSetPositionWithCollideTest(HIE_tdxHandleToSuperObject p_SuperObjPerso, struct MTH3D_tdstVector_ *p_stVertex);
/*ANNECY BBB { parti dans gam\actions\dynam.h*/
/*ACP_tdxBool fn_bSetPositionWithoutCollideTest(HIE_tdxHandleToSuperObject p_SuperObjPerso, struct MTH3D_tdstVector_ *p_stVertex);*/
/*ANNECY BBB } parti dans gam\actions\dynam.h*/
 
#if 0
/* YLG modif*/
void fn_vBoolAddRequest(HIE_tdxHandleToSuperObject p_SuperObjPerso,enum LRM_eKindOfRequest_ eRequest);
#endif
unsigned char fn_bGethDynamAndMACDPIDPointers(HIE_tdxHandleToSuperObject p_SuperObjPerso, MS_tdxHandleToDynam *p_h_Dynam, tdstMACDPID **p_p_stMACDPID);
 
unsigned char fn_ucInternalTurn(HIE_tdxHandleToSuperObject p_SuperObjPerso,MTH_tdxReal  xAngle);
 
void fn_vConvertParamToColor(struct tdstGetSetParam_ *p_stParam,struct GEO_tdstColor_ *p_stColor);
void fn_vConvertColorToParam(struct GEO_tdstColor_ *p_stColor,struct tdstGetSetParam_ *p_stParam);
 
#endif /* __AITOOLS_H__*/
