AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
AggregateContactGenerator.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
20#include <agx/Plane.h>
24
26namespace detail
27{
28 struct ContactPatchData;
29 struct ContactSpanData;
30}
32
33namespace agxTerrain
34{
35 class TerrainToolCollection;
36
39
41
43 {
44 public:
46
47 void onPre( TerrainToolCollection* collection );
48
49 void onPost(TerrainToolCollection* collection);
50
55
60
65
70
75
81 bool particleIsInShovelContacts( agx::UInt32 particleId ) const;
82
83
88
93
97
98 void setEnableCustomFrictionModels( bool enable );
100
101 protected:
103
104 private:
105
106 void createGeometryContacts( TerrainToolCollection* collection );
107
108 void createTerrainContacts( TerrainToolCollection* collection,
110
111 void createShovelContacts( TerrainToolCollection* collection,
113
114 agx::Real getContactPointAngle( const agx::Vec3& midPoint,
115 const agx::Vec3& zeroPoint,
116 const agx::Vec3& contactPoint,
117 const agx::Plane& polarPlane,
118 const agx::Plane& cutTopPlane ) const;
119
120 GeometryHashSet getShovelGeometries( TerrainToolCollection* collection ) const;
121
122 void getShovelContactsAndContactRange( TerrainToolCollection* collection,
123 GeometryHashSet& geometrySet,
125 agx::RangeReal& range );
126
127 agxCollide::LocalParticleGeometryContactVector calculateShovelContactPoints( TerrainToolCollection* collection,
128 const agxCollide::ParticleGeometryContactVector& shovelContacts,
129 const agx::RangeReal& range ) const;
130
131 void updateMeanContactData( detail::ContactPatchData& contactData,
133 const agx::Plane& cuttingTopPlane,
134 agx::Real contactAngle ) const;
135
136 void updateContactSpan( detail::ContactPatchData& contactPatchData,
137 detail::ContactSpanData& contactSpanData,
139 const agx::Plane& middlePlane,
140 agx::Real contactAngle ) const;
141
143 detail::ContactPatchData& contactPatchData,
144 const agx::Vec3f& separationNormal,
145 const agx::Vec3& cuttingVector,
146 const detail::ContactSpanData& contactSpanData ) const;
147
148 agx::Real calculateContactArea( const TerrainToolCollection* collection,
150
151 private:
153
154 ParticleIdSet m_particleIds;
155 ParticleIdSet m_particlesInShovelContacts;
156 agxCollide::LocalGeometryContactVector m_localGeometryContacts;
157 agxCollide::LocalGeometryContactVector m_localShovelAggregateContacts;
158 agx::ContactMaterialRef m_aggregateTerrainContactMaterial;
159 agx::ContactMaterialRef m_aggregateShovelContactMaterial;
160 AggregateContactDepthModel m_depthModel;
161 ShovelAggregateFrictionModelRef m_frictionModel;
162 bool m_enableCustomFrictionModels;
163 };
164}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXTERRAIN_EXPORT
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition Simulation.h:126
Class used to calculate the contact depth in the soil aggregate <-> terrain contacts to mimic an elas...
void resetAggregateContactHistory()
Resets contact model history in the contact generator.
void onPost(TerrainToolCollection *collection)
bool particleIsInShovelContacts(agx::UInt32 particleId) const
Checks if a particle with a given id is in contact with the shovel.
agx::ContactMaterial * getAggregateShovelContactMaterial() const
Get the internal shovel <-> aggregate contact material.
const AggregateContactDepthModel & getAggregateDepthModel() const
Get the aggregate <-> terrain contact depth model.
void setEnableCustomFrictionModels(bool enable)
agxCollide::GeometryContactPtrVector getGeometryContacts(agxSDK::Simulation *simulation) const
void initializeContactMaterials(TerrainToolCollection *collection)
Initialize contact materials used in the aggregate contacts.
void onPre(TerrainToolCollection *collection)
agx::ContactMaterial * getAggregateTerrainContactMaterial() const
Get the internal aggregate <-> terrain contact material.
void initializeFrictionModels(TerrainToolCollection *collection)
Initialize custom friction models used in the aggregate contacts.
Collection of terrain tool (currently Shovel) related objects which are terrain instance specific.
This class store the combine material properties between two agx::Material's.
Definition Material.h:516
Inheritance with partial specialization due to bug with ref_ptr containers.
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition HashVector.h:41
Pointer to a entity instance of type Physics.ParticleGeometryContact.
Class representing the mathematical concept of a plane, also called a half- space.
Definition agx/Plane.h:32
Base class providing referencing counted objects.
Definition Referenced.h:120
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition Geometry.h:59
agx::HashVector< agxCollide::Geometry *, agxCollide::LocalGeometryContact > GeometryLocalContactTable
agx::HashSet< agxCollide::Geometry * > GeometryHashSet
uint32_t UInt32
Definition Integer.h:32
double Real
Definition Real.h:42