Momentum Scripting v1
Loading...
Searching...
No Matches
ContactPoint.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
15#ifndef MOMENTUM_CONTACTPOINT_H
16#define MOMENTUM_CONTACTPOINT_H
17
18#include "momentum_export.h"
19#include "momentum_namespace.h"
20
21#include "macros.h"
22#include "Vec3.h"
23
24#include <string>
25#include <vector>
26
27#ifndef SWIG
29namespace agxCollide
30{
31 class GeometryContact;
32}
34#endif
35
36namespace MOMENTUM_NAMESPACE
37{
38
39 class RigidBody;
40 class MaterialPair;
41 class ContactPoint;
42 class Joint;
43 V1_DECLARE_CONTAINER_TYPE(ContactPoint);
44
48 class MOMENTUM_EXPORT ContactPoint
49 {
50 public:
51#ifndef SWIG
53
56 ContactPoint(agxCollide::GeometryContact* contact, size_t index);
58
63
65#endif
66
71 std::shared_ptr<RigidBody> getBody1() const;
76 std::shared_ptr<RigidBody> getBody2() const;
77
82 std::shared_ptr<MaterialPair> getContactMaterial() const;
83
88 Vec3 getForce() const;
89
96
103
108 Vec3 getPoint() const;
109
114 double getDepth() const;
115
117 std::string __str__() const;
119
120
121 private:
122#ifndef SWIG
124 agxCollide::GeometryContact* m_contact;
126 size_t m_index;
127#endif
128 public:
135 static Vec3 calculateSumForce(const std::vector<std::shared_ptr<ContactPoint> >& points);
136
143 static Vec3 calculateSumNormalForce(const std::vector<std::shared_ptr<ContactPoint> >& points);
144
151 static Vec3 calculateSumFrictionForce(const std::vector<std::shared_ptr<ContactPoint> >& points);
152 };
153
154#ifdef SWIG
155 V1_DECLARE_CONTAINER_TYPE(ContactPoint);
156#endif
157
158
159} // namespace momentum
160
161
162#endif
A class describing a single contact point.
Definition: ContactPoint.h:49
Vec3 getForce() const
Get the 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.
ContactPoint()
Default constructor.
Vec3 getFrictionForce() const
Get the friction 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() const
Get the depth of the contact in meters, describing the size of the overlap.
static Vec3 calculateSumForce(const std::vector< std::shared_ptr< ContactPoint > > &points)
This static method will calculate the resulting sum of all Normal and Friction forces (in world coord...
Vec3 getPoint() const
Get the point of the contact in the world.
std::shared_ptr< RigidBody > getBody1() const
Get the first of the bodies in the contact.
static Vec3 calculateSumFrictionForce(const std::vector< std::shared_ptr< ContactPoint > > &points)
This static method will calculate the resulting sum of all Friction forces (in world coordinate syste...
ContactPoint(const ContactPoint &copy)
static Vec3 calculateSumNormalForce(const std::vector< std::shared_ptr< ContactPoint > > &points)
This static method will calculate the resulting sum of all Normal forces (in world coordinate system)...
std::shared_ptr< RigidBody > getBody2() const
Get the second of the bodies in the contact.
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