# ifndef CAR_HEADER_FILE # define CAR_HEADER_FILE // Basiques # include # include # include // Random # include # include // SDL # include # undef main # include # include // bBox2D # include # define MULTI 100.0f enum command { FREE, BREAK, GO, REVERSE }; class Car { public: Car(); virtual ~Car(); void init( b2World &world, float32 x, float32 y, float32 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 ; float32 m_currentTorque ; float32 m_currentSpeed ; float32 m_goTorque ; float32 m_minTorque ; float32 m_maxSpeed ; }; # endif // CAR_HEADER_FILE