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
47 class MOMENTUM_EXPORT ContactPoint
48 {
49 public:
50#ifndef SWIG
52
55 ContactPoint(agxCollide::GeometryContact* contact, size_t index);
57
62
64#endif
65
70 std::shared_ptr<RigidBody> getBody1() const;
75 std::shared_ptr<RigidBody> getBody2() const;
76
81 std::shared_ptr<MaterialPair> getContactMaterial() const;
82
87 Vec3 getForce() const;
88
95
102
107 Vec3 getPoint() const;
108
113 double getDepth() const;
114
116 std::string __str__() const;
118
119
120 private:
121#ifndef SWIG
123 agxCollide::GeometryContact* m_contact;
125 size_t m_index;
126#endif
127 public:
134 static Vec3 calculateSumForce(const std::vector<std::shared_ptr<ContactPoint> >& points);
135
142 static Vec3 calculateSumNormalForce(const std::vector<std::shared_ptr<ContactPoint> >& points);
143
150 static Vec3 calculateSumFrictionForce(const std::vector<std::shared_ptr<ContactPoint> >& points);
151 };
152
153 V1_DECLARE_CONTAINER_TYPE( ContactPoint );
154
155} // namespace momentum
156
157
158#endif
A class describing a single contact point.
Definition: ContactPoint.h:48
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