15extern std::vector<Entity*> colliders;
38 bool isStatic =
false,
bool considerVel =
false,
bool isUi =
false
69 std::function<void(
Collider& other)> collFunc;
76 const bool checkCollision(
Collider& other)
const;
77 bool AABB(
const SDL_Rect& otherRect)
const;
78 bool AABB(
const Collider& otherColl)
const;
79 bool AABBvel(
const Collider& otherColl)
const;
Defines global constants and enums used throughout the engine and game.
Defines the core classes for the Entity-Component-System (ECS) architecture.
Provides an entity with a physical bounding box for collision detection.
Definition Collider.h:22
std::string tag
A tag to identify the type of collider (e.g., "player", "wall").
Definition Collider.h:24
const bool isColliding(std::string collTag)
Checks if this collider is currently colliding with any collider of a specific tag.
Definition Collider.cpp:63
void onCollision(Collider &other)
Executes the collision callback function.
Definition Collider.cpp:59
void update() override
Updates the collider's position and checks for collisions against other colliders.
Definition Collider.cpp:38
void init() override
Initializes the collider by linking it to the entity's transform.
Definition Collider.cpp:29
The base class for all components in the ECS.
Definition ECS.h:53