![]() |
Murl Engine API
Version 2025.1
|
A box class describing the minimum and maximum coordinate of a 3d-box. More...
#include <murl_math_box.h>
A box class describing the minimum and maximum coordinate of a 3d-box.
Public Types | |
| using | ValueType = DataType |
| The template parameter value type. | |
Public Member Functions | |
| Box () | |
| The default constructor. | |
| Box (const Box &b1, const Box &b2) | |
| Constructor uniting two given boxes. More... | |
| Box (const Vector< DataType > &point) | |
| Constructor taking a single coordinate. More... | |
| Box (const Vector< DataType > &min, const Vector< DataType > &max) | |
| Constructor taking minimum and maximum coordinates. More... | |
| Box (const Vector< DataType > &a, const Vector< DataType > &b, const Vector< DataType > &c) | |
| Constructor taking the three points of a triangle. More... | |
| Box (const Sphere< DataType > &sphere) | |
| Constructor taking a sphere. More... | |
| template<class DataType2 > | |
| Box (const Box< DataType2 > &b) | |
| The copy constructor using a box of different type. More... | |
| void | Clear () |
| Clear the box. | |
| void | Set (const Box &other) |
| Set the coordinates from a box. More... | |
| void | Set (const Box &b1, const Box &b2) |
| Set the coordinates by uniting two given boxes. More... | |
| void | Set (const Vector< DataType > &point) |
| Set the coordinates to a single coordinate. More... | |
| void | Set (const Vector< DataType > &min, const Vector< DataType > &max) |
| Set the minimum and maximum coordinates. More... | |
| void | Set (const Vector< DataType > &a, const Vector< DataType > &b, const Vector< DataType > &c) |
| Set the coordinates by the three points of a triangle. More... | |
| void | Set (const Sphere< DataType > &sphere) |
| Set the coordinates by a sphere. More... | |
| void | SetMinimum (const Vector< DataType > &min) |
| Set the minimum coordinate. More... | |
| void | SetMaximum (const Vector< DataType > &max) |
| Set the maximum coordinate. More... | |
| const Vector< DataType > & | GetMinimum () const |
| Get the minimum coordinate. More... | |
| const Vector< DataType > & | GetMaximum () const |
| Get the maximum coordinate. More... | |
| void | Unite (const Box &other) |
| Unite this box with another box. More... | |
| void | Include (const Vector< DataType > &point) |
| Include a point in this box. More... | |
| Bool | IsIntersecting (const Box &other) const |
| Check if a given box is intersecting this box. More... | |
| Bool | IsEmpty () const |
| Check if a the box is empty. More... | |
| UInt32 | GetFlags () const |
| Get the flags. More... | |
| String | ToString () const |
| Get the string representation of the object. More... | |
Protected Attributes | |
| Vector< DataType > | mMin |
| The minimum position. | |
| Vector< DataType > | mMax |
| The maximum position. | |
| UInt32 | mFlags |
| Box flags. | |
|
inline |
Constructor uniting two given boxes.
| b1 | The first box. |
| b2 | The second box. |
|
inline |
Constructor taking a single coordinate.
| point | The coordinate for minimum and maximum. |
|
inline |
Constructor taking minimum and maximum coordinates.
| min | The minimum coordinate. |
| max | The maximum coordinate. |
|
inline |
Constructor taking the three points of a triangle.
| a | The first triangle coordinate. |
| b | The second triangle coordinate. |
| c | The third triangle coordinate. |
|
inline |
Constructor taking a sphere.
The box is only approximated and slightly larger than it needs to be.
| sphere | The sphere to enclose. |
|
inline |
The copy constructor using a box of different type.
| b | The box to copy. |
|
inline |
Set the coordinates from a box.
| other | The box to copy from. |
|
inline |
Set the coordinates by uniting two given boxes.
| b1 | The first box. |
| b2 | The second box. |
|
inline |
Set the coordinates to a single coordinate.
| point | The coordinate for minimum and maximum. |
|
inline |
Set the minimum and maximum coordinates.
| min | The minimum coordinate. |
| max | The maximum coordinate. |
|
inline |
Set the coordinates by the three points of a triangle.
| a | The first triangle coordinate. |
| b | The second triangle coordinate. |
| c | The third triangle coordinate. |
|
inline |
Set the coordinates by a sphere.
The box is only approximated and slightly larger than it needs to be.
| sphere | The sphere to enclose. |
|
inline |
Set the minimum coordinate.
| min | The minimum coordinate. |
|
inline |
Set the maximum coordinate.
| max | The maximum coordinate. |
|
inline |
Get the minimum coordinate.
|
inline |
Get the maximum coordinate.
|
inline |
Unite this box with another box.
| other | The other box to unite. |
|
inline |
Include a point in this box.
| point | The point to include. |
|
inline |
Check if a given box is intersecting this box.
| other | The other box to check. |
|
inline |
Check if a the box is empty.
A box is only empty when created with the default constructor, explicitly cleared by calling Clear(), or duplicated from another empty box or sphere. As soon as a single point is included, the box is considered "not empty".
|
inline |
Get the flags.
|
inline |
Get the string representation of the object.