H3D::BoxBound Class Reference

The BoxBound is a Bound class that specifies the bound using an axis-aligned bounding box. More...

#include <H3D/Bound.h>

Inheritance diagram for H3D::BoxBound:

Inheritance graph

List of all members.

Public Member Functions

 BoxBound (Inst< SFVec3f > _center=0, Inst< SFVec3f > _size=0)
 Constructor.
template<class InputIterator >
void fitAroundPoints (InputIterator begin, InputIterator end)
 This function sets the BoxBound to encompass all the points between the begin and end iterators.
virtual bool isInside (const Vec3f &p)
 Determines if a given point is inside the bound or not.
virtual bool lineSegmentIntersect (const Vec3f &from, const Vec3f &to)
 Checks a line segment for intersection with the bound.
virtual bool movingSphereIntersect (const Vec3f &from, const Vec3f &to, H3DFloat radius)
 Checks a moving sphere for intersection with the bound.
virtual Vec3f closestPoint (const Vec3f &p)
 Returns the closest point on the bound to the given point.
virtual void render ()
 Render the outline of the bound with OpenGL.

Public Attributes

auto_ptr< SFVec3fcenter
 The center point of the bounding box.
auto_ptr< SFVec3fsize
 The size of the bounding box.


Detailed Description

The BoxBound is a Bound class that specifies the bound using an axis-aligned bounding box.

The center field is the center point of the bounding box and the size field is the size of the bounding box.


Member Function Documentation

template<class InputIterator >
void H3D::BoxBound::fitAroundPoints ( InputIterator  begin,
InputIterator  end 
) [inline]

This function sets the BoxBound to encompass all the points between the begin and end iterators.

The iterator must have a value_type of Vec3f

Referenced by H3D::NurbsCurve::SFBound::update(), and H3D::CoordBoundField::update().

virtual bool H3D::BoxBound::lineSegmentIntersect ( const Vec3f &  from,
const Vec3f &  to 
) [inline, virtual]

Checks a line segment for intersection with the bound.

If line intersects, true is returned.

Implements H3D::Bound.

References H3DAbs().

bool BoxBound::movingSphereIntersect ( const Vec3f &  from,
const Vec3f &  to,
H3DFloat  radius 
) [virtual]

Checks a moving sphere for intersection with the bound.

If the sphere intersects, true is returned.

Implements H3D::Bound.

References center, H3DAbs(), and size.


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

Generated on Fri Nov 7 10:29:25 2008 for H3D API by  doxygen 1.5.7