skizzle/include/ball.hpp

47 lines
1.1 KiB
C++
Raw Normal View History

2016-03-08 22:28:50 +00:00
#ifndef __PTF_BALL_HPP__
#define __PTF_BALL_HPP__
2016-03-04 15:29:31 +00:00
#include <SFML/Graphics.hpp>
#include <iostream>
#include "object.hpp"
#include "engine_state.hpp"
2016-03-04 15:29:31 +00:00
class Ball : public Object {
private:
sf::Sprite sprite;
protected:
/**
* Calcule les forces appliquées à l'objet
*/
virtual sf::Vector2f getForces(EngineState& state);
2016-03-04 15:29:31 +00:00
public:
Ball(float x, float y);
/**
* Dessine la balle dans la fenêtre donnée
*/
virtual void draw(sf::RenderWindow& window, ResourceManager& resources);
2016-03-04 15:29:31 +00:00
/**
* Récupère la boîte englobante de l'objet
*/
std::unique_ptr<sf::FloatRect> 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();
2016-03-04 15:29:31 +00:00
};
#endif