Class ConstraintNode#
Defined in File Node.h
Inheritance Relationships#
Base Type#
public Karana::Dynamics::Node(Class Node)
Class Documentation#
-
class ConstraintNode : public Karana::Dynamics::Node#
This class is used by LoopConstraintBase loop constraints as attachment body nodes.
ConstraintNodes are always force nodes, but do not allow the accumulation of forces. The node constraint forces are computed automatically by dynamics algorithms such as Karana::Dynamics::Algorithms::evalTAForwardDynamics(). See the
Hinge loop-constraints section for more on constraint nodes.
Public Functions
-
inline ConstraintNode(std::string_view name, kc::ks_ptr<PhysicalBody> bd)#
Constructor.
This method first checks if a detached constraint node is available for use. If not, the method creates a new ConstraintNode for the body.
- Parameters:
name – the name for the node
bd – the physical parent body
-
inline virtual std::string_view typeString() const noexcept override#
Returns the type string of Base.
- Returns:
The type string.
Public Static Functions
-
static kc::ks_ptr<ConstraintNode> lookupOrCreate(kc::ks_ptr<PhysicalBody> bd, std::string_view name)#
Factory method to create a ConstraintNode instance.
This method first checks if a detached constraint node is available for use. If not, the method creates a new ConstraintNode for the body.
- Parameters:
bd – the physical parent body
name – the name for the node
- Returns:
a ConstraintNode instance
Protected Functions
-
virtual void detach() override#
detach the node from the current parent body, and put in the pool of detached nodes for possible reuse
-
inline virtual void setExternalSpForce(const km::SpatialVector &spforce, const kc::ks_ptr<kf::Frame>& = nullptr) override#
Make this method protected since the constraint forces at the nodes are computed algorithmically by methods such as Karana::Dynamics::Algorithms::evalTAForwardDynamics()
-
void _discard(kc::ks_ptr<kc::Base> &base) override#
Discard a constriant node.
- Parameters:
base – - A base pointer to the constraint node to discard.
-
inline ConstraintNode(std::string_view name, kc::ks_ptr<PhysicalBody> bd)#