AGX Dynamics
2.37.3.2
GenericConstraint.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
#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
111
agx::Bool
setRigidBodies(
agx::RigidBody
* rb1,
agx::RigidBody
* rb2 );
112
113
public
:
117
virtual
void
onAddNotification();
118
122
virtual
void
onRemoveNotification();
123
130
virtual
agx::Bool
onPreSolve();
131
135
virtual
void
onPostSolve();
136
142
virtual
void
updateComplianceMatrix(
GenericConstraintComplianceMatrix
* matrix );
143
144
public
:
145
#ifndef SWIG
146
static
void
onPreSolveCallback(
const
agxSDK::Simulation
* simulation );
147
static
void
onPostSolveCallback(
const
agxSDK::Simulation
* simulation );
148
static
void
onCleanup(
const
agxSDK::Simulation
* simulation );
149
#endif
150
151
public
:
152
int
getNumDOF()
const override
;
153
void
render(
class
agxRender::RenderManager
* manager,
float
scale )
const override
;
154
155
protected
:
156
virtual
~
GenericConstraint
();
157
158
#ifndef SWIG
159
virtual
void
addNotification()
override
;
160
virtual
void
removeNotification()
override
;
161
#endif
162
};
163
172
class
AGXPHYSICS_EXPORT
GenericConstraintComplianceMatrix
:
public
agx::Referenced
173
{
174
public
:
180
GenericConstraintComplianceMatrix
(
UInt32
maxSize,
Bool
isStaticSize );
181
187
Real
get
(
UInt32
row,
UInt32
col )
const
;
188
194
void
set
(
UInt32
row,
UInt32
col,
Real
value );
195
199
UInt32
size()
const
;
200
206
void
reset(
UInt32
size );
207
211
const
UInt32Vector
& getDiagonalUpdates()
const
;
212
216
Bool
isStaticSize()
const
;
217
218
protected
:
222
virtual
~
GenericConstraintComplianceMatrix
();
223
224
private
:
228
UInt32
calculateIndex(
UInt32
row,
UInt32
col )
const
;
229
233
UInt32
arraySize()
const
;
234
235
private
:
236
RealVector
m_data;
237
UInt32
m_size
;
238
UInt32
m_maxSize;
239
Bool
m_isStaticSize;
240
UInt32Vector
m_diagonalUpdates;
241
};
242
243
using
GenericConstraintComplianceMatrixRef
=
agx::ref_ptr<GenericConstraintComplianceMatrix>
;
244
}
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:88
agxRender::RenderManager
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc...
Definition:
RenderManager.h:106
agx::Referenced
Base class providing referencing counted objects.
Definition:
Referenced.h:119
GenericConstraintData.h
agx::VectorPOD< UInt32 >
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition:
AddedMassInteraction.h:22
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:54
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:126
agx::GenericConstraintComplianceMatrix
Compliance matrix data containing the lower triangle (including the diagonal) of the compliance matri...
Definition:
GenericConstraint.h:172
agx::Real
double Real
Definition:
Real.h:42
agx::UInt32
uint32_t UInt32
Definition:
Integer.h:40
include
agx
GenericConstraint.h
Generated on Fri Apr 12 2024 12:40:22 for AGX Dynamics by
1.8.13