AGX Dynamics  2.37.3.2
CustomElementaryConstraints.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 #ifndef AGX_CUSTOMELEMENTARYCONSTRAINTS_H
18 #define AGX_CUSTOMELEMENTARYCONSTRAINTS_H
19 
21 
22 namespace agx
23 {
25  {
26  public:
27  ContactNormal();
28 
29  agx::ContactNormal* set( const agx::Vec3f& n, const agx::Vec3f& v1, const agx::Vec3f& v2, agx::Real c, agx::Real impactSpeed, agx::Real restitution, agx::Real impactCondition = agx::Real( -0.5 ), agx::Real adhesiveOverlap = agx::Real( 0 ) );
30 
31  agx::Real getImpactSpeed() const;
32 
33  void setImpactSpeed( Real impactSpeed );
34 
35  agx::Real getDepth() const;
36 
37  void setDepth( agx::Real c );
38 
39  agx::Real getAdhesiveOverlap() const;
40 
41  void setAdhesiveOverlap( agx::Real adhesiveOverlap );
42 
43  const agx::Vec3f& getV1() const;
44 
45  void setV1( const agx::Vec3f& v1 );
46 
47  const agx::Vec3f& getV2() const;
48 
49  void setV2( const agx::Vec3f& v2 );
50 
51  const agx::Vec3f& getN() const;
52 
53  void setN( const agx::Vec3f& n );
54 
56 
57  protected:
58  virtual ~ContactNormal();
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  protected:
70  };
71 
73 
75  {
76  public:
78 
79  agx::ContactTangent* set( const agx::Vec3f& dir, const agx::Vec3f& v1, const agx::Vec3f& v2, const agx::Vec3f& velocity );
80 
81  const agx::Vec3f& getDirection() const;
82 
83  const agx::Vec3f& getV1() const;
84 
85  const agx::Vec3f& getV2() const;
86 
88 
89  protected:
90  virtual ~ContactTangent();
91 
92  virtual agx::UInt getJacobian( agx::Jacobian6DOFElement* G, agx::UInt numBlocks, agx::UInt row, agx::GWriteState::Enum writeState ) override;
93  virtual agx::UInt getViolation( agx::Real* g, agx::UInt row ) override;
94  virtual agx::UInt getVelocity( agx::Real* v, agx::UInt row ) const override;
95 
96  protected:
101  };
102 
104 }
105 
106 #endif
agx::ref_ptr< ContactNormal > ContactNormalRef
agx::ref_ptr< ContactTangent > ContactTangentRef
Helper class to hold data that is general for elementary constraints.
#define AGXPHYSICS_EXPORT
uint32_t UInt
Definition: Integer.h:34
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
#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
double Real
Definition: Real.h:42