#ifndef _MECDEF_H_
#define _MECDEF_H_

/* game material type */
#define C_xDNM_SLIDE_TYPE_GAME_MATERIAL			(1<<0)
#define C_xDNM_REBOUND_TYPE_GAME_MATERIAL		(1<<1)
#define C_xDNM_HANG_TYPE_GAME_MATERIAL			(1<<2)
#define C_xDNM_HAND_TYPE_GAME_MATERIAL			(1<<3)
#define C_xDNM_NO_COLLISION_WITH_GROUND			(1<<4)
#define C_xDNM_GI_TYPE_GAME_MATERIAL			(1<<5)
#define C_xDNM_CLIMB_TYPE_GAME_MATERIAL			(1<<6)
#define C_xDNM_HURT_TYPE_GAME_MATERIAL			(1<<10)
#define C_xDNM_WATER_TYPE_GAME_MATERIAL			(1<<14)
#define C_xDNM_NO_COLLISION_TYPE_GAME_MATERIAL	(1<<15)



/* combined game material type */
#define C_xDNM_NO_COLLISION_CLIMB_TYPE_GAME_MATERIAL	(C_xDNM_CLIMB_TYPE_GAME_MATERIAL|C_xDNM_NO_COLLISION_TYPE_GAME_MATERIAL)
#define C_xDNM_COLLISION_REPORT_MASK					8072	/* 0001111110001000 */

/* custom bits */
#define C_ulDNM_COMPUTE_CHANNEL				(0x2) 
#define C_ulDNM_NO_CRASH_CUSTOM_BIT			(0x40)
#define C_ulDNM_CAN_PUSH_RAYMAN_CUSTOM_BIT	(0x4000000)
#define C_ulDNM_RAYMAN_CUSTOM_BIT			(0x80000000)

/* Rayman zone */
#define C_ulDNM_RAYMAN_ZDM_RADIUS			MTH_M_xDoubleToReal(0.9)

/* Climb limits */
#define C_xDNM_CLIMB_COS_ANGLE_LIMIT		MTH_M_xDoubleToReal(0.92718)   /* cos(22°)

/* Initial coeff */
#define C_xDNM_BASE_COEF	MTH_C_ZERO
#define C_xDNM_WALK_COEF	MTH_C_ZERO


/* internal define */
#define C_xDNM_MTH_EPSILON MTH_M_xDoubleToReal(1e-3)
#define C_xDNM_MAX_MULT_SPEED MTH_M_xDoubleToReal(1.0370)
#define C_xDNM_NUL_MOVE	MTH_M_xDoubleToReal(1e-10)
#define C_xDNM_CLIMB_SLOPE_LIMIT MTH_M_xDoubleToReal(MTH_M_xTan(MTH_M_xDegToRad(60)))
#define C_xDNM_SPIDER_SLOPE_LIMIT MTH_M_xDoubleToReal(MTH_M_xTan(MTH_M_xDegToRad(60)))
#define C_xDNM_EPSILON_DOT_PROD MTH_M_xDoubleToReal(0.05)
#define C_xDNM_CLIMB_FIRST_NORMAL_MOVE MTH_M_xDoubleToReal(0.75)
#define C_xDNM_GI_DEFAULT_NORMAL_MOVE MTH_M_xDoubleToReal(0.45)
#define C_xDNM_CLIMB_DEFAULT_NORMAL_MOVE MTH_M_xDoubleToReal(0.45)
#define C_xDNM_ON_GROUND_DEFAULT_NORMAL_MOVE MTH_M_xDoubleToReal(0.45)
#define C_xDNM_SPIDER_DEFAULT_NORMAL_MOVE MTH_M_xDoubleToReal(0.5)
#define C_xDNM_REAL_PRECISION (MTH_M_xDoubleToReal(1e-4))   /* max 2e-5 */
#define C_xDNM_EDGE_GROUND_LIMIT (MTH_M_xDoubleToReal(0.9848))       /* z limit */
#define C_xDNM_DISTANCE_FROM_WALL_ON_GROUND (MTH_M_xDoubleToReal(0.10))       
#define C_xDNM_CORNER_LIMIT (MTH_M_xDoubleToReal(0.7071067811865))   /* 45° */
#define C_xDNM_MINUS_CORNER_LIMIT (MTH_M_xDoubleToReal(-0.7071067811865))  /* 45° */
#define C_xDNM_VERTICAL_FALL_LIMIT MTH_M_xDoubleToReal(0.07)
#define C_xDNM_TILT_SENSIBILITY MTH_M_xDoubleToReal(1)
#define C_xDNM_CLIMB_BACKFACE_LIMIT MTH_M_xDoubleToReal(0.95)
#define C_xDNM_ON_GROUND_STEP MTH_M_xDoubleToReal(0.45)


#endif //_MECDEF_H_