Moby
|
A sphere-swept rectangle (SSR) that optionally allows building an SSR tree. More...
#include <SSR.h>
Public Member Functions | |
SSR () | |
Initializes an empty SSR. | |
SSR (const SSR &obb) | |
SSR (const Point3d ¢er, const Ravelin::Matrix3d &R, const Ravelin::Vector2d &l, double radius) | |
SSR (const SSR &s, const Ravelin::Vector3d &v) | |
SSR & | operator= (const SSR &s) |
Copies one SSR to another. | |
virtual BVPtr | calc_swept_BV (CollisionGeometryPtr g, const Ravelin::SVelocityd &v) const |
Calculates the velocity-expanded bounding volume. | |
virtual bool | intersects (const LineSeg3 &seg, double &tmin, double tmax, Point3d &q) const |
Determines whether a line segment intersects the bounding volume. | |
virtual bool | outside (const Point3d &point, double tol=NEAR_ZERO) const |
Determines whether a point is outside the bounding volume. | |
boost::shared_ptr< SSR > | get_this () |
boost::shared_ptr< const SSR > | get_this () const |
virtual std::ostream & | to_vrml (std::ostream &out, const Ravelin::Pose3d &T) const |
Outputs the SSR to VRML (not yet implemented) | |
unsigned | calc_size () const |
Calculates the size (number of elements in) a SSR tree. | |
virtual boost::shared_ptr < const Ravelin::Pose3d > | get_relative_pose () const |
Gets the associated pose for this bounding volume. | |
virtual void | transform (const Ravelin::Transform3d &T, BV *result) const |
Transforms the SSR using the given transform. | |
virtual Point3d | get_lower_bounds () const |
Gets the lower bounds of the SSR. | |
virtual Point3d | get_upper_bounds () const |
Gets the upper bounds of the SSR. | |
void | get_rect_verts (Point3d rect_verts[4]) const |
Gets the vertices of the rectangle. | |
template<class ForwardIterator > | |
void | expand_to_fit (ForwardIterator begin, ForwardIterator end) |
template<class ForwardIterator > | |
SSR (ForwardIterator begin, ForwardIterator end) | |
Computes a SSR from a set of points. More... | |
virtual double | calc_volume () const |
Calculates (approximate?) volume of the SSR. | |
template<class ForwardIterator > | |
SSR (ForwardIterator begin, ForwardIterator end) | |
Computes a SSR from a set of points. More... | |
template<class ForwardIterator > | |
void | calc_lengths_and_radius (ForwardIterator begin, ForwardIterator end) |
Calculates the lengths and radius for a SSR. | |
template<class ForwardIterator > | |
void | align (ForwardIterator begin, ForwardIterator end, const Ravelin::Vector3d &d1, Ravelin::Vector3d &d2) |
Aligns this SSR with the minimum area bounding rectangle projected along the first dimension of the SSR. | |
Public Member Functions inherited from Moby::BV | |
BVPtr | get_this () |
boost::shared_ptr< const BV > | get_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 SSR &a, const Point3d &p) |
Calculates the distance of the sphere-swept rectangle from a point. | |
static double | calc_dist (const SSR &a, const LineSeg3 &s) |
Calculates the distance of the sphere-swept rectangle from a line segment. | |
static double | calc_dist (const SSR &a, const SSR &b, Point3d &cpa, Point3d &cpb) |
Calculates the distance between two sphere-swept rectangles and also calculates closest points. | |
static double | calc_dist (const SSR &a, const SSR &b, const Ravelin::Transform3d &aTb, Point3d &cpa, Point3d &cpb) |
static bool | intersects (const SSR &a, const SSR &b) |
Determines whether two SSRs intersect. | |
static bool | intersects (const SSR &a, const SSR &b, const Ravelin::Transform3d &T) |
static bool | intersects (const SSR &a, const LineSeg3 &seg, double &tmin, double tmax, Point3d &q) |
Determines whether (and when) a line segment intersects with the SSR. | |
static bool | outside (const SSR &a, const Point3d &point, double tol=NEAR_ZERO) |
Determines whether a point is outside the SSR. | |
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 volume. | |
Ravelin::Vector2d | l |
Lengths of the rectangle sides. | |
Ravelin::Matrix3d | R |
Orientation of this SSR. | |
double | radius |
Radius of the spherical addition. | |
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< BVPtr > | children |
The children of this BV. | |
A sphere-swept rectangle (SSR) that optionally allows building an SSR tree.
Moby::SSR::SSR | ( | ForwardIterator | begin, |
ForwardIterator | end | ||
) |
Computes a SSR from a set of points.
begin | an iterator to type Point3d |
end | an iterator to type Point3d Algorithm taken from [Ericson, 2005] |
Moby::SSR::SSR | ( | ForwardIterator | begin, |
ForwardIterator | end | ||
) |
Computes a SSR from a set of points.
begin | an iterator to type Point3d |
end | an iterator to type Point3d Algorithm taken from [Ericson, 2005] |
References Moby::IndexedTri::a, Moby::IndexedTri::b, and Moby::IndexedTri::c.