17#ifndef AGX_PHYSICS_GRANULARBODYSYSTEM_H
18#define AGX_PHYSICS_GRANULARBODYSYSTEM_H
64#if (!defined SWIG ) || ( defined SWIGCSHARP || defined SWIGJAVA)
155 bool onlyCheckForMidPoint)
const;
167 bool onlyCheckForMidPoint)
const;
#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 AGXPHYSICS_EXPORT
The geometry representation used by the collision detection engine.
Type-specific Array used for fast access into the data held by a Buffer.
const agxData::Array< EntityPtr > getInstances() const
An agx::Device is an abstract representation of a device on which data can be stored and processed.
A basic particle system that contains all the storages and buffers required for basic operation and a...
agxData::EntityStorage * getParticleStorage()
Physics::ParticlePtr createParticle()
Create a new particle in the particle system.
Pointer to a entity instance of type Physics.GranularBody.
agx::Physics::GranularBodyPtrVector getGranularBodyPtrVector() const
void setSingleParticleAngularVelocity(agx::Index particleId, const agx::Vec3 &angularVelocity)
Set angular velocity for a single particle.
virtual bool setUpdateTask(Task *updateTask) override
Set the task that will be executed whenever it is time to step the simulation.
GranularBodySystem(Device *device=CpuDevice::instance())
virtual void setParticleMass(Real mass, bool updateExistingParticles=false) override
Set granular body mass and inertia.
GranularBodyPtrVector filterBodiesInGeometry(const agxCollide::Geometry *geometry, const GranularBodyPtrVector &granularBodies, bool onlyCheckForMidPoint) const
Return a subset of specified granular bodies that intersect with a specified geometry.
void setMotionControl(agx::Physics::GranularBodyPtr gptr, MotionControl motionControl)
Set motion control of the granular body.
virtual ~GranularBodySystem()
void preAllocateParticleGeometryContactStorage(size_t numElements)
Pre-allocate memory for elements via the reserve function in the storages related to particle-geometr...
agx::Vec3 getSingleParticleAngularVelocity(agx::Index particleId)
Get angular velocity for a single particle.
virtual void setSingleParticleRadius(agx::Index particleId, agx::Real radius) override
Set single particle radius given a specified id.
static bool isGranularBodySystem(agx::ParticleSystem *system)
Checks if a particle system is a granular body system by either class or by internal models.
MotionControl getMotionControl(agx::Physics::GranularBodyPtr gptr) const
Get the motion control of a granular body.
GranularBodyPtrVector getGranularBodiesInsideGeometry(const agxCollide::Geometry *geometry, bool onlyCheckForMidPoint) const
Return all granular bodies that intersect with a specified geometry.
void setContactMode(agx::UInt contactMode)
Set the contact mode of the GranularBodySystem.
void invalidLicenseCallback()
agx::Physics::GranularBodyPtrVector getGranularBodyPtrVector()
Physics::GranularBodyPtr createParticle()
Create a new particle in the particle system.
MotionControl
The MotionControl enumeration indicates what makes a GranularBody in the GranularBodySystem move.
static void copyGranularBodyData(agx::Physics::GranularBodyPtr target, agx::Physics::GranularBodyPtr source, bool copyMaterial=true)
Copy data from GranularBody source to target body.
const agx::Physics::GranularBodyPtrArray getParticles() const
static void applyTransform(agx::Physics::GranularBodyPtr gptr, const agx::AffineMatrix4x4 &transform, bool includeVelocity=false)
Apply a 4x4 transform on a particle.
agx::Real calculateTotalKineticEnergy() const
calculate total kinetic energy of the granular body system
static agx::RigidBody * convertGranularBodyToRigidBody(agx::Physics::GranularBodyPtr gptr)
Convert a granular body to a rigid body.
void preAllocateParticlePairContactStorage(size_t numElements)
Pre-allocate memory for elements via the reserve function in the storages related to particle-particl...
void preAllocateParticleStorage(size_t numElements)
Pre-allocate memory for elements via the reserve function in the particle data storage with specified...
The rigid body class, combining a geometric model and a frame of reference.
A representation of a generic task.
Vector containing 'raw' data.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.