AGX Dynamics  2.38.0.2
MergedBodySolverData.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 
20 
21 #include <agx/MergedBody.h>
22 
23 namespace agxSDK
24 {
25  class GeometryContactMergeSplitAlgorithm;
26  class ConstraintMergeSplitAlgorithm;
27 
32  {
33  public:
37  struct ForceFrame
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 
90  const BodyForceDataContainer& getForceData() const;
91 
95  const ForceDataVector* tryGetForceData( const agx::RigidBody* rb ) const;
96 
100  const agx::MergedBody* getMergedBody() const;
101 
108  agx::Bool calculateContactEdgeStrength( const agx::RigidBody* rb,
109  MergedBodySolverData::ForceFrame& contactStrength ) const;
110 
114  using ContactEdgeStrengthVisitor = std::function<void( ForceFrame, const agx::RigidBody* )>;
115 
120 
127  void traverseContactEdgeStrength( const agx::RigidBody* rb,
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 }
agxSDK::MergedBodySolverData::ForceData::graphNodeIndex
agx::UInt graphNodeIndex
Graph node index such that type = postSolveData.getType( graphNodeIndex ).
Definition: MergedBodySolverData.h:61
agxSDK::MergedBodySolverData::ForceFrame
Force frame where the resultant force is u + v + n.
Definition: MergedBodySolverData.h:37
agx::UIntVector
VectorPOD< UInt > UIntVector
Definition: agx_vector_types.h:104
agx::UInt
uint64_t UInt
Definition: Integer.h:27
agxSDK::MergedBodySolverData::getMergedBody
const agx::MergedBody * getMergedBody() const
Definition: MergedBodySolverData.h:137
agxSDK::MergeSplitPostSolveData
Definition: MergeSplitPostSolveData.h:37
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:51
agxSDK::MergedBodySolverData::ForceData
Object containing force and torque from a graph node.
Definition: MergedBodySolverData.h:47
agx::VectorPOD
Vector containing 'raw' data.
Definition: Vector.h:245
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
agxSDK::MergedBodySolverData::ContactEdgeStrengthVisitorPredicate
std::function< agx::Bool(const agx::RigidBody *)> ContactEdgeStrengthVisitorPredicate
Predicate to calculate force frame and visit ContactEdgeStrengthVisitor.
Definition: MergedBodySolverData.h:119
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxSDK::MergedBodySolverData::ForceData::ForceData
ForceData(agx::UInt graphNodeIndex, const agx::Vec3 &force, const agx::Vec3 &torque)
Definition: MergedBodySolverData.h:54
agxSDK::ConstraintMergeSplitAlgorithm
Definition: ConstraintMergeSplitAlgorithm.h:29
agxSDK::MergedBodySolverData::ForceData::torque
agx::Vec3 torque
Torque in world coordinates.
Definition: MergedBodySolverData.h:63
agxSDK::MergedBodySolverData::ForceData::ForceData
ForceData()
Definition: MergedBodySolverData.h:49
MergedBody.h
agx::LinearProbingHashTable
Inheritance with partial specialization due to bug with ref_ptr containers.
Definition: LinearProbingHashTable.h:926
agxSDK::GeometryContactMergeSplitAlgorithm
Definition: GeometryContactMergeSplitAlgorithm.h:28
agxSDK::MergedBodySolverData::ForceFrame::u
agx::Vec3 u
Force in u direction.
Definition: MergedBodySolverData.h:39
agx::Bool
bool Bool
Definition: Integer.h:40
agxSDK::MergedBodySolverData
Collection of external (active) interactions, interacting with merged rigid bodies.
Definition: MergedBodySolverData.h:31
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
agx::Vec3T< Real >
agxSDK::MergedBodySolverData::ContactEdgeStrengthVisitor
std::function< void(ForceFrame, const agx::RigidBody *)> ContactEdgeStrengthVisitor
Visitor callback where ForceFrame is edge strength in world coordinates and 'otherRb'.
Definition: MergedBodySolverData.h:114
agxSDK::MergedBodySolverData::ForceFrame::v
agx::Vec3 v
Force in v direction.
Definition: MergedBodySolverData.h:40
agx::InvalidIndex
const AGXCORE_EXPORT InvalidIndexStruct InvalidIndex
MergeSplitPostSolveData.h
agxSDK::MergedBodySolverData::ForceData::force
agx::Vec3 force
Force in world coordinates.
Definition: MergedBodySolverData.h:62
agx::MergedBody
Structure holding several "normal" rigid bodies.
Definition: MergedBody.h:55
agx::HashVector< const agx::RigidBody *, ForceDataVector >
agxSDK::MergedBodySolverData::ForceFrame::n
agx::Vec3 n
Force in n direction.
Definition: MergedBodySolverData.h:41