Class HuntCrossleyContactForce#
Defined in File HuntCrossleyContactForce.h
Nested Relationships#
Nested Types#
Inheritance Relationships#
Base Type#
public Karana::Collision::ContactForceBase(Class ContactForceBase)
Class Documentation#
-
class HuntCrossleyContactForce : public Karana::Collision::ContactForceBase#
ContactForceBase implementation using a Hunt-Crossley model.
See Collision dynamics for more discussion on contact and collision dynamics.
Public Functions
-
virtual km::SpatialForce computeForce(const FrameContact &contact, const kc::ks_ptr<kd::Node> &nd_1, const kc::ks_ptr<kd::Node> &nd_2) final#
Compute the contact force for the associated contact.
- Parameters:
contact – The contact to compute the force for.
nd_1 – The contact node on the first body.
nd_2 – The contact node on the second body.
- Returns:
The contact force.
-
virtual bool isReady() const final#
Used to ensure the HuntCrossleyContactForce contact force model is ready.
- Returns:
true if the HuntCrossleyContactForce is ready, false otherwise.
-
virtual std::string dumpString(std::string_view prefix, const Karana::Core::Base::DumpOptions *options = nullptr) const override#
Return information about the object.
- Parameters:
prefix – A string to use as prefix for each output line
options – Struct with options to tailor the output
- Returns:
String with the information about the object.
Public Members
-
HuntCrossleyContactForceParams params#
Parameters used for the contact model.
-
HuntCrossleyContactForceScratch scratch#
Scratch values.
Public Static Functions
-
static kc::ks_ptr<HuntCrossleyContactForce> create(std::string_view name)#
Create an instance of the HuntCrossleyContactForce contact force model.
- Parameters:
name – The name for the HuntCrossleyContactForce instance.
- Returns:
A ks_ptr to the newly created HuntCrossleyContactForce contact force model.
-
class HuntCrossleyContactForceParams#
Structure that holds the HuntCrossleyContactForce contact force parameters.
Public Members
-
double kp = km::notReadyNaN#
Normal penetration stiffness coefficient.
-
double kc = km::notReadyNaN#
Normal penetration restitution/damping coefficient.
-
double n = km::notReadyNaN#
Exponent.
-
double mu = km::notReadyNaN#
Friction coefficient.
-
double linear_region_tol = km::notReadyNaN#
Tolerance at which friction is linearly interpolated between the real value and 0.
To avoid jittering for cases like rolling without friction, near zero, the friction force uses a linear interpolation between the full friction force and zero. This avoids rapid, large changes in the friction force as the velocity changes sign, and instead, smoothly, linearly interpolates between these large forces over a region of linear_region_tol * 2.
-
double kp = km::notReadyNaN#
-
class HuntCrossleyContactForceScratch#
Structure that holds the HuntCrossleyContactForce scratch data.
-
virtual km::SpatialForce computeForce(const FrameContact &contact, const kc::ks_ptr<kd::Node> &nd_1, const kc::ks_ptr<kd::Node> &nd_2) final#