IMS2  Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
BoundingBox Class Reference

Defines a simple axis-aligned bounding box for a SimpleShape. More...

Public Member Functions

 BoundingBox (VECTOR3 left_lower_rear, VECTOR3 right_top_front)
 
 BoundingBox (BoundingBox *bb)
 Creates a new boudning box identical to the passed pointer.
 
double GetLeft ()
 
double GetRight ()
 
double GetBottom ()
 
double GetTop ()
 
double GetRear ()
 
double GetFront ()
 
bool IsTwoDimensional ()
 
void MergeBoundingBox (BoundingBox *bb)
 Merges this bounding box with the one passed to it. The result will be the minimum box that can contain both boxes. More...
 

Private Member Functions

void initBoundingBox (VECTOR3 &left_lower_rear, VECTOR3 &right_top_front)
 

Private Attributes

double left
 
double right
 
double bottom
 
double top
 
double front
 
double rear
 
bool twodee = false
 

Friends

class SimpleShape
 

Detailed Description

Defines a simple axis-aligned bounding box for a SimpleShape.

Think of this as a nested class of SimpleShape, really.

Constructor & Destructor Documentation

BoundingBox::BoundingBox ( VECTOR3  left_lower_rear,
VECTOR3  right_top_front 
)
inline
Parameters
left_lower_rearThe left-lower-rear corner of the bounding box, i.e. the minimum values in x, y and z
right_top_frontThe right-top-front corner of the bounding box, i.e. the maximum values in x, y and z

Member Function Documentation

double BoundingBox::GetBottom ( )
inline
Returns
The bottom limit of the bounding box, or minimum y-value
double BoundingBox::GetFront ( )
inline
Returns
The front limit of the bounding box, or maximum z-value
double BoundingBox::GetLeft ( )
inline
Returns
The left-hand limit of the bounding box, or minimum x-value
double BoundingBox::GetRear ( )
inline
Returns
The rear limit of the bounding box, or minimum z-value
double BoundingBox::GetRight ( )
inline
Returns
The right-hand limit of the bounding box, or maximum x-value
double BoundingBox::GetTop ( )
inline
Returns
The top limit of the bounding box, or maximum y-value
bool BoundingBox::IsTwoDimensional ( )
inline
Returns
True if the bounding box is only two-dimensional
void BoundingBox::MergeBoundingBox ( BoundingBox bb)
inline

Merges this bounding box with the one passed to it. The result will be the minimum box that can contain both boxes.

Note
It is completely irrelevant to this operation if the boxes are spaced apart. The resulting box will encompass both boxes and all the space in between, so be sensible!

The documentation for this class was generated from the following file: