Physsim::ContactData Class Reference

Container class for data used for various contact methods. More...

#include <ContactData.h>

Inheritance diagram for Physsim::ContactData:

Physsim::Base List of all members.

Public Member Functions

 ContactData ()
 Constructs a ContactData object with no object pointers.
 ContactData (BasePtr o1, BasePtr o2)
 Constructs a ContactData object with the given object IDs.
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
virtual bool is_struct_identical (BaseConstPtr object) const
 Verifies that the structure of two objects is identical.
virtual void clone (BasePtr &cloned, bimap< BasePtr, BasePtr > *obj_map=NULL) const
 Clones this object.
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_penalty_gains (Real kp, Real kv, Real ki)
 Sets the gains for penalty methods.
void set_static_friction_gains (Real kp_static, Real kv_static)
 Sets the gains for maintaining static friction with penalty methods.
void set_restitution (Real restitution)
 Sets the restitution scalar [0,1].
void set_mu_coulomb (Real mu)
 Sets the coefficient of friction for Coulomb friction (mu = 0..infinity).
void set_mu_viscous (Real mu)
 Sets the coefficient of friction for viscous friction (mu = 0..infinity).
void set_num_samples (unsigned num_samples)
 Sets the number of samples to use (i.e., contact points) to approximate a contact volume, surface, or line.
void set_static_friction_velocity_thresh (Real thresh)
 Sets the threshold velocity for differentiating between static and dynamic friction.
void set_resting_contact_method (boost::shared_ptr< RestingContactMethod > rcm)
 Sets the resting contact method used for this pair of objects.
void set_collision_method (boost::shared_ptr< CollisionMethod > cm)
 Sets the collision method used for this pair of objects.
Real get_kp () const
 Gets the position gain for penalty methods (default 0.0).
Real get_kv () const
 Gets the velocity gain for penalty methods (default 0.0).
Real get_ki () const
 Gets the integrative gain for penalty methods (default 0.0).
Real get_kp_static () const
 Gets the positional gain for maintaining static friction with penalty methods (default 0.0).
Real get_kv_static () const
 Gets the velocity gain for maintaining static friction with penalty methods (default 0.0).
Real get_static_friction_velocity_thresh () const
 Gets the threshold velocity for differentiating between static and dynamic friction.
Real get_restitution () const
 Gets the restitution scalar [0,1].
Real get_mu_coulomb () const
 Gets the coefficient of Coulomb friction.
Real get_mu_viscous () const
 Gets the coefficient of viscous friction.
unsigned get_num_samples () const
 Gets the number of samples to use (i.e., contact points) to approximate a contact volume, surface, or line.
boost::shared_ptr< RestingContactMethodget_resting_contact_method () const
 Gets the resting contact method used for this pair of objects.
boost::shared_ptr< CollisionMethodget_collision_method () const
 Gets the collision method used for this pair of objects.
bool operator== (const ContactData &cd) const
 Equality operation for use with maps, sets, etc.
bool operator< (const ContactData &cd) const
 Comparison operation for use with maps, sets, etc.

Public Attributes

sorted_pair< BasePtr > objects
 The two objects represented by the contact data.

Detailed Description

Container class for data used for various contact methods.

This data applies to pairs of geometries / bodies in contact. Not all of the data contained within this class will necessarily be used by every contact method.


Constructor & Destructor Documentation

ContactData::ContactData (  ) 

Constructs a ContactData object with no object pointers.

All gains and coefficients are set to zero.

ContactData::ContactData ( BasePtr  o1,
BasePtr  o2 
)

Constructs a ContactData object with the given object IDs.

All gains and coefficients are set to zero.


Member Function Documentation

void ContactData::load_from_xml ( XMLTreeConstPtr  node,
std::map< std::string, BasePtr > &  id_map 
) [virtual]

Implements Base::load_from_xml().

This method does not read the Base information (i.e., name()), because a name for this object is unnecessary.

Reimplemented from Physsim::Base.

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

This method does not write the Base information, because neither a name nor a unique ID are useful.

Reimplemented from Physsim::Base.

void ContactData::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::Base.

void Physsim::ContactData::set_num_samples ( unsigned  num_samples  )  [inline]

Sets the number of samples to use (i.e., contact points) to approximate a contact volume, surface, or line.

Note:
default is 10

void Physsim::ContactData::set_static_friction_velocity_thresh ( Real  thresh  )  [inline]

Sets the threshold velocity for differentiating between static and dynamic friction.

Note:
the default threshold is NEAR_ZERO

Real Physsim::ContactData::get_static_friction_velocity_thresh (  )  const [inline]

Gets the threshold velocity for differentiating between static and dynamic friction.

Note:
the default threshold is NEAR_ZERO

unsigned Physsim::ContactData::get_num_samples (  )  const [inline]

Gets the number of samples to use (i.e., contact points) to approximate a contact volume, surface, or line.

Note:
default is 10

bool Physsim::ContactData::operator== ( const ContactData cd  )  const [inline]

Equality operation for use with maps, sets, etc.

Comparison utilizes the object sorted_pair only, so two ContactData objects will found to be equal if the objects are equal.

bool Physsim::ContactData::operator< ( const ContactData cd  )  const [inline]

Comparison operation for use with maps, sets, etc.

Comparison utilizes the object sorted_pair only.


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