AGX Dynamics 2.39.0.0
Loading...
Searching...
No Matches
agxTerrain::Shovel Class Reference

Shovel object used to interact with a terrain via an active zone that converts solid terrain to dynamic terrain which can be moved by the shovel rigid body. More...

#include <Shovel.h>

+ Inheritance diagram for agxTerrain::Shovel:

Classes

class  ExcavationSettings
 Class containing the settings for the different ExcavationModes for a shovel. More...
 
struct  SoilPenetrationParameters
 
struct  TeethSettings
 

Public Types

enum class  ExcavationMode : agx::UInt32 { PRIMARY = 0 , DEFORM_BACK = 1 , DEFORM_RIGHT = 2 , DEFORM_LEFT = 3 }
 Enum for describing the different excavation modes of a shovel: More...
 
- Public Types inherited from agx::Component
typedef Event2< Component *, Object * > ObjectEvent
 Event when adding removing child objects.
 
typedef Callback1< Object * > TraverseCallback
 
- Public Types inherited from agx::Object
typedef agx::observer_ptr< const EventEventConstObserver
 
typedef agx::ref_ptr< const EventEventConstRef
 
typedef agx::observer_ptr< EventEventObserver
 
typedef agx::Vector< EventObserverEventObserverVector
 
typedef agx::VectorPOD< Event * > EventPtrVector
 
typedef agx::ref_ptr< EventEventRef
 
typedef agx::Vector< EventRefEventRefVector
 

Public Member Functions

 Shovel (agx::RigidBody *shovelBody, const agx::Line &topEdge, const agx::Line &cuttingEdge, const agx::Vec3 &cuttingDirection, Shovel *connectedShovel=nullptr)
 Basic constructor.
 
bool collisionGeometriesAreInsideTerrain (Terrain *terrain) const
 Check if any of the collision geometries are inside terrain bounds.
 
agx::Real computeCuttingEdgeLength () const
 
TerraingetActiveTerrain () const
 
PrimaryActiveZonegetActiveZone () const
 
AggregateContactGeneratorgetAggregateContactGenerator () const
 
agx::MaterialgetAggregateMaterial () const
 
agx::Real getAggregateTerrainContactArea (Shovel::ExcavationMode excavationMode) const
 Get the aggregate <-> terrain contact area given an excavation mode and a shovel.
 
agx::Real getAggregateTerrainContactDepth (Shovel::ExcavationMode excavationMode) const
 
agx::Vec3 getAggregateTerrainContactForce (Shovel::ExcavationMode excavationMode) const
 Get the terrain <-> aggregate contact force for the given excavation mode.
 
agxCollide::GeometryContactPtrVector getAggregateTerrainContacts (Shovel::ExcavationMode excavationMode) const
 Get the aggregate <-> terrain geometry contacts with the shovel given an excavation mode.
 
agx::Vec3 getAggregateTerrainNormalForce (Shovel::ExcavationMode excavationMode) const
 Get the terrain <-> aggregate normal force for the given excavation mode.
 
agx::Vec3 getAggregateTerrainTangentialForce (Shovel::ExcavationMode excavationMode) const
 Get the terrain <-> aggregate tangential force for the given excavation mode.
 
bool getAlwaysRemoveShovelContacts () const
 
agx::Vec3 getContactForce () const
 Given geometry contacts exists and the solver has solved them - calculates total shovel contact force between the shovel and it's active terrain.
 
agx::Real getContactRegionThreshold () const
 Get the starting distance threshold from the shovel planes where regular geometry contacts between the shovel underside and the terrain can be created.
 
agx::Real getContactRegionVerticalLimit () const
 
agx::Plane getCurrentSeparationPlane (ExcavationMode mode) const
 
const agx::Vec3getCuttingDirection () const
 
agx::Vec3 getCuttingDirectionWorld () const
 
const agx::LinegetCuttingEdge () const
 
agx::Line getCuttingEdgeWorld () const
 
agx::Real getDeadLoadFraction () const
 Get the last computed dead load fraction of the shovel, i.e how much of it's inner volume that is filled with dynamic soil.
 
agx::Vec3 getDeformationContactForce () const
 Given geometry contacts exists and the solver has solved them - calculates total contact force between the terrain deformation soil aggregate and the shovel.
 
DeformControllergetDeformController () const
 
agx::Real getDynamicMass () const
 
bool getEnable () const
 Access the state enable flag.
 
bool getEnableForTerrain (Terrain *terrain) const
 
bool getEnableInnerShapeCreateDynamicMass () const
 Get if inner shape alone should always create dynamic mass.
 
bool getEnableParticleForceFeedback ()
 
bool getEnableParticleFreeDeformers () const
 
agx::Vec3 getExcavationModeContactForce (Shovel::ExcavationMode excavationMode) const
 Calculates total contact force between the soil aggregate associated with the specified excavation mode in the shovel.
 
ExcavationSettingsgetExcavationSettings (ExcavationMode mode)
 
const agx::Vector< agxCollide::BoundingAABB > & getForbiddenBounds ()
 Get the shovels forbidden bounds.
 
agx::Real getInnerContactArea () const
 Get the last computed inner contact area of the shovel, i.e the estimated cross-section area of the inner volume that is filled with dynamic soil.
 
agx::Real getInnerVolume () const
 
agx::Real getMaxPenetrationForce () const
 Set the maximum limit on penetration force (N) that the terrain will generate on this shovel.
 
agx::Real getMinimumSubmergedContactLengthFraction () const
 Get the minimum submerged cutting edge length fraction (0-1) that generates submerged cutting.
 
agx::Real getNoMergeExtensionDistance () const
 Get the margin outside the shovel bonding box where soil particle merging is forbidden.
 
agx::UInt getNumberOfTeeth () const
 
agx::FramegetParentFrame () const
 
agx::Real getParticleInclusionMultiplier () const
 
agx::Real getPenetrationDepthThreshold () const
 Get the vertical penetration depth threshold for when the shovel tooth for penetration resistance should reach full effectiveness.
 
bool getPenetrationForce (agx::Vec3 &force, agx::Vec3 &torque) const
 The result includes the active force and torque from the penetration resistance from the active terrain on the shovel if the shovel is digging in the terrain.
 
agx::Real getPenetrationForceScaling () const
 
SoilPenetrationResistancegetPenetrationResistance () const
 
virtual agx::RigidBodygetRigidBody () const override
 
agx::Vec3 getSecondaryCuttingDirection () const
 
agx::Real getSecondarySeparationAngle () const
 
agx::Real getSecondarySeparationDeadloadLimit () const
 
agx::Vec3 getSeparationContactForce () const
 Given geometry contacts exists and the solver has solved them - calculates total contact force between the terrain soil particle aggregate and the shovel.
 
agx::Vec3 getSeparationFrictionForce () const
 Given geometry contacts exists and the solver has solved them - calculates total contact friction force between the terrain soil particle aggregate and the given shovel.
 
agx::Vec3 getSeparationNormalForce () const
 Given geometry contacts exists and the solver has solved them - calculates total contact normal force between the terrain soil particle aggregate and the shovel.
 
agx::Bool getSetZeroAggregateVelocity () const
 
agx::ContactMaterialgetShovelAggregateContactMaterial (Shovel::ExcavationMode mode=Shovel::ExcavationMode::PRIMARY) const
 Get the explicitly set contact material in a shovel-aggregate contact corresponding to a specified excavation mode for the shovel.
 
agxCollide::GeometryContactPtrVector getShovelAggregateContacts (Shovel::ExcavationMode excavationMode) const
 Get the shovel <-> aggregate contacts with the soil particle aggregate for the given excavation mode.
 
ShovelAggregateContactMaterialContainergetShovelTerrainContactMaterialContainer () const
 
agx::Real getSoilAggregateMass (Shovel::ExcavationMode excavationMode) const
 Returns the total soil aggregate mass in the shovel for the specific excavation mode.
 
SoilParticleAggregategetSoilParticleAggregate () const
 
bool getSoilPenetrationModel (agxTerrain::SoilPenetrationResistance::PenetrationModel &model) const
 Get the soil penetration model used for the shovel.
 
Shovel::TeethSettingsgetTeethSettings ()
 
agx::Real getToothLength () const
 
agx::Real getToothMaximumRadius () const
 
agx::Real getToothMinimumRadius () const
 
const agx::LinegetTopEdge () const
 
agx::Line getTopEdgeWorld () const
 
bool getUseCustomFricionModel () const
 
agx::Real getVerticalBladeSoilMergeDistance () const
 Get the vertical distance under the blade cutting edge that the soil is allowed to instantly merge up to.
 
const agxCollide::GeometryRefVectorgetVoxelCollisionGeometries () const
 
const agx::RigidBodygetWedgeAggregate (Shovel::ExcavationMode excavationMode) const
 
bool isActive () const
 
bool isDigging () const
 Check if the shovel is currently in digging mode with a terrain, i.e if the cutting edge is submerged.
 
virtual bool isValid () const override
 
void setAlwaysRemoveShovelContacts (bool enable)
 Set to true/false if shovel <-> terrain contacts should always be removed param enable - set to true/false if shovel <-> terrain contacts should always be removed.
 
void setContactRegionThreshold (agx::Real contactRegionThreshold)
 Set the starting distance threshold from the shovel planes where regular geometry contacts between the shovel underside and the terrain can be created.
 
void setContactRegionVerticalLimit (agx::Real verticalLimit)
 Set the maximum vertical distance from the shovel bottom plane where regular geometry contacts between the shovel and the terrain are allowed to be created.
 
void setCuttingDirection (agx::Vec3 cuttingDirection)
 
void setCuttingEdge (agx::Line cuttingEdge)
 Set the cutting edge in local space.
 
void setEnable (bool enable)
 Change state enable of this shovel.
 
void setEnableForTerrain (Terrain *terrain, bool enable)
 Set if the shovel is enabled for the particular terrain.
 
void setEnableInnerShapeCreateDynamicMass (bool enable)
 Set if inner shape alone should always create dynamic mass.
 
void setEnableParticleForceFeedback (bool enable)
 Set whenever the excavation force feedback during PRIMARY excavation should be generated from particle contacts instead of aggregate contacts.
 
void setEnableParticleFreeDeformers (bool enable)
 Set true/false if the shovel deformers should make particle free deformations.
 
void setEnableShovelTerrainGeometryContacts (Terrain *terrain, bool enable)
 Set if regular geometry contacts should be created between the shovel geometries and the associated terrain geometry.
 
void setExcavationSettings (ExcavationMode mode, ExcavationSettings excavationSettings)
 Set a settings object for an ExcavationMode of the shovel.
 
void setMaxPenetrationForce (agx::Real maxPenetrationForce)
 Set a maximum limit on penetration force (N) that the terrain will generate on this shovel.
 
void setMinimumSubmergedContactLengthFraction (agx::Real minimumSubmergedContactLengthFraction)
 Set the minimum submerged cutting edge length fraction (0-1) that generates submerged cutting.
 
void setNoMergeExtensionDistance (agx::Real extensionDistance)
 Set the extension outside the shovel bounding box where soil particle merging is forbidden.
 
void setNumberOfTeeth (agx::UInt count)
 
void setParticleInclusionMultiplier (agx::Real radiusMultiplier)
 
void setPenetrationDepthThreshold (agx::Real depthThreshold)
 Set the vertical penetration depth threshold for when the shovel tooth for penetration resistance should reach full effectiveness.
 
void setPenetrationForceScaling (agx::Real penetrationForceScaling)
 Set the linear scaling coefficient for the penetration force (Default: 1.0)
 
void setSecondarySeparationDeadloadLimit (agx::Real secondarySeparationLimit)
 Sets the dead-load limit where secondary separation will start to activate where the forward direction starts to change according to the virtual separation plate created by the material inside the shovel.
 
bool setShovelAggregateContactMaterial (agx::ContactMaterial *contactMaterial, Shovel::ExcavationMode mode=Shovel::ExcavationMode::PRIMARY)
 Explicitly set contact material properties in a shovel-aggregate contact for a specific excavation mode for the shovel.
 
bool setSoilPenetrationModel (agxTerrain::SoilPenetrationResistance::PenetrationModel model)
 Set the soil penetration model used for the shovel.
 
void setToothLength (agx::Real length)
 
void setToothMaximumRadius (agx::Real radius)
 
void setToothMinimumRadius (agx::Real radius)
 
void setTopEdge (agx::Line topEdge)
 Set the top edge in local space.
 
void setUseCustomFrictionModel (bool enable)
 
void setVerticalBladeSoilMergeDistance (agx::Real verticalSoilBladeMergeDistance)
 Sets the vertical distance under the blade cutting edge that the soil is allowed to instantly merge up to.
 
void setZeroAggregateVelocity (bool enable)
 Set whenever the innerbody aggregate should have zero velocity before solve step as opposed to using particle or cached post-solve velocities from the previous time step.
 
- Public Member Functions inherited from agxSDK::ShovelInstance
void addEventListener (agxSDK::StepEventListener *listener)
 Add a StepEventListener which follows the shovel - ie added and removed from a simulation at the same time as the shovel is added/removed from the simulation.
 
virtual agx::RigidBodygetRigidBody () const =0
 
agxSDK::SimulationgetSimulation () const
 
virtual bool isValid () const =0
 
bool removeEventListener (agxSDK::StepEventListener *listener)
 Remove an added StepEventListener from the shovel.
 
- Public Member Functions inherited from agx::Component
 Component (const agx::Name &name=agx::Name(), agx::Model *model=agx::Component::ClassModel(), agx::Device *device=nullptr)
 
virtual void addObject (agx::Object *object, bool assignContext=true)
 Add an object to the component.
 
virtual String autoComplete (const String &partialName, StringVector &matchingNames) const
 
virtual void buildNavigationTree (agxJson::Value &eNode) const override
 
void configure (Model *model)
 
virtual void configure (TiXmlElement *eComponent) override
 
agx::DevicegetDevice ()
 
template<typename T >
T * getDevice ()
 
const agx::DevicegetDevice () const
 
template<typename T >
const T * getDevice () const
 
size_t getNumObjects (const agx::Name &name) const
 
agx::ObjectgetObject (const agx::Name &name, agx::Model *model, size_t index=0)
 
const agx::ObjectgetObject (const agx::Name &name, agx::Model *model, size_t index=0) const
 
agx::ObjectgetObject (const agx::Name &name, size_t index=0)
 
template<typename T >
T * getObject (const agx::Name &name, size_t index=0)
 
const agx::ObjectgetObject (const agx::Name &name, size_t index=0) const
 
template<typename T >
const T * getObject (const agx::Name &name, size_t index=0) const
 
const agx::ObjectRefVectorgetObjects () const
 
template<typename T >
void getObjects (agx::ObjectPtrVector &result, bool recursive=false) const
 
void getObjects (agx::ObjectPtrVector &result, const agx::Model *model, bool recursive=false) const
 
virtual ObjectgetResourceImpl (const Path &path, agx::Model *model) override
 
virtual void printSubtree () const override
 
void printSubtree (std::ostream &stream, int depth=0) const
 
virtual void rebind () override
 
void removeAllObjects ()
 Remove all components.
 
virtual void removeObject (agx::Object *object)
 Remove an object from the component.
 
void removeObject (const agx::Name &name, size_t index=0)
 Remove an object with a specified name (and optional index) from the component.
 
virtual void snapshot (TiXmlNode *eParent, const String &directory) const override
 
void traverse (ComponentVisitor *)
 
void traverse (const TraverseCallback &callback)
 
- Public Member Functions inherited from agx::Object
 Object (const Name &name=Name(), Model *model=Object::ClassModel())
 
void addListener (EventListener *listener)
 
virtual void buildNavigationTree (agxJson::Value &eNode) const
 
virtual void configure (TiXmlElement *)
 
agx::String fullName () const
 
agx::String fullPath () const
 
agx::String fullPath (const agx::Object *root) const
 
template<typename T >
T * getAutoScopedResource (const agx::Path &path)
 
template<typename T >
const T * getAutoScopedResource (const agx::Path &path) const
 
agx::ObjectgetAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::ObjectgetAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr) const
 
agx::ObjectgetContext ()
 
template<typename T >
T * getContext ()
 
const agx::ObjectgetContext () const
 
template<typename T >
const T * getContext () const
 
agx::UInt32 getId () const
 
const agx::NamegetImplementationName () const
 
agx::ModelgetModel ()
 
const agx::ModelgetModel () const
 
const agx::NamegetName () const
 
agx::ObjectgetNextSibling ()
 
const agx::ObjectgetNextSibling () const
 
agx::Path getPath () const
 
agx::Path getPath (const agx::Object *root) const
 
template<typename T >
T * getResource (const agx::Path &path)
 
template<typename T >
const T * getResource (const agx::Path &path) const
 
agx::ObjectgetResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::ObjectgetResource (const agx::Path &path, agx::Model *model=nullptr) const
 
virtual agx::ObjectgetResourceImpl (const agx::Path &path, agx::Model *model)
 
agx::ObjectgetRootContext ()
 
const agx::ObjectgetRootContext () const
 
bool hasListener (EventListener *listener)
 
bool hasParent (const agx::Object *node) const
 
bool isUnique () const
 
virtual void printSubtree () const
 
virtual void rebind ()
 
void removeListener (EventListener *listener)
 
virtual void save (TiXmlElement *) const
 
virtual void setContext (agx::Object *context)
 
void setId (UInt32 id)
 
void setModel (agx::Model *model)
 Set the object model (handled automatically).
 
void setName (const agx::Name &name)
 Set the name of the object.
 
virtual void snapshot (TiXmlNode *, const String &) const
 
- 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.
 
Referencedoperator= (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.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static Shovelfind (const agxSDK::Simulation *simulation, const agx::Name &name)
 Find first shovel with given name.
 
static Shovelfind (const agxSDK::Simulation *simulation, const agx::Uuid &uuid)
 Find shovel with given UUID.
 
static ShovelPtrVector findAll (const agxSDK::Simulation *simulation)
 Finds all shovels in the given simulation.
 
- Static Public Member Functions inherited from agx::Component
static Component_load (TiXmlElement *eComponent, Device *device)
 
static agx::ModelClassModel ()
 
static Componentload (const Path &path, const Name &implementation, Device *device, const Path &_namespace=Path())
 
static Componentload (const String &path, const Path &_namespace=Path())
 
static Componentload (const String &path, Device *device, const Path &_namespace=Path())
 
static Componentload (TiXmlElement *eComponent, Device *device)
 
- Static Public Member Functions inherited from agx::Object
static agx::ModelClassModel ()
 
static agx::String generateName (const agx::String &bindPath)
 
static const HashSet< Object * > & getActiveObjects ()
 
static bool getEnableRebind ()
 Should rebinding be allowed? Right now a global setting.
 
static Objectload (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
static Objectload (const String &path, Device *device, const String &type="", size_t instance=0)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type="", size_t instance=0)
 
static void load (const String &path, Device *device, ObjectPtrVector &loadedObjects)
 
static Objectload (TiXmlElement *eObject, Device *device)
 
template<typename T >
static T * load (TiXmlElement *eObject, Device *device)
 
static TiXmlDocument openDocument (const String &path)
 
static void setEnableRebind (bool flag)
 Sets if rebinding of objects should be allowed (Right now a global setting).
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Protected Types

using Flags = agx::BitState< StateFlags, agx::UInt32 >
 
enum  StateFlags : agx::UInt32 {
  ENABLED = 1 << 0 , REMOVE_SHOVEL_CONTACTS = 1 << 1 , INNER_SHAPE_CREATE_DYNAMIC_MASS = 1 << 2 , ENABLE_PARTICLE_FREE_DEFORMATION = 1 << 3 ,
  ENABLE_PARTICLE_FORCE_FEEDBACK = 1 << 4 , SET_ZERO_AGGREGATE_VELOCITY = 1 << 5 , USE_CUSTOM_FRICTION_MODELS = 1 << 6
}
 

Protected Member Functions

 Shovel ()
 Default constructor used in serialization.
 
virtual ~Shovel ()
 Reference counted object - protected destructor.
 
virtual void addNotification () override
 Add notification when a shovel is added to a simulation.
 
void calculateDeadLoadFraction ()
 
void calculateForbiddenBounds ()
 Calculate the shovels forbidden bounds around all the active zones.
 
void checkContactMaterials ()
 
void clearActiveZoneWedges () const
 Clear the active zone wedges of the primary active zones and deformers.
 
agx::Real computeDefaultContactRegionThreshold () const
 
agx::FramecreateParentFrame ()
 
agxCollide::GeometryRefVector createVoxelCollisionGeometries (agx::Real tessellationLevel=0.5) const
 
agx::Vec3 ensureCuttingDirectionIsNormalized (agx::Vec3 cuttingDirection)
 
agxSDK::TerrainManager * getTerrainManager ()
 
TerrainPtrVec getTerrainsInSimulation ()
 
void initalizeContactMaterialsForExistingTerrains (agxSDK::Simulation *simulation)
 Initialize contact materials when added to simulation.
 
virtual void last () override
 Callback to be executed at the end of the time step Shovel and Terrain step events are synchronized via the TerrainManager.
 
virtual void post () override
 Executes post-step events for agxTerrain::Shovel in the simulation.
 
virtual void pre () override
 Executes pre-step events for agxTerrain::Shovel in the simulation.
 
virtual void preCollide () override
 Executes pre-collide events for agxTerrain::Shovel in the simulation.
 
virtual void removeNotification () override
 Remove notification when this shovel is removed from a simulation.
 
void setAggregateMaterial (agx::Material *material)
 Set the common material used by the SoilParticleAggregates inside the primary active zone and deformers.
 
bool shovelHasParticles () const
 
- Protected Member Functions inherited from agxSDK::ShovelInstance
 ShovelInstance ()
 Default constructor.
 
virtual ~ShovelInstance ()
 Reference counted object - protected destructor.
 
virtual void addNotification ()
 
virtual void last ()
 
virtual void post ()
 
virtual void pre ()
 
virtual void preCollide ()
 
virtual void removeNotification ()
 
- Protected Member Functions inherited from agx::Component
virtual ~Component ()
 
String expandAutoCompletionMatch (const String &query, const StringVector &matchingNames) const
 
void setDevice (Device *device)
 
- Protected Member Functions inherited from agx::Object
virtual ~Object ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Static Protected Member Functions

static agx::UInt excavationModeToDeformerCollectionIndex (Shovel::ExcavationMode excavationMode)
 Cast from excavation mode enum to deformer collection index.
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandlergetDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Protected Attributes

Terrainm_activeTerrain
 
PrimaryActiveZoneRef m_activeZone
 
AggregateContactGeneratorRef m_aggregateContactGenerator
 
agx::MaterialRef m_aggregateMaterial
 
agxCollide::BoundingAABB m_collisionBound
 
Shovelm_connectedShovel
 
agx::Real m_contactThreshold
 
agx::Vec3 m_cuttingDirection
 
agx::Line m_cuttingEdge
 
agx::Real m_deadLoadFraction
 
DeformControllerRef m_deformController
 
std::array< ExcavationSettings, 4 > m_excavationSettings
 
Flags m_flags
 
agx::Vector< agxCollide::BoundingAABBm_forbiddenBounds
 
agx::Real m_innerContactArea
 
bool m_isActive
 
agx::Real m_minimumSubmergedContactLengthFraction
 
agx::Real m_noMergeExtensionDistance
 
agx::FrameRef m_parentFrame
 
agx::Real m_particleInclusionMultiplier
 
SoilPenetrationResistanceRef m_penetrationResistance
 
agx::Real m_secondarySeparationDeadLoadLimit
 
bool m_settingsAreDirty
 
ShovelAggregateContactMaterialContainerRef m_shovelAggregateCMContainer
 
agx::RigidBodyRef m_shovelBody
 
SoilParticleAggregateRef m_soilParticleAggregate
 
SoilPenetrationParameters m_soilPenetrationParameters
 
TeethSettings m_teethSettings
 
agx::Line m_topEdge
 
agx::Real m_verticalContactThreshold
 
agx::Real m_verticalSoilBladeMergeDistance
 
agxCollide::GeometryRefVector m_voxelCollisionGeometries
 
agx::Vec3iVector m_voxelsInPrimaryActiveZoneLastTimeStep
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Public Attributes inherited from agx::Component
ObjectEvent addObjectEvent
 
ObjectEvent removeObjectEvent
 

Detailed Description

Shovel object used to interact with a terrain via an active zone that converts solid terrain to dynamic terrain which can be moved by the shovel rigid body.

A shovel object consists of a rigid body, two edges and a cutting direction. A convex inner shape is created between the two edges, the top edge and the cutting edge, and the attached rigid body. When the cutting edge intersects a terrain surface an active zone is created in the cutting direction inside the terrain, which then converts solid mass into dynamic mass. The shovel receives feedback forces through a rigid body aggregate constructed from the intertia of the soil particles in the active zone.

The shovel has 4 modes for deforming terrain: PRIMARY, DEFORM_BACK, DEFORM_LEFT and DEFORM_RIGHT. See the Shovel::ExcavationMode enum for details.

Definition at line 60 of file Shovel.h.

Member Typedef Documentation

◆ Flags

using agxTerrain::Shovel::Flags = agx::BitState<StateFlags, agx::UInt32>
protected

Definition at line 1058 of file Shovel.h.

Member Enumeration Documentation

◆ ExcavationMode

Enum for describing the different excavation modes of a shovel:

Enumerator
PRIMARY 

The primary mode of excavation, where the shovel digs along the cutting direction in the terrain horizontal plane.

DEFORM_BACK 

The mode of excavation where the shovel is digging in the opposite direction of the cutting direction in the terrain horizontal plane.

( Example: Backside grading )

DEFORM_RIGHT 

The mode of excavation where the shovel is digging to the clock wise (Right) direction orthogonal to the cutting direction in the terrain horizontal plane.

( Example: Side push/grading )

DEFORM_LEFT 

The mode of excavation where the shovel is digging to the counter-clock wise (Left) direction orthogonal to the cutting direction in the terrain horizontal plane.

( Example: Side push/grading )

Definition at line 112 of file Shovel.h.

◆ StateFlags

Enumerator
ENABLED 
REMOVE_SHOVEL_CONTACTS 
INNER_SHAPE_CREATE_DYNAMIC_MASS 
ENABLE_PARTICLE_FREE_DEFORMATION 
ENABLE_PARTICLE_FORCE_FEEDBACK 
SET_ZERO_AGGREGATE_VELOCITY 
USE_CUSTOM_FRICTION_MODELS 

Definition at line 1048 of file Shovel.h.

Constructor & Destructor Documentation

◆ Shovel() [1/2]

agxTerrain::Shovel::Shovel ( agx::RigidBody shovelBody,
const agx::Line topEdge,
const agx::Line cuttingEdge,
const agx::Vec3 cuttingDirection,
Shovel connectedShovel = nullptr 
)

Basic constructor.

Parameters
shovelBody- The base body of the shovel.
topEdge- The top edge of the active zone, specified in the LOCAL shovelBody frame that will be created in front of the shovel.
cuttingEdge- The lowest edge on the shovel, specified in the LOCAL shovelBody frame that serves as the cutting edge of the active zone.
cuttingDirection- The cutting direction of the shovel where the penetration resistance will be active, which is usually parallel to the lowest shovel plate that is used to initially penetrate the soil.
connectedShovel- Set if the shovel should be connected to another shovels InnerBody for purposes of simulating composite shovels with varying shovel vectors in along the shovel geometry. This means you can have multiple cutting edges with varying orientation per shovel where you have a central shovel with a single inner shape. (Default: nullptr)

◆ Shovel() [2/2]

agxTerrain::Shovel::Shovel ( )
protected

Default constructor used in serialization.

◆ ~Shovel()

virtual agxTerrain::Shovel::~Shovel ( )
protectedvirtual

Reference counted object - protected destructor.

Member Function Documentation

◆ addNotification()

virtual void agxTerrain::Shovel::addNotification ( )
overrideprotectedvirtual

Add notification when a shovel is added to a simulation.

Reimplemented from agxSDK::ShovelInstance.

◆ calculateDeadLoadFraction()

void agxTerrain::Shovel::calculateDeadLoadFraction ( )
protected

◆ calculateForbiddenBounds()

void agxTerrain::Shovel::calculateForbiddenBounds ( )
protected

Calculate the shovels forbidden bounds around all the active zones.

◆ checkContactMaterials()

void agxTerrain::Shovel::checkContactMaterials ( )
protected

◆ clearActiveZoneWedges()

void agxTerrain::Shovel::clearActiveZoneWedges ( ) const
protected

Clear the active zone wedges of the primary active zones and deformers.

◆ collisionGeometriesAreInsideTerrain()

bool agxTerrain::Shovel::collisionGeometriesAreInsideTerrain ( Terrain terrain) const

Check if any of the collision geometries are inside terrain bounds.

◆ computeCuttingEdgeLength()

agx::Real agxTerrain::Shovel::computeCuttingEdgeLength ( ) const
Returns
the computed cutting edge length of the Shovel.

◆ computeDefaultContactRegionThreshold()

agx::Real agxTerrain::Shovel::computeDefaultContactRegionThreshold ( ) const
protected

◆ createParentFrame()

agx::Frame * agxTerrain::Shovel::createParentFrame ( )
protected

◆ createVoxelCollisionGeometries()

agxCollide::GeometryRefVector agxTerrain::Shovel::createVoxelCollisionGeometries ( agx::Real  tessellationLevel = 0.5) const
protected

◆ ensureCuttingDirectionIsNormalized()

agx::Vec3 agxTerrain::Shovel::ensureCuttingDirectionIsNormalized ( agx::Vec3  cuttingDirection)
protected

◆ excavationModeToDeformerCollectionIndex()

static agx::UInt agxTerrain::Shovel::excavationModeToDeformerCollectionIndex ( Shovel::ExcavationMode  excavationMode)
staticprotected

Cast from excavation mode enum to deformer collection index.

◆ find() [1/2]

static Shovel * agxTerrain::Shovel::find ( const agxSDK::Simulation simulation,
const agx::Name name 
)
static

Find first shovel with given name.

Parameters
simulation- simulation the shovel is part of
name- name of the shovel
Returns
shovel if found - otherwise nullptr

◆ find() [2/2]

static Shovel * agxTerrain::Shovel::find ( const agxSDK::Simulation simulation,
const agx::Uuid uuid 
)
static

Find shovel with given UUID.

Parameters
simulation- simulation the shovel is part of
uuid- UUID of the shovel
Returns
shovel if found - otherwise nullptr

◆ findAll()

static ShovelPtrVector agxTerrain::Shovel::findAll ( const agxSDK::Simulation simulation)
static

Finds all shovels in the given simulation.

Parameters
simulation- simulation with shovels.
Returns
vector of shovels

◆ getActiveTerrain()

Terrain * agxTerrain::Shovel::getActiveTerrain ( ) const

◆ getActiveZone()

PrimaryActiveZone * agxTerrain::Shovel::getActiveZone ( ) const
Returns
shovel active zone specific for this shovel instance

◆ getAggregateContactGenerator()

AggregateContactGenerator * agxTerrain::Shovel::getAggregateContactGenerator ( ) const
Returns
aggregate contact generator specific for this shovel instance

◆ getAggregateMaterial()

agx::Material * agxTerrain::Shovel::getAggregateMaterial ( ) const
Returns
the common material used for the SoilParticleAggregates inside the primary active zone and deformers.

◆ getAggregateTerrainContactArea()

agx::Real agxTerrain::Shovel::getAggregateTerrainContactArea ( Shovel::ExcavationMode  excavationMode) const

Get the aggregate <-> terrain contact area given an excavation mode and a shovel.

Parameters
excavationMode- the excavation mode that the aggregate belongs too ( PRIMARY, DEFORM_BACK, DEFORM_RIGHT, DEFORM_LEFT )
Returns
the aggregate <-> terrain contact area given an excavation mode and a shovel.

◆ getAggregateTerrainContactDepth()

agx::Real agxTerrain::Shovel::getAggregateTerrainContactDepth ( Shovel::ExcavationMode  excavationMode) const
Returns
the current wedge aggregate depth in the specified collection given an excavation mode.

◆ getAggregateTerrainContactForce()

agx::Vec3 agxTerrain::Shovel::getAggregateTerrainContactForce ( Shovel::ExcavationMode  excavationMode) const

Get the terrain <-> aggregate contact force for the given excavation mode.

Parameters
excavationMode- the excavation mode that the aggregate belongs too ( PRIMARY, DEFORM_BACK, DEFORM_RIGHT, DEFORM_LEFT )
Returns
the total force (N) acting on the aggregate in the terrain-aggregate contact

◆ getAggregateTerrainContacts()

agxCollide::GeometryContactPtrVector agxTerrain::Shovel::getAggregateTerrainContacts ( Shovel::ExcavationMode  excavationMode) const

Get the aggregate <-> terrain geometry contacts with the shovel given an excavation mode.

Parameters
excavationMode- the excavation mode that the aggregate belongs too ( PRIMARY, DEFORM_BACK, DEFORM_RIGHT, DEFORM_LEFT )
Returns
vector containing the geometry contacts between the specified aggregate and the terrain

◆ getAggregateTerrainNormalForce()

agx::Vec3 agxTerrain::Shovel::getAggregateTerrainNormalForce ( Shovel::ExcavationMode  excavationMode) const

Get the terrain <-> aggregate normal force for the given excavation mode.

Parameters
excavationMode- the excavation mode that the aggregate belongs too ( PRIMARY, DEFORM_BACK, DEFORM_RIGHT, DEFORM_LEFT )
Returns
the total force (N) acting on the aggregate in the terrain-aggregate contact

◆ getAggregateTerrainTangentialForce()

agx::Vec3 agxTerrain::Shovel::getAggregateTerrainTangentialForce ( Shovel::ExcavationMode  excavationMode) const

Get the terrain <-> aggregate tangential force for the given excavation mode.

Parameters
excavationMode- the excavation mode that the aggregate belongs too ( PRIMARY, DEFORM_BACK, DEFORM_RIGHT, DEFORM_LEFT )
Returns
the total force (N) acting on the aggregate in the terrain-aggregate contact

◆ getAlwaysRemoveShovelContacts()

bool agxTerrain::Shovel::getAlwaysRemoveShovelContacts ( ) const
Returns
true/false if shovel <-> terrain contacts are removed.

◆ getContactForce()

agx::Vec3 agxTerrain::Shovel::getContactForce ( ) const

Given geometry contacts exists and the solver has solved them - calculates total shovel contact force between the shovel and it's active terrain.

This is the contact force that prevents the shovel from falling through the terrain when not in excavation mode, where contact feedback is generated from the soil aggregates.

Note
- This method returns regular contact forces ONLY when no soil aggregates are present to generate excavation feedback!
Returns
the total non-excavation contact force between this terrain and the given shovel.

◆ getContactRegionThreshold()

agx::Real agxTerrain::Shovel::getContactRegionThreshold ( ) const

Get the starting distance threshold from the shovel planes where regular geometry contacts between the shovel underside and the terrain can be created.

Contacts that do not reach the distance threshold will be filtered away.

Returns
the starting distance threshold from the shovel planes where regular geometry contacts between the shovel underside and the terrain can be created. ( Default: cuttingEdgeLength / 10.0 )

◆ getContactRegionVerticalLimit()

agx::Real agxTerrain::Shovel::getContactRegionVerticalLimit ( ) const

◆ getCurrentSeparationPlane()

agx::Plane agxTerrain::Shovel::getCurrentSeparationPlane ( ExcavationMode  mode) const
Returns
get current separation plane for each excavation mode

◆ getCuttingDirection()

const agx::Vec3 & agxTerrain::Shovel::getCuttingDirection ( ) const
Returns
the forward vector in local space.

◆ getCuttingDirectionWorld()

agx::Vec3 agxTerrain::Shovel::getCuttingDirectionWorld ( ) const
Returns
the forward vector in world space.

◆ getCuttingEdge()

const agx::Line & agxTerrain::Shovel::getCuttingEdge ( ) const
Returns
the cutting edge in local space.

◆ getCuttingEdgeWorld()

agx::Line agxTerrain::Shovel::getCuttingEdgeWorld ( ) const
Returns
the cutting edge in world space.

◆ getDeadLoadFraction()

agx::Real agxTerrain::Shovel::getDeadLoadFraction ( ) const

Get the last computed dead load fraction of the shovel, i.e how much of it's inner volume that is filled with dynamic soil.

The dead load fraction ranges from 0.0 (empty), to 1.0 (full).

Returns
the last computed dead load fraction

◆ getDeformationContactForce()

agx::Vec3 agxTerrain::Shovel::getDeformationContactForce ( ) const

Given geometry contacts exists and the solver has solved them - calculates total contact force between the terrain deformation soil aggregate and the shovel.

This represents the deformation force that is required to move soil via shovel deformation instead of excavation, i.e not excavation or digging. Examples of this would be side movement and backwards grading of the soil.

Returns
the total contact force between given shovel and the deformer soil aggregates in the terrain.

◆ getDeformController()

DeformController * agxTerrain::Shovel::getDeformController ( ) const
Returns
aggregate contact generator specific for this shovel instance

◆ getDynamicMass()

agx::Real agxTerrain::Shovel::getDynamicMass ( ) const
Returns
dynamic mass in the shovel, including both particles and fluid mass

◆ getEnable()

bool agxTerrain::Shovel::getEnable ( ) const

Access the state enable flag.

Returns
true if the body is enabled (default) - otherwise false

◆ getEnableForTerrain()

bool agxTerrain::Shovel::getEnableForTerrain ( Terrain terrain) const
Returns
if the shovel is enabled for the specified terrain. Default: true.

◆ getEnableInnerShapeCreateDynamicMass()

bool agxTerrain::Shovel::getEnableInnerShapeCreateDynamicMass ( ) const

Get if inner shape alone should always create dynamic mass.

The alternative is to only create dynamic mass in the inner shape when primary excavation soil wedges create mass.

Returns
true if inner shape should always create dynamic mass (default), false otherwise.

◆ getEnableParticleForceFeedback()

bool agxTerrain::Shovel::getEnableParticleForceFeedback ( )
Returns
whenever the excavation force feedback during PRIMARY excavation should be generated from particle contacts instead of aggregate contacts. (Default: false)

◆ getEnableParticleFreeDeformers()

bool agxTerrain::Shovel::getEnableParticleFreeDeformers ( ) const
Returns
whether the shovel deformers should create dynamic mass.

◆ getExcavationModeContactForce()

agx::Vec3 agxTerrain::Shovel::getExcavationModeContactForce ( Shovel::ExcavationMode  excavationMode) const

Calculates total contact force between the soil aggregate associated with the specified excavation mode in the shovel.

This represents the deformation force that is required to move soil via shovel deformation instead of excavation, i.e not excavation or digging. Examples of this would be side movement and backwards grading of the soil.

Parameters
excavationMode- the excavation mode that the specified soil aggregate belongs to
Returns
the total contact force between the shovel and the soil aggregate specified by the excavation mode

◆ getExcavationSettings()

ExcavationSettings & agxTerrain::Shovel::getExcavationSettings ( ExcavationMode  mode)
Returns
the excavation settings for an excavation mode in the shovel.

◆ getForbiddenBounds()

const agx::Vector< agxCollide::BoundingAABB > & agxTerrain::Shovel::getForbiddenBounds ( )

Get the shovels forbidden bounds.

◆ getInnerContactArea()

agx::Real agxTerrain::Shovel::getInnerContactArea ( ) const

Get the last computed inner contact area of the shovel, i.e the estimated cross-section area of the inner volume that is filled with dynamic soil.

Note
- This is used in the shovel-aggregate contact in primary excavation to calculate stiffness and cohesion.
Returns
the last computed inner contact area of the shovel.

◆ getInnerVolume()

agx::Real agxTerrain::Shovel::getInnerVolume ( ) const
Returns
the shovel inner volume that is used in the dead load calculations

◆ getMaxPenetrationForce()

agx::Real agxTerrain::Shovel::getMaxPenetrationForce ( ) const

Set the maximum limit on penetration force (N) that the terrain will generate on this shovel.

(Default: Infinity)

Returns
The maximum penetration force that the terrain will act on this shovel

◆ getMinimumSubmergedContactLengthFraction()

agx::Real agxTerrain::Shovel::getMinimumSubmergedContactLengthFraction ( ) const

Get the minimum submerged cutting edge length fraction (0-1) that generates submerged cutting.

Default: 0.5

◆ getNoMergeExtensionDistance()

agx::Real agxTerrain::Shovel::getNoMergeExtensionDistance ( ) const

Get the margin outside the shovel bonding box where soil particle merging is forbidden.

◆ getNumberOfTeeth()

agx::UInt agxTerrain::Shovel::getNumberOfTeeth ( ) const
Returns
the teeth count of the shovel.

◆ getParentFrame()

agx::Frame * agxTerrain::Shovel::getParentFrame ( ) const
Returns
parent frame located at model center of the shovel

◆ getParticleInclusionMultiplier()

agx::Real agxTerrain::Shovel::getParticleInclusionMultiplier ( ) const
Returns
the radius multiplier for extending the inclusion bound with particle radius during post-excavation with particles in bucket. (Default: 1.0)
Note
- This will only be active post-excavation and NOT during excavation when we have active soil wedges.

◆ getPenetrationDepthThreshold()

agx::Real agxTerrain::Shovel::getPenetrationDepthThreshold ( ) const

Get the vertical penetration depth threshold for when the shovel tooth for penetration resistance should reach full effectiveness.

The penetration depth is defined as the vertical distance between the tip of a shovel tooth and the surface position of the height field. The penetration resistance will increase from a baseline of 10% until maximum effectiveness is reached when the vertical penetration depth of the shovel reaches the specified value. (Default: 0.5 m)

Returns
the vertical depth penetration threshold that will cause penetration resistance to reach full effectiveness.

◆ getPenetrationForce()

bool agxTerrain::Shovel::getPenetrationForce ( agx::Vec3 force,
agx::Vec3 torque 
) const

The result includes the active force and torque from the penetration resistance from the active terrain on the shovel if the shovel is digging in the terrain.

Parameters
force- the penetration force out parameter
torque- the penetration torque out parameter
Returns
true if resulting force and torque was written to force and torque - otherwise false

◆ getPenetrationForceScaling()

agx::Real agxTerrain::Shovel::getPenetrationForceScaling ( ) const
Returns
the linear scaling coefficient for the penetration force (Default: 1.0)

◆ getPenetrationResistance()

SoilPenetrationResistance * agxTerrain::Shovel::getPenetrationResistance ( ) const
Returns
shovel penetration resistance specific for this shovel instance

◆ getRigidBody()

virtual agx::RigidBody * agxTerrain::Shovel::getRigidBody ( ) const
overridevirtual
Returns
the base rigid body from the shovel object.

Implements agxSDK::ShovelInstance.

◆ getSecondaryCuttingDirection()

agx::Vec3 agxTerrain::Shovel::getSecondaryCuttingDirection ( ) const
Returns
the secondary cutting direction of the shovel

◆ getSecondarySeparationAngle()

agx::Real agxTerrain::Shovel::getSecondarySeparationAngle ( ) const
Returns
the secondary separation forward vector of the shovel

◆ getSecondarySeparationDeadloadLimit()

agx::Real agxTerrain::Shovel::getSecondarySeparationDeadloadLimit ( ) const
Returns
the dead-load limit where secondary separation will start to active where the forward direction starts to change according to the virtual separation plate created by the material inside the shovel

◆ getSeparationContactForce()

agx::Vec3 agxTerrain::Shovel::getSeparationContactForce ( ) const

Given geometry contacts exists and the solver has solved them - calculates total contact force between the terrain soil particle aggregate and the shovel.

This represents the separation force that is required to move the excavated soil in the shovel active zone.

Returns
the total contact force between given shovel and the soil particle aggregate in the terrain.

◆ getSeparationFrictionForce()

agx::Vec3 agxTerrain::Shovel::getSeparationFrictionForce ( ) const

Given geometry contacts exists and the solver has solved them - calculates total contact friction force between the terrain soil particle aggregate and the given shovel.

Returns
the total contact friction force between given shovel and the soil particle aggregate in the terrain.

◆ getSeparationNormalForce()

agx::Vec3 agxTerrain::Shovel::getSeparationNormalForce ( ) const

Given geometry contacts exists and the solver has solved them - calculates total contact normal force between the terrain soil particle aggregate and the shovel.

Returns
the total contact normal force between given shovel and the soil particle aggregate in the terrain.

◆ getSetZeroAggregateVelocity()

agx::Bool agxTerrain::Shovel::getSetZeroAggregateVelocity ( ) const
Returns
true if the innerbody aggregate should have zero velocity, false otherwise.

◆ getShovelAggregateContactMaterial()

agx::ContactMaterial * agxTerrain::Shovel::getShovelAggregateContactMaterial ( Shovel::ExcavationMode  mode = Shovel::ExcavationMode::PRIMARY) const

Get the explicitly set contact material in a shovel-aggregate contact corresponding to a specified excavation mode for the shovel.

This overrides the shovel-terrain contact material properties that are used in the default case.

Parameters
mode- The specified excavation mode that corresponds to the aggregate.
Note
- this returns nullptr if the shovel is not valid.
Returns
a contact material if one has been explicitly set, nullptr otherwise.

◆ getShovelAggregateContacts()

agxCollide::GeometryContactPtrVector agxTerrain::Shovel::getShovelAggregateContacts ( Shovel::ExcavationMode  excavationMode) const

Get the shovel <-> aggregate contacts with the soil particle aggregate for the given excavation mode.

Parameters
excavationMode- the excavation mode that the soil aggregate belongs too ( PRIMARY, DEFORM_BACK, DEFORM_RIGHT, DEFORM_LEFT )
Returns
vector containing the geometry contacts between the specified shovel and the aggregate.

◆ getShovelTerrainContactMaterialContainer()

ShovelAggregateContactMaterialContainer * agxTerrain::Shovel::getShovelTerrainContactMaterialContainer ( ) const
Returns
the ShovelAggregateContactMaterialContainer that contains all contact materials explicitly set for this shovel.

◆ getSoilAggregateMass()

agx::Real agxTerrain::Shovel::getSoilAggregateMass ( Shovel::ExcavationMode  excavationMode) const

Returns the total soil aggregate mass in the shovel for the specific excavation mode.

This function can be used to extract the active mass that the shovel is trying to displace in the failure zones during digging and deformation.

Parameters
excavationMode- The excavation mode of the aggregate that will be used to extract the mass.
Returns
the total aggregate mass, including inner shape if excavation mode is PRIMARY_EXCAVATION.

◆ getSoilParticleAggregate()

SoilParticleAggregate * agxTerrain::Shovel::getSoilParticleAggregate ( ) const
Returns
soil particle aggregate specific for this shovel instance

◆ getSoilPenetrationModel()

bool agxTerrain::Shovel::getSoilPenetrationModel ( agxTerrain::SoilPenetrationResistance::PenetrationModel model) const

Get the soil penetration model used for the shovel.

Available models are:

  • NO_MODEL - Only use the soil pressure above the cutting edge to determine the penetration resistance.
  • ELASTIC_PLASTIC_LIMIT - Calculate the expected penetration resistance based in the elastic plastic limit. (Default)
  • PLASTIC - Calculate the expected penetration resistance based on plastic expansion due to tooth pressure.
Parameters
model- The output variable where the penetration model that is used will be put, if successful.
Returns
true if the model was successfully extracted, false otherwise.

◆ getTeethSettings()

Shovel::TeethSettings & agxTerrain::Shovel::getTeethSettings ( )

◆ getTerrainManager()

agxSDK::TerrainManager * agxTerrain::Shovel::getTerrainManager ( )
protected

◆ getTerrainsInSimulation()

TerrainPtrVec agxTerrain::Shovel::getTerrainsInSimulation ( )
protected

◆ getToothLength()

agx::Real agxTerrain::Shovel::getToothLength ( ) const
Returns
the tooth length of the shovel.

◆ getToothMaximumRadius()

agx::Real agxTerrain::Shovel::getToothMaximumRadius ( ) const
Returns
the maximum radius of the shovel teeth.

◆ getToothMinimumRadius()

agx::Real agxTerrain::Shovel::getToothMinimumRadius ( ) const
Returns
the minimum radius of the shovel teeth.

◆ getTopEdge()

const agx::Line & agxTerrain::Shovel::getTopEdge ( ) const
Returns
the top edge in local space.

◆ getTopEdgeWorld()

agx::Line agxTerrain::Shovel::getTopEdgeWorld ( ) const
Returns
the top edge in world space.

◆ getUseCustomFricionModel()

bool agxTerrain::Shovel::getUseCustomFricionModel ( ) const
Returns
whenever custom friction models should be used in the shovel <-> aggregate contacts. (Default: true)

◆ getVerticalBladeSoilMergeDistance()

agx::Real agxTerrain::Shovel::getVerticalBladeSoilMergeDistance ( ) const

Get the vertical distance under the blade cutting edge that the soil is allowed to instantly merge up to.

◆ getVoxelCollisionGeometries()

const agxCollide::GeometryRefVector & agxTerrain::Shovel::getVoxelCollisionGeometries ( ) const
Returns
the shovel geometries colliding with voxels in the terrain

◆ getWedgeAggregate()

const agx::RigidBody * agxTerrain::Shovel::getWedgeAggregate ( Shovel::ExcavationMode  excavationMode) const
Returns
the current wedge aggregate in the specified collection given an excavation mode if it exists, nullptr otherwise.

◆ initalizeContactMaterialsForExistingTerrains()

void agxTerrain::Shovel::initalizeContactMaterialsForExistingTerrains ( agxSDK::Simulation simulation)
protected

Initialize contact materials when added to simulation.

◆ isActive()

bool agxTerrain::Shovel::isActive ( ) const

◆ isDigging()

bool agxTerrain::Shovel::isDigging ( ) const

Check if the shovel is currently in digging mode with a terrain, i.e if the cutting edge is submerged.

Note
Internally check if the shovel is acting on an active terrain or not, see getActiveTerrain.
Returns
whether the Shovel is currently digging or not.

◆ isValid()

virtual bool agxTerrain::Shovel::isValid ( ) const
overridevirtual

◆ last()

virtual void agxTerrain::Shovel::last ( )
overrideprotectedvirtual

Callback to be executed at the end of the time step Shovel and Terrain step events are synchronized via the TerrainManager.

Reimplemented from agxSDK::ShovelInstance.

◆ post()

virtual void agxTerrain::Shovel::post ( )
overrideprotectedvirtual

Executes post-step events for agxTerrain::Shovel in the simulation.

Shovel and Terrain step events are synchronized via the TerrainManager.

Reimplemented from agxSDK::ShovelInstance.

◆ pre()

virtual void agxTerrain::Shovel::pre ( )
overrideprotectedvirtual

Executes pre-step events for agxTerrain::Shovel in the simulation.

Shovel and Terrain step events are synchronized via the TerrainManager. In the pre step we:

  • Filter contact points for the deformers
  • Calculate dead load fraction
  • Check and if need be, set the internal contact materials (this is a new ContactMaterial and transfer each pre step)
  • Run the onPre calls in all internal classes (aggregates, deformers, pen resistance)

Reimplemented from agxSDK::ShovelInstance.

◆ preCollide()

virtual void agxTerrain::Shovel::preCollide ( )
overrideprotectedvirtual

Executes pre-collide events for agxTerrain::Shovel in the simulation.

Shovel and Terrain step events are synchronized via the TerrainManager. In the preCollide step, we:

  • Check if the shovel is active either by colliding with a terrain or if there are particles in the shovel.
  • If we need to, we create soil wedges in the primary and secondary deformers. (onPreCollide calls)
  • Forbidden bounds around the shovel are calculated.

Reimplemented from agxSDK::ShovelInstance.

◆ removeNotification()

virtual void agxTerrain::Shovel::removeNotification ( )
overrideprotectedvirtual

Remove notification when this shovel is removed from a simulation.

Reimplemented from agxSDK::ShovelInstance.

◆ setAggregateMaterial()

void agxTerrain::Shovel::setAggregateMaterial ( agx::Material material)
protected

Set the common material used by the SoilParticleAggregates inside the primary active zone and deformers.

Propagates the material into the internal classes.

◆ setAlwaysRemoveShovelContacts()

void agxTerrain::Shovel::setAlwaysRemoveShovelContacts ( bool  enable)

Set to true/false if shovel <-> terrain contacts should always be removed param enable - set to true/false if shovel <-> terrain contacts should always be removed.

◆ setContactRegionThreshold()

void agxTerrain::Shovel::setContactRegionThreshold ( agx::Real  contactRegionThreshold)

Set the starting distance threshold from the shovel planes where regular geometry contacts between the shovel underside and the terrain can be created.

Contacts that are not past the distance threshold will be filtered away.

Parameters
contactRegionThreshold- The contact distance threshold from the shovel planes where regular geometry contacts between the shovel underside and the terrain are allowed to be created. ( Default: cuttingEdgeLength / 10.0 )

◆ setContactRegionVerticalLimit()

void agxTerrain::Shovel::setContactRegionVerticalLimit ( agx::Real  verticalLimit)

Set the maximum vertical distance from the shovel bottom plane where regular geometry contacts between the shovel and the terrain are allowed to be created.

Contacts past the distance will be filtered away.

Parameters
verticalLimit- The vertical contact distance threshold from the shovel planes where regular geometry contacts between the shovel underside and the terrain are allowed to be created. ( Default: cuttingEdgeLength / 10.0 )

◆ setCuttingDirection()

void agxTerrain::Shovel::setCuttingDirection ( agx::Vec3  cuttingDirection)
Parameters
cuttingDirection- new cutting direction in local space.

◆ setCuttingEdge()

void agxTerrain::Shovel::setCuttingEdge ( agx::Line  cuttingEdge)

Set the cutting edge in local space.

Parameters
cuttingEdge- new cutting edge in local space.

◆ setEnable()

void agxTerrain::Shovel::setEnable ( bool  enable)

Change state enable of this shovel.

If the shovel is disabled, it can not be used for excavation in a terrain. Default: true.

Parameters
enable- true to enable, false to disable

◆ setEnableForTerrain()

void agxTerrain::Shovel::setEnableForTerrain ( Terrain terrain,
bool  enable 
)

Set if the shovel is enabled for the particular terrain.

Prerequisites: Shovel needs to be added to the simulation. Default: True, ie enabled for any terrain.

◆ setEnableInnerShapeCreateDynamicMass()

void agxTerrain::Shovel::setEnableInnerShapeCreateDynamicMass ( bool  enable)

Set if inner shape alone should always create dynamic mass.

The alternative is to only create dynamic mass in the inner shape when primary excavation soil wedges create mass. Default: true.

Parameters
enable- true if inner shape should always create dynamic mass (default), false otherwise.

◆ setEnableParticleForceFeedback()

void agxTerrain::Shovel::setEnableParticleForceFeedback ( bool  enable)

Set whenever the excavation force feedback during PRIMARY excavation should be generated from particle contacts instead of aggregate contacts.

Parameters
enable- true if particles should generate contact forces on the shovel, false otherwise. (Default: false)

◆ setEnableParticleFreeDeformers()

void agxTerrain::Shovel::setEnableParticleFreeDeformers ( bool  enable)

Set true/false if the shovel deformers should make particle free deformations.

(Default: false) Note, if this is true all excavation modes will make particle free deformations. Even if enableCreateDynamicMass is set to false for one or more excavation modes.

Parameters
enable- true if the shovel deformers mode should make particle free deformations.

◆ setEnableShovelTerrainGeometryContacts()

void agxTerrain::Shovel::setEnableShovelTerrainGeometryContacts ( Terrain terrain,
bool  enable 
)

Set if regular geometry contacts should be created between the shovel geometries and the associated terrain geometry.

◆ setExcavationSettings()

void agxTerrain::Shovel::setExcavationSettings ( ExcavationMode  mode,
ExcavationSettings  excavationSettings 
)

Set a settings object for an ExcavationMode of the shovel.

Excavation modes are as follows:

  • PRIMARY - The primary mode of excavation, where the shovel digs along the cutting direction in the terrain horizontal plane.
  • DEFORM_BACK - The mode of excavation where the shovel is digging in the opposite direction of the cutting direction in the terrain horizontal plane. ( Example: Backside grading )
  • DEFORM_LEFT - The mode of excavation where the shovel is digging to the counter-clock wise (Left) direction orthogonal to the cutting direction in the terrain horizontal plane. ( Example: Side push/grading )
  • DEFORM_RIGHT - The mode of excavation where the shovel is digging to the clock wise (Right) direction orthogonal to the cutting direction in the terrain horizontal plane. ( Example: Side push/grading )
    Parameters
    mode- The specified excavation mode that the settings will apply to.
    excavationSettings- The specified excavation settings that will apply to the excavation mode.

◆ setMaxPenetrationForce()

void agxTerrain::Shovel::setMaxPenetrationForce ( agx::Real  maxPenetrationForce)

Set a maximum limit on penetration force (N) that the terrain will generate on this shovel.

(Default: Infinity)

Parameters
maxPenetrationForce- The maximum penetration force that the terrain will act on this shovel

◆ setMinimumSubmergedContactLengthFraction()

void agxTerrain::Shovel::setMinimumSubmergedContactLengthFraction ( agx::Real  minimumSubmergedContactLengthFraction)

Set the minimum submerged cutting edge length fraction (0-1) that generates submerged cutting.

Default: 0.5

◆ setNoMergeExtensionDistance()

void agxTerrain::Shovel::setNoMergeExtensionDistance ( agx::Real  extensionDistance)

Set the extension outside the shovel bounding box where soil particle merging is forbidden.

◆ setNumberOfTeeth()

void agxTerrain::Shovel::setNumberOfTeeth ( agx::UInt  count)
Parameters
count- new teeth count of shovel.

◆ setParticleInclusionMultiplier()

void agxTerrain::Shovel::setParticleInclusionMultiplier ( agx::Real  radiusMultiplier)

◆ setPenetrationDepthThreshold()

void agxTerrain::Shovel::setPenetrationDepthThreshold ( agx::Real  depthThreshold)

Set the vertical penetration depth threshold for when the shovel tooth for penetration resistance should reach full effectiveness.

The penetration depth is defined as the vertical distance between the tip of a shovel tooth and the surface position of the height field. The penetration resistance will increase from a baseline of 10% until maximum effectiveness is reached when the vertical penetration depth of the shovel reaches the specified value. (Default: 0.5 m)

Parameters
depthThreshold- the vertical pressure threshold that will cause penetration resistance to start.

◆ setPenetrationForceScaling()

void agxTerrain::Shovel::setPenetrationForceScaling ( agx::Real  penetrationForceScaling)

Set the linear scaling coefficient for the penetration force (Default: 1.0)

Parameters
penetrationForceScaling- The coefficient for scaling the penetration force that the terrain will give on this shovel

◆ setSecondarySeparationDeadloadLimit()

void agxTerrain::Shovel::setSecondarySeparationDeadloadLimit ( agx::Real  secondarySeparationLimit)

Sets the dead-load limit where secondary separation will start to activate where the forward direction starts to change according to the virtual separation plate created by the material inside the shovel.

Parameters
secondarySeparationLimit- The dead load limit where secondary separation will start to activate (Default: 0.8)

◆ setShovelAggregateContactMaterial()

bool agxTerrain::Shovel::setShovelAggregateContactMaterial ( agx::ContactMaterial contactMaterial,
Shovel::ExcavationMode  mode = Shovel::ExcavationMode::PRIMARY 
)

Explicitly set contact material properties in a shovel-aggregate contact for a specific excavation mode for the shovel.

This overrides the shovel-terrain contact material properties that are used in the default case.

Parameters
contactMaterial- The contact material to be set in the aggregate contact.
mode- The specified excavation mode that corresponds to the aggregate.
Returns
true if the contact material was successfully set, false otherwise.

◆ setSoilPenetrationModel()

bool agxTerrain::Shovel::setSoilPenetrationModel ( agxTerrain::SoilPenetrationResistance::PenetrationModel  model)

Set the soil penetration model used for the shovel.

Available models are:

  • NO_MODEL - Only use the soil pressure above the cutting edge to determine the penetration resistance.
  • ELASTIC_PLASTIC_LIMIT - Calculate the expected penetration resistance based in the elastic plastic limit. (Default)
  • PLASTIC - Calculate the expected penetration resistance based on plastic expansion due to tooth pressure.
Parameters
model- The specified penetration model to use in the shovel against the terrain. ( Default: ELASTIC_PLASTIC_LIMIT )
Returns
true if the model was successfully changed, false otherwise.

◆ setToothLength()

void agxTerrain::Shovel::setToothLength ( agx::Real  length)
Parameters
length- new tooth length.

◆ setToothMaximumRadius()

void agxTerrain::Shovel::setToothMaximumRadius ( agx::Real  radius)
Parameters
radius- new maximum radius of the shovel teeth.

◆ setToothMinimumRadius()

void agxTerrain::Shovel::setToothMinimumRadius ( agx::Real  radius)
Parameters
radius- new minimum radius of the shovel teeth.

◆ setTopEdge()

void agxTerrain::Shovel::setTopEdge ( agx::Line  topEdge)

Set the top edge in local space.

Parameters
topEdge- new top edge in local space.

◆ setUseCustomFrictionModel()

void agxTerrain::Shovel::setUseCustomFrictionModel ( bool  enable)

◆ setVerticalBladeSoilMergeDistance()

void agxTerrain::Shovel::setVerticalBladeSoilMergeDistance ( agx::Real  verticalSoilBladeMergeDistance)

Sets the vertical distance under the blade cutting edge that the soil is allowed to instantly merge up to.

◆ setZeroAggregateVelocity()

void agxTerrain::Shovel::setZeroAggregateVelocity ( bool  enable)

Set whenever the innerbody aggregate should have zero velocity before solve step as opposed to using particle or cached post-solve velocities from the previous time step.

Parameters
enable- true if the innerbody aggregate should have zero velocity, false otherwise.

◆ shovelHasParticles()

bool agxTerrain::Shovel::shovelHasParticles ( ) const
protected

Member Data Documentation

◆ m_activeTerrain

Terrain* agxTerrain::Shovel::m_activeTerrain
protected

Definition at line 1103 of file Shovel.h.

◆ m_activeZone

PrimaryActiveZoneRef agxTerrain::Shovel::m_activeZone
protected

Definition at line 1097 of file Shovel.h.

◆ m_aggregateContactGenerator

AggregateContactGeneratorRef agxTerrain::Shovel::m_aggregateContactGenerator
protected

Definition at line 1098 of file Shovel.h.

◆ m_aggregateMaterial

agx::MaterialRef agxTerrain::Shovel::m_aggregateMaterial
protected

Definition at line 1101 of file Shovel.h.

◆ m_collisionBound

agxCollide::BoundingAABB agxTerrain::Shovel::m_collisionBound
protected

Definition at line 1106 of file Shovel.h.

◆ m_connectedShovel

Shovel* agxTerrain::Shovel::m_connectedShovel
protected

Definition at line 1091 of file Shovel.h.

◆ m_contactThreshold

agx::Real agxTerrain::Shovel::m_contactThreshold
protected

Definition at line 1077 of file Shovel.h.

◆ m_cuttingDirection

agx::Vec3 agxTerrain::Shovel::m_cuttingDirection
protected

Definition at line 1063 of file Shovel.h.

◆ m_cuttingEdge

agx::Line agxTerrain::Shovel::m_cuttingEdge
protected

Definition at line 1061 of file Shovel.h.

◆ m_deadLoadFraction

agx::Real agxTerrain::Shovel::m_deadLoadFraction
protected

Definition at line 1081 of file Shovel.h.

◆ m_deformController

DeformControllerRef agxTerrain::Shovel::m_deformController
protected

Definition at line 1099 of file Shovel.h.

◆ m_excavationSettings

std::array< ExcavationSettings, 4 > agxTerrain::Shovel::m_excavationSettings
protected

Definition at line 1075 of file Shovel.h.

◆ m_flags

Flags agxTerrain::Shovel::m_flags
protected

Definition at line 1072 of file Shovel.h.

◆ m_forbiddenBounds

agx::Vector<agxCollide::BoundingAABB> agxTerrain::Shovel::m_forbiddenBounds
protected

Definition at line 1104 of file Shovel.h.

◆ m_innerContactArea

agx::Real agxTerrain::Shovel::m_innerContactArea
protected

Definition at line 1083 of file Shovel.h.

◆ m_isActive

bool agxTerrain::Shovel::m_isActive
protected

Definition at line 1102 of file Shovel.h.

◆ m_minimumSubmergedContactLengthFraction

agx::Real agxTerrain::Shovel::m_minimumSubmergedContactLengthFraction
protected

Definition at line 1069 of file Shovel.h.

◆ m_noMergeExtensionDistance

agx::Real agxTerrain::Shovel::m_noMergeExtensionDistance
protected

Definition at line 1067 of file Shovel.h.

◆ m_parentFrame

agx::FrameRef agxTerrain::Shovel::m_parentFrame
protected

Definition at line 1085 of file Shovel.h.

◆ m_particleInclusionMultiplier

agx::Real agxTerrain::Shovel::m_particleInclusionMultiplier
protected

Definition at line 1071 of file Shovel.h.

◆ m_penetrationResistance

SoilPenetrationResistanceRef agxTerrain::Shovel::m_penetrationResistance
protected

Definition at line 1095 of file Shovel.h.

◆ m_secondarySeparationDeadLoadLimit

agx::Real agxTerrain::Shovel::m_secondarySeparationDeadLoadLimit
protected

Definition at line 1070 of file Shovel.h.

◆ m_settingsAreDirty

bool agxTerrain::Shovel::m_settingsAreDirty
protected

Definition at line 1089 of file Shovel.h.

◆ m_shovelAggregateCMContainer

ShovelAggregateContactMaterialContainerRef agxTerrain::Shovel::m_shovelAggregateCMContainer
protected

Definition at line 1093 of file Shovel.h.

◆ m_shovelBody

agx::RigidBodyRef agxTerrain::Shovel::m_shovelBody
protected

Definition at line 1060 of file Shovel.h.

◆ m_soilParticleAggregate

SoilParticleAggregateRef agxTerrain::Shovel::m_soilParticleAggregate
protected

Definition at line 1094 of file Shovel.h.

◆ m_soilPenetrationParameters

SoilPenetrationParameters agxTerrain::Shovel::m_soilPenetrationParameters
protected

Definition at line 1073 of file Shovel.h.

◆ m_teethSettings

TeethSettings agxTerrain::Shovel::m_teethSettings
protected

Definition at line 1065 of file Shovel.h.

◆ m_topEdge

agx::Line agxTerrain::Shovel::m_topEdge
protected

Definition at line 1062 of file Shovel.h.

◆ m_verticalContactThreshold

agx::Real agxTerrain::Shovel::m_verticalContactThreshold
protected

Definition at line 1078 of file Shovel.h.

◆ m_verticalSoilBladeMergeDistance

agx::Real agxTerrain::Shovel::m_verticalSoilBladeMergeDistance
protected

Definition at line 1068 of file Shovel.h.

◆ m_voxelCollisionGeometries

agxCollide::GeometryRefVector agxTerrain::Shovel::m_voxelCollisionGeometries
protected

Definition at line 1088 of file Shovel.h.

◆ m_voxelsInPrimaryActiveZoneLastTimeStep

agx::Vec3iVector agxTerrain::Shovel::m_voxelsInPrimaryActiveZoneLastTimeStep
protected

Definition at line 1105 of file Shovel.h.


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