35 class TerrainMaterial;
36 class TerrainToolCollection;
491 ENABLE_CREATE_DYNAMIC_MASS = 1 << 1,
492 ENABLE_FORCE_FEEDBACK = 1 << 2,
494 using Flags = agx::BitState<StateFlags, agx::UInt32>;
505 agx::
Bool initializeCollection( TerrainToolCollection* collection,
agxSDK::Simulation* simulation );
511 void uninitializeCollection( TerrainToolCollection* collection,
agxSDK::Simulation* simulation );
517 void onPre( TerrainToolCollection* collection );
523 void onPost( TerrainToolCollection* collection );
525 bool getShovelPlanes(TerrainToolCollection* collection,
531 void removeTerrainShovelContacts(TerrainToolCollection* collection);
533 void removeTerrainShovelContactsDeformer(TerrainToolCollection* collection);
535 bool isEdgeSubmerged(const
agx::
Line& edge, const Terrain* terrain) const;
537 bool isEdgeSubmergedInSolid(const
agx::
Line& edge, const Terrain* terrain) const;
539 bool isEdgeSubmergedInHeightfield(const
agx::
Line& edge, const
agxCollide::HeightField* heightfield, const Terrain* terrain) const;
541 agx::
Real getSubmergedEdgeLength(const
agx::
Line& edge, const Terrain* terrain) const;
543 agx::
Vec3 getCuttingEdgeVelocity();
545 void correctShovelVectors();
547 void calculateDeadLoadFraction( const Terrain* terrain,
548 const ActiveZone* activeZone,
551 void setInnerContactArea(
agx::
Real contactArea );
553 void setSettingsAreDirty(
bool enable);
555 bool getSettingsAreDirty() const;
557 agx::
Real computeDefaultBottomContactThreshold() const;
586 REMOVE_SHOVEL_CONTACTS = 1 << 1,
588 INNER_SHAPE_CREATE_DYNAMIC_MASS = 1 << 2,
590 ENABLE_PARTICLE_FREE_DEFORMATION = 1 << 3,
593 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::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::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 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
agx::UInt getNumberOfTeeth() const
void setToothMaximumRadius(agx::Real radius)
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 setToothLength(agx::Real length)
void setEnableParticleFreeDeformers(bool enable)
Set true/false if the shovel deformers should make particle free deformations.
void setBottomContactThreshold(agx::Real bottomContactThreshold)
Set the distance threshold from the shovel planes where regular geometry contacts between the shovel ...
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...
Shovel(agx::RigidBody *shovelBody, const agx::Line &topEdge, const agx::Line &cuttingEdge, const agx::Vec3 &cuttingDirection)
Basic constructor.
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
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.
agx::Real getBottomContactThreshold() const
Get the distance threshold from the shovel planes where regular geometry contacts between the shovel ...
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/...
agx::RigidBody * getRigidBody() const
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
SoilPenetrationParameters m_soilPenetrationParameters
agx::Real m_innerContactArea
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
ExcavationSettings & getExcavationSettings(ExcavationMode mode)
agx::Real m_toothMinRadius
agx::Line getTopEdge() const
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...
agx::Vector< agx::ref_ptr< Geometry > > GeometryRefVector
Flags
Flags for specifying what is enabled in the debug rendering system.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
agx::VectorPOD< GranularBodyPtr > GranularBodyPtrVector
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
PlaneT< agx::Real > Plane
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.