Class for box volume.
More...
#include <kanzi/core/math/box.hpp>
◆ Box() [1/2]
Constructs an empty box.
- Note
- The box will contain (0, 0, 0).
◆ Box() [2/2]
Constructs a box which contains a single point.
- Parameters
-
point | Point for box to contain. |
◆ fromContainedPoints()
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.
◆ fromCornerAndSize()
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.
◆ fromCenterAndSize()
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.
◆ fromCorners()
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.
◆ extendedBy()
Returns a box extended to include a given point.
- Parameters
-
point | Point to be included in the box. |
- Returns
- Box extended with given point.
◆ getMinimumCorner()
Vector3 kanzi::Box::getMinimumCorner |
( |
| ) |
const |
|
inline |
Gets minimum corner of box.
- Returns
- Minimum corner of the box.
◆ getMaximumCorner()
Vector3 kanzi::Box::getMaximumCorner |
( |
| ) |
const |
|
inline |
Gets maximum corner of box.
- Returns
- Maximum corner of the box.
◆ getCenter()
Vector3 kanzi::Box::getCenter |
( |
| ) |
const |
|
inline |
Gets center of the box.
- Returns
- Center of the box.
◆ getSize()
Vector3 kanzi::Box::getSize |
( |
| ) |
const |
|
inline |
Gets size of box.
- Returns
- Size of the box.
◆ isEmpty()
bool kanzi::Box::isEmpty |
( |
| ) |
const |
|
inline |
Indicates whether the box is empty.
- Returns
- true if box is empty, false if box is not empty.
◆ isValid()
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.
◆ contains() [1/2]
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.
◆ contains() [2/2]
Checks if box contains other box completely.
- Parameters
-
- Returns
- true if volume2 is completely inside this box.
◆ getVolume()
float kanzi::Box::getVolume |
( |
| ) |
const |
|
inline |
Calculates the volume of the box.
- Returns
- Volume of the box.
◆ translatedBy()
Box kanzi::Box::translatedBy |
( |
Vector3 | translation | ) |
const |
|
inline |
Translates a box.
- Parameters
-
translation | Translation amount. |
◆ intersects
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.
◆ operator==
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.
◆ operator!=
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.
◆ minimumBoundingBox
Calculates a minimum bounding box for given two boxes.
- Parameters
-
box1 | First box. |
box2 | Second box. |
- Returns
- Minimum bounding box for given two boxes.
◆ intersection
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: