#ifndef __DNMDYNAM_H__
#define __DNMDYNAM_H__
 
 
#include "hidcard.h"
#include "MecMatCa.h"
#include "DNMRepor.h"
#include "macdpid.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
 
/* Option */
#if !defined(RETAIL) && !defined(U64) /*AR9812 Gcc bug with MEC_CHECK_ACCESS*/
	#define MEC_CHECK_ACCESS		/* Check dynamic size */
#endif /* RETAIL*/
 
 
 
/* Definition of the object type */
#define DNM_C_lObjectType_Solid       0x00000001
#define DNM_C_lObjectType_Liquid      0x00000002
#define DNM_C_lObjectType_Gas         0x00000003
#define DNM_C_lObjectType_Plasma      0x00000004
#define DNM_C_lObjectType_Mobile      0x00010000
#define DNM_C_lObjectType_SolidMobile  (DNM_C_lObjectType_Solid|DNM_C_lObjectType_Mobile)
#define DNM_C_lObjectType_LiquidMobile (DNM_C_lObjectType_Liquid|DNM_C_lObjectType_Mobile)
#define DNM_C_lObjectType_GasMobile    (DNM_C_lObjectType_Gas|DNM_C_lObjectType_Mobile)
#define DNM_C_lObjectType_PlasmaMobile (DNM_C_lObjectType_Plasma|DNM_C_lObjectType_Mobile)
 
/* Bit field	*/
#define DNM_C_Animation					0x00000001		/* animation speed ? */
#define DNM_C_Collide					0x00000002		/* collide with the map ? */
#define DNM_C_Gravity					0x00000004		/* gravity on ? */
#define DNM_C_Tilt						0x00000008		/* tilt in turn */
#define DNM_C_Gi						0x00000010		/* gi */
#define DNM_C_OnGround					0x00000020		/* put on ground */
#define DNM_C_Climb						0x00000040		/* climb */
#define DNM_C_CollisionControl			0x00000080		/* use dynamics parameters when collide */
#define DNM_C_KeepWallSpeedZ			0x00000100		/* keep z speed when collide a wall */
#define DNM_C_SpeedLimit				0x00000200		/* limit speed ? */
#define DNM_C_Inertia					0x00000400		/* inertia ? */
#define DNM_C_Stream					0x00000800		/* stream ? */
#define DNM_C_StickOnPlatform			0x00001000		/* stick on platform ? */
#define DNM_C_Scale						0x00002000		/* use scale ? */
#define DNM_C_AbsoluteImposeSpeed		0x00004000		/* absolute speed ? */
#define DNM_C_AbsoluteProposeSpeed		0x00008000		/* absolute speed ? */
#define DNM_C_AbsoluteAddSpeed			0x00010000		/* absolute speed ? */
#define DNM_C_ImposeSpeedX				0x00020000		/* impose x ? */
#define DNM_C_ImposeSpeedY				0x00040000		/* impose y ? */
#define DNM_C_ImposeSpeedZ				0x00080000		/* impose z ? */
#define DNM_C_ProposeSpeedX				0x00100000		/* propose x ? */
#define DNM_C_ProposeSpeedY				0x00200000		/* propose y ? */
#define DNM_C_ProposeSpeedZ				0x00400000		/* propose z ? */
#define DNM_C_AddSpeedX					0x00800000		/* add x ? */
#define DNM_C_AddSpeedY					0x01000000		/* add y ? */
#define DNM_C_AddSpeedZ					0x02000000		/* add z ? */
#define DNM_C_LimitX					0x04000000		/* limit x ? */
#define DNM_C_LimitY					0x08000000		/* limit y ? */
#define DNM_C_LimitZ					0x10000000		/* limit z ? */
#define DNM_C_ImposeRotation			0x20000000		/* impose rotation ? */
#define DNM_C_LockPlatform				0x40000000		/* lock the link between platform and actor */
#define DNM_C_ImposeTranslation			0x80000000		/* impose translation ? */
 
#define DNM_C_BaseSize					0x00000001		/* Base	*/			/* IMPORTANT don't change */
#define DNM_C_AdvancedSize				0x00000002		/* Advanced */		/* IMPORTANT don't change */
#define DNM_C_ComplexSize				0x00000004		/* Complex */		/* IMPORTANT don't change */
#define DNM_C_Reservated				0x00000008		/* reserved */		/* IMPORTANT don't change */
#define DNM_C_MechanicChange			0x00000010		/* The machanic has just change */
#define DNM_C_PlatformCrash				0x00000020		/* actor takes a platform on the mug */
#define DNM_C_CanFall					0x00000040		/* actor walk on an edge ground limit */
#define DNM_C_Init						0x00000080		/* mechanic must be initialized */
#define DNM_C_Spider					0x00000100		/* spider mechanic */
#define DNM_C_Shoot						0x00000200		/* shoot option ? */
#define DNM_C_SafeValid					0x00000400		/* safe translation valid ? */
#define DNM_C_ComputeInvertMatrix		0x00000800		/* compute invert matrix */
#define DNM_C_ChangeScale				0x00001000		/* change scale */
#define DNM_C_Exec						0x00002000		/* mechanic execution flag */
#define DNM_C_CollisionReport			0x00004000		/* Collision */
#define DNM_C_NoGravity					0x00008000		/* No gravity */
#define DNM_C_Stop						0x00010000		/* The mechanic can't realize the request */
#define DNM_C_SlidingGround				0x00020000		/* The actor is on a sliding ground */
#define DNM_C_Always					0x00040000		/* always dynamic */
#define DNM_C_Crash						0x00080000		/* actor is crashed by another actor */
#define DNM_C_Swim						0x00100000		/* swim */
#define DNM_C_NeverFall					0x00200000		/* if CanFall is set, don't fall */
#define DNM_C_Hanging					0x00400000		/* Hanging mechanic */
#define DNM_C_WallAdjust				0x00800000		/* we must check wall collision next time */
#define DNM_C_ActorMove					0x01000000		/* actor move ? */
#define DNM_C_ForceSafeWalk				0x02000000		/*  safe walk mechanic next time ? */
#define DNM_C_DontUseNewMechanic		0x04000000		/*  Use new mechanic ? */
	
	
 
	
/* for actor editor */
#define C_ucMechanic_Base				DNM_C_BaseSize
#define C_ucMechanic_Advanced			(DNM_C_BaseSize|DNM_C_AdvancedSize)
#define C_ucMechanic_Complex			(DNM_C_BaseSize|DNM_C_AdvancedSize|DNM_C_ComplexSize)
 
 
 
/*-----------------------------------------------------------------------------------------*/
/*--------------------------------------- DEFINITION --------------------------------------*/
/*-----------------------------------------------------------------------------------------*/
 
 
 
/*---------------------------------- Base block -------------------------------------------*/
typedef struct DNM_stDynamicsBaseBlock
{
	long m_lObjectType;
	DNM_tdxHandleToMecIdentityCard m_pCurrentIdCard;	/* current Id card */
	unsigned long	ulFlags;			/* Bit			*/
	unsigned long	ulEndFlags;			/*		Field	*/	
#if !defined(PRESS_DEMO) /* swap members to make the engine unusable with the binarized data of another engine */
	MTH_tdxReal m_xGravity;				/* g */
	MTH_tdxReal m_xSlopeLimit;			/* tan of slope limit */
#else
	MTH_tdxReal m_xSlopeLimit;			/* tan of slope limit */
	MTH_tdxReal m_xGravity;				/* g */
#endif /* PRESS_DEMO */
	MTH_tdxReal m_xCosSlope;			/* Cos ( SlopeLimit ) */
	MTH_tdxReal m_xSlide;				/* slide parameter for collision control */
	MTH_tdxReal m_xRebound;				/* rebound parameter for collision control */
	MTH3D_tdstVector m_stImposeSpeed;	/* user speed */
	MTH3D_tdstVector m_stProposeSpeed;	/* user speed */
	MTH3D_tdstVector m_stPreviousSpeed;						/* previous speed */
	MTH3D_tdstVector m_stScale;								/* actor scale */
	MTH3D_tdstVector m_stSpeedAnim;							/* animation speed from player */
	MTH3D_tdstVector m_stSafeTranslation;					/* safe position in the map */
	MTH3D_tdstVector m_stAddTranslation;					/* additionnal translation */
	POS_tdstCompletePosition m_stPreviousMatrix;			/* actor previous matrix */		
	POS_tdstCompletePosition m_stCurrentMatrix;				/* actor current matrix */
	MTH3D_tdstMatrix m_stImposeRotationMatrix;				/* impose rotation matrix */
	unsigned char m_ucNbFrame;								/* previous number of frame */
	DNM_tdstReport* m_pstReport;							/* collision report : NULL if not used */
} DNM_tdstDynamicsBaseBlock;
 
 
/*---------------------------------- Advanced block -------------------------------------------*/
typedef struct DNM_stDynamicsAdvancedBlock
{
	MTH_tdxReal m_xInertiaX;			/* inertia x factor */
	MTH_tdxReal m_xInertiaY;			/* inertia y factor */
	MTH_tdxReal m_xInertiaZ;			/* inertia z factor */
	MTH_tdxReal m_xStreamPrority;		/* stream priority */
	MTH_tdxReal m_xStreamFactor;		/* stream = stream speed x StreamFactor */
	MTH_tdxReal m_xSlideFactorX;		/* x slide */
	MTH_tdxReal m_xSlideFactorY;		/* y slide */
	MTH_tdxReal m_xSlideFactorZ;		/* z slide */
	MTH_tdxReal m_xPreviousSlide;			/* previous slide */
	MTH3D_tdstVector m_stMaxSpeed;		/* max speed limit */ 
	MTH3D_tdstVector m_stStreamSpeed;	/* stream speed */
	MTH3D_tdstVector m_stAddSpeed;		/* user speed */
	MTH3D_tdstVector m_stLimit;			/* user limit */
	MTH3D_tdstVector m_stCollisionTranslation;		/* next end collision point */	
	MTH3D_tdstVector m_stInertiaTranslation;		/* translation that doesn't take part to inertia */
	MTH3D_tdstVector m_stGroundNormal;		/* ground normal */
	MTH3D_tdstVector m_stWallNormal;		/* wall normal */
	char m_cCollideCounter;							/* number of mechanic call without collision */
} DNM_tdstDynamicsAdvancedBlock;
 
 
/*---------------------------------- Complex block -------------------------------------------*/
typedef struct DNM_stDynamicsComplexBlock
{
	MTH_tdxReal	m_xTiltIntensity;							/* tilt intensity */
	MTH_tdxReal m_xTiltInertia;								/* tilt inertia */
	MTH_tdxReal m_xTiltOrigin;								/* tilt rotation origin on Z axis */
	MTH_tdxReal m_xTiltAngle;
	MTH_tdxReal m_xHangingLimit;							/* Z limit in hanging mechanic */
	MTH3D_tdstVector m_stContact;							/* contact with obstacle */
	MTH3D_tdstVector m_stFallTranslation;					/* fall translation : is valid when flag can fall is set */
	tdstMACDPID m_stExternalDatas;
	HIE_tdxHandleToSuperObject m_hPlatform;					/* handle to father platform if one else NULL */
	POS_tdstCompletePosition m_stAbsolutePreviousMatrix;	/* actor absolute/platform previous matrix */
	POS_tdstCompletePosition m_stPrevPreviousMatrix;		/* actor previous previous matrix */
} DNM_tdstDynamicsComplexBlock;
 
 
 
/*---------------------------------- Base dynamic -------------------------------------------*/
typedef struct DNM_stBaseDynamics
{
	DNM_tdstDynamicsBaseBlock m_tdstDynamicsBaseBlock;
} DNM_tdstBaseDynamics;
 
/*---------------------------------- Advanced dynamic -------------------------------------------*/
typedef struct DNM_stAdvancedDynamics
{
	DNM_tdstDynamicsBaseBlock m_tdstDynamicsBaseBlock;
	DNM_tdstDynamicsAdvancedBlock m_tdstDynamicsAdvancedBlock;
} DNM_tdstAdvancedDynamics;
 
/*---------------------------------- Complex dynamic -------------------------------------------*/
typedef struct DNM_stComplexDynamics
{
	DNM_tdstDynamicsBaseBlock m_tdstDynamicsBaseBlock;
	DNM_tdstDynamicsAdvancedBlock m_tdstDynamicsAdvancedBlock;
	DNM_tdstDynamicsComplexBlock m_tdstDynamicsComplexBlock;
} DNM_tdstComplexDynamics;
 
 
/*---------------------------------- Dynamic -------------------------------------------*/
typedef struct DNM_stDynamics
{
	DNM_tdstDynamicsBaseBlock m_tdstDynamicsBaseBlock;
	DNM_tdstDynamicsAdvancedBlock m_tdstDynamicsAdvancedBlock;
	DNM_tdstDynamicsComplexBlock m_tdstDynamicsComplexBlock;
} DNM_tdstDynamics;
	
 
 
/*-----------------------------------------------------------------------------------------*/
/*----------------------------------------- MACRO  ----------------------------------------*/
/*-----------------------------------------------------------------------------------------*/
 
/*------------------------------------------ Internal function  ---------------------------------------*/
#ifdef MEC_CHECK_ACCESS 
	DNM_tdstDynamicsBaseBlock*		DNM_fn_pstGetBaseBlockWithAdvancedCheckAccess (DNM_tdstDynamics *p_stDynamic);
	DNM_tdstDynamicsBaseBlock*		DNM_fn_pstGetBaseBlockWithComplexCheckAccess (DNM_tdstDynamics *p_stDynamic);
	DNM_tdstDynamicsAdvancedBlock*	DNM_fn_pstGetAdvancedBlockWithCheckAccess	(DNM_tdstDynamics *p_stDynamic);
	DNM_tdstDynamicsComplexBlock*	DNM_fn_pstGetComplexBlockWithCheckAccess	(DNM_tdstDynamics *p_stDynamic);
	DNM_tdstReport*					DNM_fn_pstGetReportWithCheckAccess			(DNM_tdstDynamics *p_stDynamic);
	HIE_tdxHandleToSuperObject		DNM_fn_pstGetActorWithDynamic				(DNM_tdstDynamics *p_stDynamic);
#endif /* MEC_CHECK_ACCESS*/
 
 
/*------------------------------------------ Internal tools  ------------------------------*/
#define DNM_M_pstGetBaseBlock(_p_stDynamics) (&((_p_stDynamics)->m_tdstDynamicsBaseBlock))
 
#ifdef MEC_CHECK_ACCESS
	#define DNM_M_pstGetBaseBlockForAdvancedAccess(_p_stDynamics) DNM_fn_pstGetBaseBlockWithAdvancedCheckAccess(_p_stDynamics)
	#define DNM_M_pstGetBaseBlockForComplexAccess(_p_stDynamics) DNM_fn_pstGetBaseBlockWithComplexCheckAccess(_p_stDynamics)
	#define DNM_M_pstGetAdvancedBlock(_p_stDynamics) DNM_fn_pstGetAdvancedBlockWithCheckAccess(_p_stDynamics)
	#define DNM_M_pstGetComplexBlock(_p_stDynamics) DNM_fn_pstGetComplexBlockWithCheckAccess(_p_stDynamics)
#else
	#define DNM_M_pstGetBaseBlockForAdvancedAccess(_p_stDynamics) DNM_M_pstGetBaseBlock(_p_stDynamics)
	#define DNM_M_pstGetBaseBlockForComplexAccess(_p_stDynamics) DNM_M_pstGetBaseBlock(_p_stDynamics)
	#define DNM_M_pstGetAdvancedBlock(_p_stDynamics) (&((_p_stDynamics)->m_tdstDynamicsAdvancedBlock))
	#define DNM_M_pstGetComplexBlock(_p_stDynamics) (&((_p_stDynamics)->m_tdstDynamicsComplexBlock))
#endif
 
/*------------------------------------------ Base  ---------------------------------------*/
 
/*----- Get  ----*/
#define DNM_M_lDynamicsGetObjectType(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->m_lObjectType)
#define DNM_M_pDynamicsGetCurrentIdCard(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->m_pCurrentIdCard)
 
/* get bit-booleans */
#define DNM_M_bDynamicsIsAnimation(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_Animation ? TRUE: FALSE)
#define DNM_M_bDynamicsIsCollide(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_Collide ? TRUE: FALSE)
#define DNM_M_bDynamicsIsGravity(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_Gravity ? TRUE: FALSE)
#define DNM_M_bDynamicsIsTilt(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_Tilt ? TRUE: FALSE)
#define DNM_M_bDynamicsIsGi(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_Gi ? TRUE: FALSE)
#define DNM_M_bDynamicsIsOnGround(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_OnGround ? TRUE: FALSE)
#define DNM_M_bDynamicsIsClimb(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_Climb ? TRUE: FALSE)
#define DNM_M_bDynamicsIsSpider(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_Spider ? TRUE: FALSE)
#define DNM_M_bDynamicsIsShoot(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_Shoot ? TRUE: FALSE)
#define DNM_M_bDynamicsIsCollisionControl(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_CollisionControl ? TRUE: FALSE)
#define DNM_M_bDynamicsIsKeepWallSpeedZ(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_KeepWallSpeedZ ? TRUE: FALSE)
#define DNM_M_bDynamicsIsSpeedLimit(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_SpeedLimit ? TRUE: FALSE)
#define DNM_M_bDynamicsIsInertia(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_Inertia ? TRUE: FALSE)
#define DNM_M_bDynamicsIsStream(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_Stream ? TRUE: FALSE)
#define DNM_M_bDynamicsIsStickOnPlatform(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_StickOnPlatform ? TRUE: FALSE)
#define DNM_M_bDynamicsIsScale(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_Scale ? TRUE: FALSE)
#define DNM_M_bDynamicsIsAbsoluteImposeSpeed(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_AbsoluteImposeSpeed ? TRUE: FALSE)
#define DNM_M_bDynamicsIsRelativeImposeSpeed(_p_stDynamics) (!(DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_AbsoluteImposeSpeed) ? TRUE: FALSE)
#define DNM_M_bDynamicsIsAbsoluteProposeSpeed(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_AbsoluteProposeSpeed ? TRUE: FALSE)
#define DNM_M_bDynamicsIsRelativeProposeSpeed(_p_stDynamics) (!(DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_AbsoluteProposeSpeed) ? TRUE: FALSE)
#define DNM_M_bDynamicsIsAbsoluteAddSpeed(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_AbsoluteAddSpeed ? TRUE: FALSE)
#define DNM_M_bDynamicsIsRelativeAddSpeed(_p_stDynamics) (!(DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_AbsoluteAddSpeed) ? TRUE: FALSE)
#define DNM_M_bDynamicsIsImposeSpeedX(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_ImposeSpeedX ? TRUE: FALSE)
#define DNM_M_bDynamicsIsImposeSpeedY(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_ImposeSpeedY ? TRUE: FALSE)
#define DNM_M_bDynamicsIsImposeSpeedZ(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_ImposeSpeedZ ? TRUE: FALSE)
#define DNM_M_bDynamicsIsProposeSpeedX(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_ProposeSpeedX ? TRUE: FALSE)
#define DNM_M_bDynamicsIsProposeSpeedY(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_ProposeSpeedY ? TRUE: FALSE)
#define DNM_M_bDynamicsIsProposeSpeedZ(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_ProposeSpeedZ ? TRUE: FALSE)
#define DNM_M_bDynamicsIsAddSpeedX(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_AddSpeedX ? TRUE: FALSE)
#define DNM_M_bDynamicsIsAddSpeedY(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_AddSpeedY ? TRUE: FALSE)
#define DNM_M_bDynamicsIsAddSpeedZ(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_AddSpeedZ ? TRUE: FALSE)
#define DNM_M_bDynamicsIsLimitX(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_LimitX ? TRUE: FALSE)
#define DNM_M_bDynamicsIsLimitY(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_LimitY ? TRUE: FALSE)
#define DNM_M_bDynamicsIsLimitZ(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_LimitZ ? TRUE: FALSE)
#define DNM_M_bDynamicsIsImposeRotation(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_ImposeRotation ? TRUE: FALSE)
#define DNM_M_bDynamicsIsImposeTranslation(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_ImposeTranslation ? TRUE: FALSE)
#define DNM_M_bDynamicsIsLockPlatform(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & DNM_C_LockPlatform ? TRUE: FALSE)
#define DNM_M_bDynamicsIsMechanicChange(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_MechanicChange ? TRUE: FALSE)
#define DNM_M_bDynamicsIsPlatformCrash(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_PlatformCrash ? TRUE: FALSE)
#define DNM_M_bDynamicsIsCanFall(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_CanFall ? TRUE: FALSE)
#define DNM_M_bDynamicsIsInit(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_Init ? TRUE: FALSE)
#define DNM_M_bDynamicsIsChangeScale(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_ChangeScale ? TRUE: FALSE)
#define DNM_M_bDynamicsIsExec(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_Exec ? TRUE: FALSE)
#define DNM_M_bDynamicsIsBaseSize(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_BaseSize ? TRUE: FALSE)
#define DNM_M_bDynamicsIsAdvancedSize(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_AdvancedSize ? TRUE: FALSE)
#define DNM_M_bDynamicsIsComplexSize(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_ComplexSize ? TRUE: FALSE)
#define DNM_M_bDynamicsIsCollisionReport(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_CollisionReport ? TRUE: FALSE)
#define DNM_M_bDynamicsIsSafeValid(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_SafeValid ? TRUE: FALSE)
#define DNM_M_bDynamicsIsComputeInvertMatrix(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_ComputeInvertMatrix ? TRUE: FALSE)
#define DNM_M_bDynamicsIsNoGravity(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_NoGravity ? TRUE: FALSE)
#define DNM_M_bDynamicsIsStop(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_Stop ? TRUE: FALSE)
#define DNM_M_bDynamicsIsSlidingGround(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_SlidingGround ? TRUE: FALSE)
#define DNM_M_bDynamicsIsAlways(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_Always ? TRUE: FALSE)
#define DNM_M_bDynamicsIsCrash(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_Crash ? TRUE: FALSE)
#define DNM_M_bDynamicsIsSwim(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_Swim ? TRUE: FALSE)
#define DNM_M_bDynamicsIsNeverFall(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_NeverFall ? TRUE: FALSE)
#define DNM_M_bDynamicsIsHanging(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_Hanging ? TRUE: FALSE)
#define DNM_M_bDynamicsIsWallAdjust(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_WallAdjust ? TRUE: FALSE)
#define DNM_M_bDynamicsIsActorMove(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_ActorMove ? TRUE: FALSE)
#define DNM_M_bDynamicsIsForceSafeWalk(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_ForceSafeWalk ? TRUE: FALSE)
#define DNM_M_bDynamicsIsDontUseNewMechanic(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags & DNM_C_DontUseNewMechanic ? TRUE: FALSE)


#define DNM_M_xDynamicsGetGravityFactor(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->m_xGravity)
#define DNM_M_xDynamicsGetSlopeLimit(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->m_xSlopeLimit)
#define DNM_M_xDynamicsGetCosSlope(_p_stDynamics) ( DNM_M_pstGetBaseBlock(_p_stDynamics)->m_xCosSlope )
#define DNM_M_xDynamicsGetSlide(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->m_xSlide)
#define DNM_M_xDynamicsGetRebound(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->m_xRebound)
#define DNM_M_pDynamicsGetImposeSpeed(_p_stDynamics) ( &DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stImposeSpeed )
#define DNM_M_pDynamicsGetProposeSpeed(_p_stDynamics) ( &DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stProposeSpeed )
#define DNM_M_pDynamicsGetPreviousSpeed(_p_stDynamics) ( &DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stPreviousSpeed )
#define DNM_M_p_stDynamicsGetScaleX(_p_stDynamics) (MTH3D_M_xGetXofVector(&DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stScale))
#define DNM_M_p_stDynamicsGetScaleY(_p_stDynamics) (MTH3D_M_xGetYofVector(&DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stScale))
#define DNM_M_p_stDynamicsGetScaleZ(_p_stDynamics) (MTH3D_M_xGetZofVector(&DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stScale))
#define DNM_M_p_stDynamicsGetSpeedAnim(_p_stDynamics) (&DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stSpeedAnim)
#define DNM_M_pDynamicsGetSafeTranslation(_p_stDynamics) ( &DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stSafeTranslation )
#define DNM_M_pDynamicsGetAddTranslation(_p_stDynamics) ( &DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stAddTranslation )
#define DNM_M_p_stDynamicsGetPreviousMatrix(_p_stDynamics) (&DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stPreviousMatrix)
#define DNM_M_p_stDynamicsGetCurrentMatrix(_p_stDynamics) (&DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stCurrentMatrix)
#define DNM_M_p_stDynamicsGetImposeRotationMatrix(_p_stDynamics) (&DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stImposeRotationMatrix)
#define DNM_M_cDynamicsGetNbFrame(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->m_ucNbFrame)
#ifdef MEC_CHECK_ACCESS
	#define DNM_M_p_stDynamicsGetReport(_p_stDynamics) 	DNM_fn_pstGetReportWithCheckAccess(_p_stDynamics)
#else
	#define DNM_M_p_stDynamicsGetReport(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->m_pstReport)
#endif /* MEC_CHECK_ACCESS*/
#define DNM_M_p_stDynamicsGetReportWithoutCheckAccess(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->m_pstReport)
/*#define DNM_M_p_stDynamicsGetMecReport(_p_stDynamics) ((DNM_tdstReport*)(DNM_M_pstGetBaseBlock(_p_stDynamics)->m_pstReport))*/
 
/*----- Set  ----*/
#define DNM_M_lDynamicsSetObjectType(_p_stDynamics,_lValue) (DNM_M_lDynamicsGetObjectType(_p_stDynamics) = (_lValue))
#define DNM_M_vDynamicsSetCurrentIdCard(_p_stDynamics,pCurrentIdCard) (DNM_M_pDynamicsGetCurrentIdCard(_p_stDynamics) = pCurrentIdCard)
 
/* set Bit-Booleans */
#define DNM_M_vDynamicsSetAnimation(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_Animation) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_Animation)))
#define DNM_M_vDynamicsSetCollide(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_Collide) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_Collide)))
#define DNM_M_vDynamicsSetGravity(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_Gravity) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_Gravity)))
#define DNM_M_vDynamicsSetTilt(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlockForComplexAccess(_p_stDynamics)->ulFlags |= DNM_C_Tilt) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_Tilt)))
#define DNM_M_vDynamicsSetGi(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_Gi) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_Gi)))
#define DNM_M_vDynamicsSetOnGround(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_OnGround) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_OnGround)))
#define DNM_M_vDynamicsSetClimb(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_Climb) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_Climb)))
#define DNM_M_vDynamicsSetSpider(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_Spider) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_Spider)))
#define DNM_M_vDynamicsSetShoot(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_Shoot) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_Shoot)))
#define DNM_M_vDynamicsSetCollisionControl(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_CollisionControl) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_CollisionControl)))
#define DNM_M_vDynamicsSetKeepWallSpeedZ(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_KeepWallSpeedZ) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_KeepWallSpeedZ)))
#define DNM_M_vDynamicsSetSpeedLimit(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlockForAdvancedAccess(_p_stDynamics)->ulFlags |= DNM_C_SpeedLimit) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_SpeedLimit)))
#define DNM_M_vDynamicsSetInertia(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlockForAdvancedAccess(_p_stDynamics)->ulFlags |= DNM_C_Inertia) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_Inertia)))
#define DNM_M_vDynamicsSetStream(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlockForAdvancedAccess(_p_stDynamics)->ulFlags |= DNM_C_Stream) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_Stream)))
#define DNM_M_vDynamicsSetStickOnPlatform(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_StickOnPlatform) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_StickOnPlatform)))
#define DNM_M_vDynamicsSetScaleOption(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_Scale) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_Scale)))
#define DNM_M_bDynamicsSetAbsoluteImposeSpeed(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_AbsoluteImposeSpeed) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_AbsoluteImposeSpeed)))
#define DNM_M_bDynamicsSetRelativeImposeSpeed(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_AbsoluteImposeSpeed) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_AbsoluteImposeSpeed)))
#define DNM_M_bDynamicsSetAbsoluteProposeSpeed(_p_stDynamics,_bValue)(DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_AbsoluteProposeSpeed) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_AbsoluteProposeSpeed)))
#define DNM_M_bDynamicsSetRelativeProposeSpeed(_p_stDynamics,_bValue)(DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_AbsoluteProposeSpeed) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_AbsoluteProposeSpeed)))
#define DNM_M_bDynamicsSetAbsoluteAddSpeed(_p_stDynamics,_bValue)(DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_AbsoluteAddSpeed) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_AbsoluteAddSpeed)))
#define DNM_M_bDynamicsSetRelativeAddSpeed(_p_stDynamics,_bValue)(DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_AbsoluteAddSpeed) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_AbsoluteAddSpeed)))
#define DNM_M_vDynamicsSetImposeSpeedX(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_ImposeSpeedX) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_ImposeSpeedX)))
#define DNM_M_vDynamicsSetImposeSpeedY(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_ImposeSpeedY) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_ImposeSpeedY)))
#define DNM_M_vDynamicsSetImposeSpeedZ(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_ImposeSpeedZ) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_ImposeSpeedZ)))
#define DNM_M_vDynamicsSetProposeSpeedX(_p_stDynamics,_bValue)(DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_ProposeSpeedX) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_ProposeSpeedX)))
#define DNM_M_vDynamicsSetProposeSpeedY(_p_stDynamics,_bValue)(DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_ProposeSpeedY) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_ProposeSpeedY)))
#define DNM_M_vDynamicsSetProposeSpeedZ(_p_stDynamics,_bValue)(DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_ProposeSpeedZ) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_ProposeSpeedZ)))
#define DNM_M_vDynamicsSetAddSpeedX(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlockForAdvancedAccess(_p_stDynamics)->ulFlags |= DNM_C_AddSpeedX) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_AddSpeedX)))
#define DNM_M_vDynamicsSetAddSpeedY(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlockForAdvancedAccess(_p_stDynamics)->ulFlags |= DNM_C_AddSpeedY) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_AddSpeedY)))
#define DNM_M_vDynamicsSetAddSpeedZ(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlockForAdvancedAccess(_p_stDynamics)->ulFlags |= DNM_C_AddSpeedZ) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_AddSpeedZ)))
#define DNM_M_vDynamicsSetLimitX(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlockForAdvancedAccess(_p_stDynamics)->ulFlags |= DNM_C_LimitX) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_LimitX)))
#define DNM_M_vDynamicsSetLimitY(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlockForAdvancedAccess(_p_stDynamics)->ulFlags |= DNM_C_LimitY) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_LimitY)))
#define DNM_M_vDynamicsSetLimitZ(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlockForAdvancedAccess(_p_stDynamics)->ulFlags |= DNM_C_LimitZ) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_LimitZ)))
#define DNM_M_vDynamicsSetImposeRotation(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_ImposeRotation) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_ImposeRotation)))
#define DNM_M_vDynamicsSetImposeTranslation(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_ImposeTranslation) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_ImposeTranslation)))
#define DNM_M_bDynamicsSetLockPlatform(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags |= DNM_C_LockPlatform) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags &= ~DNM_C_LockPlatform)))
#define DNM_M_bDynamicsSetMechanicChange(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_MechanicChange) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_MechanicChange)))
#define DNM_M_bDynamicsSetPlatformCrash(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_PlatformCrash) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_PlatformCrash)))
#define DNM_M_bDynamicsSetCanFall(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_CanFall) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_CanFall)))
#define DNM_M_vDynamicsSetInit(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_Init) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_Init)))
#define DNM_M_vDynamicsSetChangeScale(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_ChangeScale) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_ChangeScale)))
#define DNM_M_vDynamicsSetExec(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_Exec) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_Exec)))
#define DNM_M_vDynamicsSetBaseSize(_p_stDynamics)													\
{																									\
	DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~(DNM_C_BaseSize|DNM_C_AdvancedSize|DNM_C_ComplexSize);			\
	DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_BaseSize;													\
}
#define DNM_M_vDynamicsSetAdvancedSize(_p_stDynamics)												\
{																									\
	DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~(DNM_C_BaseSize|DNM_C_AdvancedSize|DNM_C_ComplexSize);			\
	DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= (DNM_C_AdvancedSize|DNM_C_BaseSize);												\
}
#define DNM_M_vDynamicsSetComplexSize(_p_stDynamics)												\
{																									\
	DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= (DNM_C_ComplexSize|DNM_C_AdvancedSize|DNM_C_BaseSize);												\
}
#define DNM_M_vDynamicsSetCollisionReport(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_CollisionReport) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_CollisionReport)))
#define DNM_M_vDynamicsSetSafeValid(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_SafeValid) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_SafeValid)))
#define DNM_M_vDynamicsSetComputeInvertMatrix(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_ComputeInvertMatrix) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_ComputeInvertMatrix)))
#define DNM_M_vDynamicsSetNoGravity(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_NoGravity) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_NoGravity)))
#define DNM_M_vDynamicsSetStop(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_Stop) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_Stop)))
#define DNM_M_vDynamicsSetSlidingGround(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_SlidingGround) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_SlidingGround)))
#define DNM_M_vDynamicsSetAlways(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_Always) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_Always)))
#define DNM_M_vDynamicsSetCrash(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_Crash) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_Crash)))
#define DNM_M_vDynamicsSetSwim(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_Swim) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_Swim)))
#define DNM_M_vDynamicsSetNeverFall(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_NeverFall) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_NeverFall)))
#define DNM_M_vDynamicsSetHanging(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_Hanging) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_Hanging)))
#define DNM_M_vDynamicsSetWallAdjust(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_WallAdjust) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_WallAdjust)))
#define DNM_M_vDynamicsSetActorMove(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_ActorMove) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_ActorMove)))
#define DNM_M_vDynamicsSetForceSafeWalk(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_ForceSafeWalk) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_ForceSafeWalk)))
#define DNM_M_vDynamicsSetDontUseNewMechanic(_p_stDynamics,_bValue) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags = ((_bValue) ? (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags |= DNM_C_DontUseNewMechanic) : (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulEndFlags &= ~DNM_C_DontUseNewMechanic)))
 


#define DNM_M_vDynamicsSetGravityFactor(_p_stDynamics,xGravity) (DNM_M_xDynamicsGetGravityFactor(_p_stDynamics)=xGravity )
#define DNM_M_vDynamicsSetSlopeLimit(_p_stDynamics,xSlopeLimit) (DNM_M_xDynamicsGetSlopeLimit(_p_stDynamics)=xSlopeLimit )
#define DNM_M_vDynamicsSetCosSlope(_p_stDynamics,xCosSlope) (DNM_M_xDynamicsGetCosSlope(_p_stDynamics)=xCosSlope)
#define DNM_M_vDynamicsSetSlide(_p_stDynamics,xSlide) (DNM_M_xDynamicsGetSlide(_p_stDynamics)=xSlide )
#define DNM_M_vDynamicsSetRebound(_p_stDynamics,xRebound) (DNM_M_xDynamicsGetRebound(_p_stDynamics)=xRebound )
#define DNM_M_vDynamicsSetImposeSpeed(_p_stDynamics,p_stSpeed) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetImposeSpeed(_p_stDynamics), p_stSpeed )
#define DNM_M_vDynamicsSetProposeSpeed(_p_stDynamics,p_stSpeed) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetProposeSpeed(_p_stDynamics), p_stSpeed)
#define DNM_M_vDynamicsSetPreviousSpeed(_p_stDynamics,p_stSpeed) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetPreviousSpeed(_p_stDynamics), p_stSpeed)
#define DNM_M_vDynamicsSetScale(_p_stDynamics,_xScaleX, _xScaleY, _xScaleZ) { MTH3D_M_vSetXofVector(&(DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stScale),_xScaleX);  MTH3D_M_vSetYofVector(&(DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stScale),_xScaleY); MTH3D_M_vSetZofVector(&(DNM_M_pstGetBaseBlock(_p_stDynamics)->m_stScale),_xScaleZ); }
#define DNM_M_vDynamicsSetSpeedAnim(_p_stDynamics,pstSpeedAnim)  MTH3D_M_vCopyVector( DNM_M_p_stDynamicsGetSpeedAnim(_p_stDynamics), pstSpeedAnim )
#define DNM_M_vDynamicsSetSafeTranslation(_p_stDynamics,p_stSafeTranslation) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetSafeTranslation(_p_stDynamics), p_stSafeTranslation )
#define DNM_M_vDynamicsSetAddTranslation(_p_stDynamics,p_stAddTranslation) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetAddTranslation(_p_stDynamics), p_stAddTranslation )
#define DNM_M_vDynamicsSetImposeRotationMatrix(_p_stDynamics,hMatrix) MTH3D_M_vCopyMatrix ( DNM_M_p_stDynamicsGetImposeRotationMatrix(_p_stDynamics), hMatrix ) 
#define DNM_M_vDynamicsSetNbFrame(_p_stDynamics,_ucNbFrame) (DNM_M_cDynamicsGetNbFrame(_p_stDynamics)=_ucNbFrame)
#define DNM_M_DynamicsSetReport(_p_stDynamics,_p_stReport) (DNM_M_pstGetBaseBlock(_p_stDynamics)->m_pstReport=_p_stReport)
 
 
/*------------------------------------------ Advanced  ---------------------------------------*/
 
/*----- Get  ----*/
#define DNM_M_xDynamicsGetInertiaFactorX(_p_stDynamics) (DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_xInertiaX)
#define DNM_M_xDynamicsGetInertiaFactorY(_p_stDynamics) (DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_xInertiaY)
#define DNM_M_xDynamicsGetInertiaFactorZ(_p_stDynamics) (DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_xInertiaZ)
#define DNM_M_xDynamicsGetStreamPriority(_p_stDynamics) (DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_xStreamPrority)
#define DNM_M_xDynamicsGetStreamFactor(_p_stDynamics) (DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_xStreamFactor)
#define DNM_M_xDynamicsGetSlideFactorX(_p_stDynamics) ( DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_xSlideFactorX )
#define DNM_M_xDynamicsGetSlideFactorY(_p_stDynamics) ( DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_xSlideFactorY )
#define DNM_M_xDynamicsGetSlideFactorZ(_p_stDynamics) ( DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_xSlideFactorZ )
#define DNM_M_xDynamicsGetPreviousSlide(_p_stDynamics) ( DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_xPreviousSlide )
#define DNM_M_pDynamicsGetMaxSpeed(_p_stDynamics) (&DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_stMaxSpeed)
#define DNM_M_pDynamicsGetStreamSpeed(_p_stDynamics) (&DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_stStreamSpeed)
#define DNM_M_pDynamicsGetAddSpeed(_p_stDynamics) ( &DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_stAddSpeed )
#define DNM_M_pDynamicsGetLimit(_p_stDynamics) ( &DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_stLimit )
#define DNM_M_pDynamicsGetCollisionTranslation(_p_stDynamics) ( &(DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_stCollisionTranslation) )
#define DNM_M_pDynamicsGetInertiaTranslation(_p_stDynamics) ( &DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_stInertiaTranslation )
#define DNM_M_pDynamicsGetGroundNormal(_p_stDynamics) ( &(DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_stGroundNormal) )
#define DNM_M_pDynamicsGetWallNormal(_p_stDynamics) ( &(DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_stWallNormal) )
#define DNM_M_cDynamicsGetCollideCounter(_p_stDynamics) (DNM_M_pstGetAdvancedBlock(_p_stDynamics)->m_cCollideCounter)
 
/*----- Set  ----*/
#define DNM_M_vDynamicsSetInertiaFactorX(_p_stDynamics,xInertiaX) ( DNM_M_xDynamicsGetInertiaFactorX(_p_stDynamics)=xInertiaX )
#define DNM_M_vDynamicsSetInertiaFactorY(_p_stDynamics,xInertiaY) ( DNM_M_xDynamicsGetInertiaFactorY(_p_stDynamics)=xInertiaY )
#define DNM_M_vDynamicsSetInertiaFactorZ(_p_stDynamics,xInertiaZ) ( DNM_M_xDynamicsGetInertiaFactorZ(_p_stDynamics)=xInertiaZ )
#define DNM_M_vDynamicsSetStreamPriority(_p_stDynamics,xStreamPriority) (DNM_M_xDynamicsGetStreamPriority(_p_stDynamics)=xStreamPriority)
#define DNM_M_vDynamicsSetStreamFactor(_p_stDynamics,xStreamFactor) (DNM_M_xDynamicsGetStreamFactor(_p_stDynamics)=xStreamFactor)
#define DNM_M_vDynamicsSetSlideFactorX(_p_stDynamics,xSlideFactorX) (DNM_M_xDynamicsGetSlideFactorX(_p_stDynamics) = xSlideFactorX)
#define DNM_M_vDynamicsSetSlideFactorY(_p_stDynamics,xSlideFactorY) (DNM_M_xDynamicsGetSlideFactorY(_p_stDynamics) = xSlideFactorY)
#define DNM_M_vDynamicsSetSlideFactorZ(_p_stDynamics,xSlideFactorZ) (DNM_M_xDynamicsGetSlideFactorZ(_p_stDynamics) = xSlideFactorZ)
#define DNM_M_vDynamicsSetPreviousSlide(_p_stDynamics,xPreviousSlide) (DNM_M_xDynamicsGetPreviousSlide(_p_stDynamics) = xPreviousSlide)
#define DNM_M_vDynamicsSetMaxSpeed(_p_stDynamics,pstMaxSpeed)  MTH3D_M_vCopyVector( DNM_M_pDynamicsGetMaxSpeed(_p_stDynamics), pstMaxSpeed )
#define DNM_M_vDynamicsSetStreamSpeed(_p_stDynamics,pstStreamSpeed) MTH3D_M_vCopyVector( DNM_M_pDynamicsGetStreamSpeed(_p_stDynamics), pstStreamSpeed )
#define DNM_M_vDynamicsSetAddSpeed(_p_stDynamics,p_stSpeed) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetAddSpeed(_p_stDynamics), p_stSpeed)
#define DNM_M_vDynamicsSetLimit(_p_stDynamics,p_stLimit) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetLimit(_p_stDynamics), p_stLimit)
#define DNM_M_vDynamicsSetCollisionTranslation(_p_stDynamics,p_stCollisionTranslation) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetCollisionTranslation(_p_stDynamics), p_stCollisionTranslation )
#define DNM_M_vDynamicsSetInertiaTranslation(_p_stDynamics,p_stInertiaTranslation) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetInertiaTranslation(_p_stDynamics), p_stInertiaTranslation )
#define DNM_M_vDynamicsSetGroundNormal(_p_stDynamics,p_stGroundNormal) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetGroundNormal(_p_stDynamics), p_stGroundNormal )
#define DNM_M_vDynamicsSetWallNormal(_p_stDynamics,p_stWallNormal) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetWallNormal(_p_stDynamics), p_stWallNormal )
#define DNM_M_vDynamicsSetCollideCounter(_p_stDynamics,_cCounter) (DNM_M_cDynamicsGetCollideCounter(_p_stDynamics)=_cCounter)
 
 
/*------------------------------------------ Complex  ---------------------------------------*/
 
