38 class ShovelAggregateContactMaterialContainer;
110 Shovel* connectedShovel=
nullptr,
111 ShovelDebugRenderSettings* settings =
nullptr);
690 ENABLE_CREATE_DYNAMIC_MASS = 1 << 1,
691 ENABLE_FORCE_FEEDBACK = 1 << 2
693 using Flags = agx::BitState<StateFlags, agx::UInt32>;
694 Flags m_excavationFlags;
704 agx::Plane calculateCutTopPlane();
711 void setEdgesCodirectional();
716 agx::Bool canDeformTerrain(Terrain* terrain) const;
718 bool getShovelPlanes(
agx::Plane& bottomPlane,
719 agx::Plane& backPlane,
720 agx::Plane& leftPlane,
721 agx::Plane& rightPlane) const;
723 void removeTerrainShovelContacts(Terrain* terrain);
726 void removeTerrainShovelContactsDeformer(Terrain* terrain);
728 agx::Real getSubmergedEdgeLength(const
agx::Line& edge, const Terrain* terrain) const;
730 agx::Vec3 getCuttingEdgeVelocity();
732 void setInnerContactArea(
agx::Real contactArea );
735 void setSettingsAreDirty(
bool enable);
737 bool getSettingsAreDirty() const;
739 Shovel* getConnectedShovel();
741 agx::Physics::GranularBodySystem* getGranularBodySystem() const;
743 virtual
void onAssemblyAdd(
agxSDK::Assembly* assembly ) override;
750 agx::Vec3 getUpDirection() const;
752 const
agx::Vec3iVector& getVoxelsInActiveZoneLastTimeStep();
754 ShovelDebugRenderSettings* getDebugRenderSettings()
const {
return m_debugRenderSettings; }
771 agx::Vec3 ensureCuttingDirectionIsNormalized(
agx::Vec3 cuttingDirection);
774 agx::Real computeDefaultContactRegionThreshold() const;
781 agx::Frame* createParentFrame();
783 agxSDK::TerrainManager* getTerrainManager();
790 virtual
void addNotification() override;
795 virtual
void removeNotification() override;
801 void setAggregateMaterial(
agx::Material* material);
806 void initalizeContactMaterialsForExistingTerrains(
agxSDK::Simulation* simulation);
813 void checkContactMaterials();
823 virtual
void preCollide() override;
834 virtual
void pre() override;
840 virtual
void post() override;
846 virtual
void last() override;
848 void calculateDeadLoadFraction();
853 bool shovelHasParticles() const;
858 void clearActiveZoneWedges() const;
863 void calculateForbiddenBounds();
882 void createDeformers(
const agx::Line& cuttingEdge,
896 void addDeformers(
const std::array<DeformerCollectionRef, 3>& deformers);
898 bool shouldDeformMass(
Terrain* terrain);
972 agx::Vector<
agx::ContactMaterialRef > m_contactMaterials;
#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)
Axis aligned bounding box implementation.
The geometry representation used by the collision detection engine.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
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...
static bool isGeometryShovel(const agxCollide::Geometry *geometry)
static bool isRigidBodyShovel(const agx::RigidBody *rigidBody)
static void setIsRigidBodyShovel(agx::RigidBody *rigidBody, bool enable)
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
Shovel object used to interact with a terrain via an active zone that converts solid terrain to dynam...
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 mo...
agx::Plane getCutTopPlaneWorld() const
agx::Vec3 getAggregateTerrainContactForce(Shovel::ExcavationMode excavationMode) const
Get the terrain <-> aggregate contact force for the given excavation mode.
agx::Real getTotalSoilBulkVolume(agx::Real packingFraction=0.67) const
Returns the total bulk volume moved by the shovel, both in the inner shapes and in the soil wedges in...
agx::Vec3 getContactForce() const
Given geometry contacts exists and the solver has solved them - calculates total shovel contact force...
agx::Real getInnerSoilBulkVolume() const
Get the last computed dead load bulk volume of the shovel, i.e the inner volume that is filled with d...
agx::Real getAggregateTerrainContactDepth(Shovel::ExcavationMode excavationMode) const
void setCuttingDirection(agx::Vec3 cuttingDirection)
agx::RigidBodyRef m_shovelBody
agx::Real getInnerSoilMass() const
agx::Vec3 getSeparationNormalForce() const
Given geometry contacts exists and the solver has solved them - calculates total contact normal force...
bool collisionGeometriesAreInsideTerrain(Terrain *terrain) const
Check if any of the collision geometries are inside terrain bounds.
agx::Real getInnerVolume() const
SoilParticleVector getInnerSoilParticles() const
ShovelDebugRenderSettingsRef m_debugRenderSettings
agx::Vec3 m_cuttingDirection
DeformController * getDeformController() const
static Shovel * find(const agxSDK::Simulation *simulation, const agx::Name &name)
Find first shovel with given name.
agx::Plane getCurrentSeparationPlane(ExcavationMode mode) const
virtual bool isValid() const override
Shovel(agx::RigidBody *shovelBody, const agx::Line &topEdge, const agx::Line &cuttingEdge, const agx::Vec3 &cuttingDirection, Shovel *connectedShovel=nullptr, ShovelDebugRenderSettings *settings=nullptr)
Basic constructor.
Shovel * m_connectedShovel
const agx::Vector< agxCollide::BoundingAABB > & getForbiddenBounds()
Get the shovels forbidden bounds.
agx::Real m_deadLoadFraction
static ShovelPtrVector findAll(const agxSDK::Simulation *simulation)
Finds all shovels in the given simulation.
agx::Frame * getParentFrame() const
SoilParticleAggregate * getSoilParticleAggregate() const
agx::Material * getAggregateMaterial() const
void setEnableShovelTerrainGeometryContacts(Terrain *terrain, bool enable)
Set if regular geometry contacts should be created between the shovel geometries and the associated t...
void setCutTopPlane(agx::Plane cutTopPlane)
Set the cutting plane in local space.
agx::Vector< agxCollide::BoundingAABB > m_forbiddenBounds
const agx::RigidBody * getWedgeAggregate(Shovel::ExcavationMode excavationMode) const
agxCollide::GeometryContactPtrVector getShovelAggregateContacts(Shovel::ExcavationMode excavationMode) const
Get the shovel <-> aggregate contacts with the soil particle aggregate for the given excavation mode.
agx::Real getDynamicMass() const
agx::Real getTotalSoilMass() const
agx::MaterialRef m_aggregateMaterial
agx::Vec3 getDeformationContactForce() const
Given geometry contacts exists and the solver has solved them - calculates total contact force betwee...
agx::FrameRef m_parentFrame
void setTopEdge(agx::Line topEdge)
Set the top edge in local space.
ShovelAggregateContactMaterialContainer * getShovelTerrainContactMaterialContainer() const
const agxCollide::GeometryRefVector & getVoxelCollisionGeometries() const
agx::Real getSoilAggregateMass(Shovel::ExcavationMode excavationMode) const
Returns the total soil aggregate mass in the shovel for the specific excavation mode.
bool getEnable() const
Access the state enable flag.
agx::Vec3 getCuttingDirectionWorld() const
agx::Vec3 getSeparationContactForce() const
Given geometry contacts exists and the solver has solved them - calculates total contact force betwee...
ShovelAggregateContactMaterialContainerRef m_shovelAggregateCMContainer
ShovelSettings * getSettings()
void setEnableForTerrain(Terrain *terrain, bool enable)
Set if the shovel is enabled for the particular terrain.
agxCollide::GeometryRefVector m_voxelCollisionGeometries
SoilParticleAggregateRef m_soilParticleAggregate
agx::Real getSecondarySeparationAngle() const
AggregateContactGenerator * getAggregateContactGenerator() const
SoilParticleVector getTotalSoilParticles() const
agx::Vec3 getSecondaryCuttingDirection() 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 fil...
agx::Vec3 getAggregateTerrainTangentialForce(Shovel::ExcavationMode excavationMode) const
Get the terrain <-> aggregate tangential force for the given excavation mode.
agx::Vec3iVector m_voxelsInPrimaryActiveZoneLastTimeStep
const agx::Plane & getCutTopPlane() const
PrimaryActiveZone * getActiveZone() const
agx::Line getTopEdgeWorld() const
Terrain * m_activeTerrain
std::array< ExcavationSettings, 4 > m_excavationSettings
const agx::Line & getTopEdge() const
void setEnable(bool enable)
Change state enable of this shovel.
SoilPenetrationResistanceRef m_penetrationResistance
agx::ContactMaterial * getShovelAggregateContactMaterial(Shovel::ExcavationMode mode=Shovel::ExcavationMode::PRIMARY) const
Get the explicitly set contact material in a shovel-aggregate contact corresponding to a specified ex...
agx::Vec3 getSeparationFrictionForce() const
Given geometry contacts exists and the solver has solved them - calculates total contact friction for...
agxCollide::BoundingAABB m_collisionBound
agx::Line getCuttingEdgeWorld() const
Terrain * getActiveTerrain() const
bool isDigging() const
Check if the shovel is currently in digging mode with a terrain, i.e if the cutting edge is submerged...
PrimaryActiveZoneRef m_activeZone
void setExcavationSettings(ExcavationMode mode, ExcavationSettings excavationSettings)
Set a settings object for an ExcavationMode of the shovel.
agx::Real getInnerParticleVolume() const
AdvancedShovelSettings * getAdvancedSettings()
agxCollide::GeometryContactPtrVector getAggregateTerrainContacts(Shovel::ExcavationMode excavationMode) const
Get the aggregate <-> terrain geometry contacts with the shovel given an excavation mode.
bool getPenetrationForce(agx::Vec3 &force, agx::Vec3 &torque) const
The result includes the active force and torque from the penetration resistance from the active terra...
static Shovel * find(const agxSDK::Simulation *simulation, const agx::Uuid &uuid)
Find shovel with given UUID.
agx::Vec3 getAggregateTerrainNormalForce(Shovel::ExcavationMode excavationMode) const
Get the terrain <-> aggregate normal force for the given excavation mode.
agx::Real getInnerContactArea() const
Get the last computed inner contact area of the shovel, i.e the estimated cross-section area of the i...
agx::Real getAggregateTerrainContactArea(Shovel::ExcavationMode excavationMode) const
Get the aggregate <-> terrain contact area given an excavation mode and a shovel.
AggregateContactGeneratorRef m_aggregateContactGenerator
SoilPenetrationResistance * getPenetrationResistance() const
ShovelSettingsRef m_shovelSettings
std::array< DeformerCollectionRef, 3 > m_deformers
agx::RigidBody * getRigidBody() const
bool getEnableForTerrain(Terrain *terrain) const
agx::Vec3 getExcavationModeContactForce(Shovel::ExcavationMode excavationMode) const
Calculates total contact force between the soil aggregate associated with the specified excavation mo...
bool setSoilPenetrationModel(agxTerrain::SoilPenetrationResistance::PenetrationModel model)
Set the soil penetration model used for the shovel.
bool getSoilPenetrationModel(agxTerrain::SoilPenetrationResistance::PenetrationModel &model) const
Get the soil penetration model used for the shovel.
const agx::Vec3 & getCuttingDirection() const
DeformControllerRef m_deformController
agx::Real m_innerContactArea
const agx::Line & getCuttingEdge() const
ExcavationSettings & getExcavationSettings(ExcavationMode mode)
ExcavationMode
Enum for describing the different excavation modes of a shovel:
void setCuttingEdge(agx::Line cuttingEdge)
Set the cutting edge in local space.
agx::Real computeCuttingEdgeLength() const
This class is used to describe the general material properties of the Terrain.
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
The object defining a frame of reference and providing transformations operations.
Main material class which acts as a holder of a Surface Material and a Bulk material.
Representation of a name string.
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.
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
Vector containing 'raw' data.
#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.