AGXDynamics
2.31.1.0
GenericConstraint.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
19
#include <
agx/Constraint.h
>
20
#include <
agx/GenericConstraintData.h
>
21
22
namespace
agx
23
{
24
class
GenericConstraintComplianceMatrix;
25
53
class
AGXPHYSICS_EXPORT
GenericConstraint
:
public
agx::Constraint
54
{
55
public
:
62
GenericConstraint
(
agx::RigidBody
* rb1 );
63
71
GenericConstraint
(
agx::RigidBody
* rb1,
agx::RigidBody
* rb2 );
72
80
GenericConstraint
(
agx::RigidBody
* rb1,
agx::Frame
* f1,
agx::RigidBody
* rb2,
agx::Frame
* f2 );
81
94
void
setSupportComplianceMatrix(
agx::Bool
enable,
agx::Bool
isStaticSize =
false
);
95
102
GenericConstraintComplianceMatrix
* getComplianceMatrix()
const
;
103
104
public
:
108
virtual
void
onAddNotification();
109
113
virtual
void
onRemoveNotification();
114
121
virtual
agx::Bool
onPreSolve();
122
126
virtual
void
onPostSolve();
127
133
virtual
void
updateComplianceMatrix(
GenericConstraintComplianceMatrix
* matrix );
134
135
public
:
136
#ifndef SWIG
137
static
void
onPreSolveCallback(
const
agxSDK::Simulation
* simulation );
138
static
void
onPostSolveCallback(
const
agxSDK::Simulation
* simulation );
139
static
void
onCleanup(
const
agxSDK::Simulation
* simulation );
140
#endif
141
142
public
:
143
int
getNumDOF()
const override
;
144
void
render(
class
agxRender::RenderManager
* manager,
float
scale )
const override
;
145
146
protected
:
147
virtual
~
GenericConstraint
();
148
149
#ifndef SWIG
150
virtual
void
addNotification()
override
;
151
virtual
void
removeNotification()
override
;
152
#endif
153
};
154
163
class
AGXPHYSICS_EXPORT
GenericConstraintComplianceMatrix
:
public
agx::Referenced
164
{
165
public
:
171
GenericConstraintComplianceMatrix
(
UInt32
maxSize,
Bool
isStaticSize );
172
178
Real
get
(
UInt32
row,
UInt32
col )
const
;
179
185
void
set
(
UInt32
row,
UInt32
col,
Real
value );
186
190
UInt32
size()
const
;
191
197
void
reset(
UInt32
size );
198
202
const
UInt32Vector
& getDiagonalUpdates()
const
;
203
207
Bool
isStaticSize()
const
;
208
209
protected
:
213
virtual
~
GenericConstraintComplianceMatrix
();
214
215
private
:
219
UInt32
calculateIndex(
UInt32
row,
UInt32
col )
const
;
220
224
UInt32
arraySize()
const
;
225
226
private
:
227
RealVector
m_data;
228
UInt32
m_size
;
229
UInt32
m_maxSize;
230
Bool
m_isStaticSize;
231
UInt32Vector
m_diagonalUpdates;
232
};
233
234
using
GenericConstraintComplianceMatrixRef
=
agx::ref_ptr<GenericConstraintComplianceMatrix>
;
235
}
agx::Bool
bool Bool
Definition:
Integer.h:48
m_size
#define m_size
Definition:
Vector.h:429
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agx::Constraint
The base class for a constraint.
Definition:
Constraint.h:86
agxRender::RenderManager
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc...
Definition:
RenderManager.h:110
agx::Referenced
Base class providing referencing counted objects.
Definition:
Referenced.h:113
GenericConstraintData.h
agx::VectorPOD< UInt32 >
agx
Namespace agx contains the dynamics/math part of the AGX Dynamics API.
Definition:
AckermannSteering.h:21
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition:
ref_ptr.h:29
Constraint.h
agx::GenericConstraint
Generic constraint which by default is empty of elementary constraints.
Definition:
GenericConstraint.h:53
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition:
RigidBody.h:52
agx::Frame
The object defining a frame of reference and providing transformations operations.
Definition:
Frame.h:67
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition:
Simulation.h:121
agx::GenericConstraintComplianceMatrix
Compliance matrix data containing the lower triangle (including the diagonal) of the compliance matri...
Definition:
GenericConstraint.h:163
agx::Real
double Real
Definition:
Real.h:42
agx::UInt32
uint32_t UInt32
Definition:
Integer.h:40
include
agx
GenericConstraint.h
Generated on Thu Jan 13 2022 19:49:29 for AGXDynamics by
1.8.13