Class ContactForceBase#

Inheritance Relationships#

Base Type#

Derived Types#

Class Documentation#

class ContactForceBase : public Karana::Core::Base#

Base class for all contact force models.

See Collision dynamics for more discussion on contact and collision dynamics.

Subclassed by Karana::Collision::ContactForceManager, Karana::Collision::HuntCrossley

Public Functions

virtual void applyForce(const FrameContact &contact, const kc::ks_ptr<Karana::Dynamics::SubTree> &st)#

Apply the contact force for the associated contact.

This first calls computeForce to get the contact force. Then, it applies it to frames if those frames belong to a body.

Parameters:
  • contact – The contact to apply the force for.

  • st – The SubTree we are computing forces for.

virtual km::SpatialVector computeForce(const FrameContact &contact, const kc::ks_ptr<kd::Node> &nd_1, const kc::ks_ptr<kd::Node> &nd_2) = 0#

Compute the contact force for the associated contact.

Parameters:
  • contact – The contact to compute the force for.

  • nd_1 – The contact node associated with object 1. This node is located at contact.location_1 and the frame of the node is that of frame_1.

  • nd_2 – The contact node associated with object 2. This node is located at contact.location_2 and the frame of the node is that of frame_2.

Returns:

The contact force on the frame_1 object at location_1 expressed in frame_1 coordinates.

Base(std::string_view name, const ks_ptr<BaseContainer> &container = nullptr)#

Use the Base constructor.

Base(const Base &other)#

Use the Base constructor.

Base(Base &&other) noexcept#

Use the Base constructor.