AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
WireFrictionController.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19
22
24
25namespace agxWire
26{
27
28 //Forward declaration
29 class WireFrictionConstraintImplementation;
30
31 class AGXPHYSICS_EXPORT WireFrictionController : public agx::Referenced
32 {
33 public:
34 WireFrictionController();
35
39 void initialize();
40
41 void updateDirection();
42
43 void toggleDirection( NodeIterator node );
44 void reset( NodeConstIterator node, bool useCurrentLength = false ) const;
45
52 bool updateRowOfSlidingNodes( NodeIterator begin, NodeIterator end );
53
60 bool update( NodeIterator node, agx::Real normalForceMagnitude = 0 );
61
72 bool createFrictionConstraint( const NodeIterator firstSlidingNode, NodeIterator& nodeAfterLastSlidingNode, WireFrictionConstraintImplementation* wfci, agx::Real compliancePerUnitLength, agx::Real damping );
73
78 void setEnable( bool enable );
79
83 inline bool getEnable() const
84 {
85 return m_enable;
86 }
87
91 void updateFrictionRestlength( NodeConstIterator A, NodeConstIterator B, NodeConstIterator middleLump, bool remove ) const;
92
96 void setWire( WireDistanceCompositeConstraint* wire );
97
101 WireDistanceCompositeConstraint* getWire() const { return m_wire; }
102
103 private:
104
105 void updateToggledRestLength( agxWire::BodyFixedNode* nextBfn, agxWire::NodeMaterial* nMaterial );
106 void initialize( NodeIterator node ) const;
107 agx::Vec3 calculateNormalForce( NodeIterator node ) const;
108 agx::Bool isSlidingNode(Node* node) const;
109
110 private:
112 bool m_enable;
113 };
114
115 typedef agx::ref_ptr< WireFrictionController > WireFrictionControllerRef;
116}
117
118
#define AGXPHYSICS_EXPORT
The body fixed node is attached to a body at a given offset.
Material definition for a wire node Specifies the friction of a wire for sliding through an EyeNode.
Base class providing referencing counted objects.
Definition Referenced.h:120
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Smart pointer for handling referenced counted objects.
Definition ref_ptr.h:30
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition macros.h:96
Implements a Wire model with adaptive resolution.
Definition MergedBody.h:40
bool Bool
Definition Integer.h:40
double Real
Definition Real.h:42