AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
CustomElementaryConstraints.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGX_CUSTOMELEMENTARYCONSTRAINTS_H
18#define AGX_CUSTOMELEMENTARYCONSTRAINTS_H
19
21
22namespace agx
23{
25 {
26 public:
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
32
33 void setImpactSpeed( Real impactSpeed );
34
36
38
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
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
agx::Real getAdhesiveOverlap() const
const agx::Vec3f & getV1() const
agx::Real getImpactSpeed() const
void setV1(const agx::Vec3f &v1)
virtual agx::UInt getViolation(agx::Real *g, agx::UInt row) override
Returns the violation of this elementary constraint.
void setV2(const agx::Vec3f &v2)
virtual ~ContactNormal()
agx::Real getDepth() const
const agx::Vec3f & getV2() const
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))
virtual agx::UInt getJacobian(agx::Jacobian6DOFElement *G, agx::UInt numBlocks, agx::UInt row, agx::GWriteState::Enum writeState) override
Returns the Jacobian of this elementary constraint.
void setImpactSpeed(Real impactSpeed)
void setAdhesiveOverlap(agx::Real adhesiveOverlap)
void setN(const agx::Vec3f &n)
void setDepth(agx::Real c)
const agx::Vec3f & getN() const
virtual ~ContactTangent()
const agx::Vec3f & getV2() const
virtual agx::UInt getViolation(agx::Real *g, agx::UInt row) override
Returns the violation of this elementary constraint.
virtual agx::UInt getVelocity(agx::Real *v, agx::UInt row) const override
Returns the velocity of this elementary constraint (extra, driving term on the right hand side).
agx::ContactTangent * set(const agx::Vec3f &dir, const agx::Vec3f &v1, const agx::Vec3f &v2, const agx::Vec3f &velocity)
const agx::Vec3f & getDirection() const
virtual agx::UInt getJacobian(agx::Jacobian6DOFElement *G, agx::UInt numBlocks, agx::UInt row, agx::GWriteState::Enum writeState) override
Returns the Jacobian of this elementary constraint.
const agx::Vec3f & getV1() const
Helper class to hold data that is general for elementary constraints.
Smart pointer for handling referenced counted objects.
Definition ref_ptr.h:30
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::ref_ptr< ContactNormal > ContactNormalRef
uint64_t UInt
Definition Integer.h:27
double Real
Definition Real.h:42
agx::ref_ptr< ContactTangent > ContactTangentRef