Flat 2D axis-aligned rectangle shape with a position and size.
More...
#include <GREM/core/geometry.hpp>
|
| using | Component = T |
| | Scalar coordinate component type.
|
|
| template<typename U> |
| GREM_ALWAYS_INLINE constexpr | operator Rectangle< U > () const noexcept |
| | Convert this rectangle to an equivalent rectangle of another scalar type.
|
| constexpr | operator Box< 2, T > () const noexcept |
| | Convert this rectangle to an equivalent 2D axis-aligned box.
|
| bool | operator== (const Rectangle &other) const =default |
| | Compare this rectangle to another for equality.
|
| constexpr bool | contains (const Point< 2, T > &point) const noexcept |
| | Check if a given point is contained within the extents of this rectangle.
|
| constexpr bool | intersects (const Ray< 2, T > &ray) const noexcept |
| | Check if this rectangle intersects a given ray.
|
| constexpr RaycastResult< 2, T > | raycast (const Ray< 2, T > &ray) const noexcept |
| | Find the closest intersection of this rectangle with a given ray.
|
| constexpr Box< 2, T > | getBoundingBox () const noexcept |
| | Get the axis-aligned bounding box of the rectangle.
|
| constexpr Box< 2, T > | toBox () const noexcept |
| | Convert this shape to an equivalent axis-aligned bounding box.
|
|
| Point< 2, T > | position |
| | Position of the bottom left corner of the rectangle.
|
| Length< 2, T > | size |
| | Width and height of the rectangle.
|
|
| static constexpr size_t | RANK = 2 |
| | Number of dimensions of the vector space.
|
template<typename T>
struct grem::Rectangle< T >
Flat 2D axis-aligned rectangle shape with a position and size.
- Template Parameters
-
| T | scalar coordinate component type. |
◆ Component
Scalar coordinate component type.
◆ operator Rectangle< U >()
template<typename T>
template<typename U>
|
|
inlineexplicitconstexprnoexcept |
Convert this rectangle to an equivalent rectangle of another scalar type.
- Returns
- the converted rectangle.
◆ operator Box< 2, T >()
Convert this rectangle to an equivalent 2D axis-aligned box.
- Returns
- the rectangle as an axis-aligned box.
◆ operator==()
Compare this rectangle to another for equality.
- Parameters
-
| other | the rectangle to compare this rectangle to. |
- Returns
- true if the rectangles are equal, false otherwise.
◆ contains()
template<typename T>
|
|
inlinenodiscardconstexprnoexcept |
Check if a given point is contained within the extents of this rectangle.
- Parameters
-
- Returns
- true if the rectangle contains the given point, false otherwise.
◆ intersects()
template<typename T>
|
|
inlinenodiscardconstexprnoexcept |
Check if this rectangle intersects a given ray.
- Parameters
-
- Returns
- true if an intersection was found, false otherwise.
◆ raycast()
template<typename T>
|
|
inlinenodiscardconstexprnoexcept |
Find the closest intersection of this rectangle with a given ray.
- Parameters
-
- Returns
- the result of the raycast.
◆ getBoundingBox()
template<typename T>
|
|
inlinenodiscardconstexprnoexcept |
Get the axis-aligned bounding box of the rectangle.
- Returns
- an axis-aligned box that contains the entire rectangle.
◆ toBox()
template<typename T>
|
|
inlinenodiscardconstexprnoexcept |
Convert this shape to an equivalent axis-aligned bounding box.
- Returns
- an axis-aligned box that is equivalent to this shape.
◆ RANK
Number of dimensions of the vector space.
◆ position
Position of the bottom left corner of the rectangle.
◆ size
Width and height of the rectangle.
The documentation for this struct was generated from the following file: