13 #include <boost/tuple/tuple.hpp>
14 #include <boost/enable_shared_from_this.hpp>
15 #include <Ravelin/Vector3d.h>
16 #include <Ravelin/Pose3d.h>
17 #include <Ravelin/AAngled.h>
19 #include <Moby/Constants.h>
20 #include <Moby/Types.h>
21 #include <Moby/CompGeom.h>
32 SSL(
const SSL& s,
const Ravelin::Vector3d& v);
34 virtual void transform(
const Ravelin::Transform3d& T,
BV* result)
const;
40 static bool intersects(
const SSL& a,
const SSL& b,
const Ravelin::Transform3d& aTb);
45 boost::shared_ptr<SSL> get_this() {
return boost::dynamic_pointer_cast<
SSL>(shared_from_this()); }
46 boost::shared_ptr<const SSL> get_this()
const {
return boost::dynamic_pointer_cast<
const SSL>(shared_from_this()); }
47 virtual std::ostream&
to_vrml(std::ostream& out,
const Ravelin::Pose3d& T)
const;
49 virtual boost::shared_ptr<const Ravelin::Pose3d>
get_relative_pose()
const {
return p1.pose; }
54 virtual double calc_volume()
const {
return (p1 - p2).norm() * M_PI * radius * radius *
radius; }
68 static double calc_sq_dist(
const Point3d& origin,
const Ravelin::Vector3d& dir,
const LineSeg3& seg,
Point3d& cp_line,
Point3d& cp_seg,
double& line_param);
virtual BVPtr calc_swept_BV(CollisionGeometryPtr g, const Ravelin::SVelocityd &v) const
Calculates the velocity-expanded bounding volume.
Definition: SSL.cpp:65
boost::shared_ptr< BV > BVPtr
Bounding volume (BV) smart pointer.
Definition: Types.h:92
virtual bool intersects(const LineSeg3 &seg, double &tmin, double tmax, Point3d &q) const
Determines whether a line segment intersects the bounding volume.
Definition: SSL.h:42
virtual std::ostream & to_vrml(std::ostream &out, const Ravelin::Pose3d &T) const
Outputs the SSL to VRML (not yet implemented)
Definition: SSL.cpp:582
static double calc_dist(const SSL &o, const Point3d &p)
Calculates the distance of the sphere-swept line from a point.
Definition: SSL.cpp:72
An abstract bounding volume.
Definition: BV.h:38
Point3d p2
The second point of the line segment.
Definition: SSL.h:60
Point3d p1
The first point of the line segment.
Definition: SSL.h:57
SSL & operator=(const SSL &s)
Copies one SSL to another.
Definition: SSL.cpp:55
boost::shared_ptr< CollisionGeometry > CollisionGeometryPtr
Collision geometry smart pointer.
Definition: Types.h:77
virtual void transform(const Ravelin::Transform3d &T, BV *result) const
Transforms the SSL using the given transform.
Definition: SSL.cpp:41
A sphere-swept line (SSL) that optionally allows building an SSL tree.
Definition: SSL.h:26
virtual boost::shared_ptr< const Ravelin::Pose3d > get_relative_pose() const
Gets the associated pose for this bounding volume.
Definition: SSL.h:49
virtual Point3d get_upper_bounds() const
Gets the upper bounds of the SSL.
Definition: SSL.cpp:566
virtual Point3d get_lower_bounds() const
Gets the lower bounds of the SSL.
Definition: SSL.cpp:550
Ravelin::Vector3d Point3d
Typedef to distinguish between a 3D vector and a point.
Definition: Types.h:47
static bool outside(const SSL &a, const Point3d &point, double tol=NEAR_ZERO)
Determines whether a point is outside the SSL.
Definition: SSL.cpp:533
static bool intersects(const SSL &a, const SSL &b)
Determines whether two SSLs intersect.
Definition: SSL.cpp:477
std::pair< Point3d, Point3d > LineSeg3
Typedef to make specifying line segments easier.
Definition: Types.h:50
double radius
Radius of the spherical addition.
Definition: SSL.h:63
SSL()
Initializes an empty SSL.
Definition: SSL.cpp:15
unsigned calc_size() const
Calculates the size (number of elements in) a SSL tree.
Definition: SSL.cpp:540
virtual bool outside(const Point3d &point, double tol=NEAR_ZERO) const
Determines whether a point is outside the bounding volume.
Definition: SSL.h:44
virtual double calc_volume() const
Calculates (approximate?) volume of the SSL.
Definition: SSL.h:54