/* Animatable point */
typedef struct particle_s
{
	vec3_t	position;
	vec3_t	velocity;
	vec3_t	acceleration;
}	particle_t, *partivle_p;

/* Interaction */

/* Force fields */
typedef struct space_properties_s
{
	
}

class friction_force_c : public force_field_c
{
	vec_t	mass;
	vec3_t	static_friction;
	vec3_t	dynamic_friction;
}

typedef struct	cam_s
{
	vec3_t		origin;		/* position */
	vec3_t		target;		/* used for target cameras */
	/* lower and upper distances from camera to target */
	vec2_t		target_distances;
	vboolean	targeted;	/* == true for target cameras */

	plane3_t	baseplane;	/* used to snap motion to */
	vec2_t		baseplane_distances;
	vboolean	snapped;	/* == true when motion snapped to baseplane */
	vec3_t		dir;		/* direction */
	vec3_t		up;			/* up vector */
	vec3_t		angles;		/* used internally */
	matrix3x4_t	transform;	/* transform based on pos, dir and up */
	matrix4_t	gl_transform;	/* same as above, OpenGL form */
	/* 	== true if position of camera changed since 
	 * 	last call to camGetTransform */
	vboolean	modified;	
}	cam_t, *cam_p;

typedef struct	sdof_control_s
{
	vec3_t		step;		/* forward, up, right (meters) */
	vec3_t		speed;		/* updated automatically */
	vec3_t		zero_speed;	/* updated automatically from max_speed */
	vec3_t		max_speed;	/* forward, up, right (meters per second) */
	vec3_t		fade_accel;	/* updated automatically from 'accel' */
	vec3_t		accel;		/* forward, up, right (meters per second^2) */
	vec3_t		angle_step;			/* pitch, yaw, roll (radians) */
	vec3_t		angle_speed;		/* updated automatically */
	vec3_t		zero_angle_speed;	/* updated automatically */
	vec3_t		max_angle_speed;	/* pitch, yaw, roll (r. p. s.) */
	vec3_t		fade_angle_accel;	/* updated automatically */
	vec3_t		angle_accel;		/* pitch, yaw, roll (r. p. s. ^2) */
}	sdof_control_t, *sdof_control_p;


#define	DIR_FORWARD		0
#define	DIR_BACKWARD	1
#define	DIR_LEFT		2
#define	DIR_RIGHT		3
#define	DIR_UP			4
#define	DIR_DOWN		5

#define	PITCH_LEFT		0
#define	PITCH_RIGHT		1
#define	YAW_UP			2
#define	YAW_DOWN		3
#define	ROLL_CW			4
#define	ROLL_CCW		5

typedef struct	key_controller_s
{
	/* scan codes of control keys */
	keycode_t	translation_key[6];
	keycode_y	rotation_key[6];
	/* flags set when buttons pressed */
	vboolean	begin_translation[6];
	vboolean	begin_rotation[6];
	/* times since processing of codes */
	
	vhandle_t timer;


	vec3_t		moving_times;
	
	vboolean	yawing_left,	yawing_right;
	vboolean	pitching_up,	pitching_down;
	vboolean	rolling_cw,		rolling_ccw;
	vec3_t		rotation_times;
	
	int			mouse_x_index;	/* 0 means x-axis controls pitch, etc. */
	int			mouse_y_index;	/* 0 means y-axis controls pitch, etc. */
	vec3_t		angle_axis;
	vec3_t		motion_axis;
}	sdof_keymap_t, *sdof_keymap_p;
