Moby
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Moby::CCD Class Reference

Implements the CollisionDetection abstract class to perform exact contact finding using abstract shapes. More...

#include <CCD.h>

Inheritance diagram for Moby::CCD:
Moby::CollisionDetection Moby::Base

Public Member Functions

 CCD ()
 Constructs a collision detector with default tolerances.
 
virtual void load_from_xml (boost::shared_ptr< const XMLTree > node, std::map< std::string, BasePtr > &id_map)
 Implements Base::load_from_xml()
 
virtual void save_to_xml (XMLTreePtr node, std::list< boost::shared_ptr< const Base > > &shared_objects) const
 Implements Base::save_to_xml() More...
 
virtual void broad_phase (double dt, const std::vector< ControlledBodyPtr > &bodies, std::vector< std::pair< CollisionGeometryPtr, CollisionGeometryPtr > > &to_check)
 Default broad phase function (checks everything)
 
virtual double calc_CA_Euler_step (const PairwiseDistInfo &pdi)
 Computes a conservative advancement step between two collision geometries assuming that velocity is constant over the interval.
 
virtual void find_contacts (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, std::vector< UnilateralConstraint > &contacts, double TOL=NEAR_ZERO)
 
template<class OutputIterator >
OutputIterator find_contacts (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator output_begin, double TOL=NEAR_ZERO)
 Determines contact data between two geometries that are touching or interpenetrating.
 
template<class BidirectionalIterator >
void insertion_sort (BidirectionalIterator first, BidirectionalIterator last)
 Does insertion sort – custom comparison function not supported (uses operator<)
 
template<class OutputIterator >
OutputIterator find_contacts (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator output_begin, double TOL)
 Determines contact data between two geometries that are touching or interpenetrating.
 
template<class OutputIterator >
OutputIterator find_contacts_polyhedron_polyhedron (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator output_begin, double TOL)
 Finds contacts between two polyhedra.
 
template<class OutputIterator >
OutputIterator find_contacts_vertex_vertex (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, boost::shared_ptr< Polyhedron::Vertex > v1, boost::shared_ptr< Polyhedron::Vertex > v2, double signed_dist, OutputIterator output_begin)
 
template<class OutputIterator >
OutputIterator find_contacts_vertex_edge (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, boost::shared_ptr< Polyhedron::Vertex > v, boost::shared_ptr< Polyhedron::Edge > e, double signed_dist, OutputIterator output_begin)
 
template<class OutputIterator >
OutputIterator find_contacts_vertex_face (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, boost::shared_ptr< Polyhedron::Vertex > vA, boost::shared_ptr< Polyhedron::Face > fB, double signed_dist, OutputIterator output_begin)
 
template<class OutputIterator >
OutputIterator find_contacts_edge_edge (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, boost::shared_ptr< Polyhedron::Edge > e1, boost::shared_ptr< Polyhedron::Edge > e2, double signed_dist, OutputIterator output_begin)
 
template<class OutputIterator >
OutputIterator find_contacts_edge_face (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, boost::shared_ptr< Polyhedron::Edge > eA, boost::shared_ptr< Polyhedron::Face > fB, double signed_dist, OutputIterator output_begin)
 
template<class OutputIterator >
OutputIterator find_contacts_face_face (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, boost::shared_ptr< Polyhedron::Face > fA, boost::shared_ptr< Polyhedron::Face > fB, double signed_dist, OutputIterator output_begin)
 
template<class OutputIterator >
OutputIterator find_contacts_generic (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator output_begin, double TOL)
 
template<class OutputIterator >
OutputIterator find_contacts_cylinder_plane (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator o, double TOL)
 
template<class OutputIterator >
OutputIterator find_contacts_sphere_plane (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator o, double TOL)
 
template<class OutputIterator >
OutputIterator find_contacts_plane_generic (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator o, double TOL)
 
template<class OutputIterator >
OutputIterator find_contacts_heightmap_generic (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator o, double TOL)
 
template<class OutputIterator >
OutputIterator find_contacts_sphere_heightmap (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator output_begin, double TOL)
 Finds contacts between a sphere and a heightmap.
 
template<class OutputIterator >
OutputIterator find_contacts_convex_heightmap (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator output_begin, double TOL)
 Finds contacts for a convex shape and a heightmap.
 
template<class OutputIterator >
OutputIterator find_contacts_sphere_sphere (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator output_begin, double TOL)
 Finds contacts for two spheres (one piece of code works for both separated and non-separated spheres)
 
template<class OutputIterator >
OutputIterator find_contacts_box_sphere (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator o, double TOL)
 Gets contact points between a box and a sphere.
 
template<class OutputIterator >
OutputIterator find_contacts_torus_plane (CollisionGeometryPtr cgA, CollisionGeometryPtr cgB, OutputIterator o, double TOL)
 Gets contact points between a torus and a plane.
 
template<class BidirectionalIterator >
void insertion_sort (BidirectionalIterator first, BidirectionalIterator last)
 Does insertion sort – custom comparison function not supported (uses operator<)
 
- Public Member Functions inherited from Moby::CollisionDetection
virtual void set_simulator (boost::shared_ptr< ConstraintSimulator > sim)
 
virtual double calc_signed_dist (CollisionGeometryPtr cg1, CollisionGeometryPtr cg2, Point3d &p1, Point3d &p2)
 Calculates the signed distance between two geometries.
 
boost::shared_ptr
< CollisionDetection
get_this ()
 Get the shared pointer for this.
 
- Public Member Functions inherited from Moby::Base
 Base (const Base *b)
 

Static Public Member Functions

static unsigned constrain_unsigned (int ii, int maxi)
 
- Static Public Member Functions inherited from Moby::Base
template<class T >
static boost::shared_ptr< T > clone (boost::shared_ptr< T > x)
 Static method for cloning a shared pointer.
 

Public Attributes

std::set< Ravelin::sorted_pair
< CollisionGeometryPtr > > 
disabled_pairs
 Pairs of collision geometries that aren't checked for contact/collision. More...
 
- Public Attributes inherited from Moby::Base
boost::shared_ptr< void > userdata
 Any relevant userdata.
 
std::string id
 The unique ID for this object.
 

Protected Member Functions

virtual double calc_next_CA_Euler_step (const PairwiseDistInfo &pdi)
 

Additional Inherited Members

- Static Protected Member Functions inherited from Moby::CollisionDetection
static UnilateralConstraint create_contact (CollisionGeometryPtr a, CollisionGeometryPtr b, const Point3d &point, const Ravelin::Vector3d &normal, double violation=0.0)
 Creates a contact constraint given the bare-minimum info.
 

Detailed Description

Implements the CollisionDetection abstract class to perform exact contact finding using abstract shapes.

Member Function Documentation

void CCD::save_to_xml ( XMLTreePtr  node,
std::list< boost::shared_ptr< const Base > > &  shared_objects 
) const
virtual

Implements Base::save_to_xml()

Note
neither the contact cache nor the pairs currently in collision are saved

Reimplemented from Moby::Base.

Member Data Documentation

std::set<Ravelin::sorted_pair<CollisionGeometryPtr> > Moby::CCD::disabled_pairs

Pairs of collision geometries that aren't checked for contact/collision.

Note
collisions between geometries for two disabled bodies and collisions between geometries for a single body are automatically not checked and do not need to be added to this set.

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