AGXDynamics  2.35.0.2
ElementarySlackConstraint.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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
agx::Real
double Real
Definition: Real.h:42
agx::Jacobian6DOFElementT
Definition: Jacobian.h:104
agx::SphericalRelSlack
SphericalRelSalck is similar to the SphericalRel elementary constraint, but also supports slack and u...
Definition: ElementarySlackConstraint.h:103
agx::Dot1Slack
Dot1Slack is similar to the Dot1 elementary constraint but also supports slack and uses twice as many...
Definition: ElementarySlackConstraint.h:36
AGXSTREAM_DECLARE_SERIALIZABLE
#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
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agx::Dot2SlackData
Data holder class for elementary constraint Dot2Slack.
Definition: ElementaryConstraintData.h:252
agx::ElementaryConstraintNData
Definition: ElementaryConstraint.h:397
agx::Dot1SlackData
Extended Dot1Data with additional slack parameter.
Definition: ElementaryConstraintData.h:151
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agx::Slack3ConstraintData
Generic class for holding constraint data including 3 slack parameters.
Definition: ElementaryConstraintData.h:304
agx::Dot1SlackRef
agx::ref_ptr< Dot1Slack > Dot1SlackRef
Definition: ElementarySlackConstraint.h:64
ElementaryConstraint.h
agx::UInt
uint32_t UInt
Definition: Integer.h:34
agx::Dot2Slack
Dot2Slack is similar to Dot2 elementary constraint.
Definition: ElementarySlackConstraint.h:70
agx::Vec3T< Real >
agx::SphericalRelSlackRef
agx::ref_ptr< SphericalRelSlack > SphericalRelSlackRef
Definition: ElementarySlackConstraint.h:132