|
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 Collider class represents a generic collider object. More...
#include <CollidingObject.h>
Public Member Functions | |
| 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. | |
Data Fields | |
| std::string | id |
| The unique identifier of the collider. | |
| point | p |
| The position of the collider. | |
The Collider class represents a generic collider object.
The Collider class provides functionality for handling collisions and rendering in a game environment.
Definition at line 96 of file CollidingObject.h.
|
virtualdefault |
Virtual destructor for the Collider class.
|
pure virtual |
Checks for collision with another collider.
| other | The other collider to check for collision with. |
Implemented in RectCollider, TriangleCollider, HexagonCollider, and CircleCollider.
|
pure virtual |
Gets the type of the collider.
Implemented in RectCollider, TriangleCollider, HexagonCollider, and CircleCollider.
| void Collider::move | ( | point | newPoint | ) |
Moves the collider to a new position.
| newPoint | The new position of the collider. |
Definition at line 8 of file CollidingObject.cpp.
| void Collider::moveTo | ( | point | newPoint | ) |
Moves the collider to an absolute position.
| newPoint | The new absolute position of the collider. |
Definition at line 12 of file CollidingObject.cpp.
|
pure virtual |
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. |
Implemented in RectCollider, TriangleCollider, HexagonCollider, and CircleCollider.
| std::string Collider::id |
The unique identifier of the collider.
Definition at line 98 of file CollidingObject.h.
| point Collider::p |
The position of the collider.
Definition at line 99 of file CollidingObject.h.