Momentum Scripting v1
Loading...
Searching...
No Matches
GranularContacts.h
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 without having a written signed agreement with Algoryx Simulation AB.
9
10Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
11from using this software, unless otherwise stated in written agreements with
12Algoryx Simulation AB.
13*/
14#ifndef MOMENTUM_GRANULARCONTACTS_H
15#define MOMENTUM_GRANULARCONTACTS_H
16
17#include "momentum_namespace.h"
18#include "momentum_export.h"
19#include <memory>
20
21#include <agx/Physics/ParticlePairContactEntity.h>
22#include <agx/Physics/ParticleGeometryContactEntity.h>
23
24#include "Vec3.h"
25
26#ifndef SWIG
28namespace agxSDK
29{
30 class Simulation;
31}
33#endif
34
35namespace MOMENTUM_NAMESPACE
36{
37 class RigidBody;
38 class GranularBody;
39 class MaterialPair;
40
44 class MOMENTUM_EXPORT GranularGranularContact
45 {
46 public:
47#ifndef SWIG
51 GranularGranularContact(agx::Physics::ParticlePairContactPtr, agxSDK::Simulation*);
52
57#endif
58
63 std::shared_ptr<GranularBody> getGranularBody1() const;
64
69 std::shared_ptr<GranularBody> getGranularBody2() const;
70
75 Vec3 getForce() const;
76
83
90
95 Vec3 getPoint() const;
96
101 double getDepth();
102
108
113
117 bool isImpacting() const;
118
123 std::shared_ptr<MaterialPair> getContactMaterial() const;
124
125 protected:
126 private:
127#ifndef SWIG
129 agx::Physics::ParticlePairContactPtr m_granularContactPtr;
130 agxSDK::Simulation* m_simulation;
132#endif
133 };
134
135 V1_DECLARE_CONTAINER_TYPE(GranularGranularContact);
136
140 class MOMENTUM_EXPORT GranularRigidBodyContact
141 {
142 public:
143#ifndef SWIG
147 GranularRigidBodyContact(agx::Physics::ParticleGeometryContactPtr, agxSDK::Simulation*);
148
153#endif
154
159 std::shared_ptr<RigidBody> getRigidBody() const;
160
165 std::shared_ptr<GranularBody> getGranularBody() const;
166
171 Vec3 getPoint() const;
172
177 double getDepth();
178
184
189 Vec3 getForce() const;
190
197
204
209
213 bool isImpacting() const;
214
219 std::shared_ptr<MaterialPair> getContactMaterial() const;
220
221 protected:
222 private:
223#ifndef SWIG
225 agx::Physics::ParticleGeometryContactPtr m_granularContactPtr;
226 agxSDK::Simulation* m_simulation;
228#endif
229 };
230
231 V1_DECLARE_CONTAINER_TYPE(GranularRigidBodyContact);
232}
233#endif
A class describing a contact point between two GranularBodies.
Definition: GranularContacts.h:45
double getNormalImpactForceMagnitude() const
Returns the magnitude of the normal impact force if the contact is impacting.
bool isImpacting() const
Returns true/false if the contact is impacting.
std::shared_ptr< GranularBody > getGranularBody2() const
Get the second GranularBody in the contact.
Vec3 getPoint() const
Get the point of the contact in the world.
double getDepth()
Get the depth of the contact in meters, describing the size of the overlap.
Vec3 getNormalForce() const
Get the normal force that this contact applies to its bodies in Newton.
Vec3 getForce() const
Get the force that this contact applies to its bodies in Newton.
GranularGranularContact(agx::Physics::ParticlePairContactPtr, agxSDK::Simulation *)
Create a wrapper around an agx::Physics::GranularBodyPtr.
std::shared_ptr< MaterialPair > getContactMaterial() const
Get the contact material that the collision is using.
std::shared_ptr< GranularBody > getGranularBody1() const
Get the first GranularBody in the contact.
Vec3 getNormal() const
Get the normal of this contact.
Vec3 getFrictionalForce() const
Get the tangential force that this contact applies to its bodies in Newton.
A class describing a contact point between a GranularBody and a RigidBody.
Definition: GranularContacts.h:141
Vec3 getNormal() const
Get the normal of this contact.
double getNormalImpactForceMagnitude() const
Returns the magnitude of the normal impact force if the contact is impacting.
Vec3 getForce() const
Get the force that this contact applies to its bodies in Newton.
std::shared_ptr< MaterialPair > getContactMaterial() const
Get the contact material that the collision is using.
double getDepth()
Get the depth of the contact in meters, describing the size of the overlap.
Vec3 getPoint() const
Get the point of the contact in the world.
std::shared_ptr< GranularBody > getGranularBody() const
Get the GranularBody in the contact.
bool isImpacting() const
Returns true/false if the contact is impacting.
Vec3 getFrictionalForce() const
Get the tangential force that this contact applies to its bodies in Newton.
Vec3 getNormalForce() const
Get the normal that this contact applies to its bodies in Newton.
std::shared_ptr< RigidBody > getRigidBody() const
Get the Rigid Body in the contact.
GranularRigidBodyContact(agx::Physics::ParticleGeometryContactPtr, agxSDK::Simulation *)
Create a wrapper around an agx::Physics::GranularBodyPtr.
A 3 dimensional vector which can be used to define a point or a vector and contains basic arithmetic.
Definition: Vec3.h:40
Namespace for Momentum Scripting API.
Definition: AffineMatrix4x4.h:29
Definition: SceneGraph.h:29