Moby
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Moby::BoundingSphere Class Reference

A sphere used for bounding geometry. More...

#include <BoundingSphere.h>

Inheritance diagram for Moby::BoundingSphere:
Moby::BV

Public Member Functions

 BoundingSphere (const BoundingSphere &bsphere)
 
 BoundingSphere (const Point3d &center, double radius)
 
BoundingSphereoperator= (const BoundingSphere &bsphere)
 
virtual void transform (const Ravelin::Transform3d &T, BV *result) const
 Transforms the BoundingSphere using the given transform.
 
virtual std::ostream & to_vrml (std::ostream &out, const Ravelin::Pose3d &T) const
 Sends the bounding sphere to VRML.
 
virtual BVPtr calc_swept_BV (CollisionGeometryPtr g, const Ravelin::SVelocityd &v) const
 Calculates the velocity expanded bounding volume for the bounding sphere (calculates an OBB)
 
virtual bool outside (const Point3d &point, double tol=NEAR_ZERO) const
 Determines whether a point is outside the bounding volume.
 
virtual bool intersects (const LineSeg3 &seg, double &tmin, double tmax, Point3d &q) const
 Determines whether a line segment intersects the bounding volume.
 
template<class ForwardIterator >
 BoundingSphere (ForwardIterator begin, ForwardIterator end)
 
virtual boost::shared_ptr
< const Ravelin::Pose3d > 
get_relative_pose () const
 Gets the pose for this BV.
 
virtual Point3d get_lower_bounds () const
 Gets the lower bounds on the bounding sphere.
 
virtual Point3d get_upper_bounds () const
 Gets the upper bounds on the bounding sphere.
 
virtual double calc_volume () const
 Calculates the volume of this bounding volume.
 
template<class ForwardIterator >
 BoundingSphere (ForwardIterator begin, ForwardIterator end)
 
- Public Member Functions inherited from Moby::BV
BVPtr get_this ()
 
boost::shared_ptr< const BVget_this () const
 
bool is_leaf () const
 
template<class OutputIterator >
OutputIterator get_all_BVs (OutputIterator begin) const
 Gets all BV nodes. More...
 
template<class OutputIterator >
OutputIterator get_all_leafs (OutputIterator begin) const
 Gets all leaf nodes.
 
template<class OutputIterator >
OutputIterator get_all_BVs (OutputIterator begin) const
 Gets all BV nodes. More...
 
template<class OutputIterator >
OutputIterator get_all_leafs (OutputIterator begin) const
 Gets all leaf nodes.
 
template<class OutputIterator >
OutputIterator intersect_BV_trees (BVPtr a, BVPtr b, const Ravelin::Transform3d &aTb, const Ravelin::Transform3d &bTa, OutputIterator output_begin)
 Intersects two BV trees; returns list of all leaf-level intersecting BVs. More...
 

Static Public Member Functions

static double calc_dist (const BoundingSphere &s1, const BoundingSphere &s2)
 Calculates the signed distance between two bounding spheres.
 
static bool intersects (const BoundingSphere &a, const BoundingSphere &b)
 Determines whether two bounding spheres intersect.
 
static bool intersects (const BoundingSphere &a, const BoundingSphere &b, const Ravelin::Transform3d &aTb)
 
static bool intersects (const BoundingSphere &a, const LineSeg3 &seg, double &tmin, double tmax, Point3d &q)
 Determines whether there is an intersection between the primitive and a line segment.
 
static bool outside (const BoundingSphere &a, const Point3d &point, double tol=NEAR_ZERO)
 Determines whether a point is outside of the bounding sphere.
 
- Static Public Member Functions inherited from Moby::BV
static bool intersects (BVPtr a, BVPtr b)
 Convenience method.
 
static bool intersects (BVPtr a, BVPtr b, const Ravelin::Transform3d &T)
 Convenience method.
 
static double calc_distance (BVPtr a, BVPtr b, Point3d &cp1, Point3d &cp2)
 Convenience method.
 
static double calc_distance (BVPtr a, BVPtr b, const Ravelin::Transform3d &aTb, Point3d &cp1, Point3d &cp2)
 Convenience method.
 
static bool intersects (const BV *a, const BV *b)
 Computes whether two abstract bounding volumes intersect.
 
static bool intersects (const BV *a, const BV *b, const Ravelin::Transform3d &T)
 
static double calc_distance (const BV *a, const BV *b, Point3d &cp1, Point3d &cp2)
 Computes the distance between two abstract bounding volumes and stores the closest points. More...
 
static double calc_distance (const BV *a, const BV *b, const Ravelin::Transform3d &aTb, Point3d &cp1, Point3d &cp2)
 
template<class OutputIterator >
static OutputIterator intersect_BV_trees (BVPtr a, BVPtr b, const Ravelin::Transform3d &aTb, const Ravelin::Transform3d &bTa, OutputIterator output_begin)
 Intersects two BV trees; returns list of all leaf-level intersecting BVs. More...
 

Public Attributes

Point3d center
 Center of the bounding box.
 
double radius
 The radius of the bounding sphere (we use a float b/c accuracy here not so important)
 
- Public Attributes inherited from Moby::BV
boost::shared_ptr< void > userdata
 Userdata for the BV.
 
CollisionGeometryPtr geom
 The collision geometry associated with this bounding volume.
 
std::list< BVPtrchildren
 The children of this BV.
 

Detailed Description

A sphere used for bounding geometry.


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