AGXDynamics  2.35.0.2
AggregateContactUtils.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 #pragma once
18 
19 #include <agx/Plane.h>
20 #include <agx/Vec3.h>
21 #include <agx/Vector.h>
22 
23 namespace agx
24 {
25  class RigidBody;
26 }
27 
28 
29 namespace agxTerrain
30 {
31  class Terrain;
32  class TerrainToolCollection;
33 
45  {
46  public:
51 
61  void updateContactDepth( const agx::Vec3& referencePoint,
62  const agx::Vec3& separationNormal,
63  const agx::Vec3Vector& contactPoints,
64  agx::Real cos_contactAngleThreshold );
65 
69  void resetContactHistory();
70 
74  bool hasContactHistory() const;
75 
79  agx::Real getCurrentDepth() const;
80 
84  agx::Real getMaximumContactDepth() const;
85 
90  agx::Real getDepthDecayFactor() const;
91 
96  agx::Real getDepthIncreaseFactor() const;
97 
102  agx::Real getAggregateContactArea() const;
103 
108  void setCurrentDepth( agx::Real currentDepth );
109 
115  void setDepthDecayFactor(agx::Real depthDecayFactor);
116 
122  void setDepthIncreaseFactor(agx::Real depthIncreaseFactor);
123 
128  void setMaximumContactDepth( agx::Real maximumDepth );
129 
135  void setAggregateContactArea(agx::Real area);
136 
140  void setDebugDrawColor(const agxRender::Color& color);
141 
145  void DEBUG_DRAW_CONTACT_POINTS();
146 
150  void DEBUG_DRAW_DEPTH_METER( const agx::Vec3& meterDirection );
151 
155  void DEBUG_DRAW_CONTACT_PLANE( const agx::Vec3Vector& contactPoints );
156 
160  void trimPreviousContactPoints();
161 
163  // Variables
165  private:
166  agx::Plane m_soilContactPlane;
167  agx::Vec3 m_previousReferencePoint;
168  agx::Real m_maximumContactDepth;
169  agx::Real m_contactDepthDecayFactor;
170  agx::Real m_contactDepthIncreaseFactor;
171  agx::Real m_currentDepth;
172  agx::Real m_contactArea;
173  bool m_hasContactHistory;
174 
175  agx::Vec3Vector m_previousPoints;
176  agxRender::Color m_debugColor;
177  };
178 
188  agx::Real soilAggregateMass,
189  agx::Real contactArea,
190  agx::Real frictionAngle );
191 
198 }
agx::Real
double Real
Definition: Real.h:42
Vector.h
agxTerrain::AggregateContactDepthModel
Class used to calculate the contact depth in the soil aggregate <-> terrain contacts to mimic an elas...
Definition: AggregateContactUtils.h:44
agxTerrain
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition: Geometry.h:59
agx::VectorPOD< Vec3 >
Plane.h
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
agx::PlaneT
Class representing the mathematical concept of a plane, also called a half- space.
Definition: Plane.h:31
agxTerrain::estimateMaximumAggregateForce
agx::Real AGXTERRAIN_EXPORT estimateMaximumAggregateForce(const TerrainToolCollection *collection, agx::Real soilAggregateMass, agx::Real contactArea, agx::Real frictionAngle)
Estimate the maximum force that can be generated from a soil aggregate in the contact between the agg...
agxRender::Color
Utility color class with "common colors".
Definition: Color.h:33
Vec3.h
AGXTERRAIN_EXPORT
#define AGXTERRAIN_EXPORT
Definition: agxTerrain/export.h:41
agxTerrain::calculateContactReferencePoint
agx::Vec3 AGXTERRAIN_EXPORT calculateContactReferencePoint(const agx::Vec3Vector &contactPoints)
Calculates the reference point that will be used in the contact model from specified contact points.
agxTerrain::TerrainToolCollection
Collection of terrain tool (currently Shovel) related objects which are terrain instance specific.
Definition: TerrainToolCollection.h:35
agx::Vec3T< Real >