AGX Dynamics  2.37.2.0
ElementarySlackConstraint.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 
20 
21 
22 
23 #ifdef _MSC_VER
24 # pragma warning(push)
25 # pragma warning(disable: 6011) // Disable warningC6011: dereferencing nullptr pointer
26 #endif
27 
28 
29 namespace agx
30 {
31 
36  class AGXPHYSICS_EXPORT Dot1Slack : public ElementaryConstraintNData< 2, Dot1SlackData >
37  {
38  public:
43  Dot1Slack( const agx::Dot1SlackData& data );
44 
46 
47  agx::Real getSlack() const;
48  void setSlack( agx::Real slack );
49  protected:
53  Dot1Slack();
54 
58  virtual ~Dot1Slack();
59 
60  virtual agx::UInt getJacobian( agx::Jacobian6DOFElement* G, agx::UInt numBlocks, agx::UInt row, agx::GWriteState::Enum writeState ) override;
61  virtual agx::UInt getViolation( agx::Real* g, agx::UInt row ) override;
62  };
63 
65 
66 
70  class AGXPHYSICS_EXPORT Dot2Slack : public ElementaryConstraintNData< 2, Dot2SlackData >
71  {
72  public:
76  Dot2Slack( const agx::Dot2SlackData& data );
77 
79 
80  agx::Real getSlack() const;
81  void setSlack( agx::Real slack );
82 
83  protected:
87  Dot2Slack();
88 
92  virtual ~Dot2Slack();
93 
94  virtual agx::UInt getJacobian( agx::Jacobian6DOFElement* G, agx::UInt numBlocks, agx::UInt row, agx::GWriteState::Enum writeState ) override;
95  virtual agx::UInt getViolation( agx::Real* g, agx::UInt row ) override;
96  };
97 
98 
103  class AGXPHYSICS_EXPORT SphericalRelSlack : public ElementaryConstraintNData< 6, Slack3ConstraintData >
104  {
105  public:
110 
112 
113 
114  agx::Vec3 getSlack() const;
115  void setSlack( agx::Vec3 slack );
116 
117  protected:
122 
126  virtual ~SphericalRelSlack();
127 
128  virtual agx::UInt getJacobian( agx::Jacobian6DOFElement* G, agx::UInt numBlocks, agx::UInt row, agx::GWriteState::Enum writeState ) override;
129  virtual agx::UInt getViolation( agx::Real* g, agx::UInt row ) override;
130  };
131 
133 }
134 
135 #ifdef _MSC_VER
136 # pragma warning(pop)
137 #endif
SphericalRelSalck is similar to the SphericalRel elementary constraint, but also supports slack and u...
#define AGXPHYSICS_EXPORT
agx::ref_ptr< Dot1Slack > Dot1SlackRef
uint32_t UInt
Definition: Integer.h:34
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Dot2Slack is similar to Dot2 elementary constraint.
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
Generic class for holding constraint data including 3 slack parameters.
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
Data holder class for elementary constraint Dot2Slack.
Extended Dot1Data with additional slack parameter.
double Real
Definition: Real.h:42
agx::ref_ptr< SphericalRelSlack > SphericalRelSlackRef
Dot1Slack is similar to the Dot1 elementary constraint but also supports slack and uses twice as many...