|
casse-brick latest
Ce projet est réalisé dans le cadre du cours de Programmation Avancée en M1 Informatique de l'université de Strasbourg.
|
The CircleCollider class represents a circular collider object. More...
#include <CollidingObject.h>
Public Member Functions | |
| CircleCollider (point mid, int radius, std::string id) | |
| Constructs a new CircleCollider object with specified parameters. | |
| int | getRadius () const |
| Gets the radius of the circular collider. | |
| std::tuple< bool, float, float > | collided (const Collider &other) const override |
| Checks for collision with another collider. | |
| std::string | getType () const override |
| Gets the type of the collider. | |
| void | render (std::shared_ptr< SDL_Renderer > renderer, SDL_Color color1, SDL_Color color2) override |
| Renders the collider on the screen. | |
Public Member Functions inherited from Collider | |
| void | move (point newPoint) |
| Moves the collider to a new position. | |
| void | moveTo (point newPoint) |
| Moves the collider to an absolute position. | |
| virtual | ~Collider ()=default |
| Virtual destructor for the Collider class. | |
| virtual std::tuple< bool, float, float > | collided (const Collider &other) const =0 |
| Checks for collision with another collider. | |
| virtual std::string | getType () const =0 |
| Gets the type of the collider. | |
| virtual void | render (std::shared_ptr< SDL_Renderer > renderer, SDL_Color color1, SDL_Color color2)=0 |
| Renders the collider on the screen. | |
Private Attributes | |
| int | radius |
| The radius of the circular collider. | |
Additional Inherited Members | |
Data Fields inherited from Collider | |
| std::string | id |
| The unique identifier of the collider. | |
| point | p |
| The position of the collider. | |
The CircleCollider class represents a circular collider object.
The CircleCollider class inherits from the Collider class and represents a collider with a circular shape.
Definition at line 323 of file CollidingObject.h.
|
inline |
Constructs a new CircleCollider object with specified parameters.
| mid | The midpoint of the circular collider. |
| radius | The radius of the circular collider. |
| id | The unique identifier of the collider. |
Definition at line 335 of file CollidingObject.h.
|
overridevirtual |
Checks for collision with another collider.
| other | The other collider to check for collision with. |
Implements Collider.
Definition at line 37 of file CollidingObject.cpp.
| int CircleCollider::getRadius | ( | ) | const |
Gets the radius of the circular collider.
Definition at line 142 of file CollidingObject.cpp.
|
overridevirtual |
Gets the type of the collider.
Implements Collider.
Definition at line 138 of file CollidingObject.cpp.
|
overridevirtual |
Renders the collider on the screen.
| renderer | A shared pointer to the SDL renderer used for rendering. |
| color1 | The primary color of the collider. |
| color2 | The secondary color of the collider. |
Implements Collider.
Definition at line 146 of file CollidingObject.cpp.
|
private |
The radius of the circular collider.
Definition at line 325 of file CollidingObject.h.