AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
AggregateContactUtils.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. 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 <agx/Plane.h>
20#include <agx/Vec3.h>
21#include <agx/Vector.h>
22#include <agx/Math.h>
23
24namespace agx
25{
26 class RigidBody;
27}
28
29
30namespace agxTerrain
31{
32 class Terrain;
33 class TerrainToolCollection;
34
46 {
47 public:
52
62 void updateContactDepth( const agx::Vec3& referencePoint,
63 const agx::Vec3& separationNormal,
64 const agx::Vec3Vector& contactPoints,
65 agx::Real cos_contactAngleThreshold );
66
71
75 bool hasContactHistory() const;
76
81
86
92
98
104
109 void setCurrentDepth( agx::Real currentDepth );
110
116 void setDepthDecayFactor(agx::Real depthDecayFactor);
117
123 void setDepthIncreaseFactor(agx::Real depthIncreaseFactor);
124
129 void setMaximumContactDepth( agx::Real maximumDepth );
130
137
142
147
151 void DEBUG_DRAW_DEPTH_METER( const agx::Vec3& meterDirection );
152
156 void DEBUG_DRAW_CONTACT_PLANE( const agx::Vec3Vector& contactPoints );
157
162
164 // Variables
166 private:
167 agx::Plane m_soilContactPlane;
168 agx::Vec3 m_previousReferencePoint;
169 agx::Real m_maximumContactDepth;
170 agx::Real m_contactDepthDecayFactor;
171 agx::Real m_contactDepthIncreaseFactor;
172 agx::Real m_currentDepth;
173 agx::Real m_contactArea;
174 bool m_hasContactHistory;
175
176 agx::Vec3Vector m_previousPoints;
177 agxRender::Color m_debugColor;
178 };
179
189 agx::Real soilAggregateMass,
190 agx::Real contactArea,
191 agx::Real frictionAngle );
192
199}
#define AGXTERRAIN_EXPORT
Utility color class with "common colors".
Definition Color.h:34
Class used to calculate the contact depth in the soil aggregate <-> terrain contacts to mimic an elas...
AggregateContactDepthModel()
Default constructor.
void trimPreviousContactPoints()
Trim the history of contact points.
void setMaximumContactDepth(agx::Real maximumDepth)
Set the maximum contact depth (m) in the model.
void setCurrentDepth(agx::Real currentDepth)
Update the current depth (m) of the model.
void resetContactHistory()
Reset the contact history by erasing the current depth, contact plane and previous contact points.
void DEBUG_DRAW_CONTACT_POINTS()
Debug draw contact history.
void DEBUG_DRAW_CONTACT_PLANE(const agx::Vec3Vector &contactPoints)
Debug the depth meter, illustrating how far the current depth is from the maximum depth.
void setDepthIncreaseFactor(agx::Real depthIncreaseFactor)
Set the depth increase factor of the model.
void DEBUG_DRAW_DEPTH_METER(const agx::Vec3 &meterDirection)
Debug the depth meter, illustrating how far the current depth is from the maximum depth.
void setDepthDecayFactor(agx::Real depthDecayFactor)
Set the depth decay factor of the model.
void updateContactDepth(const agx::Vec3 &referencePoint, const agx::Vec3 &separationNormal, const agx::Vec3Vector &contactPoints, agx::Real cos_contactAngleThreshold)
Update the depth in the model by using a reference contact point, separation normal of the excavation...
void setAggregateContactArea(agx::Real area)
Set the aggregate contact area (m3) in the model, spanned by the contact points in that interface.
void setDebugDrawColor(const agxRender::Color &color)
Set the color to use during debug rendering.
Collection of terrain tool (currently Shovel) related objects which are terrain instance specific.
Class representing the mathematical concept of a plane, also called a half- space.
Definition agx/Plane.h:32
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition Geometry.h:59
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...
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.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition Real.h:42