|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Description of an axis-aligned box in world space. More...
#include <GREM/physics/Shape.hpp>
Public Types | |
| using | Unit = typename Position<N>::Unit |
| Unit type. | |
| using | DimensionType = typename Unit::DimensionType |
| Unit dimension type. | |
| using | MagnitudeType = typename Unit::MagnitudeType |
| Unit magnitude type. | |
Public Member Functions | |
| template<typename OtherUnitT> requires (OtherUnitT::DIMENSION == LENGTH) | |
| GREM_ALWAYS_INLINE constexpr grem::Box< N, Scalar > | in (OtherUnitT unit) const noexcept |
| Convert this physical box to a unitless box given a desired unit. | |
| bool | operator== (const Box &other) const =default |
| Compare this box to another for equality. | |
| GREM_ALWAYS_INLINE constexpr bool | contains (const Position< N > &point) const noexcept |
| Check if a given point is contained within the extents of this box. | |
| GREM_ALWAYS_INLINE constexpr bool | intersects (const Ray< N > &ray) const noexcept |
| Check if this box intersects a given ray. | |
| GREM_ALWAYS_INLINE constexpr RaycastResult< N > | raycast (const Ray< N > &ray) const noexcept |
| Find the closest intersection of this box with a given ray. | |
| GREM_ALWAYS_INLINE constexpr Box< N > | getBoundingBox () const noexcept |
| Get the axis-aligned bounding box of the box. | |
| GREM_ALWAYS_INLINE constexpr Box< N > | getExpanded (Length< N > expansion) const noexcept |
| Get a version of the box that is symmetrically expanded by a certain amount. | |
| GREM_ALWAYS_INLINE constexpr Box< N > | getExpanded (Distance expansion) const noexcept |
| Get a version of the box that is symmetrically expanded by a certain amount. | |
Static Public Member Functions | |
| template<typename T> | |
| static GREM_ALWAYS_INLINE constexpr Box | reinterpret (const grem::Box< N, T > &box) noexcept |
| Reinterpret a unitless box as a physical box in default units. | |
Public Attributes | |
| Position< N > | min |
| Position with the minimum coordinates of the box extents on each coordinate axis. | |
| Position< N > | max |
| Position with the maximum coordinates of the box extents on each coordinate axis. | |
Static Public Attributes | |
| static constexpr Unit | UNIT {} |
| Unit. | |
| static constexpr DimensionType | DIMENSION {} |
| Unit dimension. | |
| static constexpr MagnitudeType | MAGNITUDE {} |
| Unit magnitude. | |
Friends | |
| GREM_ALWAYS_INLINE friend constexpr bool | intersects (const Box &a, const Box &b) noexcept |
| Check if two axis-aligned boxes intersect. | |
Description of an axis-aligned box in world space.
| using grem::physics::Box< N >::Unit = typename Position<N>::Unit |
Unit type.
| using grem::physics::Box< N >::DimensionType = typename Unit::DimensionType |
Unit dimension type.
| using grem::physics::Box< N >::MagnitudeType = typename Unit::MagnitudeType |
Unit magnitude type.
|
inlinestaticnodiscardconstexprnoexcept |
Reinterpret a unitless box as a physical box in default units.
| box | box to reinterpret. |
|
inlinenodiscardconstexprnoexcept |
Convert this physical box to a unitless box given a desired unit.
| unit | unit to get the box in. |
|
nodiscarddefault |
Compare this box to another for equality.
| other | the box to compare this box to. |
|
inlinenodiscardconstexprnoexcept |
Check if a given point is contained within the extents of this box.
| point | point to check. |
|
inlinenodiscardconstexprnoexcept |
Check if this box intersects a given ray.
| ray | ray to check. |
|
inlinenodiscardconstexprnoexcept |
Find the closest intersection of this box with a given ray.
| ray | ray to check. |
|
inlinenodiscardconstexprnoexcept |
Get the axis-aligned bounding box of the box.
|
inlinenodiscardconstexprnoexcept |
Get a version of the box that is symmetrically expanded by a certain amount.
| expansion | distance to expand the box by along each axis. Each component must be non-negative. |
|
inlinenodiscardconstexprnoexcept |
Get a version of the box that is symmetrically expanded by a certain amount.
| expansion | distance to expand the box by along each axis. Must be non-negative. |
|
friend |
Check if two axis-aligned boxes intersect.
| a | first box. |
| b | second box. |
|
staticconstexpr |
Unit.
|
staticconstexpr |
Unit dimension.
|
staticconstexpr |
Unit magnitude.
| Position<N> grem::physics::Box< N >::min |
Position with the minimum coordinates of the box extents on each coordinate axis.
| Position<N> grem::physics::Box< N >::max |
Position with the maximum coordinates of the box extents on each coordinate axis.