AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxTerrain::TerrainContact Class Reference

Class that contains information about a terrain contact between an external object and the terrain geometry. More...

#include <TerrainContact.h>

+ Inheritance diagram for agxTerrain::TerrainContact:

Classes

struct  SurfaceForce
 Struct holding information about a surface force of the Terrain contact. More...
 

Public Types

typedef agx::Vector< SurfaceForce > SurfaceForceVector
 

Public Member Functions

 TerrainContact ()
 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 calculateTotalForce () const
 
agx::Real getArea () const
 Get the contact area.
 
agx::Bound3 getContactBound () const
 The 3D bound spanned by the contact points of the colliding geometry.
 
agx::Vec3 getContactMidPoint () const
 
agx::Real getCurrentContactTime () const
 Get the time that the colliding geometry has been in contact with the terrain.
 
const TerrainIndexToDepthTable & getDepthTable () const
 Get the table which holds information about the contact depth at each terrain index in the contact area.
 
const agxCollide::Geometry * getGeometry () const
 Get the geometry colliding with the terrain.
 
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.
 
agx::Real getSurfaceForce () const
 Get the total surface force of the Terrain contact from all the contact points.
 
const SurfaceForceVector & getSurfacePointForces () const
 Get the surface point forces active in the Terrain contact.
 
agx::Real getSurfaceStress () const
 Get the average surface stress of the contact which is calculated using the approximated contact area and the total surface force of the contact.
 
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 the depth in the specific index.
 
void setContactArea (agx::Real area)
 Internal method.
 
void setSurfaceForce (agx::Real surfaceForce)
 Internal method.
 
void setSurfacePointForces (const SurfaceForceVector &pointForces)
 Internal method.
 
void setSurfaceStress (agx::Real surfaceStress)
 Internal method.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 

Protected Member Functions

virtual ~TerrainContact ()
 Reference counted object - protected destructor.
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Class that contains information about a terrain contact between an external object and the terrain geometry.

The contact contains an estimated area calculated from grid points intersecting the colliding geometry as well as mean stress calculated from estimated area and contact forces. Stress distribution can also be estimated by scaling the surface stress with the depth in each grid point.

This data container is used primarily in soil compaction calculation.

Definition at line 40 of file TerrainContact.h.

Member Typedef Documentation

◆ SurfaceForceVector

Constructor & Destructor Documentation

◆ TerrainContact() [1/2]

agxTerrain::TerrainContact::TerrainContact ( )

Internal method.

Default constructor

◆ TerrainContact() [2/2]

agxTerrain::TerrainContact::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.

Construct a Terrain contact with specified arguments.

◆ ~TerrainContact()

virtual agxTerrain::TerrainContact::~TerrainContact ( )
protectedvirtual

Reference counted object - protected destructor.

Member Function Documentation

◆ calculateTotalForce()

agx::Real agxTerrain::TerrainContact::calculateTotalForce ( ) const

◆ getArea()

agx::Real agxTerrain::TerrainContact::getArea ( ) const

Get the contact area.

The contact area is approximated by doing intersection tests between the colliding geometry and the terrain in grid points close to the contact points. All the grid points which intersect the collider are used when calculating the total area which is given by: number_of_grid_points * gridElementArea.

Returns
The approximated contact area from intersected grid points.

◆ getContactBound()

agx::Bound3 agxTerrain::TerrainContact::getContactBound ( ) const

The 3D bound spanned by the contact points of the colliding geometry.

Returns
The contact bound.

◆ getContactMidPoint()

agx::Vec3 agxTerrain::TerrainContact::getContactMidPoint ( ) const
Returns
the computed average mid point from the from all the contact points.

◆ getCurrentContactTime()

agx::Real agxTerrain::TerrainContact::getCurrentContactTime ( ) const

Get the time that the colliding geometry has been in contact with the terrain.

Mainly used in compression calculation in order to include compression rate relaxation.

Returns
The current contact time of the Terrain contact.

◆ getDepthTable()

const TerrainIndexToDepthTable & agxTerrain::TerrainContact::getDepthTable ( ) const

Get the table which holds information about the contact depth at each terrain index in the contact area.

Returns
The geometry colliding with the terrain.

◆ getGeometry()

const agxCollide::Geometry * agxTerrain::TerrainContact::getGeometry ( ) const

Get the geometry colliding with the terrain.

Returns
The geometry colliding with the terrain.

◆ getMaxSurfaceForce()

agx::Real agxTerrain::TerrainContact::getMaxSurfaceForce ( ) const

Get the maximum force of the Terrain contact from the associated contact points.

Returns
The total surface force of the Terrain contact.

◆ getMeanGridDepth()

agx::Real agxTerrain::TerrainContact::getMeanGridDepth ( ) const

Get the mean depth of the intersected grid points in the TerrainContact.

Returns
The mean depth of the Terrain contact.

◆ getSurfaceForce()

agx::Real agxTerrain::TerrainContact::getSurfaceForce ( ) const

Get the total surface force of the Terrain contact from all the contact points.

Note
- This is only accessible in post-update of the simulation
Returns
The total surface force of the Terrain contact.

◆ getSurfacePointForces()

const SurfaceForceVector & agxTerrain::TerrainContact::getSurfacePointForces ( ) const

Get the surface point forces active in the Terrain contact.

The surface point forces consists of the contact points in the associated geometry contact, which has been projected onto the terrain surface.

Returns
The surface points forces in the Terrain contact.

◆ getSurfaceStress()

agx::Real agxTerrain::TerrainContact::getSurfaceStress ( ) const

Get the average surface stress of the contact which is calculated using the approximated contact area and the total surface force of the contact.

Returns
The average surface stress of the contact.

◆ getSurfaceStressInIndex()

agx::Real agxTerrain::TerrainContact::getSurfaceStressInIndex ( const agx::Vec2i &  terrainIndex) const

Get the specific contact stress in a terrain index in the contact by scaling the average stress with the depth in the specific index.

Returns
The specific surface stress in the contact terrain index.

◆ setContactArea()

void agxTerrain::TerrainContact::setContactArea ( agx::Real  area)

Internal method.

Set the contact area of the contact.

Parameters
area- The surface area of the contact.

◆ setSurfaceForce()

void agxTerrain::TerrainContact::setSurfaceForce ( agx::Real  surfaceForce)

Internal method.

Set the surface force of the contact.

Parameters
surfaceForce- The surface force to set on the contact

◆ setSurfacePointForces()

void agxTerrain::TerrainContact::setSurfacePointForces ( const SurfaceForceVector &  pointForces)

Internal method.

Set the surface point forces of the contact.

Parameters
pointForces- The point forces to set on the contact.

◆ setSurfaceStress()

void agxTerrain::TerrainContact::setSurfaceStress ( agx::Real  surfaceStress)

Internal method.

Set the surface stress of the contact.

Parameters
surfaceStress- The surface stress to set.

The documentation for this class was generated from the following file: