Axis-aligned box given by its two corners, in logical pixels.
More...
#include <aegis2d/ecs/collision.hpp>
|
| bool | overlaps (const Aabb &other) const noexcept |
| | Tells whether two boxes overlap.
|
| |
|
| static Aabb | of (const Transform &transform, const Collider &collider) noexcept |
| | Box of an entity's collider, placed on its transform.
|
| |
|
| Vec2 | min {} |
| | Top-left corner (smallest x and y).
|
| |
| Vec2 | max {} |
| | Bottom-right corner (largest x and y).
|
| |
Axis-aligned box given by its two corners, in logical pixels.
◆ of()
Box of an entity's collider, placed on its transform.
- Parameters
-
| transform | Position of the entity (its center). |
| collider | Size and offset of the box. |
- Returns
- The box centered on
transform.position + collider.offset.
◆ overlaps()
| bool aegis2d::ecs::Aabb::overlaps |
( |
const Aabb & |
other | ) |
const |
|
inlinenoexcept |
Tells whether two boxes overlap.
Boxes that only touch (an edge of one on an edge of the other) do not overlap, and a box with a NaN corner overlaps nothing.
- Parameters
-
- Returns
true if the boxes share an area.
◆ max
| Vec2 aegis2d::ecs::Aabb::max {} |
Bottom-right corner (largest x and y).
◆ min
| Vec2 aegis2d::ecs::Aabb::min {} |
Top-left corner (smallest x and y).
The documentation for this struct was generated from the following file: