AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
IGenericConstraint.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. 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#pragma once
18
19#include <agx/Constraint.h>
20
21namespace agx
22{
23 class GenericConstraintComplianceMatrix;
24 class GenericConstraintImplementation;
25
27 {
28 public:
29#ifndef SWIG
30 static void onPreSolveCallback( const agxSDK::Simulation* simulation );
31 static void onPostSolveCallback( const agxSDK::Simulation* simulation );
32 static void onCleanup( const agxSDK::Simulation* simulation );
33#endif
34
35 public:
48 void setSupportComplianceMatrix( Bool enable, Bool isStaticSize = false );
49
57
66
74 Bool addChild( Constraint* constraint );
75
81 Bool removeChild( Constraint* constraint );
82
87
94
101
106
107 public:
109 virtual void addNotification() final override;
110 virtual void removeNotification() final override;
111
112 virtual void onAddNotification() = 0;
113 virtual void onRemoveNotification() = 0;
114
115 virtual bool onPreSolve() = 0;
116 virtual void onPostSolve() = 0;
117
118 virtual void updateComplianceMatrix( GenericConstraintComplianceMatrix* matrix ) = 0;
119
120 public:
121 int getNumDOF() const override;
122 void render( class agxRender::RenderManager* manager, float scale ) const override;
123
124 protected:
125 IGenericConstraint( GenericConstraintImplementation* implementation );
126
127 private:
128 ConstraintRefVector m_children;
129 };
130}
#define AGXPHYSICS_EXPORT
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:131
The base class for a constraint.
Definition: Constraint.h:89
Compliance matrix data containing the lower triangle (including the diagonal) of the compliance matri...
void setSupportComplianceMatrix(Bool enable, Bool isStaticSize=false)
Enable/disable updateComplianceMatrix callback with write access to the elements in the compliance ma...
Bool add(RigidBody *rb)
Register rigid body part of this many-body constraint.
GenericConstraintComplianceMatrix * getComplianceMatrix() const
If this constraint active rows doesn't vary and isStaticSize = true has been flagged when enabling su...
virtual void addNotification() final override
Called when added to a simulation.
Bool setRigidBodies(RigidBody *rb1, RigidBody *rb2)
Assign/update rigid bodies of this constraint.
static void onCleanup(const agxSDK::Simulation *simulation)
static void onPreSolveCallback(const agxSDK::Simulation *simulation)
Bool removeChild(Constraint *constraint)
Remove child constraint.
void removeAllBodies()
Removes all bodies previously added.
Bool remove(RigidBody *rb)
Remove rigid body from this many-body constraint.
static void onPostSolveCallback(const agxSDK::Simulation *simulation)
Bool addChild(Constraint *constraint)
Add child constraint (binary or many-body).
void removeAllChildren()
Removes all child constraints previously added.
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:49
Namespace containing classes for handling debug rendering of collision geometries,...
Definition: Constraint.h:36
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool Bool
Definition: Integer.h:40