| 
									
										
										
										
											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>
 | 
					
						
							| 
									
										
										
										
											2016-03-13 16:03:56 +00:00
										 |  |  | #include "engine_state.hpp"
 | 
					
						
							| 
									
										
										
										
											2016-03-15 16:08:21 +00:00
										 |  |  | #include "object.hpp"
 | 
					
						
							| 
									
										
										
										
											2016-03-04 15:29:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-15 16:08:21 +00:00
										 |  |  | class Ball : public Object { | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2016-03-12 13:15:27 +00:00
										 |  |  |     sf::Texture texture; | 
					
						
							| 
									
										
										
										
											2016-03-10 20:47:19 +00:00
										 |  |  |     sf::CircleShape shape; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-15 16:08:21 +00:00
										 |  |  | protected: | 
					
						
							| 
									
										
										
										
											2016-03-08 18:50:21 +00:00
										 |  |  |     /**
 | 
					
						
							|  |  |  |      * Calcule les forces appliquées à l'objet | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-03-13 16:03:56 +00:00
										 |  |  |     virtual sf::Vector2f getForces(EngineState& state); | 
					
						
							| 
									
										
										
										
											2016-03-04 15:29:31 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2016-03-14 20:11:09 +00:00
										 |  |  |     Ball(float x, float y); | 
					
						
							| 
									
										
										
										
											2016-03-09 19:01:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-08 17:07:21 +00:00
										 |  |  |     /**
 | 
					
						
							| 
									
										
										
										
											2016-03-08 18:50:21 +00:00
										 |  |  |      * Dessine la balle dans la fenêtre donnée | 
					
						
							| 
									
										
										
										
											2016-03-08 17:07:21 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-03-15 16:08:21 +00:00
										 |  |  |     virtual void draw(sf::RenderWindow& window); | 
					
						
							| 
									
										
										
										
											2016-03-04 15:29:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-13 18:07:35 +00:00
										 |  |  |     /**
 | 
					
						
							|  |  |  |      * Récupère la boîte englobante de l'objet | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     std::unique_ptr<sf::FloatRect> getAABB(); | 
					
						
							| 
									
										
										
										
											2016-03-15 21:00:03 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /**
 | 
					
						
							| 
									
										
										
										
											2016-03-18 15:48:22 +00:00
										 |  |  |      * Calcule les informations sur une éventuelle collision de | 
					
						
							|  |  |  |      * cet objet avec un autre : la normale et la profondeur | 
					
						
							| 
									
										
										
										
											2016-03-15 21:00:03 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-03-18 15:48:22 +00:00
										 |  |  |     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); | 
					
						
							| 
									
										
										
										
											2016-03-04 15:29:31 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 |