#include <c4d_tools.h>
A class to construct a bounding box around points.
Public Member Functions | |
| SMinMax () | |
| SMinMax (const Vector32 &v) | |
| void | Init (void) |
| void | Init (const Vector32 &v) |
| void | AddPoint (const Vector32 &p) |
| void | AddPoints (const Vector32 &a, const Vector32 &b) |
| void | Set (const Vector32 &a, const Vector32 &b) |
| Bool | IsPopulated (void) const |
| const Vector32 & | GetMin (void) const |
| const Vector32 & | GetMax (void) const |
| Vector32 | GetMp (void) const |
| Vector32 | GetRad (void) const |
| void | GetMpRad (Vector32 *mp, Vector32 *rad) const |
Private Attributes | |
| Vector32 | min |
| Vector32 | max |
| Bool | used |
| SMinMax | ( | ) |
Default constructor.
Constructs with vector v set for both the minimum and maximum.
| [in] | v | The vector for minimum and maximum. |
| void Init | ( | void | ) |
Resets the minimum and maximum to the largest values possible.
| void Init | ( | const Vector32 & | v | ) |
Initializes the minimum and maximum with vector v.
| [in] | v | The value to initialize minimum and maximum. |
| void AddPoint | ( | const Vector32 & | p | ) |
Adds point p and recalculates the minimum and maximum.
| [in] | p | The point to add into the bounds. |
Adds points a and b and recalculates the minimum and maximum.
| [in] | a | The minimum point to add into the bounds. |
| [in] | b | The maximum point to add into the bounds. |
Sets the minimum and maximum of the bounding box.
| [in] | a | The minimum. |
| [in] | b | The maximum. |
| Bool IsPopulated | ( | void | ) | const |
Checks if any points were added.
| const Vector32& GetMin | ( | void | ) | const |
Gets the minimum of the bounding box.
| const Vector32& GetMax | ( | void | ) | const |
Gets the maximum of the bounding box.
| Vector32 GetMp | ( | void | ) | const |
Gets the middle between the minimum and maximum (the center).
| Vector32 GetRad | ( | void | ) | const |
Gets half the distance between the minimum and the maximum (the size).
Gets both the center and size of the bounding box.
| [out] | mp | Assigned the center of the bounds. |
| [out] | rad | Assigned the size of the bounds. |
|
private |
|
private |
|
private |