AGX Dynamics  2.37.2.0
GenericElementaryConstraint.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 
21 
22 namespace agx
23 {
54  {
55  public:
62 
69 
73  const agx::AttachmentPair* getAttachmentPair() const;
74 
90  void setEnableMultiTangentNlCallback( agx::Bool enable,
91  agx::Real primaryFrictionCoefficient,
92  agx::Real secondaryFrictionCoefficient,
93  const agx::Vec3& contactPointPosition );
94 
100  agx::Bool getEnableMultiTangentNlCallback() const;
101 
102  public:
110  virtual agx::Bool onPrepare();
111 
119  virtual void onWriteData( agx::GenericConstraintBodyData* rb1Data,
121  agx::GenericConstraintData* constraintData );
122 
123 #ifndef SWIG
124  public:
128  void fetchData();
129 #endif
130 
131  public:
132  void prepare() override;
133  agx::Bool isActive() const override;
134  agx::UInt getJacobian( agx::Jacobian6DOFElement* G, agx::UInt numBlocks, agx::UInt row, agx::GWriteState::Enum writeState ) override;
135  agx::UInt getViolation( agx::Real* g, agx::UInt row ) override;
136  agx::UInt getVelocity( agx::Real* v, agx::UInt row ) const override;
137  agx::UInt getBounds( agx::RangeReal* bounds, agx::UInt row, agx::Real h ) const override;
138  agx::Bool isImpacting() const override;
139 #ifndef SWIG
140  agx::ConstraintNlmcpCallback* getNlCallback() const override;
141 #endif
142 
143  void setAttachmentPair( const agx::AttachmentPair* ap ) override;
144 
145  protected:
146  virtual ~GenericElementaryConstraint();
147 
148  private:
149  GenericConstraintBodyData m_rb1Data;
150  GenericConstraintBodyData m_rb2Data;
151  GenericConstraintData m_constraintData;
152  const AttachmentPair* m_attachmentPair;
153  Bool m_active;
154  ref_ptr<Referenced> m_multiTangentNlCallback;
155  };
156 }
Elementary constraint base class with interface and global constraint functionality.
bool Bool
Definition: Integer.h:48
Generic elementary constraint with minimal amount of user callbacks to reduce development/prototype t...
#define AGXPHYSICS_EXPORT
Constraint body data used with GenericElementaryConstraint containing the per body Jacobian data...
Constraint data used with GenericElementaryConstraint containing data such as; constraint violation...
Constraint solver callback interface with context and start rows for context.
uint32_t UInt
Definition: Integer.h:34
Constraint attachment pair class.
Definition: Attachment.h:300
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
double Real
Definition: Real.h:42