|
Aegis2D
Modular C++26 2D game engine for networked games
|
Axis-aligned box an entity collides with. More...
#include <aegis2d/ecs/components.hpp>
Public Attributes | |
| Vec2 | size {} |
| Width and height of the box, in logical pixels. | |
| Vec2 | offset {} |
| Center of the box relative to the entity's position. | |
| std::uint32_t | layer = 0 |
| Layers the entity belongs to, one bit each. | |
| std::uint32_t | mask = 0 |
| Layers the entity can collide with. | |
Axis-aligned box an entity collides with.
The box is centered on Transform::position plus offset. Layers are bit masks: layer is what the entity is (player, enemy, player missile...) and mask is what it can hit; the game defines the bits. The default collider has no layer and no mask, so it collides with nothing.
| std::uint32_t aegis2d::ecs::Collider::layer = 0 |
Layers the entity belongs to, one bit each.
| std::uint32_t aegis2d::ecs::Collider::mask = 0 |
Layers the entity can collide with.
| Vec2 aegis2d::ecs::Collider::offset {} |
Center of the box relative to the entity's position.
| Vec2 aegis2d::ecs::Collider::size {} |
Width and height of the box, in logical pixels.