AGX Dynamics 2.41.3.0
Loading...
Searching...
No Matches
MergedBodySolverData.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
20
21#include <agx/MergedBody.h>
22
23namespace agxSDK
24{
25 class GeometryContactMergeSplitAlgorithm;
26 class ConstraintMergeSplitAlgorithm;
27
32 {
33 public:
38 {
42 };
43
47 struct ForceData
48 {
50 : graphNodeIndex( agx::InvalidIndex )
51 {
52 }
53
54 ForceData( agx::UInt graphNodeIndex,
55 const agx::Vec3& force,
56 const agx::Vec3& torque )
57 : graphNodeIndex( graphNodeIndex ), force( force ), torque( torque )
58 {
59 }
60
64 };
65
66 public:
71
72 public:
77
81 void collectData( const agx::MergedBody* mergedBody,
82 const MergeSplitPostSolveData& data,
83 const GlobalGraphNodeIndexContainer* externalInteractions,
84 const GeometryContactMergeSplitAlgorithm* geometryContactAlgorithm,
85 const ConstraintMergeSplitAlgorithm* constraintAlgorithm );
86
91
96
100 const agx::MergedBody* getMergedBody() const;
101
109 MergedBodySolverData::ForceFrame& contactStrength ) const;
110
114 using ContactEdgeStrengthVisitor = std::function<void( ForceFrame, const agx::RigidBody* )>;
115
120
129 ContactEdgeStrengthVisitor visitor ) const;
130
131 private:
132 const agx::MergedBody* m_mergedBody;
134 BodyForceDataContainer m_bodyForceDataContainer;
135 };
136
138 {
139 return m_mergedBody;
140 }
141}
#define AGXPHYSICS_EXPORT
Collection of external (active) interactions, interacting with merged rigid bodies.
std::function< void(ForceFrame, const agx::RigidBody *)> ContactEdgeStrengthVisitor
Visitor callback where ForceFrame is edge strength in world coordinates and 'otherRb'.
const BodyForceDataContainer & getForceData() const
std::function< agx::Bool(const agx::RigidBody *)> ContactEdgeStrengthVisitorPredicate
Predicate to calculate force frame and visit ContactEdgeStrengthVisitor.
void collectData(const agx::MergedBody *mergedBody, const MergeSplitPostSolveData &data, const GlobalGraphNodeIndexContainer *externalInteractions, const GeometryContactMergeSplitAlgorithm *geometryContactAlgorithm, const ConstraintMergeSplitAlgorithm *constraintAlgorithm)
Collect data given sources.
void traverseContactEdgeStrength(const agx::RigidBody *rb, ContactEdgeStrengthVisitorPredicate pred, ContactEdgeStrengthVisitor visitor) const
Traverses all contact edges associated to rb where the visitor arguments are the edge strength and ot...
const ForceDataVector * tryGetForceData(const agx::RigidBody *rb) const
const agx::MergedBody * getMergedBody() const
agx::Bool calculateContactEdgeStrength(const agx::RigidBody *rb, MergedBodySolverData::ForceFrame &contactStrength) const
Calculates the total contact edge strength given merged rigid body.
MergedBodySolverData()
Default constructor.
Inheritance with partial specialization due to bug with ref_ptr containers.
Structure holding several "normal" rigid bodies.
Definition: MergedBody.h:56
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:52
Vector containing 'raw' data.
Definition: agx/Vector.h:246
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool Bool
Definition: Integer.h:40
uint64_t UInt
Definition: Integer.h:27
VectorPOD< UInt > UIntVector
Object containing force and torque from a graph node.
agx::Vec3 force
Force in world coordinates.
agx::Vec3 torque
Torque in world coordinates.
ForceData(agx::UInt graphNodeIndex, const agx::Vec3 &force, const agx::Vec3 &torque)
agx::UInt graphNodeIndex
Graph node index such that type = postSolveData.getType( graphNodeIndex ).
Force frame where the resultant force is u + v + n.