Class HuntCrossley#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Type#

Class Documentation#

class HuntCrossley : 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::SpatialVector 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 isFinalized() const final#

Used to ensure the HuntCrossley constact force model is finalized.

Returns:

true if the HuntCrossley is finalized, false otherwise.

virtual std::string dumpString(std::string_view prefix, const Karana::Core::Base::DumpOptions *options) 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

HuntCrossleyParams params#

Parameters used for the contact model.

Public Static Functions

static kc::ks_ptr<HuntCrossley> create(std::string_view name)#

Create an instance of the HuntCrossley contact force model.

Parameters:

name – The name for the HuntCrossley instance.

Returns:

A ks_ptr to the newly created HuntCrossley contact force model.

class HuntCrossleyParams#

Structure that holds the HuntCrossley contact force parameters.

Public Members

double kp = km::uninitializedNaN#

Normal penetration siffness coefficient.

double kc = km::uninitializedNaN#

Normal penetration restituion/damping coefficient.

double n = km::uninitializedNaN#

Exponent.

double mu = km::uninitializedNaN#

Friction coefficient.

double linear_region_tol = km::uninitializedNaN#

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.