Class ContactForceManager#
Defined in File ContactForceManager.h
Inheritance Relationships#
Base Type#
public Karana::Collision::ContactForceBase(Class ContactForceBase)
Class Documentation#
-
class ContactForceManager : public Karana::Collision::ContactForceBase#
Public Functions
-
ContactForceManager(std::string_view name)#
ContactForceManager constructor.
-
virtual ~ContactForceManager()#
ContactForceManager destructor.
-
virtual Karana::Math::SpatialVector computeForce(const FrameContact &contact, const Karana::Core::ks_ptr<Karana::Dynamics::Node> &nd_1, const Karana::Core::ks_ptr<Karana::Dynamics::Node> &nd_2) override#
Compute the contact force for the associated contact.
This looks up the most specific delegate ContactForceBase for the given frame pair and returns the force computed by the delegate. If there is no default delegate or specific delegate for this pair, returns zero.
- Parameters:
contact – The contact to compute the force for.
- Returns:
The contact force.
-
const Karana::Core::ks_ptr<ContactForceBase> &getDelegate(const FrameContact &contact) const#
Get the most specific matching ContactForceBase.
- Returns:
The ContactForceBase (may be nullptr)
-
const Karana::Core::ks_ptr<ContactForceBase> &getDelegate() const#
Get the ContactForceBase used by default.
- Returns:
The ContactForceBase used by default (may be nullptr)
-
void setDelegate(const Karana::Core::ks_ptr<ContactForceBase> &force = nullptr)#
Set the ContactForceBase used by default.
- Parameters:
force – The ContactForceBase (may be nullptr)
-
const Karana::Core::ks_ptr<ContactForceBase> &getDelegate(const Karana::Frame::Frame &frame1, const Karana::Frame::Frame &frame2, bool strict = false) const#
Get the ContactForceBase used for a Frame pair.
Note the ordering of frame1 and frame2 does not matter.
- Parameters:
frame1 – A frame that must be involved
frame2 – Another frame that must be involved
strict – If false and there’s no delegate for this pair, return the default delegate.
- Returns:
The ContactForceBase (may be nullptr)
-
void setDelegate(const Karana::Frame::Frame &frame1, const Karana::Frame::Frame &frame2, const Karana::Core::ks_ptr<ContactForceBase> &force = nullptr)#
Set the ContactForceBase used for a Frame pair.
Note the ordering of frame1 and frame2 does not matter.
- Parameters:
frame1 – A frame that must be involved
frame2 – Another frame that must be involved
The – ContactForceBase (may be nullptr)
-
void clearDelegates()#
Clear out all registered ContactForceBase instances.
Public Static Functions
-
static Karana::Core::ks_ptr<ContactForceManager> create(std::string_view name)#
Create an instance of ContactForceManager.
- Parameters:
name – The name for the ContactForceManager instance.
- Returns:
A ks_ptr to the newly created ContactForceManager.
-
ContactForceManager(std::string_view name)#