AGX Dynamics  2.37.2.0
WireFrictionController.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 
20 #include <agx/agxPhysics_export.h>
22 
24 
25 namespace 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 
bool Bool
Definition: Integer.h:48
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Definition: observer_ptr.h:60
NodeContainer::iterator NodeIterator
Definition: agxWire/Node.h:54
#define AGXPHYSICS_EXPORT
Material definition for a wire node Specifies the friction of a wire for sliding through an EyeNode...
Definition: agxWire/Node.h:181
Base class providing referencing counted objects.
Definition: Referenced.h:119
The body fixed node is attached to a body at a given offset.
Implements a Wire model with adaptive resolution.
Definition: MergedBody.h:39
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
LinearProbingHashSetImplementation< KeyT, HashT >::iterator begin(LinearProbingHashSetImplementation< KeyT, HashT > &set)
NodeContainer::const_iterator NodeConstIterator
Definition: agxWire/Node.h:57
LinearProbingHashSetImplementation< KeyT, HashT >::iterator end(LinearProbingHashSetImplementation< KeyT, HashT > &set)
double Real
Definition: Real.h:42
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97