AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
TerrainContact.h
Go to the documentation of this file.
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 unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agxTerrain/export.h>
20#include <agx/Referenced.h>
21#include <agxCollide/Geometry.h>
22#include <agx/HashTable.h>
23
24namespace agxTerrain
25{
26 class TerrainContactGenerator;
28
31
41 {
42 public:
47 struct SurfaceForce {
50 };
51
53
54 public:
55
61
67
73
81
87
93
99
104 agx::Real getSurfaceStressInIndex(const agx::Vec2i& terrainIndex) const;
105
112
117
123
130
131 public:
132 // Internal, but public methods
133
140
147 const TerrainIndexToDepthTable terrainIndicesToDepth,
148 const agx::Real area,
149 const agx::Real meanGridDepth,
150 const agx::Real currentContactTime,
151 const agx::Bound3 contactBound);
152
159 void setSurfaceStress(agx::Real surfaceStress);
160
167 void setSurfaceForce(agx::Real surfaceForce);
168
176
184
185 protected:
190
191 public:
193
194 private:
195 const agxCollide::Geometry* m_geometry;
196 TerrainIndexToDepthTable m_terrainIndicesToDepth;
197 agx::Real m_area;
198 agx::Real m_meanGridDepth;
199 agx::Real m_currentContactTime;
200 agx::Bound3 m_contactBound;
201 agx::Real m_surfaceStress;
202 agx::Real m_surfaceForce;
203 SurfaceForceVector m_pointForces;
204 };
205}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXTERRAIN_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
Class that contains information about a terrain contact between an external object and the terrain ge...
agx::Vec3 getContactMidPoint() const
agx::Vector< SurfaceForce > SurfaceForceVector
agx::Real getMaxSurfaceForce() const
Get the maximum force of the Terrain contact from the associated contact points.
agx::Real getMeanGridDepth() const
Get the mean depth of the intersected grid points in the TerrainContact.
const SurfaceForceVector & getSurfacePointForces() const
Get the surface point forces active in the Terrain contact.
agx::Real getArea() const
Get the contact area.
void setContactArea(agx::Real area)
Internal method.
TerrainContact(const agxCollide::Geometry *geometry, const TerrainIndexToDepthTable terrainIndicesToDepth, const agx::Real area, const agx::Real meanGridDepth, const agx::Real currentContactTime, const agx::Bound3 contactBound)
Internal method.
agx::Real getSurfaceForce() const
Get the total surface force of the Terrain contact from all the contact points.
const TerrainIndexToDepthTable & getDepthTable() const
Get the table which holds information about the contact depth at each terrain index in the contact ar...
virtual ~TerrainContact()
Reference counted object - protected destructor.
TerrainContact()
Internal method.
agx::Real calculateTotalForce() const
agx::Real getSurfaceStressInIndex(const agx::Vec2i &terrainIndex) const
Get the specific contact stress in a terrain index in the contact by scaling the average stress with ...
agx::Real getSurfaceStress() const
Get the average surface stress of the contact which is calculated using the approximated contact area...
const agxCollide::Geometry * getGeometry() const
Get the geometry colliding with the terrain.
agx::Real getCurrentContactTime() const
Get the time that the colliding geometry has been in contact with the terrain.
void setSurfaceForce(agx::Real surfaceForce)
Internal method.
void setSurfaceStress(agx::Real surfaceStress)
Internal method.
void setSurfacePointForces(const SurfaceForceVector &pointForces)
Internal method.
agx::Bound3 getContactBound() const
The 3D bound spanned by the contact points of the colliding geometry.
Inheritance with partial specialization due to bug with ref_ptr containers.
Base class providing referencing counted objects.
Definition: Referenced.h:120
Templated vector class.
Definition: agx/Vector.h:53
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition: Geometry.h:59
agx::HashTable< agx::Vec2i, agx::Real > TerrainIndexToDepthTable
double Real
Definition: Real.h:41
Struct holding information about a surface force of the Terrain contact.