AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
SoilSimulationInterface.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agxTerrain/export.h>
20
22
23namespace agxTerrain
24{
25 class Terrain;
26
29
31
37 {
38 public:
44
51
59
68
73
77 bool isValid( agx::Physics::GranularBodyPtr ptr ) const;
78
79#if (!defined SWIG ) || ( defined SWIGCSHARP || defined SWIGJAVA)
85#endif
86
91
98
108 void addCollisionGroup(const agx::Name& name);
109
116
120 size_t getNumSoilParticles() const;
121
126
131
136
142
147
152
157
158 public:
160 void onAddNotification();
161 void onRemoveNotification();
162
165
166 protected:
168
169 agx::Physics::GranularBodyPtr _createSoilParticle( agx::Real radius, const agx::Vec3& position, const agx::Vec3& velocity, agx::Material* material );
170 void initGranularBodySystem();
171 bool isLastTerrain();
172 bool isTerrainPagerActive();
173
174 private:
175 Terrain* m_terrain;
176 agx::Physics::GranularBodySystemRef m_soilParticleSystem;
177 };
178
179 AGX_FORCE_INLINE bool SoilSimulationInterface::isValid(agx::Physics::GranularBodyPtr ptr) const
180 {
181 return m_soilParticleSystem != nullptr ? m_soilParticleSystem->isValid(ptr) : false;
182 }
183}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXTERRAIN_STORE_RESTORE_INTERFACE
#define AGXTERRAIN_EXPORT
Only use as member allocated variable.
Definition Value.h:285
Interface class for accessing data and functions for the internal soil particle simulation used in ag...
void removeSoilParticle(agx::Physics::GranularBodyPtr ptr)
Tag a soil particle for removal at the last stages of the current time step.
void addCollisionGroup(agx::UInt32 id)
Add the specified id to a vector of group id, this will make the created soil particles part of the g...
size_t getNumSoilParticles() const
Get the number of soil particles active in the soil simulation.
void removeCollisionGroup(agx::UInt32 id)
Remove a group id from the vector of group ids.
agx::Physics::GranularBodySystem * getGranularBodySystem() const
Returns the internal GranularBodySystem used to simulate the soil particles.
agx::Bound3 getSoilParticleBound() const
Get the complete bound of the soil particle system active in the simulation.
void removeCollisionGroup(const agx::Name &name)
SoilSimulationInterface(Terrain *terrain)
Construct given terrain instance.
const agxCollide::ParticlePairContactVector & getParticleParticleContacts() const
Returns the particle-particle contacts in the internal soil simulation.
bool isParticleGeometryContactValid(agx::Physics::ParticleGeometryContactPtr contact)
void addCollisionGroup(const agx::Name &name)
SoilParticleArray getSoilParticles() const
Get the soil particles active in the simulation.
agx::Real calculateSoilParticleBulkVolume() const
agx::Physics::GranularBodyPtr createSoilParticle(agx::Real radius, const agx::Vec3 &position=agx::Vec3(), const agx::Vec3 &velocity=agx::Vec3())
Create a soil particle with specified radius and material in the internal soil simulation.
agx::Real calculateSoilParticleSpecificVolume() const
agx::Physics::GranularBodyPtr createSoilParticle(const agx::Vec3 &position=agx::Vec3(), const agx::Vec3 &velocity=agx::Vec3())
Create a soil particle with nominal radius and material in the internal soil simulation.
bool isGeometryPtrValid(agx::Physics::GeometryPtr geometry) const
bool isValid(agx::Physics::GranularBodyPtr ptr) const
bool isParticlePairContactValid(agx::Physics::ParticlePairContactPtr contact)
const agxCollide::ParticleGeometryContactVector & getParticleGeometryContacts() const
Returns the particle-geometry contacts in the internal soil simulation.
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Definition Terrain.h:86
Representation of a name string.
Definition Name.h:33
Pointer to a entity instance of type Physics.Geometry.
Pointer to a entity instance of type Physics.GranularBody.
Pointer to a entity instance of type Physics.ParticleGeometryContact.
Pointer to a entity instance of type Physics.ParticlePairContact.
Base class providing referencing counted objects.
Definition Referenced.h:120
Vector containing 'raw' data.
Definition agx/Vector.h:246
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition macros.h:96
#define AGX_FORCE_INLINE
Definition macros.h:58
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition Geometry.h:59
agx::Physics::GranularBodyPtrArray SoilParticleArray
agx::Physics::GranularBodyPtrVector SoilParticleVector
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
uint32_t UInt32
Definition Integer.h:32
double Real
Definition Real.h:42