AGX Dynamics  2.37.3.2
ContactForceReader.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 #ifndef AGX_CONTACT_FORCE_READER_H
18 #define AGX_CONTACT_FORCE_READER_H
19 
20 #include <agx/agx.h>
21 #include <agx/Referenced.h>
22 #include <agx/agxPhysics_export.h>
23 #include <agxSDK/Simulation.h>
24 
25 namespace agx
26 {
34  {
35  public:
37  {
38  IMPACT = (1 << 0),
39  RESTING = (1 << 1),
40  IMPACT_AND_RESTING = (IMPACT & RESTING)
41  };
42 
44 
52  Vec3 getContactForces(
53  const agx::RigidBody* body1, const agx::RigidBody* body2 = nullptr, ContactType type = IMPACT_AND_RESTING);
54 
62  Vec3 getContactForces(
63  const agx::RigidBody* body, const agxCollide::Geometry* geometry, ContactType type = IMPACT_AND_RESTING);
64 
72  Vec3 getContactForces(
73  const agxCollide::Geometry* geometry1, const agxCollide::Geometry* geometry2 = nullptr,
74  ContactType type = IMPACT_AND_RESTING);
75 
83  Vec3 getNormalContactForces(
84  const agx::RigidBody* body1, const agx::RigidBody* body2 = nullptr, ContactType type = IMPACT_AND_RESTING);
85 
93  Vec3 getNormalContactForces(
94  const agx::RigidBody* body, const agxCollide::Geometry* geometry, ContactType type = IMPACT_AND_RESTING);
95 
103  Vec3 getNormalContactForces(
104  const agxCollide::Geometry* geometry1, const agxCollide::Geometry* geometry2 = nullptr,
105  ContactType type = IMPACT_AND_RESTING);
106 
114  Vec3 getTangentialContactForces(
115  const agx::RigidBody* body1, const agx::RigidBody* body2 = nullptr, ContactType type = IMPACT_AND_RESTING);
116 
124  Vec3 getTangentialContactForces(
125  const agx::RigidBody* body, const agxCollide::Geometry* geometry, ContactType type = IMPACT_AND_RESTING);
126 
134  Vec3 getTangentialContactForces(
135  const agxCollide::Geometry* geometry1, const agxCollide::Geometry* geometry2 = nullptr,
136  ContactType type = IMPACT_AND_RESTING);
137 
145  Vec3 getSumAbsoluteContactForces(
146  const agx::RigidBody* body1, const agx::RigidBody* body2 = nullptr, ContactType type = IMPACT_AND_RESTING);
147 
155  Vec3 getSumAbsoluteContactForces(
156  const agx::RigidBody* body, const agxCollide::Geometry* geometry, ContactType type = IMPACT_AND_RESTING);
157 
165  Vec3 getSumAbsoluteContactForces(
166  const agxCollide::Geometry* geometry1, const agxCollide::Geometry* geometry2 = nullptr,
167  ContactType type = IMPACT_AND_RESTING);
168 
176  Vec3 getSumAbsoluteNormalContactForces(
177  const agx::RigidBody* body1, const agx::RigidBody* body2 = nullptr, ContactType type = IMPACT_AND_RESTING);
178 
186  Vec3 getSumAbsoluteNormalContactForces(
187  const agx::RigidBody* body, const agxCollide::Geometry* geometry, ContactType type = IMPACT_AND_RESTING);
188 
196  Vec3 getSumAbsoluteNormalContactForces(
197  const agxCollide::Geometry* geometry1, const agxCollide::Geometry* geometry2 = nullptr,
198  ContactType type = IMPACT_AND_RESTING);
199 
207  Vec3 getSumAbsoluteTangentialContactForces(
208  const agx::RigidBody* body1, const agx::RigidBody* body2 = nullptr, ContactType type = IMPACT_AND_RESTING);
209 
217  Vec3 getSumAbsoluteTangentialContactForces(
218  const agx::RigidBody* body, const agxCollide::Geometry* geometry, ContactType type = IMPACT_AND_RESTING);
219 
227  Vec3 getSumAbsoluteTangentialContactForces(
228  const agxCollide::Geometry* geometry1, const agxCollide::Geometry* geometry2 = nullptr,
229  ContactType type = IMPACT_AND_RESTING);
230 
232  void setSimulation(agxSDK::Simulation* simulation);
233 
234  private:
236  };
237 
239 
240 } // namespace agx
241 
242 #endif
#define AGXPHYSICS_EXPORT
Base class providing referencing counted objects.
Definition: Referenced.h:119
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
ref_ptr< ContactForceReader > ContactForceReaderRef
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
#define CALLABLE
Definition: Object.h:73
Class for reading contact forces between rigid bodies and geometries.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126