Physsim::ADFCollisionDetection Class Reference

Implements the CollisionDetection abstract class to perform collision detection using a hybrid of PQP and adaptively sampled distance fields. More...

#include <ADFCollisionDetection.h>

Inheritance diagram for Physsim::ADFCollisionDetection:

Physsim::PQPCollisionDetection Physsim::CollisionDetection Physsim::Base List of all members.

Public Member Functions

 ADFCollisionDetection ()
 Constructs an empty ADFCollisionDetection object.
 ADFCollisionDetection (Real epsilon, unsigned max_recursion)
 Constructs a ADFCollisionDetection object with the specified tolerance value and maximum recursion for the underlying ADFs.
 ADFCollisionDetection (const std::vector< DynamicBodyPtr > &bodies, Real epsilon, unsigned max_recursion)
 Constructs a ADFCollisionDetection object with a vector of dynamic bodies.
 ADFCollisionDetection (const std::vector< DynamicBodyPtr > &bodies, Real epsilon, unsigned max_recursion, bool disable_adjacent)
 Constructs a ADFCollisionDetection object with a vector of dynamic bodies.
virtual void clone (BasePtr &cloned, bimap< BasePtr, BasePtr > *obj_map=NULL) const
 Clones this object.
virtual bool is_struct_identical (BaseConstPtr object) const
 Verifies that structure is identical.
virtual void load_state (BaseConstPtr object, bimap< BasePtr, BasePtr > *correspondence=NULL)
 Loads the state of this object.
virtual void save_state (BasePtr object, bimap< BasePtr, BasePtr > *correspondence=NULL) const
 Saves the state of this object.
void set_max_recursion (unsigned max_recursion)
 Sets the maximum recursion used when building ADF models.
void set_epsilon (Real epsilon)
 Sets the absolute tolerance for error above which ADF cells are subdivided.
virtual std::list< ContactPtr > find_contacts (CollisionGeometryPtr g1, CollisionGeometryPtr g2)
 Determines the contact for a pair of CollisionGeometries.
virtual void load_from_xml (XMLTreeConstPtr node, std::map< std::string, BasePtr > &id_map)
 Implements Base::load_from_xml().
virtual void save_to_xml (XMLTreePtr node, std::list< BaseConstPtr > &shared_objects) const
 Implements Base::save_to_xml().
virtual void remove_collision_geometry (CollisionGeometryPtr geom)
 Removes a specific collision geometry.
virtual void remove_all_collision_geometries ()
 Removes all geometries.
virtual void add_collision_geometry (CollisionGeometryPtr geom)
 Adds a geometry to the collision detector.
unsigned get_max_recursion () const
 Gets the maximum recursion used when building ADF models.

Detailed Description

Implements the CollisionDetection abstract class to perform collision detection using a hybrid of PQP and adaptively sampled distance fields.


Constructor & Destructor Documentation

ADFCollisionDetection::ADFCollisionDetection (  ) 

Constructs an empty ADFCollisionDetection object.

epsilon and max_recursion are both set to infinity

ADFCollisionDetection::ADFCollisionDetection ( const std::vector< DynamicBodyPtr > &  bodies,
Real  epsilon,
unsigned  max_recursion 
)

Constructs a ADFCollisionDetection object with a vector of dynamic bodies.

Parameters:
bodies a vector of dynamic bodies
epsilon the tolerance for constructing ADFs
max_recursion the maximum level of recursion in ADFs

ADFCollisionDetection::ADFCollisionDetection ( const std::vector< DynamicBodyPtr > &  bodies,
Real  epsilon,
unsigned  max_recursion,
bool  disable_adjacent 
)

Constructs a ADFCollisionDetection object with a vector of dynamic bodies.

Parameters:
bodies a vector of dynamic bodies
epsilon the tolerance for constructing ADFs
max_recursion the maximum level of recursion in ADFs
disable_adjacent set to true to disable adjacent links in articulated bodies


Member Function Documentation

void ADFCollisionDetection::load_state ( BaseConstPtr  object,
bimap< BasePtr, BasePtr > *  correspondence = NULL 
) [virtual]

Loads the state of this object.

The underlying penalty resting contact method must have identical structure.

Reimplemented from Physsim::PQPCollisionDetection.

void ADFCollisionDetection::save_state ( BasePtr  object,
bimap< BasePtr, BasePtr > *  correspondence = NULL 
) const [virtual]

Saves the state of this object.

The underlying penalty resting contact method must have identical structure.

Reimplemented from Physsim::PQPCollisionDetection.

void ADFCollisionDetection::set_max_recursion ( unsigned  max_recursion  ) 

Sets the maximum recursion used when building ADF models.

Parameters:
max_recursion the maximum level of recursion
Note:
the ADF can potentially create > 8^(max_recursion) cells

this method forces reconstruction of the ADF models for all bodies currently present in the simulator

void ADFCollisionDetection::set_epsilon ( Real  epsilon  ) 

Sets the absolute tolerance for error above which ADF cells are subdivided.

Parameters:
epsilon the absolute tolerance for error; if the error at any of 15 points on the cell is above epsilon, the cell will be subdivided (unless the cell exists at the maximum level of recursion)
Note:
this method forces reconstruction of the ADF models for all bodies currently present in the simulator

std::list< ContactPtr > ADFCollisionDetection::find_contacts ( CollisionGeometryPtr  g1,
CollisionGeometryPtr  g2 
) [virtual]

Determines the contact for a pair of CollisionGeometries.

Precondition:
g1 and g2 have been determined to be in collision

Reimplemented from Physsim::PQPCollisionDetection.

void ADFCollisionDetection::save_to_xml ( XMLTreePtr  node,
std::list< BaseConstPtr > &  shared_objects 
) const [virtual]

Implements Base::save_to_xml().

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

Reimplemented from Physsim::PQPCollisionDetection.

void ADFCollisionDetection::remove_collision_geometry ( CollisionGeometryPtr  geom  )  [virtual]

Removes a specific collision geometry.

This method removes a specific collision geometry from the detector; it does not remove the children of this geometry.

Note:
this method is relatively slow, and should be used sparingly; if all geometries are to be removed, remove_all_collision_geometries() is much faster

Reimplemented from Physsim::PQPCollisionDetection.

unsigned Physsim::ADFCollisionDetection::get_max_recursion (  )  const [inline]

Gets the maximum recursion used when building ADF models.

Note:
the ADF is capable of creating > 8^(max_recursion) cells


The documentation for this class was generated from the following files:
Generated on Wed Oct 24 14:54:22 2007 for Physsim by  doxygen 1.5.1