29 class TerrainMaterial;
30 class AggregateContactGenerator;
31 class ExternalDeformer;
47 bool isDeformerAggregate =
false,
197 void addNotification(
agxSDK::Simulation* simulation );
204 void removeNotification(
agxSDK::Simulation* simulation );
211 void onPreCollide(
Terrain* terrain,
241 void onEnableChange(
bool enable );
243 static
agx::Plane transformPlaneToWorld(const
agx::Frame* localFrame, const
agx::Plane& localPlane);
245 static
agx::Vector<
agx::Plane> transformPlanesToWorld( const
agx::Frame* localFrame, const
agx::Vector<
agx::Plane>& localPlanes );
252 void setConnectedInnerBody(
agx::RigidBody* connectedInnerBody);
259 agx::RigidBody* getInnerOrConnectedBody() const;
265 bool isConnectedAggregate() const;
272 void clearAggregateData();
274 void disableWedgeAggregates();
276 void renderWegePositions( const
agx::Vec3& origin,
279 void renderWedgeVelocityNormals(
agx::Real normalLength =
agx::Real( 1.0 ) );
300 using RealArray = std::array<agx::Real, 6>;
301 RealArray violations;
322 SoilWedgeContainer(
size_t numWedges );
351 void onEnableChange(
bool enable);
362 void calculatePartitionPlaneData(
Shovel* shovel );
369 void splitWedgeParticles(
const Shovel* shovel,
377 void splitWedgeVoxels(
const Terrain* terrain,
392 void updatePartitionBodyMomentum(
401 void updateCachedWedgeMomentum();
406 void computeLockViolations();
411 void synchronizeLockJoints(
Terrain* terrain,
Shovel* shovel);
413 void clearParticles(
size_t reserve );
415 void clearVoxelsAndParticles();
423 void setSinglePartitionMode();
429 void setDeformerWedgeMode();
439 const WedgePartitionData& getPartitionData(
const agx::RigidBody* partitionBody )
const;
441 const agx::Vec3& getCuttingVectorFlat()
const;
443 const agx::Vec3& getCutTopVector()
const;
445 const agx::Vec3& getForwardDiggingPlane()
const;
447 inline const WedgePartitionData& operator[] (
size_t index )
const {
448 return m_wedgePartitions[ index ];
451 inline WedgePartitionData& operator[] (
size_t index ) {
452 return m_wedgePartitions[ index ];
455 size_t size() const noexcept
457 return m_wedgePartitions.size();
465 std::vector<WedgePartitionData> m_wedgePartitions;
468 SoilWedgeContainer* getSoilWedgeContainer();
501 void computeParticlesInActiveZone(
Shovel* shovel,
504 void sortParticlesBySeparatingPlane(
agx::ParticleSystem* soilParticleSystem,
508 bool onlyMidpoint=false);
510 void computeParticlesInInnerShape(
Shovel* shovel,
513 agx::Real radiusMultiplier);
518 void computeParticlesAboveShovel(
Shovel* shovel,
521 bool isPointAbovePlane( const
agx::Plane& plane,
522 const
agx::Vec3& point,
523 agx::Real threshold = 0.0 ) const;
525 bool isSphereIntersectingPlane( const
agx::Plane& plane,
526 const
agx::Vec3& point,
527 agx::Real radius ) const;
529 bool shouldSplitWedgeAggregate( const
Shovel* shovel );
531 void clearParticles(
size_t particleStorageSize );
541 agx::RigidBodyRef m_innerBody;
543 agx::Vec3 m_innerBodyCachedMomentum;
544 agx::Vec3 m_innerBodyCachedAngularMomentum;
546 agx::Vec3 m_innerParticleMomentum;
547 agx::Vec3 m_innerParticleAngularMomentum;
552 agx::Real m_wedgeVoxelsVolume;
554 SoilWedgeContainer m_soilWedgeContainer;
555 agx::RigidBodyObserver m_connectedInnerBody;
561 const
agx::Vec3& point,
562 agx::Real threshold )
const
564 return plane.signedDistanceToPoint(point) > threshold;
569 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...
Shovel object used to interact with a terrain via an active zone that converts solid terrain to dynam...
const agx::LockJoint * getInnerWedgeLockJoint() const
SoilParticleAggregate(agx::RigidBody *connectedBody=nullptr, bool isDeformerAggregate=false, const agx::Name &tag="")
Construct a soil particle aggregate.
const SoilParticlePtrVector & getWedgeBodyParticles() const
void setMaterial(agx::Material *material)
Assign material used for the contact between the shovel and this soil particle aggregate (the soil pa...
agx::Real getTotalParticleVolume() const
agx::Real getWedgeParticleVolume() const
const agx::RigidBody * getContactingWedgeBody() const
const agxCollide::Geometry * getInnerGeometry() const
agx::Real getMass() const
agx::Real getTotalAggregateMass() const
agx::Real getTotalSoilBulkVolume(agx::Real packingFraction=0.67) const
Return the estimated total soil bulk volume of all particles and voxels of fluid and solid mass (both...
agx::Real getTotalWedgeBodyMass() const
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
agx::Vec3iVector getWedgeBodyVoxels() const
agx::Vec3 getInnerCachedAngularMomentum() const
agx::Vec3 getInnerParticleAngularMomentum() const
agx::Vec3 getInnerParticleMomentum() const
agx::Real getInnerParticleVolume() const
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::Vec3 getInnerCachedMomentum() const
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
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.
Representation of a name string.
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.
#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...
Namespace containing classes for handling debug rendering of collision geometries,...
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.
agx::Physics::GranularBodyPtrVector SoilParticlePtrVector
agx::HashSet< agx::Vec3i > VoxelHashSet
agx::Physics::GranularBodyPtr SoilParticlePtr
The agx namespace contains the dynamics/math part of the AGX Dynamics API.