My Project
Public Member Functions | Public Attributes | List of all members
BoundingBox3D Class Reference

#include <geometry.h>

Public Member Functions

 BoundingBox3D (const Point3D &p1, const Point3D &p2)
 
 BoundingBox3D (const Point3D *pList, const int pSize)
 
BoundingBox3D operator+ (const BoundingBox3D &b) const
 
BoundingBox3Doperator+= (const BoundingBox3D &b)
 
BoundingBox3D transform (const Matrix4D &m) const
 
double intersect (const Ray3D &ray) const
 

Public Attributes

Point3D p [2]
 

Detailed Description

This class represents a bounding box.

Constructor & Destructor Documentation

BoundingBox3D::BoundingBox3D ( const Point3D p1,
const Point3D p2 
)

This constructor creates a bounding box with the specified antipodal vertices

BoundingBox3D::BoundingBox3D ( const Point3D pList,
const int  pSize 
)

This constructor generates the minimal bounding box that contains all of the points in the input array.

Member Function Documentation

double BoundingBox3D::intersect ( const Ray3D ray) const

This method returns the distance along the ray to the box if the ray intersects, otherwise it returns -1.0. (The distance is 0.0 if the starting position of the ray is in the box

BoundingBox3D BoundingBox3D::operator+ ( const BoundingBox3D b) const

This method returns the bounding box containing the union of the two bounding boxes.
If one of the boundinb boxes has two end points that are equal, it is assumed to be empty and the union just returns the other bounding box.

BoundingBox3D & BoundingBox3D::operator+= ( const BoundingBox3D b)

This method returns the bounding box containing the union of the two bounding boxes.
If one of the boundinb boxes has two end points that are equal, it is assumed to be empty and the union just returns the other bounding box.

BoundingBox3D BoundingBox3D::transform ( const Matrix4D m) const

This method returns the bounding box generated by first transforming the initial bounding box according to the specified transformation and then finding the minimal axis-aligned bounding box containing the transformed box.

Member Data Documentation

Point3D BoundingBox3D::p[2]

The end-points of the bounding box (all of the coefficients of p[0] are assumed to be less than or equal to the coefficients of p[1]).


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