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