AGX Dynamics  2.35.0.1
DeformableParticleMesh.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGX_DEFORMABLEPARTICLEMESH_H
18 #define AGX_DEFORMABLEPARTICLEMESH_H
19 
20 #include <agxSDK/Assembly.h>
21 
22 #include <agxUtil/RawMesh.h>
23 #include <agx/DistanceJoint.h>
24 #include <agxModel/export.h>
25 #include <agxStream/Serializable.h>
26 
27 namespace agxModel
28 {
29 
31  {
32  public:
33  // Used for serialization
35 
47  agxUtil::RawMesh* rawMesh);
48 
53  void setMass(agx::Real mass);
54 
60 
66 
72 
78 
83  void addParticleGroup(const agx::Name& name);
84 
90 
95  void removeParticleGroup(const agx::Name& name);
96 
102 
108 
113 
119 
124 
126 
127  private:
128  void addJoint(size_t firstParticle, size_t secondParticle);
129 
130  agx::RigidBodyRefVector m_particles;
132 
133  agx::MaterialRef m_particleMaterial;
134 
135  agxUtil::RawMeshRef m_sourceMesh;
136  };
137 
138 }
139 #endif // AGX_DEFORMABLEPARTICLEMESH_H
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
#define AGXMODEL_EXPORT
void setParticleRadius(agx::Real radius)
Set the radius of all the particles.
void setConstraintSolveType(agx::Constraint::SolveType solveType)
Set the solve type for the distance joints connecting the particles.
void removeParticleGroup(const agx::Name &name)
Remove a collision group from all particles in the mesh.
agx::Vector< agx::UIntVector > getFaces() const
Get the indices of all particles in each face.
void addParticleGroup(agx::UInt32 id)
Add a collision group to all particles in the mesh.
agxUtil::RawMesh * getSourceMesh() const
Get the mesh without deformation.
const agx::RigidBodyRefVector & getParticles() const
Get a list of all the particles in the mesh.
void setParticleMaterial(agx::Material *material)
Set the material of all the particles.
void setMass(agx::Real mass)
Set the properties of the entire mesh.
DeformableParticleMesh(agxUtil::RawMesh *rawMesh)
Create a deformable mesh from the RawMesh specified.
void addParticleGroup(const agx::Name &name)
Add a collision group to all particles in the mesh.
void setConstraintCompliance(agx::Real compliance)
Set the compliance of the distance joints connecting the particles.
const agx::Vector< agx::DistanceJointRef > & getConstraints() const
Get a list of all the joints in the mesh.
void removeParticleGroup(agx::UInt32 id)
Remove a collision group from all particles in the mesh.
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Definition: Assembly.h:67
A class to hold a general represenation of a mesh with arbitrary number of vertices in a face.
Definition: RawMesh.h:35
SolveType
Specifies in what solvers the constraint will be solved.
Definition: Constraint.h:93
Main material class which acts as a holder of a Surface Material and a Bulk material.
Definition: Material.h:388
Representation of a name string.
Definition: Name.h:33
Templated vector class.
Definition: agx/Vector.h:53
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:37
uint32_t UInt32
Definition: Integer.h:40
double Real
Definition: Real.h:42