Axis-aligned 2D bounding box defined by center, size, and extents.
More...
#include <spk_bounding_box_2d.hpp>
|
|
spk::Vector2 | center {0.0f, 0.0f} |
| | Center point of the bounding box.
|
|
spk::Vector2 | size {0.0f, 0.0f} |
| | Size of the bounding box (width, height).
|
|
spk::Vector2 | min {0.0f, 0.0f} |
| | Minimum corner of the bounding box.
|
|
spk::Vector2 | max {0.0f, 0.0f} |
| | Maximum corner of the bounding box.
|
Axis-aligned 2D bounding box defined by center, size, and extents.
if (box.intersect(other)) {
Axis-aligned 2D bounding box defined by center, size, and extents.
Definition spk_bounding_box_2d.hpp:19
◆ BoundingBox2D()
Builds a bounding box from center and size.
- Parameters
-
| p_center | Center point. |
| p_size | Size (width, height). |
◆ applyMatrix()
Applies a transform matrix to the bounding box.
- Parameters
-
| p_transform | Transform matrix. |
- Returns
- Transformed bounding box.
◆ intersect()
| bool spk::BoundingBox2D::intersect |
( |
const BoundingBox2D & | p_other | ) |
const |
Checks intersection with another bounding box.
- Parameters
-
| p_other | Other bounding box. |
- Returns
- true when boxes overlap.
◆ setFromCenterSize()
Updates the box from center and size.
- Parameters
-
| p_center | Center point. |
| p_size | Size (width, height). |
◆ setFromMinMax()
Updates the box from minimum and maximum corners.
- Parameters
-
| p_min | Minimum corner. |
| p_max | Maximum corner. |
The documentation for this struct was generated from the following files: