28 class TerrainToolCollection;
30 class TerrainMaterial;
400 return m_wedgePartitions[ index ];
404 return m_wedgePartitions[ index ];
409 return m_wedgePartitions.size();
435 void sortParticlesBySeparatingPlane(
Terrain* terrain,
452 bool isPointAbovePlane(
const agx::Plane& plane,
456 bool isSphereIntersectingPlane(
const agx::Plane& plane,
473 agx::Vec3 m_innerParticleAngularMomentum;
487 inline bool SoilParticleAggregate::isPointAbovePlane(
const agx::Plane& plane,
496 inline bool SoilParticleAggregate::isSphereIntersectingPlane(
const agx::Plane& plane,
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXTERRAIN_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
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 that handles and creates a lumped element approximation of the soil wedge aggregate.
void setMaterial(agx::Material *material)
Set the material of each of the geometries in the lumped element structure.
void synchronizeLockJoints(TerrainToolCollection *collection)
Update the lumped element lock joints according to partition data.
void clearVoxelsAndParticles()
const WedgePartitionData & getPartitionData(const agx::RigidBody *partitionBody) const
void splitWedgeParticles(const TerrainToolCollection *collection, const SoilParticlePtrVector &soilParticles)
Split the wedge particles into different partition elements of the wedge aggregate.
std::vector< WedgePartitionData > m_wedgePartitions
void onEnableChange(bool enable)
size_t size() const noexcept
void updateCachedWedgeMomentum()
Updates the cached momentum in each partition for the wedge bodies.
void removeNotification(agxSDK::Simulation *simulation, Terrain *terrain)
void init(agx::RigidBody *innerBody)
Initializes the lumped element structure of the wedge aggregate.
const agx::Vec3 & getCuttingVectorFlat() const
agx::Vec3 m_cuttingVectorFlat
void addNotification(agxSDK::Simulation *simulation, Terrain *terrain)
const agx::Vec3 & getCutTopVector() const
void setDeformerWedgeMode()
Set deformer mode.
void clearParticles(size_t reserve)
void splitWedgeVoxels(const TerrainToolCollection *collection, VoxelHashSet &voxels)
Split the wedge voxels into different partition elements of the wedge aggregate.
agx::Vec3 m_forwardDiggingPlane
SoilWedgeContainer(size_t numWedges)
Constructor.
void calculatePartitionPlaneData(TerrainToolCollection *collection)
Calculates all the normals used to defined the internal partition splitting of the wedge volume.
agx::Real getTotalWedgeMass() const
bool isWedgePartitionBody(const agx::RigidBody *body) const
const agx::RigidBody * getContactingWedgeBody() const
This function returns the outermost enabled body in the lumped-element approximation of the wedge agg...
void setSinglePartitionMode()
Set single partition body mode when no splitting is occuring.
void computeLockViolations()
Computes lock violations of the lock joints in the lumped structure.
void updatePartitionBodyMomentum(agx::RigidBody *partitionBody, agx::Real totalMass, const agx::Matrix3x3 &invWorldInertiaTensor)
Update the a specific partition body velocity and angular velocity from updated inertia and cached mo...
const agx::Vec3 & getForwardDiggingPlane() const
agxCollide::Geometry * _getWedgeGeometry() const
Internal mutable geometry accessor.
void onPre(TerrainToolCollection *collection, ActiveZone *activeZone)
const agx::LockJoint * getInnerWedgeLockJoint() const
agx::Vec3 getInnerMomentum() const
void onPost(TerrainToolCollection *collection)
const SoilParticlePtrVector & getWedgeBodyParticles() const
void addNotification(agxSDK::Simulation *simulation, Terrain *terrain)
agx::Vec3 getInnerAngularMomentum() const
void setMaterial(agx::Material *material)
Assign material used for the contact between the shovel and this soil particle aggregate (the soil pa...
bool isConnectedAggregate() const
Return true if this soil aggregate contains a connected rigid body, false otherwise.
const agx::RigidBody * getContactingWedgeBody() const
const agxCollide::Geometry * getInnerGeometry() const
void onPreCollide(TerrainToolCollection *collection)
agx::Real getMass() const
void removeNotification(agxSDK::Simulation *simulation, Terrain *terrain)
agx::Real getTotalAggregateMass() const
virtual ~SoilParticleAggregate()
Reference counted object - protected destructor.
agx::Real getTotalWedgeBodyMass() const
SoilParticleAggregate(agx::RigidBody *connectedBody=nullptr)
Construct given shovel.
void onEnableChange(bool enable)
agx::RigidBody * getInnerBody() const
agx::ConstraintPtrVector getWedgeLockJoints(bool onlyEnabled=true) const
Return the wedge lock joints of the wedge part of the soil aggregate.
const agxCollide::Geometry * getContactingWedgeGeometry() const
static agx::Plane transformPlaneToWorld(const agx::Frame *localFrame, const agx::Plane &localPlane)
void setConnectedInnerBody(agx::RigidBody *connectedInnerBody)
Set a connected inner body to the soil aggregate.
agx::Vec3 getInnerParticleAngularMomentum() const
agx::Vec3 getInnerParticleMomentum() const
agxCollide::Geometry * _getInnerGeometry() const
Internal mutable geometry accessor.
agx::Material * getMaterial() const
const SoilParticlePtrVector & getInnerBodyParticles() const
agx::RigidBodyPtrVector getWedgeBodies(bool onlyEnabled=true) const
Return the wedge partition bodies of the wedge part of the soil aggregate.
agx::RigidBody * getInnerOrConnectedBody() const
Set a connected inner body to the soil aggregate.
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.
Inheritance with partial specialization due to bug with ref_ptr containers.
Constraint that removes all 6 DOF between two bodies, or one body and the world.
Main material class which acts as a holder of a Surface Material and a Bulk material.
Pointer to a entity instance of type Physics.GranularBody.
Class representing the mathematical concept of a plane, also called a half- space.
T signedDistanceToPoint(const agx::Vec3T< T > &point) const
Calculates the distance from the plane to a point.
Base class providing referencing counted objects.
The rigid body class, combining a geometric model and a frame of reference.
Vector containing 'raw' data.
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
agx::Physics::GranularBodyPtrVector SoilParticlePtrVector
agx::HashSet< agx::Vec3i > VoxelHashSet
agx::Physics::GranularBodyPtr SoilParticlePtr
Pure data class used to hold information about a single partition in the wedge aggregate.
agx::Vec3 wedgeBodyMomentum
std::array< agx::Real, 6 > RealArray
agx::RigidBodyRef wedgeBody
agx::Vec3 lockFramePosition
agx::Vec3 lockPlaneNormal
SoilParticlePtrVector splitWedgeParticles
agx::Vec3 wedgeBodyAngularMomentum