![]() |
AGX Dynamics 2.40.0.0
|
Interface class for accessing data and functions for the internal soil particle simulation used in agxTerrain. More...
#include <SoilSimulationInterface.h>
Public Types | |
enum | PACKING_TYPE { SQUARE_LATTICE_PACK = 0 , HEXAGONAL_CLOSE_PACK = 1 } |
Packing type when generating. More... | |
Public Member Functions | |
SoilSimulationInterface () | |
SoilSimulationInterface (Terrain *terrain) | |
Construct given terrain instance. | |
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 group id . | |
void | addCollisionGroup (const agx::Name &name) |
agx::Real | calculateSoilParticleBulkVolume () const |
agx::Real | calculateSoilParticleSpecificVolume () 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::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. | |
agx::Physics::GranularBodySystem * | getGranularBodySystem () const |
Returns the internal GranularBodySystem used to simulate the soil particles. | |
size_t | getNumSoilParticles () const |
Get the number of soil particles active in the soil simulation. | |
const agxCollide::ParticleGeometryContactVector & | getParticleGeometryContacts () const |
Returns the particle-geometry contacts in the internal soil simulation. | |
const agxCollide::ParticlePairContactVector & | getParticleParticleContacts () const |
Returns the particle-particle contacts in the internal soil simulation. | |
agx::Bound3 | getSoilParticleBound () const |
Get the complete bound of the soil particle system active in the simulation. | |
SoilParticleArray | getSoilParticles () const |
Get the soil particles active in the simulation. | |
bool | isGeometryPtrValid (agx::Physics::GeometryPtr geometry) const |
bool | isParticleGeometryContactValid (agx::Physics::ParticleGeometryContactPtr contact) |
bool | isParticlePairContactValid (agx::Physics::ParticlePairContactPtr contact) |
bool | isValid (agx::Physics::GranularBodyPtr ptr) const |
void | removeCollisionGroup (agx::UInt32 id) |
Remove a group id from the vector of group ids. | |
void | removeCollisionGroup (const agx::Name &name) |
void | removeSoilParticle (agx::Physics::GranularBodyPtr ptr) |
Tag a soil particle for removal at the last stages of the current time step. | |
agx::Physics::ParticlePtrVector | spawnSoilParticlesInGeometry (agxCollide::Geometry *geometry, agx::Real radius, const agx::Vec3 &spacing, agx::Real jitterFactor=agx::Real(0), PACKING_TYPE packingType=PACKING_TYPE::SQUARE_LATTICE_PACK) |
Spawns soil particles with the soil material from this terrain in a specified geometry. | |
void | tagParticlesAsSoilParticles (agx::Physics::ParticlePtrVector &particles) |
Tag specified particles as soil particles with material from this terrain. | |
![]() | |
Referenced () | |
Default constructor. | |
Referenced (const Referenced &) | |
template<typename T > | |
T * | as () |
Subclass casting. | |
template<typename T > | |
const T * | as () const |
template<typename T > | |
T * | asSafe () |
Safe subclass casting, return nullptr if template type does not match. | |
template<typename T > | |
const T * | asSafe () const |
int | getReferenceCount () const |
template<typename T > | |
bool | is () const |
Subclass test. | |
Referenced & | operator= (const Referenced &) |
Assignment operator. Will increment the number of references to the referenced object. | |
void | reference (void *ptr=nullptr) const |
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
void | unreference (void *ptr=nullptr) const |
Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
void | unreference_nodelete () const |
Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Protected Member Functions | |
~SoilSimulationInterface () | |
agx::Physics::GranularBodyPtr | _createSoilParticle (agx::Real radius, const agx::Vec3 &position, const agx::Vec3 &velocity, agx::Material *material) |
void | initGranularBodySystem () |
bool | isLastTerrain () |
bool | isTerrainPagerActive () |
![]() | |
virtual | ~Referenced () |
Destructor. | |
void | allocateObserverVector () const |
void | deleteUsingDeleteHandler () const |
Additional Inherited Members | |
![]() | |
template<typename T > | |
static bool | ValidateCast (const Referenced *object) |
![]() | |
static DeleteHandler * | getDeleteHandler () |
static void | setDeleteHandler (DeleteHandler *handler) |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
![]() | |
Mutex | m_mutex |
ObserverContainer | m_observers |
AtomicValue | m_refCount |
Interface class for accessing data and functions for the internal soil particle simulation used in agxTerrain.
Definition at line 36 of file SoilSimulationInterface.h.
Packing type when generating.
Enumerator | |
---|---|
SQUARE_LATTICE_PACK | |
HEXAGONAL_CLOSE_PACK |
Definition at line 42 of file SoilSimulationInterface.h.
agxTerrain::SoilSimulationInterface::SoilSimulationInterface | ( | Terrain * | terrain | ) |
Construct given terrain instance.
terrain | - terrain instance |
agxTerrain::SoilSimulationInterface::SoilSimulationInterface | ( | ) |
|
protected |
|
protected |
void agxTerrain::SoilSimulationInterface::addCollisionGroup | ( | agx::UInt32 | id | ) |
Add the specified id
to a vector of group id, this will make the created soil particles part of the group id
.
By default, the created soil particles are not part of any group.
This can be used to partition the simulation where some groups cannot collide with other groups. Which groups that can collide or not is determined by Space and can be set using the method agxCollide::Space::setEnablePair(id1,id2);
void agxTerrain::SoilSimulationInterface::addCollisionGroup | ( | const agx::Name & | name | ) |
agx::Real agxTerrain::SoilSimulationInterface::calculateSoilParticleBulkVolume | ( | ) | const |
agx::Real agxTerrain::SoilSimulationInterface::calculateSoilParticleSpecificVolume | ( | ) | const |
agx::Physics::GranularBodyPtr agxTerrain::SoilSimulationInterface::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.
radius | - radius of the created soil particle. If negative, no particle will be created. |
position | - initial position of the created soil particle in world space. |
velocity | - initial velocity of the created soil particle in world space. |
agx::Physics::GranularBodyPtr agxTerrain::SoilSimulationInterface::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.
position | - initial position of the created soil particle in world space. |
velocity | - initial velocity of the created soil particle in world space. |
agx::Physics::GranularBodySystem * agxTerrain::SoilSimulationInterface::getGranularBodySystem | ( | ) | const |
Returns the internal GranularBodySystem used to simulate the soil particles.
size_t agxTerrain::SoilSimulationInterface::getNumSoilParticles | ( | ) | const |
Get the number of soil particles active in the soil simulation.
const agxCollide::ParticleGeometryContactVector & agxTerrain::SoilSimulationInterface::getParticleGeometryContacts | ( | ) | const |
Returns the particle-geometry contacts in the internal soil simulation.
const agxCollide::ParticlePairContactVector & agxTerrain::SoilSimulationInterface::getParticleParticleContacts | ( | ) | const |
Returns the particle-particle contacts in the internal soil simulation.
agx::Bound3 agxTerrain::SoilSimulationInterface::getSoilParticleBound | ( | ) | const |
Get the complete bound of the soil particle system active in the simulation.
SoilParticleArray agxTerrain::SoilSimulationInterface::getSoilParticles | ( | ) | const |
Get the soil particles active in the simulation.
|
protected |
bool agxTerrain::SoilSimulationInterface::isGeometryPtrValid | ( | agx::Physics::GeometryPtr | geometry | ) | const |
|
protected |
bool agxTerrain::SoilSimulationInterface::isParticleGeometryContactValid | ( | agx::Physics::ParticleGeometryContactPtr | contact | ) |
bool agxTerrain::SoilSimulationInterface::isParticlePairContactValid | ( | agx::Physics::ParticlePairContactPtr | contact | ) |
|
protected |
bool agxTerrain::SoilSimulationInterface::isValid | ( | agx::Physics::GranularBodyPtr | ptr | ) | const |
Definition at line 210 of file SoilSimulationInterface.h.
References isValid().
Referenced by isValid().
void agxTerrain::SoilSimulationInterface::removeCollisionGroup | ( | agx::UInt32 | id | ) |
Remove a group id from the vector of group ids.
id | - The group id to be removed |
void agxTerrain::SoilSimulationInterface::removeCollisionGroup | ( | const agx::Name & | name | ) |
void agxTerrain::SoilSimulationInterface::removeSoilParticle | ( | agx::Physics::GranularBodyPtr | ptr | ) |
Tag a soil particle for removal at the last stages of the current time step.
agx::Physics::ParticlePtrVector agxTerrain::SoilSimulationInterface::spawnSoilParticlesInGeometry | ( | agxCollide::Geometry * | geometry, |
agx::Real | radius, | ||
const agx::Vec3 & | spacing, | ||
agx::Real | jitterFactor = agx::Real(0) , |
||
PACKING_TYPE | packingType = PACKING_TYPE::SQUARE_LATTICE_PACK |
||
) |
Spawns soil particles with the soil material from this terrain in a specified geometry.
geometry | - The specified geometry to spawn particles in |
radius | - The specified geometry to spawn particles in |
spacing | - Spacing between the particle center points that are spawned |
jitterFactor | - The factor of the distance that is used to randomize particle positions |
packingType | - the packing type of the created soil particles |
void agxTerrain::SoilSimulationInterface::tagParticlesAsSoilParticles | ( | agx::Physics::ParticlePtrVector & | particles | ) |
Tag specified particles as soil particles with material from this terrain.
particles | - the particles to tag as terrain particles |