10#include "../../Components/Buff.hpp"
11#include "../../Components/Collectible.hpp"
12#include "../../Components/Collider.hpp"
13#include "../../Components/Health.hpp"
14#include "../../Components/Player.hpp"
15#include "../../Components/Transform.hpp"
16#include "../ISystem.hpp"
86 std::vector<Address> &entitiesToDestroy);
102 bool canCollide(std::uint32_t layer1, std::uint32_t mask1, std::uint32_t layer2,
103 std::uint32_t mask2)
const;
144 std::vector<Address> &entitiesToDestroy);
159 std::vector<Address> &entitiesToDestroy);
Component for collision detection and physics interactions.
System handling collision detection between entities.
void resolveWallCollision(Address playerAddr, Address wallAddr, Transform &playerTransform, Collider &playerCollider, Transform &wallTransform, Collider &wallCollider, Registry ®istry)
Resolves collision between player and wall by instantly killing the player.
ComponentMask getComponentMask() const override
Gets the component mask for this system.
void handleProjectileCollision(Registry ®istry, std::uint32_t entity1, std::uint32_t entity2, std::vector< Address > &entitiesToDestroy)
Handle projectile collision with other entities.
void handleModuleProjectileCollision(Address moduleAddr, Address projectileAddr, Registry ®istry, std::vector< Address > &entitiesToDestroy)
Handle collision between orbital module and projectile.
void handlePickup(Address playerAddr, Address collectibleAddr, Registry ®istry, std::vector< Address > &entitiesToDestroy)
Handle collision between player and collectible.
void handleModuleEnemyCollision(Address moduleAddr, Address enemyAddr, Registry ®istry)
Handle collision between orbital module and enemy.
bool canCollide(std::uint32_t layer1, std::uint32_t mask1, std::uint32_t layer2, std::uint32_t mask2) const
Checks if two entities can collide based on layers.
void update(Registry ®istry, float deltaTime) override
Detects and handles collisions between entities.
~CollisionSystem() override=default
Default destructor.
bool checkAABB(const Transform::Vector2 &pos1, const Collider::Vector2 &size1, const Collider::Vector2 &offset1, const Transform::Vector2 &pos2, const Collider::Vector2 &size2, const Collider::Vector2 &offset2) const
Checks AABB collision between two entities.
CollisionSystem()=default
Default constructor.
Base interface for all ECS systems.
Manages entities, their signatures and component type registrations.
Maximum number of distinct component types supported by the Registry.
std::uint32_t Address
Type used to represent an entity address/ID.
std::uint64_t ComponentMask
Type alias for component bitmask.
2D vector for size and offset.