cubos::core::geom::AABB struct

Represents an axis-aligned bounding box.

Public functions

auto min() const -> glm::vec3
Minimum point of the AABB.
auto max() const -> glm::vec3
Maximum point of the AABB.
void min(const glm::vec3& min)
Sets the minimum point of the AABB.
void max(const glm::vec3& max)
Sets the maximum point of the AABB.
auto box() const -> Box
Gets a Box representation of the AABB.
auto center() const -> glm::vec3
Gets the center of the AABB.
auto overlapsX(const AABB& other) const -> bool
Checks if the AABB overlaps with another AABB on the X axis.
auto overlapsY(const AABB& other) const -> bool
Checks if the AABB overlaps with another AABB on the Y axis.
auto overlapsZ(const AABB& other) const -> bool
Checks if the AABB overlaps with another AABB on the Z axis.
auto overlaps(const AABB& other) const -> bool
Checks if the AABB overlaps with another AABB.

Public variables

glm::vec3 diag
Diagonal of the AABB.

Function documentation

glm::vec3 cubos::core::geom::AABB::min() const

Minimum point of the AABB.

Returns Minimum point of the AABB.

glm::vec3 cubos::core::geom::AABB::max() const

Maximum point of the AABB.

Returns Maximum point of the AABB.

void cubos::core::geom::AABB::min(const glm::vec3& min)

Sets the minimum point of the AABB.

Parameters
min Minimum point of the AABB.

void cubos::core::geom::AABB::max(const glm::vec3& max)

Sets the maximum point of the AABB.

Parameters
max Maximum point of the AABB.

Box cubos::core::geom::AABB::box() const

Gets a Box representation of the AABB.

Returns Box representation.

glm::vec3 cubos::core::geom::AABB::center() const

Gets the center of the AABB.

Returns Center of the AABB.

bool cubos::core::geom::AABB::overlapsX(const AABB& other) const

Checks if the AABB overlaps with another AABB on the X axis.

Parameters
other Other AABB.
Returns Whether the AABBs overlap.

bool cubos::core::geom::AABB::overlapsY(const AABB& other) const

Checks if the AABB overlaps with another AABB on the Y axis.

Parameters
other Other AABB.
Returns Whether the AABBs overlap.

bool cubos::core::geom::AABB::overlapsZ(const AABB& other) const

Checks if the AABB overlaps with another AABB on the Z axis.

Parameters
other Other AABB.
Returns Whether the AABBs overlap.

bool cubos::core::geom::AABB::overlaps(const AABB& other) const

Checks if the AABB overlaps with another AABB.

Parameters
other Other AABB.
Returns Whether the AABBs overlap.