# ifndef CAR_HEADER_FILE
# define CAR_HEADER_FILE

// Basiques
# include <iostream>
# include <cmath>
# include <vector>

// Random
# include <ctime>
# include <cstdlib>

// SDL
# include <SDL/SDL.h>
# undef main
# include <SDL/SDL_rotozoom.h>
# include <SDL/SDL_gfxPrimitives.h>

// bBox2D
# include <box2d/box2d.h>
# define MULTI 100.0f

enum command { FREE, BREAK, GO, REVERSE };

class Car
{
public:
	Car();
	virtual ~Car();

	void init( b2World &world, float x, float y, float angle = 0.0f );

	void drive( command cmd );
	void update();

	b2Vec2 GetPosition();

protected:
	b2Body* m_bodyCar ;
	b2Body* m_bodyWheelFwd ;
	b2Body* m_bodyWheelBack ;

	b2RevoluteJoint* m_motorAxe ;
	b2RevoluteJoint* m_fwdAxe ;
	
	SDL_Surface* m_imgCar ;
	SDL_Surface* m_imgWheel ;

	command m_cmd ;

	float m_currentTorque ;
	float m_currentSpeed ;

	float m_goTorque ;
	float m_minTorque ;
	float m_maxSpeed ;
};


# endif // CAR_HEADER_FILE