35 class TerrainMaterial;
36 class TerrainToolCollection;
71 Shovel* connectedShovel=
nullptr);
548 ENABLE_CREATE_DYNAMIC_MASS = 1 << 1,
549 ENABLE_FORCE_FEEDBACK = 1 << 2,
551 using Flags = agx::BitState<StateFlags, agx::UInt32>;
562 agx::Bool initializeCollection( TerrainToolCollection* collection,
agxSDK::Simulation* simulation );
568 void uninitializeCollection( TerrainToolCollection* collection,
agxSDK::Simulation* simulation );
574 void onPre( TerrainToolCollection* collection );
580 void onPost( TerrainToolCollection* collection );
582 bool getShovelPlanes(TerrainToolCollection* collection,
583 agx::Plane& bottomPlane,
584 agx::Plane& backPlane,
585 agx::Plane& leftPlane,
586 agx::Plane& rightPlane);
588 void removeTerrainShovelContacts(TerrainToolCollection* collection);
590 void removeTerrainShovelContactsDeformer(TerrainToolCollection* collection);
592 bool isEdgeSubmerged(const
agx::Line& edge, const Terrain* terrain) const;
594 bool isEdgeSubmergedInSolid(const
agx::Line& edge, const Terrain* terrain) const;
596 bool isEdgeSubmergedInHeightfield(const
agx::Line& edge, const
agxCollide::HeightField* heightfield, const Terrain* terrain) const;
598 agx::Real getSubmergedEdgeLength(const
agx::Line& edge, const Terrain* terrain) const;
600 agx::Vec3 getCuttingEdgeVelocity();
602 void correctShovelVectors();
604 void calculateDeadLoadFraction( const Terrain* terrain,
605 const ActiveZone* activeZone,
606 const
agx::Physics::GranularBodyPtrVector& innerParticles );
608 void setInnerContactArea(
agx::Real contactArea );
610 void setSettingsAreDirty(
bool enable);
612 bool getSettingsAreDirty() const;
614 agx::Real computeDefaultContactRegionThreshold() const;
616 Shovel* getConnectedShovel();
632 agxCollide::GeometryRefVector createVoxelCollisionGeometries(
agx::Real tessellationLevel ) const;
645 REMOVE_SHOVEL_CONTACTS = 1 << 1,
646 INNER_SHAPE_CREATE_DYNAMIC_MASS = 1 << 2,
647 ENABLE_PARTICLE_FREE_DEFORMATION = 1 << 3,
648 ENABLE_PARTICLE_FORCE_FEEDBACK = 1 << 4
650 using Flags = agx::BitState<StateFlags, agx::UInt32>;
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXTERRAIN_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Class for writing serialized data in binary format to a stream.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Class containing the settings for the different ExcavationModes for a shovel.
ExcavationSettings()
Default constructor.
void setEnable(bool enable)
Set whether the excavation mode should be enabled, creating dynamic mass and generating force feedbac...
ExcavationSettings(agx::UInt32 state)
Constructor taking an internal state variable from another excavation setting object.
agx::UInt32 getState() const
void store(agxStream::OutputArchive &out) const
bool getEnableForceFeedback() const
void setEnableForceFeedback(bool enable)
Set true/false if the excavation mode should generate force feedback from created aggregates.
void restore(agxStream::InputArchive &in)
void setEnableCreateDynamicMass(bool enable)
Set true/false if the excavation mode should create dynamic mass.
bool getEnableCreateDynamicMass() const
bool getEnableParticleFreeDeformers() const
void setToothMinimumRadius(agx::Real radius)
void setMinimumSubmergedContactLengthFraction(agx::Real minimumSubmergedContactLengthFraction)
Set 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::Real m_particleInclusionMultiplier
agx::Line getCuttingEdge() const
agx::Plane getCurrentSeparationPlane(Terrain *terrain, ExcavationMode mode) const
agx::Real getMaxPenetrationForce() const
Set the maximum limit on penetration force (N) that the terrain will generate on this shovel.
agx::Real m_verticalContactThreshold
agx::RigidBodyObserver m_shovelBody
agx::Real getVerticalBladeSoilMergeDistance() const
Get the vertical distance under the blade cutting edge that the soil is allowed to instantly merge up...
void setCuttingDirection(agx::Vec3 cuttingDirection)
agx::Real getToothLength() const
agx::Real getContactRegionVerticalLimit() const
agx::Real m_contactThreshold
agx::Real getPenetrationDepthThreshold() const
Get the vertical penetration depth threshold for when the shovel tooth for penetration resistance sho...
bool getAlwaysRemoveShovelContacts() const
agx::Vec3 m_cuttingDirection
void setEnableParticleForceFeedback(bool enable)
Set whenever the excavation force feedback during PRIMARY excavation should be generated from particl...
agx::UInt getNumberOfTeeth() const
agx::Real getParticleInclusionMultiplier() const
void setToothMaximumRadius(agx::Real radius)
Shovel * m_connectedShovel
bool getEnableParticleForceFeedback()
agx::Real m_noMergeExtensionDistance
void setNumberOfTeeth(agx::UInt count)
agx::Real m_deadLoadFraction
bool setSoilPenetrationModel(agxTerrain::SoilPenetrationResistance::PenetrationModel model, agxTerrain::Terrain *terrain)
Set the soil penetration model used for the specified shovel in the given terrain.
void setContactRegionThreshold(agx::Real contactRegionThreshold)
Set the starting distance threshold from the shovel planes where regular geometry contacts between th...
void setContactRegionVerticalLimit(agx::Real verticalLimit)
Set the maximum vertical distance from the shovel bottom plane where regular geometry contacts betwee...
void setToothLength(agx::Real length)
void setEnableParticleFreeDeformers(bool enable)
Set true/false if the shovel deformers should make particle free deformations.
void setTopEdge(agx::Line topEdge)
Set the top edge in local space.
void setMaxPenetrationForce(agx::Real maxPenetrationForce)
Set a maximum limit on penetration force (N) that the terrain will generate on this shovel.
agx::Real m_toothMaxRadius
agx::Real m_minimumSubmergedContactLengthFraction
agx::BitState< StateFlags, agx::UInt32 > Flags
bool getEnable() const
Access the state enable flag.
agx::Vec3 getCuttingDirectionWorld() const
agxCollide::GeometryRefVector m_voxelCollisionGeometries
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 fil...
void setNoMergeExtensionDistance(agx::Real extensionDistance)
Set the extension outside the shovel bounding box where soil particle merging is forbidden.
agx::Vec3 getCuttingDirection() const
agx::Real getMinimumSubmergedContactLengthFraction() const
Get the minimum submerged cutting edge length fraction (0-1) that generates submerged cutting.
agx::Real m_verticalSoilBladeMergeDistance
void setEnableInnerShapeCreateDynamicMass(bool enable)
Set if inner shape alone should always create dynamic mass.
agx::Real getSecondarySeparationDeadloadLimit() const
agx::Line getTopEdgeWorld() const
std::array< ExcavationSettings, 4 > m_excavationSettings
bool getEnableInnerShapeCreateDynamicMass() const
Get if inner shape alone should always create dynamic mass.
void setEnable(bool enable)
Change state enable of this shovel Default: true.
bool getSoilPenetrationModel(agxTerrain::Terrain *terrain, agxTerrain::SoilPenetrationResistance::PenetrationModel &model) const
Get the soil penetration model used for the specified shovel in the given terrain.
agx::Real getSecondarySeparationAngle(Terrain *terrain) const
void setParticleInclusionMultiplier(agx::Real radiusMultiplier)
agx::Line getCuttingEdgeWorld() const
agx::Real getToothMinimumRadius() const
void setSecondarySeparationDeadloadLimit(agx::Real secondarySeparationLimit)
Sets the dead-load limit where secondary separation will start to activate where the forward directio...
void setExcavationSettings(ExcavationMode mode, ExcavationSettings excavationSettings)
Set a settings object for an ExcavationMode of the shovel.
Shovel(agx::RigidBody *shovelBody, const agx::Line &topEdge, const agx::Line &cuttingEdge, const agx::Vec3 &cuttingDirection, Shovel *connectedShovel=nullptr)
Basic constructor.
void setPenetrationForceScaling(agx::Real penetrationForceScaling)
Set the linear scaling coefficient for the penetration force (Default: 1.0)
agx::Real getInnerContactArea() const
Get the last computed inner contact area of the shovel, i.e the estimated cross-section area of the i...
void setPenetrationDepthThreshold(agx::Real depthThreshold)
Set the vertical penetration depth threshold for when the shovel tooth for penetration resistance sho...
agx::Real getToothMaximumRadius() const
agx::Real m_secondarySeparationDeadLoadLimit
agx::Vec3 getSecondaryCuttingDirection(Terrain *terrain) const
void setAlwaysRemoveShovelContacts(bool enable)
Set to true/false if shovel <-> terrain contacts should always be removed param enable - set to true/...
void setVerticalBladeSoilMergeDistance(agx::Real verticalSoilBladeMergeDistance)
Sets the vertical distance under the blade cutting edge that the soil is allowed to instantly merge u...
agx::Real getPenetrationForceScaling() const
agx::RigidBody * getRigidBody() const
SoilPenetrationParameters m_soilPenetrationParameters
agx::Real m_innerContactArea
ExcavationSettings & getExcavationSettings(ExcavationMode mode)
ExcavationMode
Enum for describing the different excavation modes of a shovel: PRIMARY - The primary mode of excavat...
void setCuttingEdge(agx::Line cuttingEdge)
Set the cutting edge in local space.
agx::Real computeCuttingEdgeLength() const
agx::Real m_toothMinRadius
agx::Line getTopEdge() const
agx::Real getContactRegionThreshold() const
Get the starting distance threshold from the shovel planes where regular geometry contacts between th...
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Class representing the mathematical concept of a plane, also called a half- space.
Base class providing referencing counted objects.
The rigid body class, combining a geometric model and a frame of reference.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
This namespace consists of a set of classes for handling geometric intersection tests including boole...
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.