AGXDynamics
2.35.0.3
CustomElementaryConstraints.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
#ifndef AGX_CUSTOMELEMENTARYCONSTRAINTS_H
18
#define AGX_CUSTOMELEMENTARYCONSTRAINTS_H
19
20
#include <
agx/ElementaryConstraint.h
>
21
22
namespace
agx
23
{
24
class
AGXPHYSICS_EXPORT
ContactNormal
:
public
ElementaryConstraintN
< 1 >
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
55
AGXSTREAM_DECLARE_SERIALIZABLE
(
agx::ContactNormal
);
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
:
64
agx::Vec3f
m_n
;
65
agx::Vec3f
m_v1
;
66
agx::Vec3f
m_v2
;
67
agx::Real
m_c
;
68
agx::Real
m_impactSpeed
;
69
agx::Real
m_adhesiveOverlap
;
70
};
71
72
typedef
agx::ref_ptr< ContactNormal >
ContactNormalRef
;
73
74
class
AGXPHYSICS_EXPORT
ContactTangent
:
public
ElementaryConstraintN
< 1 >
75
{
76
public
:
77
ContactTangent
();
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
87
AGXSTREAM_DECLARE_SERIALIZABLE
(
agx::ContactTangent
);
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
:
97
agx::Vec3f
m_dir
;
98
agx::Vec3f
m_v1
;
99
agx::Vec3f
m_v2
;
100
agx::Vec3f
m_velocity
;
101
};
102
103
typedef
agx::ref_ptr< ContactTangent >
ContactTangentRef
;
104
}
105
106
#endif
agx::ContactNormal::m_c
agx::Real m_c
Definition:
CustomElementaryConstraints.h:67
agx::Real
double Real
Definition:
Real.h:42
agx::Jacobian6DOFElementT
Definition:
Jacobian.h:104
agx::ContactTangent
Definition:
CustomElementaryConstraints.h:74
agx::ContactTangent::m_velocity
agx::Vec3f m_velocity
Definition:
CustomElementaryConstraints.h:100
agx::ContactNormalRef
agx::ref_ptr< ContactNormal > ContactNormalRef
Definition:
CustomElementaryConstraints.h:72
agx::ContactNormal::m_v2
agx::Vec3f m_v2
Definition:
CustomElementaryConstraints.h:66
agx::ContactTangent::m_dir
agx::Vec3f m_dir
Definition:
CustomElementaryConstraints.h:97
agx::ContactTangent::m_v1
agx::Vec3f m_v1
Definition:
CustomElementaryConstraints.h:98
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::ref_ptr
Smart pointer for handling referenced counted objects.
Definition:
ref_ptr.h:29
agx::ContactTangent::m_v2
agx::Vec3f m_v2
Definition:
CustomElementaryConstraints.h:99
agx::ContactNormal::m_v1
agx::Vec3f m_v1
Definition:
CustomElementaryConstraints.h:65
agx::ContactTangentRef
agx::ref_ptr< ContactTangent > ContactTangentRef
Definition:
CustomElementaryConstraints.h:103
agx::ElementaryConstraintN
Helper class to hold data that is general for elementary constraints.
Definition:
ElementaryConstraint.h:368
agx::ContactNormal::m_n
agx::Vec3f m_n
Definition:
CustomElementaryConstraints.h:64
ElementaryConstraint.h
agx::UInt
uint32_t UInt
Definition:
Integer.h:34
agx::ContactNormal::m_impactSpeed
agx::Real m_impactSpeed
Definition:
CustomElementaryConstraints.h:68
agx::Vec3T< Real32 >
agx::ContactNormal
Definition:
CustomElementaryConstraints.h:24
agx::ContactNormal::m_adhesiveOverlap
agx::Real m_adhesiveOverlap
Definition:
CustomElementaryConstraints.h:69
include
agx
CustomElementaryConstraints.h
Generated on Fri Feb 10 2023 14:06:09 for AGXDynamics by
1.8.17