List of all members.
Detailed Description
TBBox2D defines a two dimentional bounding box. It uses two TVector2 to store the lower (fMin) and the upper (fMax) corners of the rectangle
Constructor & Destructor Documentation
Default constructor: fMin is initialized with kRealMax, fMax with kRealMin
Init constructor
- Parameters:
-
| min | initial value for fMin. |
| max | initial value for fMax. |
TBBox2D::TBBox2D |
( |
const TVector2 & |
max |
) |
|
Init constructor
- Parameters:
-
| max | initial value for fMax. fMin is initialized with -max |
Member Function Documentation
void TBBox2D::AddPoint |
( |
const TVector2 & |
PP |
) |
|
Expands the box to encompass the given point
- Parameters:
-
| PP | the point to add to the box |
void TBBox2D::ClipBy |
( |
const TBBox2D & |
clipBounds |
) |
|
Clips the box by another box
- Parameters:
-
| clipBounds | the bounds that this box should not cross |
void TBBox2D::FixInvertedFields |
( |
|
) |
|
void TBBox2D::GetCenter |
( |
TVector2 & |
center |
) |
const |
Computes the center of the box
- Parameters:
-
| center | the return value for the center of the box |
void TBBox2D::GetDelta |
( |
TVector2 & |
delta |
) |
const |
Computes the main diagonal of the box (fMax - fMin)
- Parameters:
-
real TBBox2D::GetHeight |
( |
void |
|
) |
const [inline] |
Returns the height (in y) of the box.
real TBBox2D::GetMax |
( |
|
) |
const |
Returns the bigger coordinate of the diagonal
real TBBox2D::GetMin |
( |
|
) |
const |
Returns the smaller coordinate of the diagonal
real TBBox2D::GetWidth |
( |
void |
|
) |
const [inline] |
Returns the width (in x) of the box.
void TBBox2D::Inset |
( |
const TVector2 & |
PP |
) |
|
Shrinks the box by adding PP to fMin, and substracting it from fMax
- Parameters:
-
| PP | the amount to shrink the box with |
Returns true if the two boxes intersect
- Parameters:
-
| boundingBox | the box to test for intersection with this box |
Returns true if the box is empty
Returns true if the point is inside the box.
- Parameters:
-
| point | the point to intersect with the box |
Returns true if the two boxes are equal.
Returns one of the corners of the box
- Parameters:
-
| ii | the corner index (0 => fMin, 1 => TVector2(fMax[0], fMin[1]), 2 => TVector2(fMin[0], fMax[1]), 3 => fMax, 4 => (fMax + fMin)/2. For any other value, returns 0 |
void TBBox2D::SetMax |
( |
const TVector2 & |
max |
) |
[inline] |
Setter function for fMax.
void TBBox2D::SetMin |
( |
const TVector2 & |
min |
) |
[inline] |
Setter function for fMin.
void TBBox2D::Union |
( |
const TBBox2D & |
box |
) |
|
boolean TBBox2D::Valid |
( |
|
) |
const [inline] |
Returns true if every coordinate of fMin is smaller than its fMax counterpart.
Member Data Documentation
The upper corner of the box.
The lower corner of the box.
The documentation for this class was generated from the following file: