Simbody
3.6

This is a simple class containing the basic force information for a single contact between deformable surfaces S1 and S2 mounted on rigid bodies B1 and B2. More...
Public Member Functions  
ContactForce ()  
Default constructor has invalid contact id, other fields garbage. More...  
ContactForce (ContactId id, const Vec3 &contactPt, const SpatialVec &forceOnSurface2, Real potentialEnergy, Real powerLoss)  
Construct with values for all fields. More...  
ContactId  getContactId () const 
Return the ContactId of the Contact that generated this ContactForce. More...  
const Vec3 &  getContactPoint () const 
This is the point at which this contact element applies equal and opposite forces to the two bodies, chosen as the center of pressure for composite contact patches. More...  
const SpatialVec &  getForceOnSurface2 () const 
Get the total spatial force applied to body 2 at the contact point (that is, a force and a moment); negate this to find the force applied to body 1 at the same point. More...  
Real  getPotentialEnergy () const 
Get the amount of potential energy currently stored in the deformation of this contact patch. More...  
Real  getPowerDissipation () const 
Get the energy dissipation rate (power loss) due to the deformation rate and friction losses for this contact patch (this is a signed value with positive indicating dissipation). More...  
void  setTo (ContactId id, const Vec3 &contactPt, const SpatialVec &forceOnSurface2, Real potentialEnergy, Real powerLoss) 
Replace the current contents of this ContactForce object with the given arguments. More...  
void  setContactId (ContactId id) 
Change the ContactId contained in this ContactForce object. More...  
void  setContactPoint (const Vec3 &contactPt) 
Change the contact point contained in this ContactForce object. More...  
void  setForceOnSurface2 (const SpatialVec &forceOnSurface2) 
Change the value stored in this ContactForce object for the spatial force being applied on surface 2. More...  
void  setPotentialEnergy (Real potentialEnergy) 
Change the value stored for potential energy in this ContactForce object. More...  
void  setPowerDissipation (Real powerLoss) 
Change the value stored for power loss in this ContactForce object. More...  
void  clear () 
Restore the ContactForce object to its defaultconstructed state with an invalid contact id and garbage for the other fields. More...  
bool  isValid () const 
Return true if this contact force contains a valid ContactId. More...  
void  changeFrameInPlace (const Transform &X_BA) 
This object is currently in an assumed frame A; given a transform from another frame B to A we'll remeasure and reexpress this in B. More...  
This is a simple class containing the basic force information for a single contact between deformable surfaces S1 and S2 mounted on rigid bodies B1 and B2.
Every contact interaction between two rigid bodies, however complex, can be expressed as a resultant that can be contained in this class and is sufficient for advancing a simulation. Optionally, you may be able to get more details about the deformed geometry and pressure distribution over the patch but you have to ask for that separately because it can be expensive to calculate or report.
The information stored here is:
Points and vectors are measured and expressed in some assumed but unspecified frame A, which might for example be the frame of one of the two surfaces, or one of the two bodies, or Ground. Whenever a method returns a ContactForce object it must document what frame is being used; typically that will be Ground for end user use.
When the contact patch itself involves many distributed contact points, the center of pressure might not be a particularly meaningful quantity but serves to provide enough information to proceed with a simulation, and to display resultant contact forces, without requiring detailed patch geometry information. We define the location r_c of the center of pressure like this:
sum_i (r_i * r_i X Fn_i) r_c =  sum_i r_i X Fn_i
where r_i is the vector locating contact point i, F_i=Fn_i+Ft_i is the contact force at point i resolved into locallynormal and locallytangential components, and M_i is a pure moment if any generated by the contact force model as a result of the i'th contact point. Note that the locally tangent contact force Ft_i (presumably from friction) and pure moment M_i do not contribute to the center of pressure calculation; we're choosing the point that minimizes the net moment generated by normal ("pressure") forces only. Note that the normal force Fn_i includes both stiffness and dissipation contributions, so the center of pressure can be velocitydependent.

inline 
Default constructor has invalid contact id, other fields garbage.

inline 
Construct with values for all fields.
Contact point and force must be in the same but unspecified frame (typically Ground), and force and moment must be as applied at the contact point; we can't check so don't mess up.

inline 
Return the ContactId of the Contact that generated this ContactForce.

inline 
This is the point at which this contact element applies equal and opposite forces to the two bodies, chosen as the center of pressure for composite contact patches.

inline 
Get the total spatial force applied to body 2 at the contact point (that is, a force and a moment); negate this to find the force applied to body 1 at the same point.

inline 
Get the amount of potential energy currently stored in the deformation of this contact patch.

inline 
Get the energy dissipation rate (power loss) due to the deformation rate and friction losses for this contact patch (this is a signed value with positive indicating dissipation).

inline 
Replace the current contents of this ContactForce object with the given arguments.
This provides values for all fields. Contact point and force must be in the same but unspecified frame (typically Ground), and force and moment must be as applied at the contact point; we can't check so don't mess up.

inline 
Change the ContactId contained in this ContactForce object.

inline 
Change the contact point contained in this ContactForce object.

inline 
Change the value stored in this ContactForce object for the spatial force being applied on surface 2.

inline 
Change the value stored for potential energy in this ContactForce object.

inline 
Change the value stored for power loss in this ContactForce object.

inline 
Restore the ContactForce object to its defaultconstructed state with an invalid contact id and garbage for the other fields.

inline 
Return true if this contact force contains a valid ContactId.

inline 
This object is currently in an assumed frame A; given a transform from another frame B to A we'll remeasure and reexpress this in B.
Cost is 48 flops. Note that this doesn't change the moment because we're not moving the force application point physically; just remeasuring it from B.