|
AGX Dynamics 2.41.2.0
|
A basic particle system that contains all the storages and buffers required for basic operation and also a rendering task. More...
#include <ParticleSystem.h>
Inheritance diagram for agx::ParticleSystem:Classes | |
| class | MaterialUuidBufferListener |
| class | UpdateRenderingListener |
Public Member Functions | |
| void | _setGravityTask (Task *task) |
| void | addCollisionGroup (agx::UInt32 id, bool updateExistingParticles=true) |
Add the specified id to a vector of group id, this will make a all newly created particles part of the group id. | |
| void | addCollisionGroup (const agx::Name &id, bool updateExistingParticles=true) |
| void | addCollisionGroupParticle (agx::UInt32 id, agx::Physics::ParticlePtr ptr) |
Add the specified id to a vector of group id, this make the specific particle part of the group id. | |
| void | addCollisionGroupParticle (const agx::Name &id, agx::Physics::ParticlePtr ptr) |
| void | addCustomBufferInt (const agx::String &buffername) |
| Adds a custom attribute Int buffer for the particle system. | |
| void | addCustomBufferReal (const agx::String &buffername) |
| Adds a custom attribute Real buffer for the particle system. | |
| void | addCustomBufferReal32 (const agx::String &buffername) |
| Adds a custom attribute Real32 buffer for the particle system. | |
| void | addCustomBufferVec3 (const agx::String &buffername) |
| Adds a custom attribute Vec3 buffer for the particle system. | |
| virtual void | addNotification (agxSDK::Simulation *simulation) |
| Triggers when particlesystem is added to the simulation. | |
| void | applyAirForceDragSimple (agx::Real cd, agx::Real cr) |
| Apply air drag to the particles according to formula: cd * velocity^2 + cr * velocity. | |
| void | attach () |
| Binds relevant buffer pointers to objects after inserting the particle system into the simulation. | |
| agx::Real | calculateMeanRadius () const |
| Returns the calculated mean radius of all the particles. Will return 0 if the system contains no particles. | |
| agx::Real | calculateTotalParticleMass () const |
| Calculates the total particle mass in the particle system. | |
| agx::Real | calculateTotalParticleVolume () const |
| void | clearAllParticles () |
| Utility method for clearing all particles in the particle system. | |
| void | clearContactData () |
| void | colorParticlesWithLevelsInBound (const agx::Bound3 &bound, const agx::Vec4fVector &colors) |
| Colors particles with different levels in the vertical z-direction inside a specified bound. | |
| void | commitAllBuffers () |
| Executes the "commit" command all buffers in the particle system. | |
| void | commitColorBuffer () |
| Executes the "commit" command on the buffer so that particle rendering can be updated properly. | |
| Physics::ParticlePtr | createParticle () |
| Create a new particle in the particle system. | |
| agx::Physics::ParticleGeometryContactPtr | createParticleGeometryContact (agx::Physics::ParticlePtr particle, agx::Physics::GeometryPtr geometry) |
| agx::Physics::ParticlePairContactPtr | createParticlePairContact (agx::Physics::ParticlePtr p1, agx::Physics::ParticlePtr p2) |
| agxData::EntityRange | createParticles (size_t numParticles) |
| Create a set of particles in the particle system. | |
| void | destroyParticle (Physics::ParticlePtr particle) |
| Destroy a particle. | |
| void | destroyParticles (agxData::EntityRange particles) |
| Destroy a range of particles. | |
| void | destroyParticles (const agxData::EntityPtrVector &particles) |
| void | destroyParticles (const Physics::ParticlePtrVector &particles) |
| Destroy a list of particles. | |
| virtual void | destroySingleParticle (agx::Index particleId) |
| Destroy particle with specified id. | |
| void | detach () |
| Unbinds relevant buffer pointers from objects after removing the particle system into the simulation. | |
| void | evaluateParticleDefaultMass () |
| This should be called if the density of the bulk material is changed, so the particle default mass is updated accordingly. | |
| agx::Physics::CollisionGroupSetPtr | getCollisionGroupSet () const |
| agx::Int | getCustomBufferValueInt (agx::Index id, const agx::String &buffername) |
| Returns a custom Int buffer value from a particle. | |
| agx::Real | getCustomBufferValueReal (agx::Index id, const agx::String &buffername) |
| Returns a custom Real buffer value from a particle. | |
| agx::Real32 | getCustomBufferValueReal32 (agx::Index id, const agx::String &buffername) |
| Returns a custom Real32 buffer value from a particle. | |
| agx::Vec3 | getCustomBufferValueVec3 (agx::Index id, const agx::String &buffername) |
| Returns a custom Vec3 buffer value from a particle. | |
| const agxCollide::GeometryHashVector & | getDisabledCollisions () const |
| bool | getEnableCollisions (const agxCollide::Geometry *geometry) const |
| agxData::EntityStorage * | getGeometryParticleContactListStorage () |
| Material * | getMaterial () |
| const Material * | getMaterial () const |
| size_t | getNumActiveParticleGeometryContacts () |
| Returns the number of ACTIVE particle-geometry contacts, after the last conducted contact filtering. | |
| size_t | getNumActiveParticleParticleContacts () |
| Returns the number of ACTIVE particle-particle contacts, after the last conducted contact filtering. | |
| size_t | getNumParticleGeometryContacts () |
| Returns the number of particle-geometry contacts. | |
| size_t | getNumParticleParticleContacts () |
| Returns the number of particle-particle contacts. | |
| size_t | getNumParticles () const |
| Physics::ParticlePtr | getParticle (agx::Index particleId) |
| Returns a particle from the particle system given a particle id. | |
| const agx::Bound3 & | getParticleBound () |
| agx::Vector< agx::Physics::ParticleGeometryContactPtr > | getParticleGeometryContacts () |
| Returns the current ParticleGeometryContacts in the simulation. | |
| agxData::EntityStorage * | getParticleGeometryContactStorage () |
| agx::Index | getParticleIdFromIndex (agx::Index index) const |
| Return the particle id for the specified particle entity array index. | |
| Real | getParticleMass () const |
| agxData::EntityStorage * | getParticlePairContactStorage () |
| agx::Vector< agx::Physics::ParticlePairContactPtr > | getParticleParticleContacts () |
| Returns the current ParticleParticle contacts in the simulation. | |
| Real | getParticleRadius () const |
| agx::Physics::ParticlePtrArray | getParticles () |
| const agx::Physics::ParticlePtrArray | getParticles () const |
| agxData::EntityStorage * | getParticleStorage () |
| const agxData::EntityStorage * | getParticleStorage () const |
| virtual agx::Vec4f | getSingleParticleColor (agx::Index particleId) |
| Get particle color with specified id. | |
| virtual agx::Vec3 | getSingleParticleForce (agx::Index particleId) |
| Get particle velocity with specified id. | |
| virtual agx::Real | getSingleParticleMass (agx::Index particleId) |
| Get particle radius with specified id. | |
| virtual agx::Vec3 | getSingleParticlePosition (agx::Index particleId) |
| Get particle position with specified id. | |
| virtual agx::Real | getSingleParticleRadius (agx::Index particleId) |
| Get particle radius with specified id. | |
| virtual agx::Vec3 | getSingleParticleVelocity (agx::Index particleId) |
| Get particle velocity with specified id. | |
| agx::Real | getTotalParticleGeometryContactForces () |
| agx::Real | getTotalParticleParticleContactForces () |
| Task * | getUpdateTask () |
| bool | hasCollisionGroup (agx::UInt32 id) const |
| This is performing a linear search among the group id for this particle. | |
| bool | hasCollisionGroup (const agx::Name &id) const |
| bool | hasCollisionGroupParticle (agx::UInt32 id, agx::Physics::ParticlePtr ptr) const |
| This is performing a linear search among the group id for this particle. | |
| bool | hasCollisionGroupParticle (const agx::Name &id, agx::Physics::ParticlePtr ptr) const |
| bool | hasCustomBuffer (const agx::String &buffername, const agx::String &formatName) |
| Returns true if the particle system has a buffer with the specified name and format. | |
| bool | isParticleGeometryContactValid (Physics::ParticleGeometryContactPtr contact) |
| bool | isParticlePairContactValid (Physics::ParticlePairContactPtr contact) |
| bool | isValid (Physics::ParticlePtr particle) const |
| bool | particleExistsWithId (agx::Index id) |
| Check if there is a particle with a specified id. | |
| void | removeCollisionGroup (agx::UInt32 id, bool updateExistingParticles=true) |
| Remove a group id from the vector of group ids. | |
| void | removeCollisionGroup (const agx::Name &id, bool updateExistingParticles=true) |
| void | removeCollisionGroupParticle (agx::UInt32 id, agx::Physics::ParticlePtr ptr) |
| Remove a group id from the vector of group ids. | |
| void | removeCollisionGroupParticle (const agx::Name &id, agx::Physics::ParticlePtr ptr) |
| bool | removeParticle (Physics::ParticlePtr particle) |
| Tag a particle for removal at the end of the time step. | |
| agx::Physics::ParticlePtrVector | removeParticlesOutsideBound (const agx::Bound3 &bound) |
| Removes and returns particles in the specified particle system outside the given 3D bound. | |
| void | setCustomBufferValueInt (agx::Index id, const agx::String &buffername, agx::Int val) |
| Sets a custom Int buffer value to a particle. | |
| void | setCustomBufferValueReal (agx::Index id, const agx::String &buffername, agx::Real val) |
| Sets a custom Real buffer value to a particle. | |
| void | setCustomBufferValueReal32 (agx::Index id, const agx::String &buffername, agx::Real32 val) |
| Sets a custom Real32 buffer value to a particle. | |
| void | setCustomBufferValueVec3 (agx::Index id, const agx::String &buffername, agx::Vec3 val) |
| Sets a custom Vec3 buffer value to a particle. | |
| void | setEnableCollisions (const agxCollide::Geometry *geometry, bool flag) |
Specify whether otherGeometry is allowed to collide with this geometry. | |
| void | setMaterial (Material *material, bool updateExistingParticles=false) |
| Set the default particle material. | |
| virtual void | setParticleMass (Real mass, bool updateExistingParticles=false) |
| Set particle mass. | |
| void | setParticleRadius (Real radius, bool updateExistingParticles=false) |
| Set the default particle radius of created particles, with option of updating existing particles. | |
| virtual void | setSingleParticleColor (agx::Index particleId, const agx::Vec4f &color) |
| Set particle color with specified id. | |
| virtual void | setSingleParticleForce (agx::Index particleId, const agx::Vec3 &force) |
| Set particle force with specified id. | |
| virtual void | setSingleParticleMass (agx::Index particleId, agx::Real mass) |
| Set particle radius with specified id. | |
| virtual void | setSingleParticleRadius (agx::Index particleId, agx::Real radius) |
| Set particle radius with specified id. | |
| virtual void | setSingleParticleVelocity (agx::Index particleId, const agx::Vec3 &velocity) |
| Set particle velocity with specified id. | |
| void | setSpace (agxCollide::Space *space) |
| virtual bool | setUpdateTask (Task *updateTask) |
| Set the task that will be executed whenever it is time to step the simulation. | |
| agxData::EntityRange | spawnParticles (const agx::Vec3Vector &positions) |
| Spawn particles with defined positions. | |
| agx::Physics::ParticlePtrVector | spawnParticlesInBound (const agx::Bound3 &bound, agx::Emitter::DistributionTable *sourceTable, const agx::Vec3 &spacing, agx::Real jitterFactor=agx::Real(0)) |
| Spawns particles In a specified bound from a distribution table. | |
| agx::Physics::ParticlePtrVector | spawnParticlesInBound (const agx::Bound3 &bound, Real radius, const agx::Vec3 &spacing, agx::Real jitterFactor=agx::Real(0)) |
| Spawns particles in a specified bound. | |
| agx::Physics::ParticlePtrVector | spawnParticlesInBoundHCP (const agx::Bound3 &bound, agx::Emitter::DistributionTable *sourceTable, const agx::Vec3 &spacing, agx::Real jitterFactor=agx::Real(0)) |
| Spawns particles in a specified bound from a distribution table using a Hexagonal-Close-Packing (HCP) lattice. | |
| agx::Physics::ParticlePtrVector | spawnParticlesInBoundHCP (const agx::Bound3 &bound, Real radius, const agx::Vec3 &spacing, agx::Real jitterFactor=agx::Real(0)) |
| Spawns particles In a specified bound using a Hexagonal-Close-Packing (HCP) lattice. | |
| agx::Physics::ParticlePtrVector | spawnParticlesInGeometry (agxCollide::Geometry *geometry, agx::Emitter::DistributionTable *sourceTable, const agx::Vec3 &spacing, agx::Real jitterFactor=agx::Real(0)) |
| Spawns particles In a specified geometry from a distribution table. | |
| agx::Physics::ParticlePtrVector | spawnParticlesInGeometry (agxCollide::Geometry *geometry, Real radius, const agx::Vec3 &spacing, agx::Real jitterFactor=agx::Real(0)) |
| Spawns particles In a specified geometry. | |
| agx::Physics::ParticlePtrVector | spawnParticlesInGeometryHCP (agxCollide::Geometry *geometry, agx::Emitter::DistributionTable *sourceTable, const agx::Vec3 &spacing, agx::Real jitterFactor=agx::Real(0)) |
| Spawns particles In a specified geometry from a distribution table using a Hexagonal-Close-Packing (HCP) lattice. | |
| agx::Physics::ParticlePtrVector | spawnParticlesInGeometryHCP (agxCollide::Geometry *geometry, Real radius, const agx::Vec3 &spacing, agx::Real jitterFactor=agx::Real(0)) |
| Spawns particles In a specified geometry using a Hexagonal-Close-Packing (HCP) lattice. | |
| Vec3 | sumForceMagnitudes (RigidBody *body) |
| Sums force magnitudes from particle system onto rigid body. | |
| void | updateShouldRender () |
| Update the shouldRender variable in particles given renders states such as clipping and filtering. | |
Public Member Functions inherited from agx::Component | |
| Component (const agx::Name &name=agx::Name(), agx::Model *model=agx::Component::ClassModel(), agx::Device *device=nullptr) | |
| virtual void | addObject (agx::Object *object, bool assignContext=true) |
| Add an object to the component. | |
| virtual String | autoComplete (const String &partialName, StringVector &matchingNames) const |
| virtual void | buildNavigationTree (agxJson::Value &eNode) const override |
| void | configure (Model *model) |
| virtual void | configure (TiXmlElement *eComponent) override |
| agx::Device * | getDevice () |
| template<typename T > | |
| T * | getDevice () |
| const agx::Device * | getDevice () const |
| template<typename T > | |
| const T * | getDevice () const |
| size_t | getNumObjects (const agx::Name &name) const |
| agx::Object * | getObject (const agx::Name &name, agx::Model *model, size_t index=0) |
| const agx::Object * | getObject (const agx::Name &name, agx::Model *model, size_t index=0) const |
| agx::Object * | getObject (const agx::Name &name, size_t index=0) |
| template<typename T > | |
| T * | getObject (const agx::Name &name, size_t index=0) |
| const agx::Object * | getObject (const agx::Name &name, size_t index=0) const |
| template<typename T > | |
| const T * | getObject (const agx::Name &name, size_t index=0) const |
| const agx::ObjectRefVector & | getObjects () const |
| template<typename T > | |
| void | getObjects (agx::ObjectPtrVector &result, bool recursive=false) const |
| void | getObjects (agx::ObjectPtrVector &result, const agx::Model *model, bool recursive=false) const |
| virtual Object * | getResourceImpl (const Path &path, agx::Model *model) override |
| virtual void | printSubtree () const override |
| void | printSubtree (std::ostream &stream, int depth=0) const |
| virtual void | rebind () override |
| void | removeAllObjects () |
| Remove all components. | |
| virtual void | removeObject (agx::Object *object) |
| Remove an object from the component. | |
| void | removeObject (const agx::Name &name, size_t index=0) |
| Remove an object with a specified name (and optional index) from the component. | |
| virtual void | snapshot (TiXmlNode *eParent, const String &directory) const override |
| void | traverse (ComponentVisitor *) |
| void | traverse (const TraverseCallback &callback) |
Public Member Functions inherited from agx::Object | |
| Object (const Name &name=Name(), Model *model=Object::ClassModel()) | |
| void | addListener (EventListener *listener) |
| virtual void | buildNavigationTree (agxJson::Value &eNode) const |
| virtual void | configure (TiXmlElement *) |
| agx::String | fullName () const |
| agx::String | fullPath () const |
| agx::String | fullPath (const agx::Object *root) const |
| template<typename T > | |
| T * | getAutoScopedResource (const agx::Path &path) |
| template<typename T > | |
| const T * | getAutoScopedResource (const agx::Path &path) const |
| agx::Object * | getAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr) |
| const agx::Object * | getAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr) const |
| agx::Object * | getContext () |
| template<typename T > | |
| T * | getContext () |
| const agx::Object * | getContext () const |
| template<typename T > | |
| const T * | getContext () const |
| agx::UInt32 | getId () const |
| const agx::Name & | getImplementationName () const |
| agx::Model * | getModel () |
| const agx::Model * | getModel () const |
| const agx::Name & | getName () const |
| agx::Object * | getNextSibling () |
| const agx::Object * | getNextSibling () const |
| agx::Path | getPath () const |
| agx::Path | getPath (const agx::Object *root) const |
| template<typename T > | |
| T * | getResource (const agx::Path &path) |
| template<typename T > | |
| const T * | getResource (const agx::Path &path) const |
| agx::Object * | getResource (const agx::Path &path, agx::Model *model=nullptr) |
| const agx::Object * | getResource (const agx::Path &path, agx::Model *model=nullptr) const |
| virtual agx::Object * | getResourceImpl (const agx::Path &path, agx::Model *model) |
| agx::Object * | getRootContext () |
| const agx::Object * | getRootContext () const |
| bool | hasListener (EventListener *listener) |
| bool | hasParent (const agx::Object *node) const |
| bool | isUnique () const |
| virtual void | printSubtree () const |
| virtual void | rebind () |
| void | removeListener (EventListener *listener) |
| virtual void | save (TiXmlElement *) const |
| virtual void | setContext (agx::Object *context) |
| void | setId (UInt32 id) |
| void | setModel (agx::Model *model) |
| Set the object model (handled automatically). | |
| void | setName (const agx::Name &name) |
| Set the name of the object. | |
| virtual void | snapshot (TiXmlNode *, const String &) const |
Public Member Functions inherited from agx::Referenced | |
| 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. | |
Public Member Functions inherited from agxStream::Serializable | |
| virtual | ~Serializable () |
| Destructor for normal C++ use but hidden from SWIG bindings. | |
| virtual const char * | getClassName () const |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. | |
| virtual StorageAgent * | getStorageAgent () const =0 |
| agx::Uuid | getUuid () const |
| bool | isFinished () const |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. | |
Static Public Member Functions | |
| static Model * | ClassModel () |
Static Public Member Functions inherited from agx::Component | |
| static Component * | _load (TiXmlElement *eComponent, Device *device) |
| static agx::Model * | ClassModel () |
| static Component * | load (const Path &path, const Name &implementation, Device *device, const Path &_namespace=Path()) |
| static Component * | load (const String &path, const Path &_namespace=Path()) |
| static Component * | load (const String &path, Device *device, const Path &_namespace=Path()) |
| static Component * | load (TiXmlElement *eComponent, Device *device) |
Static Public Member Functions inherited from agx::Object | |
| static agx::Model * | ClassModel () |
| static agx::String | generateName (const agx::String &bindPath) |
| static const HashSet< Object * > & | getActiveObjects () |
| static bool | getEnableRebind () |
| Should rebinding be allowed? Right now a global setting. | |
| static Object * | load (const String &path, Device *device, const String &type, const String &attribute, const String &value) |
| template<typename T > | |
| static T * | load (const String &path, Device *device, const String &type, const String &attribute, const String &value) |
| static Object * | load (const String &path, Device *device, const String &type="", size_t instance=0) |
| template<typename T > | |
| static T * | load (const String &path, Device *device, const String &type="", size_t instance=0) |
| static void | load (const String &path, Device *device, ObjectPtrVector &loadedObjects) |
| static Object * | load (TiXmlElement *eObject, Device *device) |
| template<typename T > | |
| static T * | load (TiXmlElement *eObject, Device *device) |
| static TiXmlDocument | openDocument (const String &path) |
| static void | setEnableRebind (bool flag) |
| Sets if rebinding of objects should be allowed (Right now a global setting). | |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Public Member Functions inherited from agxStream::Serializable | |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. | |
Protected Types | |
| typedef agx::observer_ptr< const MaterialUuidBufferListener > | MaterialUuidBufferListenerConstObserver |
| typedef agx::ref_ptr< const MaterialUuidBufferListener > | MaterialUuidBufferListenerConstRef |
| typedef agx::observer_ptr< MaterialUuidBufferListener > | MaterialUuidBufferListenerObserver |
| typedef agx::ref_ptr< MaterialUuidBufferListener > | MaterialUuidBufferListenerRef |
| typedef agx::observer_ptr< const UpdateRenderingListener > | UpdateRenderingListenerConstObserver |
| typedef agx::ref_ptr< const UpdateRenderingListener > | UpdateRenderingListenerConstRef |
| typedef agx::observer_ptr< UpdateRenderingListener > | UpdateRenderingListenerObserver |
| typedef agx::ref_ptr< UpdateRenderingListener > | UpdateRenderingListenerRef |
Protected Member Functions | |
| ParticleSystem () | |
| ParticleSystem (const String &model, Device *device=CpuDevice::instance()) | |
| virtual | ~ParticleSystem () |
| void | init (bool createMaterial=true) |
| void | invalidLicenseCallback () |
| void | setCollisionGroupSet (agx::Physics::CollisionGroupSetPtr) |
| void | setRadiusOnParticles (agxData::EntityRange &entityRange, agx::Real radius) |
Protected Member Functions inherited from agx::Component | |
| virtual | ~Component () |
| String | expandAutoCompletionMatch (const String &query, const StringVector &matchingNames) const |
| void | setDevice (Device *device) |
Protected Member Functions inherited from agx::Object | |
| virtual | ~Object () |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Protected Member Functions inherited from agxStream::Serializable | |
| Serializable () | |
| Default constructor. | |
| Serializable (const Serializable &other) | |
| Copy constructor. | |
| void | generateUuid () |
Protected Attributes | |
| agxData::EntityStorageRef | m_particleStorage |
| TaskGroupRef | m_updateTask |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Additional Inherited Members | |
Public Types inherited from agx::Component | |
| typedef Event2< Component *, Object * > | ObjectEvent |
| Event when adding removing child objects. | |
| typedef Callback1< Object * > | TraverseCallback |
Public Types inherited from agx::Object | |
| typedef agx::observer_ptr< const Event > | EventConstObserver |
| typedef agx::ref_ptr< const Event > | EventConstRef |
| typedef agx::observer_ptr< Event > | EventObserver |
| typedef agx::Vector< EventObserver > | EventObserverVector |
| typedef agx::VectorPOD< Event * > | EventPtrVector |
| typedef agx::ref_ptr< Event > | EventRef |
| typedef agx::Vector< EventRef > | EventRefVector |
Public Attributes inherited from agx::Component | |
| ObjectEvent | addObjectEvent |
| ObjectEvent | removeObjectEvent |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
A basic particle system that contains all the storages and buffers required for basic operation and also a rendering task.
It does not contain any update task. A simulated particle system is created by either adding an update task using setUpdateTask(Task*), or by creating one of the pre-configured particle systems available as sub-classes. Currently available are RigidParticleSystem and GranularBodySystem.
ConstraintFluid is currently disabled.
Definition at line 67 of file ParticleSystem.h.
|
protected |
Definition at line 706 of file ParticleSystem.h.
|
protected |
Definition at line 706 of file ParticleSystem.h.
|
protected |
Definition at line 706 of file ParticleSystem.h.
|
protected |
Definition at line 706 of file ParticleSystem.h.
|
protected |
Definition at line 733 of file ParticleSystem.h.
|
protected |
Definition at line 733 of file ParticleSystem.h.
|
protected |
Definition at line 733 of file ParticleSystem.h.
|
protected |
Definition at line 733 of file ParticleSystem.h.
|
protected |
|
protected |
|
protectedvirtual |
| void agx::ParticleSystem::_setGravityTask | ( | Task * | task | ) |
| void agx::ParticleSystem::addCollisionGroup | ( | agx::UInt32 | id, |
| bool | updateExistingParticles = true |
||
| ) |
Add the specified id to a vector of group id, this will make a all newly created particles part of the group id.
Following has to be true to make this method return true.
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, enable );
| void agx::ParticleSystem::addCollisionGroup | ( | const agx::Name & | id, |
| bool | updateExistingParticles = true |
||
| ) |
| void agx::ParticleSystem::addCollisionGroupParticle | ( | agx::UInt32 | id, |
| agx::Physics::ParticlePtr | ptr | ||
| ) |
Add the specified id to a vector of group id, this make the specific particle part of the group id.
By default the specific particle is 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, enable );
| void agx::ParticleSystem::addCollisionGroupParticle | ( | const agx::Name & | id, |
| agx::Physics::ParticlePtr | ptr | ||
| ) |
| void agx::ParticleSystem::addCustomBufferInt | ( | const agx::String & | buffername | ) |
Adds a custom attribute Int buffer for the particle system.
Allows for setting custom properties of type Int for each particle in the particle system.
| buffername | The name of the attribute buffer |
Definition at line 825 of file ParticleSystem.h.
| void agx::ParticleSystem::addCustomBufferReal | ( | const agx::String & | buffername | ) |
Adds a custom attribute Real buffer for the particle system.
Allows for setting custom properties of type Real for each particle in the particle system.
| buffername | The name of the attribute buffer |
Definition at line 820 of file ParticleSystem.h.
| void agx::ParticleSystem::addCustomBufferReal32 | ( | const agx::String & | buffername | ) |
Adds a custom attribute Real32 buffer for the particle system.
Allows for setting custom properties of type Real32 for each particle in the particle system.
| buffername | The name of the attribute buffer |
Definition at line 830 of file ParticleSystem.h.
| void agx::ParticleSystem::addCustomBufferVec3 | ( | const agx::String & | buffername | ) |
Adds a custom attribute Vec3 buffer for the particle system.
Allows for setting custom properties of type Vec3 for each particle in the particle system.
| buffername | The name of the Vec3 attribute buffer to add |
Definition at line 835 of file ParticleSystem.h.
|
virtual |
Triggers when particlesystem is added to the simulation.
Apply air drag to the particles according to formula: cd * velocity^2 + cr * velocity.
| void agx::ParticleSystem::attach | ( | ) |
Binds relevant buffer pointers to objects after inserting the particle system into the simulation.
| agx::Real agx::ParticleSystem::calculateMeanRadius | ( | ) | const |
Returns the calculated mean radius of all the particles. Will return 0 if the system contains no particles.
| agx::Real agx::ParticleSystem::calculateTotalParticleMass | ( | ) | const |
Calculates the total particle mass in the particle system.
| agx::Real agx::ParticleSystem::calculateTotalParticleVolume | ( | ) | const |
|
static |
| void agx::ParticleSystem::clearAllParticles | ( | ) |
Utility method for clearing all particles in the particle system.
| void agx::ParticleSystem::clearContactData | ( | ) |
| void agx::ParticleSystem::colorParticlesWithLevelsInBound | ( | const agx::Bound3 & | bound, |
| const agx::Vec4fVector & | colors | ||
| ) |
Colors particles with different levels in the vertical z-direction inside a specified bound.
| bound | The bound that is used to color the particles |
| colors | Vector containing the colors that will be used in the coloring |
| void agx::ParticleSystem::commitAllBuffers | ( | ) |
Executes the "commit" command all buffers in the particle system.
This is necessary if the raw data buffers been modified during a simulation where a journal is recorded.
| void agx::ParticleSystem::commitColorBuffer | ( | ) |
Executes the "commit" command on the buffer so that particle rendering can be updated properly.
| Physics::ParticlePtr agx::ParticleSystem::createParticle | ( | ) |
Create a new particle in the particle system.
Referenced by agx::Physics::GranularBodySystem::createParticle().
| agx::Physics::ParticleGeometryContactPtr agx::ParticleSystem::createParticleGeometryContact | ( | agx::Physics::ParticlePtr | particle, |
| agx::Physics::GeometryPtr | geometry | ||
| ) |
| agx::Physics::ParticlePairContactPtr agx::ParticleSystem::createParticlePairContact | ( | agx::Physics::ParticlePtr | p1, |
| agx::Physics::ParticlePtr | p2 | ||
| ) |
| agxData::EntityRange agx::ParticleSystem::createParticles | ( | size_t | numParticles | ) |
Create a set of particles in the particle system.
| void agx::ParticleSystem::destroyParticle | ( | Physics::ParticlePtr | particle | ) |
Destroy a particle.
| void agx::ParticleSystem::destroyParticles | ( | agxData::EntityRange | particles | ) |
Destroy a range of particles.
| void agx::ParticleSystem::destroyParticles | ( | const agxData::EntityPtrVector & | particles | ) |
| void agx::ParticleSystem::destroyParticles | ( | const Physics::ParticlePtrVector & | particles | ) |
Destroy a list of particles.
|
virtual |
Destroy particle with specified id.
| void agx::ParticleSystem::detach | ( | ) |
Unbinds relevant buffer pointers from objects after removing the particle system into the simulation.
| void agx::ParticleSystem::evaluateParticleDefaultMass | ( | ) |
This should be called if the density of the bulk material is changed, so the particle default mass is updated accordingly.
|
inline |
Definition at line 817 of file ParticleSystem.h.
| agx::Int agx::ParticleSystem::getCustomBufferValueInt | ( | agx::Index | id, |
| const agx::String & | buffername | ||
| ) |
Returns a custom Int buffer value from a particle.
| id | Id of the particle |
| buffername | The name of the custom Int attribute buffer |
Definition at line 827 of file ParticleSystem.h.
| agx::Real agx::ParticleSystem::getCustomBufferValueReal | ( | agx::Index | id, |
| const agx::String & | buffername | ||
| ) |
Returns a custom Real buffer value from a particle.
| id | Id of the particle |
| buffername | The name of the custom Real attribute buffer |
Definition at line 822 of file ParticleSystem.h.
| agx::Real32 agx::ParticleSystem::getCustomBufferValueReal32 | ( | agx::Index | id, |
| const agx::String & | buffername | ||
| ) |
Returns a custom Real32 buffer value from a particle.
| id | Id of the particle |
| buffername | The name of the custom Real32 attribute buffer |
Definition at line 832 of file ParticleSystem.h.
| agx::Vec3 agx::ParticleSystem::getCustomBufferValueVec3 | ( | agx::Index | id, |
| const agx::String & | buffername | ||
| ) |
Returns a custom Vec3 buffer value from a particle.
| id | Id of the particle |
| buffername | The name of the custom Vec3 attribute buffer |
Definition at line 837 of file ParticleSystem.h.
| const agxCollide::GeometryHashVector & agx::ParticleSystem::getDisabledCollisions | ( | ) | const |
Definition at line 815 of file ParticleSystem.h.
| bool agx::ParticleSystem::getEnableCollisions | ( | const agxCollide::Geometry * | geometry | ) | const |
geometry. | agxData::EntityStorage * agx::ParticleSystem::getGeometryParticleContactListStorage | ( | ) |
Definition at line 812 of file ParticleSystem.h.
| Material * agx::ParticleSystem::getMaterial | ( | ) |
| const Material * agx::ParticleSystem::getMaterial | ( | ) | const |
| size_t agx::ParticleSystem::getNumActiveParticleGeometryContacts | ( | ) |
Returns the number of ACTIVE particle-geometry contacts, after the last conducted contact filtering.
| size_t agx::ParticleSystem::getNumActiveParticleParticleContacts | ( | ) |
Returns the number of ACTIVE particle-particle contacts, after the last conducted contact filtering.
| size_t agx::ParticleSystem::getNumParticleGeometryContacts | ( | ) |
Returns the number of particle-geometry contacts.
| size_t agx::ParticleSystem::getNumParticleParticleContacts | ( | ) |
Returns the number of particle-particle contacts.
| size_t agx::ParticleSystem::getNumParticles | ( | ) | const |
| Physics::ParticlePtr agx::ParticleSystem::getParticle | ( | agx::Index | particleId | ) |
Returns a particle from the particle system given a particle id.
| const agx::Bound3 & agx::ParticleSystem::getParticleBound | ( | ) |
| agx::Vector< agx::Physics::ParticleGeometryContactPtr > agx::ParticleSystem::getParticleGeometryContacts | ( | ) |
Returns the current ParticleGeometryContacts in the simulation.
| agxData::EntityStorage * agx::ParticleSystem::getParticleGeometryContactStorage | ( | ) |
Definition at line 811 of file ParticleSystem.h.
| agx::Index agx::ParticleSystem::getParticleIdFromIndex | ( | agx::Index | index | ) | const |
Return the particle id for the specified particle entity array index.
| index | - specified entity array index. |
| Real agx::ParticleSystem::getParticleMass | ( | ) | const |
| agxData::EntityStorage * agx::ParticleSystem::getParticlePairContactStorage | ( | ) |
Definition at line 813 of file ParticleSystem.h.
| agx::Vector< agx::Physics::ParticlePairContactPtr > agx::ParticleSystem::getParticleParticleContacts | ( | ) |
Returns the current ParticleParticle contacts in the simulation.
| Real agx::ParticleSystem::getParticleRadius | ( | ) | const |
| agx::Physics::ParticlePtrArray agx::ParticleSystem::getParticles | ( | ) |
Definition at line 804 of file ParticleSystem.h.
| const agx::Physics::ParticlePtrArray agx::ParticleSystem::getParticles | ( | ) | const |
Definition at line 799 of file ParticleSystem.h.
| agxData::EntityStorage * agx::ParticleSystem::getParticleStorage | ( | ) |
Definition at line 809 of file ParticleSystem.h.
Referenced by agx::Physics::GranularBodySystem::getParticles().
| const agxData::EntityStorage * agx::ParticleSystem::getParticleStorage | ( | ) | const |
Definition at line 810 of file ParticleSystem.h.
|
virtual |
Get particle color with specified id.
|
virtual |
Get particle velocity with specified id.
|
virtual |
Get particle radius with specified id.
|
virtual |
Get particle position with specified id.
|
virtual |
Get particle radius with specified id.
|
virtual |
Get particle velocity with specified id.
| agx::Real agx::ParticleSystem::getTotalParticleGeometryContactForces | ( | ) |
| agx::Real agx::ParticleSystem::getTotalParticleParticleContactForces | ( | ) |
| Task * agx::ParticleSystem::getUpdateTask | ( | ) |
Definition at line 797 of file ParticleSystem.h.
| bool agx::ParticleSystem::hasCollisionGroup | ( | agx::UInt32 | id | ) | const |
This is performing a linear search among the group id for this particle.
| id | - The group id we are looking for. |
id | bool agx::ParticleSystem::hasCollisionGroup | ( | const agx::Name & | id | ) | const |
| bool agx::ParticleSystem::hasCollisionGroupParticle | ( | agx::UInt32 | id, |
| agx::Physics::ParticlePtr | ptr | ||
| ) | const |
This is performing a linear search among the group id for this particle.
| id | - The group id we are looking for. |
id | bool agx::ParticleSystem::hasCollisionGroupParticle | ( | const agx::Name & | id, |
| agx::Physics::ParticlePtr | ptr | ||
| ) | const |
| bool agx::ParticleSystem::hasCustomBuffer | ( | const agx::String & | buffername, |
| const agx::String & | formatName | ||
| ) |
Returns true if the particle system has a buffer with the specified name and format.
|
protected |
|
protected |
| bool agx::ParticleSystem::isParticleGeometryContactValid | ( | Physics::ParticleGeometryContactPtr | contact | ) |
| bool agx::ParticleSystem::isParticlePairContactValid | ( | Physics::ParticlePairContactPtr | contact | ) |
| bool agx::ParticleSystem::isValid | ( | Physics::ParticlePtr | particle | ) | const |
| bool agx::ParticleSystem::particleExistsWithId | ( | agx::Index | id | ) |
Check if there is a particle with a specified id.
| void agx::ParticleSystem::removeCollisionGroup | ( | agx::UInt32 | id, |
| bool | updateExistingParticles = true |
||
| ) |
Remove a group id from the vector of group ids.
| id | - The group id to be removed |
| void agx::ParticleSystem::removeCollisionGroup | ( | const agx::Name & | id, |
| bool | updateExistingParticles = true |
||
| ) |
| void agx::ParticleSystem::removeCollisionGroupParticle | ( | agx::UInt32 | id, |
| agx::Physics::ParticlePtr | ptr | ||
| ) |
Remove a group id from the vector of group ids.
| id | - The group id to be removed |
| void agx::ParticleSystem::removeCollisionGroupParticle | ( | const agx::Name & | id, |
| agx::Physics::ParticlePtr | ptr | ||
| ) |
| bool agx::ParticleSystem::removeParticle | ( | Physics::ParticlePtr | particle | ) |
Tag a particle for removal at the end of the time step.
| particle | - the specified particlePtr to mark for removal. |
| agx::Physics::ParticlePtrVector agx::ParticleSystem::removeParticlesOutsideBound | ( | const agx::Bound3 & | bound | ) |
Removes and returns particles in the specified particle system outside the given 3D bound.
| bound | - the specified 3D bound which all particle center positions will be tested against. |
|
protected |
| void agx::ParticleSystem::setCustomBufferValueInt | ( | agx::Index | id, |
| const agx::String & | buffername, | ||
| agx::Int | val | ||
| ) |
Sets a custom Int buffer value to a particle.
| id | Id of the particle |
| buffername | The name of the custom Int attribute buffer |
| val | The Int value to be set on the particle |
Definition at line 826 of file ParticleSystem.h.
| void agx::ParticleSystem::setCustomBufferValueReal | ( | agx::Index | id, |
| const agx::String & | buffername, | ||
| agx::Real | val | ||
| ) |
Sets a custom Real buffer value to a particle.
| id | Id of the particle |
| buffername | The name of the custom Real attribute buffer |
| val | The Real value to be set on the particle |
Definition at line 821 of file ParticleSystem.h.
| void agx::ParticleSystem::setCustomBufferValueReal32 | ( | agx::Index | id, |
| const agx::String & | buffername, | ||
| agx::Real32 | val | ||
| ) |
Sets a custom Real32 buffer value to a particle.
| id | Id of the particle |
| buffername | The name of the custom Real attribute buffer |
| val | The Real32 value to be set on the particle |
Definition at line 831 of file ParticleSystem.h.
| void agx::ParticleSystem::setCustomBufferValueVec3 | ( | agx::Index | id, |
| const agx::String & | buffername, | ||
| agx::Vec3 | val | ||
| ) |
Sets a custom Vec3 buffer value to a particle.
| id | Id of the particle |
| buffername | The name of the custom Vec3 attribute buffer |
| val | The Vec3 value to be set on the particle |
Definition at line 836 of file ParticleSystem.h.
| void agx::ParticleSystem::setEnableCollisions | ( | const agxCollide::Geometry * | geometry, |
| bool | flag | ||
| ) |
Specify whether otherGeometry is allowed to collide with this geometry.
| void agx::ParticleSystem::setMaterial | ( | Material * | material, |
| bool | updateExistingParticles = false |
||
| ) |
Set the default particle material.
The default particle mass is derived from the density of the default material.
| material | - the specific material to set as the default particle material. |
| updateExistingParticles | - true if existing particles should be updated, false otherwise. ( Default: false ) |
|
virtual |
Set particle mass.
Note that the default particle mass is normally derived from the default material of the particle system when particles are created. This function is used to set the default value of the mass buffer and also to manually set the mass on all particles.
| mass | - the specified mass to set as default and to all particles if that option is used. |
| updateExistingParticles | - true if the mass of all existing particles should be updated, false otherwise. ( Default: false ) |
Reimplemented in agx::Physics::GranularBodySystem.
| void agx::ParticleSystem::setParticleRadius | ( | Real | radius, |
| bool | updateExistingParticles = false |
||
| ) |
Set the default particle radius of created particles, with option of updating existing particles.
| radius | - the specified default radius to set to the particle system. |
| updateExistingParticles | - true if the existing particles should be updated, false otherwise. ( Default: false ) |
|
protected |
|
virtual |
Set particle color with specified id.
|
virtual |
Set particle force with specified id.
|
virtual |
Set particle radius with specified id.
|
virtual |
Set particle radius with specified id.
Reimplemented in agx::Physics::GranularBodySystem.
|
virtual |
Set particle velocity with specified id.
| void agx::ParticleSystem::setSpace | ( | agxCollide::Space * | space | ) |
|
virtual |
Set the task that will be executed whenever it is time to step the simulation.
Reimplemented in agx::Physics::GranularBodySystem.
| agxData::EntityRange agx::ParticleSystem::spawnParticles | ( | const agx::Vec3Vector & | positions | ) |
Spawn particles with defined positions.
| agx::Physics::ParticlePtrVector agx::ParticleSystem::spawnParticlesInBound | ( | const agx::Bound3 & | bound, |
| agx::Emitter::DistributionTable * | sourceTable, | ||
| const agx::Vec3 & | spacing, | ||
| agx::Real | jitterFactor = agx::Real(0) |
||
| ) |
Spawns particles In a specified bound from a distribution table.
| bound | The specified bound to spawn in |
| sourceTable | The particle model distribution table used to spawn particles |
| spacing | spacing between the particle center points that are spawned |
| jitterFactor | The factor of the distance that is used to randomize particle positions |
| agx::Physics::ParticlePtrVector agx::ParticleSystem::spawnParticlesInBound | ( | const agx::Bound3 & | bound, |
| Real | radius, | ||
| const agx::Vec3 & | spacing, | ||
| agx::Real | jitterFactor = agx::Real(0) |
||
| ) |
Spawns particles in a specified bound.
| bound | the specified bound to spawn in |
| radius | The radius for the new particles |
| spacing | spacing between the particle center points that are spawned |
| jitterFactor | the factor of the distance that is used to randomize particle positions |
| agx::Physics::ParticlePtrVector agx::ParticleSystem::spawnParticlesInBoundHCP | ( | const agx::Bound3 & | bound, |
| agx::Emitter::DistributionTable * | sourceTable, | ||
| const agx::Vec3 & | spacing, | ||
| agx::Real | jitterFactor = agx::Real(0) |
||
| ) |
Spawns particles in a specified bound from a distribution table using a Hexagonal-Close-Packing (HCP) lattice.
| bound | The specified bound to spawn in |
| sourceTable | The particle model distribution table used to spawn particles |
| spacing | Spacing between the particle center points that are spawned |
| jitterFactor | The factor of the distance that is used to randomize particle positions |
| agx::Physics::ParticlePtrVector agx::ParticleSystem::spawnParticlesInBoundHCP | ( | const agx::Bound3 & | bound, |
| Real | radius, | ||
| const agx::Vec3 & | spacing, | ||
| agx::Real | jitterFactor = agx::Real(0) |
||
| ) |
Spawns particles In a specified bound using a Hexagonal-Close-Packing (HCP) lattice.
| bound | The specified bound to spawn in |
| radius | The radius for the new particles |
| spacing | Spacing between the particle center points that are spawned |
| jitterFactor | The factor of the distance that is used to randomize particle positions |
| agx::Physics::ParticlePtrVector agx::ParticleSystem::spawnParticlesInGeometry | ( | agxCollide::Geometry * | geometry, |
| agx::Emitter::DistributionTable * | sourceTable, | ||
| const agx::Vec3 & | spacing, | ||
| agx::Real | jitterFactor = agx::Real(0) |
||
| ) |
Spawns particles In a specified geometry from a distribution table.
| geometry | The specified geometry to spawn particles in |
| sourceTable | The particle model distribution table used to spawn particles |
| spacing | Spacing between the particle center points that are spawned |
| jitterFactor | The factor of the distance that is used to randomize particle positions |
| agx::Physics::ParticlePtrVector agx::ParticleSystem::spawnParticlesInGeometry | ( | agxCollide::Geometry * | geometry, |
| Real | radius, | ||
| const agx::Vec3 & | spacing, | ||
| agx::Real | jitterFactor = agx::Real(0) |
||
| ) |
Spawns particles In a specified geometry.
| geometry | The specified geometry to spawn particles in |
| radius | The radius for the new particles |
| spacing | Spacing between the particle center points that are spawned |
| jitterFactor | The factor of the distance that is used to randomize particle positions |
| agx::Physics::ParticlePtrVector agx::ParticleSystem::spawnParticlesInGeometryHCP | ( | agxCollide::Geometry * | geometry, |
| agx::Emitter::DistributionTable * | sourceTable, | ||
| const agx::Vec3 & | spacing, | ||
| agx::Real | jitterFactor = agx::Real(0) |
||
| ) |
Spawns particles In a specified geometry from a distribution table using a Hexagonal-Close-Packing (HCP) lattice.
| geometry | The specified geometry to spawn particles in |
| sourceTable | The particle model distribution table used to spawn particles |
| spacing | Spacing between the particle center points that are spawned |
| jitterFactor | The factor of the distance that is used to randomize particle positions |
| agx::Physics::ParticlePtrVector agx::ParticleSystem::spawnParticlesInGeometryHCP | ( | agxCollide::Geometry * | geometry, |
| Real | radius, | ||
| const agx::Vec3 & | spacing, | ||
| agx::Real | jitterFactor = agx::Real(0) |
||
| ) |
Spawns particles In a specified geometry using a Hexagonal-Close-Packing (HCP) lattice.
| geometry | The specified geometry to spawn particles in |
| radius | The radius for the new particles |
| spacing | Spacing between the particle center points that are spawned |
| jitterFactor | The factor of the distance that is used to randomize particle positions |
Sums force magnitudes from particle system onto rigid body.
Only valid for iterative solver.
| body | The rigid body. |
| void agx::ParticleSystem::updateShouldRender | ( | ) |
Update the shouldRender variable in particles given renders states such as clipping and filtering.
This determines if an individual particle should be rendered or not.
|
protected |
Definition at line 756 of file ParticleSystem.h.
|
protected |
Definition at line 696 of file ParticleSystem.h.