#ifndef __PTF_BALL_HPP__ #define __PTF_BALL_HPP__ #include #include #include "object.hpp" #include "engine_state.hpp" class Ball : public Object { private: sf::Sprite sprite; protected: /** * Calcule les forces appliquées à l'objet */ virtual sf::Vector2f getForces(EngineState& state); public: Ball(float x, float y); /** * Dessine la balle dans la fenêtre donnée */ virtual void draw(sf::RenderWindow& window, ResourceManager& resources); /** * Récupère la boîte englobante de l'objet */ std::unique_ptr getAABB(); /** * Calcule les informations sur une éventuelle collision de * cet objet avec un autre : la normale et la profondeur */ virtual bool getCollisionInfo(Object& obj, sf::Vector2f& normal, float& depth); virtual bool getCollisionInfo(Ball& obj, sf::Vector2f& normal, float& depth); virtual bool getCollisionInfo(Block& obj, sf::Vector2f& normal, float& depth); /** * Renvoie le rayon de la balle */ float getRadius(); }; #endif