/*----- Get  ----*/
#define DNM_M_xDynamicsGetTiltIntensity(_p_stDynamics) (DNM_M_pstGetComplexBlock(_p_stDynamics)->m_xTiltIntensity)
#define DNM_M_xDynamicsGetTiltInertia(_p_stDynamics) (DNM_M_pstGetComplexBlock(_p_stDynamics)->m_xTiltInertia)
#define DNM_M_xDynamicsGetTiltOrigin(_p_stDynamics) (DNM_M_pstGetComplexBlock(_p_stDynamics)->m_xTiltOrigin)
#define DNM_M_xDynamicsGetTiltAngle(_p_stDynamics) ( DNM_M_pstGetComplexBlock(_p_stDynamics)->m_xTiltAngle )
#define DNM_M_xDynamicsGetHangingLimit(_p_stDynamics) ( DNM_M_pstGetComplexBlock(_p_stDynamics)->m_xHangingLimit )
#define DNM_M_pDynamicsGetContact(_p_stDynamics) ( &DNM_M_pstGetComplexBlock(_p_stDynamics)->m_stContact )
#define DNM_M_pDynamicsGetFallTranslation(_p_stDynamics) ( &DNM_M_pstGetComplexBlock(_p_stDynamics)->m_stFallTranslation )
#define DNM_M_p_stDynamicsGetExternalDatas(_p_stDynamics) (&DNM_M_pstGetComplexBlock(_p_stDynamics)->m_stExternalDatas)
#define DNM_M_hDynamicsGetPlatformSO(_p_stDynamics) ( DNM_M_pstGetComplexBlock(_p_stDynamics)->m_hPlatform )
#define DNM_M_p_stDynamicsGetAbsolutePreviousMatrix(_p_stDynamics) (&DNM_M_pstGetComplexBlock(_p_stDynamics)->m_stAbsolutePreviousMatrix)
#define DNM_M_p_stDynamicsGetPrevPreviousMatrix(_p_stDynamics) (&DNM_M_pstGetComplexBlock(_p_stDynamics)->m_stPrevPreviousMatrix)
 
/*----- Set  ----*/
#define DNM_M_vDynamicsSetTiltIntensity(_p_stDynamics,xTiltIntensity) ( DNM_M_xDynamicsGetTiltIntensity(_p_stDynamics)=xTiltIntensity )
#define DNM_M_vDynamicsSetTiltInertia(_p_stDynamics,xTiltInertia) ( DNM_M_xDynamicsGetTiltInertia(_p_stDynamics)=xTiltInertia )
#define DNM_M_vDynamicsSetTiltOrigin(_p_stDynamics,xTiltOrigin) ( DNM_M_xDynamicsGetTiltOrigin(_p_stDynamics)=xTiltOrigin )
#define DNM_M_vDynamicsSetTiltAngle(_p_stDynamics,xTiltAngle) (DNM_M_xDynamicsGetTiltAngle(_p_stDynamics) = xTiltAngle)
#define DNM_M_vDynamicsSetHangingLimit(_p_stDynamics,xHangingLimit) (DNM_M_xDynamicsGetHangingLimit(_p_stDynamics) = xHangingLimit)
#define DNM_M_vDynamicsSetContact(_p_stDynamics,p_stContact) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetContact(_p_stDynamics), p_stContact )
#define DNM_M_vDynamicsSetFallTranslation(_p_stDynamics,p_stFallTranslation) MTH3D_M_vCopyVector ( DNM_M_pDynamicsGetFallTranslation(_p_stDynamics), p_stFallTranslation )
#define DNM_M_p_stDynamicsSetExternalDatas(_p_stDynamics,_p_stMACDPID) M_vMACDPIDCopyClone(DNM_M_p_stDynamicsGetExternalDatas(_p_stDynamics),_p_stMACDPID)
#define DNM_M_vDynamicsSetPlatformSO(_p_stDynamics,hPlatform) (DNM_M_hDynamicsGetPlatformSO(_p_stDynamics) = hPlatform)
 
/*------------------------------------------ Tools  ---------------------------------------*/
#define DNM_M_bDynamicsIsProposeSpeed(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & (DNM_C_ProposeSpeedX|DNM_C_ProposeSpeedY|DNM_C_ProposeSpeedZ) ? TRUE: FALSE)
#define DNM_M_bDynamicsIsImposeSpeed(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & (DNM_C_ImposeSpeedX|DNM_C_ImposeSpeedY|DNM_C_ImposeSpeedZ)  ? TRUE: FALSE)
#define DNM_M_bDynamicsIsAddSpeed(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & (DNM_C_AddSpeedX|DNM_C_AddSpeedY|DNM_C_AddSpeedZ) ? TRUE: FALSE)
#define DNM_M_bDynamicsIsLimit(_p_stDynamics) (DNM_M_pstGetBaseBlock(_p_stDynamics)->ulFlags & (DNM_C_LimitX|DNM_C_LimitY|DNM_C_LimitZ) ? TRUE: FALSE)
#define DNM_M_vDynamicsDecCollideCounter(_p_stDynamics) (DNM_M_cDynamicsGetCollideCounter(_p_stDynamics)--)
 
 
/*------------------------------------------ Functions  ---------------------------------------*/
 
/* Initialisation */
void DNM_fn_vDynamicsInitDefault(DNM_tdstDynamics *_p_stDynamics);
 
/* Init dynamic internal parameters*/
void DNM_fn_vInitBaseMechanic (DNM_tdstDynamics *p_stDynamic);
 
/* Init dynamic fields*/
void DNM_fn_vInitDynamic (DNM_tdstDynamics *p_stDynamic, DNM_tdxHandleToMecIdentityCard hIdCard);
 
/* Id Card have changed */
void DNM_fn_vChangeIdCard (DNM_tdstDynamics *_p_stDynamics,DNM_tdxHandleToMecIdentityCard _hNewIdCard);
 
/* Clone */
void DNM_fn_vDynamicsCopyClone ( DNM_tdstDynamics *_p_stDst, DNM_tdstDynamics *_p_stSrc );
 
 
 
 
 
 
#ifdef __cplusplus
}
#endif
 
#endif
