#include <c4d_tools.h>
A class to construct a bounding box around points.
Public Member Functions | |
SMinMax () | |
SMinMax (const Vector32 &v) | |
void | Init () |
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 () const |
const Vector32 & | GetMin () const |
const Vector32 & | GetMax () const |
Vector32 | GetMp () const |
Vector32 | GetRad () 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 | ( | ) |
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 | ( | ) | const |
Checks if any points were added.
const Vector32& GetMin | ( | ) | const |
Gets the minimum of the bounding box.
const Vector32& GetMax | ( | ) | const |
Gets the maximum of the bounding box.
Vector32 GetMp | ( | ) | const |
Gets the middle between the minimum and maximum (the center).
Vector32 GetRad | ( | ) | 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 |