AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GenericElementaryConstraint.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. 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 
75  public:
83  virtual agx::Bool onPrepare();
84 
92  virtual void onWriteData( agx::GenericConstraintBodyData* rb1Data,
94  agx::GenericConstraintData* constraintData );
95 
96 #ifndef SWIG
97  public:
101  void fetchData();
102 #endif
103 
104  public:
105  void prepare() override;
106  agx::Bool isActive() const override;
107  agx::UInt getJacobian( agx::Jacobian6DOFElement* G, agx::UInt numBlocks, agx::UInt row, agx::GWriteState::Enum writeState ) override;
108  agx::UInt getViolation( agx::Real* g, agx::UInt row ) override;
109  agx::UInt getVelocity( agx::Real* v, agx::UInt row ) const override;
110  agx::UInt getBounds( agx::RangeReal* bounds, agx::UInt row, agx::Real h ) const override;
111  agx::Bool isImpacting() const override;
112 
113  void setAttachmentPair( const agx::AttachmentPair* ap ) override;
114 
115  protected:
116  virtual ~GenericElementaryConstraint();
117 
118  private:
119  GenericConstraintBodyData m_rb1Data;
120  GenericConstraintBodyData m_rb2Data;
121  GenericConstraintData m_constraintData;
122  const AttachmentPair* m_attachmentPair;
123  agx::Bool m_active;
124  };
125 }
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...
uint32_t UInt
Definition: Integer.h:34
Constraint attachment pair class.
Definition: Attachment.h:300
double Real
Definition: Real.h:42