Class for box volume.
More...
#include <kanzi/core/math/box.hpp>
Constructs an empty box.
- Note
- The box will contain (0, 0, 0).
Constructs a box which contains a single point.
- Parameters
-
point | Point for box to contain. |
Creates a box from two points.
The box will contain the given two points.
- Parameters
-
point1 | First point. |
point2 | Second point. |
- Returns
- Box which contains both of the given points.
Creates a box from a point and box size.
- Parameters
-
minimumCorner | Minimum corner point for the box. |
size | Size for the box. |
- Returns
- Box which has a specified minimumCorner and size.
Creates a box from center and size.
- Parameters
-
center | Center for the box. |
size | Size for the box. |
- Returns
- Box which has specified center and size.
Creates a box from minimum and maximum corners.
- Parameters
-
minimumCorner | Minimum corner for the box. |
maximumCorner | Maximum corner for the box. |
- Returns
- Box which has specified minimum and maximum corners.
Returns a box extended to include a given point.
- Parameters
-
point | Point to be included in the box. |
- Returns
- Box extended with given point.
Vector3 kanzi::Box::getMinimumCorner |
( |
| ) |
const |
|
inline |
Gets minimum corner of box.
- Returns
- Minimum corner of the box.
Vector3 kanzi::Box::getMaximumCorner |
( |
| ) |
const |
|
inline |
Gets maximum corner of box.
- Returns
- Maximum corner of the box.
Vector3 kanzi::Box::getCenter |
( |
| ) |
const |
|
inline |
Gets center of the box.
- Returns
- Center of the box.
Vector3 kanzi::Box::getSize |
( |
| ) |
const |
|
inline |
Gets size of box.
- Returns
- Size of the box.
bool kanzi::Box::isEmpty |
( |
| ) |
const |
|
inline |
Indicates whether the box is empty.
- Returns
- true if box is empty, false if box is not empty.
bool kanzi::Box::isValid |
( |
| ) |
const |
|
inline |
Indicates whether the box is valid.
Box is valid when minimum corner is componentwise less or equal to maximum corner.
- Returns
- true if minimum corner is componentwise less or equal to maximum corner, otherwise false.
bool kanzi::Box::contains |
( |
Vector3 |
point | ) |
const |
|
inline |
Checks if the given point is inside the box.
- Note
- The box is considered closed from minimum corner (left/right) but open from maximum corner (right/bottom).
- Parameters
-
point | Point to check to be in the box. |
- Returns
- true if given point was in the box, otherwise false.
bool kanzi::Box::contains |
( |
const Box & |
volume2 | ) |
const |
|
inline |
Checks if box contains other box completely.
- Parameters
-
- Returns
- true if volume2 is completely inside this box.
float kanzi::Box::getVolume |
( |
| ) |
const |
|
inline |
Calculates the volume of the box.
- Returns
- Volume of the box.
Box kanzi::Box::translatedBy |
( |
Vector3 |
translation | ) |
const |
|
inline |
Translates a box.
- Parameters
-
translation | Translation amount. |
bool intersects |
( |
const Box & |
box1, |
|
|
const Box & |
box2 |
|
) |
| |
|
friend |
Checks if intersection of two given boxes is non-empty.
- Parameters
-
box1 | First box. |
box2 | Second box. |
- Returns
- true if intersection of two given boxes is non-empty, otherwise false.
bool operator== |
( |
const Box & |
box1, |
|
|
const Box & |
box2 |
|
) |
| |
|
friend |
Checks if two given box volumes have equal corners.
- Parameters
-
box1 | First box volume. |
box2 | Second box volume. |
- Returns
- true if given boxes have equal corners.
bool operator!= |
( |
const Box & |
box1, |
|
|
const Box & |
box2 |
|
) |
| |
|
friend |
Checks if two given boxes do not have equal corners.
- Parameters
-
box1 | First box. |
box2 | Second box. |
- Returns
- true if given boxes do not have equal corners.
Box minimumBoundingBox |
( |
const Box & |
box1, |
|
|
const Box & |
box2 |
|
) |
| |
|
friend |
Calculates a minimum bounding box for given two boxes.
- Parameters
-
box1 | First box. |
box2 | Second box. |
- Returns
- Minimum bounding box for given two boxes.
Box intersection |
( |
const Box & |
box1, |
|
|
const Box & |
box2 |
|
) |
| |
|
friend |
Calculates intersection of two boxes.
- Parameters
-
box1 | First box. |
box2 | Second box. |
- Returns
- Intersection of two given boxes.
The documentation for this class was generated from the following file: