H3D API  2.4.1
Public Member Functions | Public Attributes | List of all members
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

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. More...
 
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. More...
 
virtual bool movingSphereIntersect (const Vec3f &from, const Vec3f &to, H3DFloat radius)
 Checks a moving sphere for intersection with the bound. More...
 
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

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

Additional Inherited Members

- Static Public Member Functions inherited from H3D::Bound
template<class Iterator >
static BoundboundUnion (Iterator begin, Iterator end)
 Returns a Bound that is the union between all the bounds specified by the iterators. More...
 
template<class Iterator >
static BoundSFBoundUnion (Iterator begin, Iterator end)
 Returns a Bound that is the union between the Bound objects in the SFBound fields specified by the iterators.
 

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

◆ fitAroundPoints()

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::CoordBoundField::update(), and H3D::NurbsCurve::SFBound::update().

◆ lineSegmentIntersect()

virtual bool H3D::BoxBound::lineSegmentIntersect ( const Vec3f &  from,
const Vec3f &  to 
)
inlinevirtual

Checks a line segment for intersection with the bound.

If line intersects, true is returned.

Implements H3D::Bound.

References H3DAbs().

◆ movingSphereIntersect()

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: