Struct aabb_t¶
Defined in File aabb.hpp
Struct Documentation¶
-
struct aabb_t¶
Simple axis-aligned bounding box (AABB) primitive.
Public Functions
-
aabb_t() noexcept = default¶
-
inline constexpr bool empty() const noexcept¶
-
inline constexpr bool isfinite() const noexcept¶
-
template<range_inclusiveness_e incl = range_inclusiveness_e::left_inclusive>
inline constexpr bool contains(const pqvec3_t &p) const noexcept¶ Returns TRUE if p is inside the AABB. Template argument incl handles inclusivity on the AABB faces.
-
inline constexpr bool contains(const aabb_t &aabb) const noexcept¶
Returns TRUE if this AABB contains
aabb
.
-
inline constexpr pqvec3_t closest_point(const pqvec3_t &p) const noexcept¶
Returns the closest point in the AABB, or on its faces, to the point
p
.
-
inline auto distance2(const pqvec3_t &p) const noexcept¶
Returns the distance squared from the AABB to the point
p
.
-
inline auto distance(const pqvec3_t &p) const noexcept¶
Returns the distance from the AABB to the point
p
.
-
inline constexpr auto volume() const noexcept¶
-
inline constexpr auto surface_area() const noexcept¶
-
inline constexpr auto surface_area(const dir3_t &dir) const noexcept¶
Area of the AABB projected upon a plane with normal dir.
-
inline constexpr auto centre() const noexcept¶
-
inline constexpr auto extent() const noexcept¶
-
inline constexpr int max_dimension() const noexcept¶
returns the axis of the AABB that is the longest (0, 1, 2 for x, y, z respectively)
-
inline std::pair<aabb_t, aabb_t> split(int axis, length_t P) const noexcept¶
Splits the AABB along dimension
axis
at planep
(in world coordinates).
-
inline auto vertex(int vid) const noexcept¶
Returns one of the 8 AABB vertices.
Public Static Functions
-
static inline auto face_normal(int face) noexcept¶
-
aabb_t() noexcept = default¶