AGXDynamics  2.35.0.3
TerrainParticles.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 AGXMODEL_TERRAIN_PARTICLES_H
18 #define AGXMODEL_TERRAIN_PARTICLES_H
19 
20 #include <agxModel/export.h>
21 
22 
23 #include <agxCollide/Contacts.h>
24 #include <agx/Material.h>
25 
26 #include <agxCollide/agxCollide.h>
27 
28 
29 #define TERRAIN_USE_PARTICLE_SYSTEM 0
30 
31 #if TERRAIN_USE_PARTICLE_SYSTEM
32 #include <agx/ParticleSystem.h>
33 #endif
34 
35 namespace agxModel
36 {
37  class Terrain;
38 
40 
42 
44 
46 
48 
54  {
55 
56  public:
57 
61  enum SoilType {
64  CONVEX_BODY
65  };
66 
68 
72  void setType( SoilType soilType );
73 
77  SoilType getType( );
78 
82  void setParticleUniqueId( agx::UInt32 uniqueParticleId );
83 
87  agx::UInt32 getParticleUniqueId() const;
88 
93  void setParticleYoungsModulusMultiplier(agx::Real multiplier);
94 
98  agx::Real getParticleYoungsModulusMultiplier() const;
99 
103  void setMergeVelocity( agx::Real velocity );
104 
108  agx::Real getMergeVelocity2() const;
109 
113  agx::Real getAdhesiveOverlap( ) const;
114 
118  agx::Real getRadius( ) const;
119 
123  agx::Real getCoreRadius( ) const;
124 
128  agx::Real getVolume( ) const;
129 
137  void setRadius( agx::Real radius);
138 
145  void setCoreRadius( agx::Real coreRadius );
146 
150  bool getRadiusIsDirty( ) const;
151 
153 
154  protected:
155  friend class Terrain;
156  private:
157 
158  void setRadiusIsDirty( bool dirty );
159 
160  SoilType m_type;
161  agx::Real m_radius;
162  agx::Real m_coreRadius;
163  agx::Real m_mergeVelocity2;
164  bool m_radiusIsDirty;
165  agx::UInt32 m_uniqueParticleId;
166  agx::Real m_particleYoungsMultiplier;
167  };
168 
175  {
176  public:
177 
180 
185 
189  agx::Real getRadius( ) const;
190 
194  virtual agx::Real getVolume( ) const;
195 
200  void setParent( SoilParticle* parent );
201 
205  void setSeedContact( );
206 
210  bool getSeedContact( ) const;
211 
215  SoilParticle* getParent( ) const;
216 
220  bool hasParent() const;
221 
225  bool isParent() const;
226 
228 
229  protected:
232  private:
233  agx::Real m_radius;
234  SoilParticle* m_parent; //particles
235  bool m_seedContact;
236 
237  };
238 
241 
243  {
244  public:
248  ConvexSoil( const agx::Vec3Vector* vertices, const agx::UInt32Vector* indices );
249 
253  virtual agx::Real getVolume( ) const override;
254 
256  protected:
258  private:
259 
260  };
261 
262 #if TERRAIN_USE_PARTICLE_SYSTEM
266 #else
270 #endif
271 
272 }
273 
274 #endif //AGXMODEL_TERRAIN_PARTICLES_H
agxModel::SoilParticleRef
agx::ref_ptr< SoilParticle > SoilParticleRef
Definition: TerrainParticles.h:239
agxModel::SizeTPairVector
agx::Vector< std::pair< size_t, size_t > > SizeTPairVector
Definition: TerrainParticles.h:45
agx::Real
double Real
Definition: Real.h:42
agxModel::SoilParticle::SoilParticle
SoilParticle()
Definition: TerrainParticles.h:230
agxModel::SoilParticleObs
agx::observer_ptr< SoilParticle > SoilParticleObs
Definition: TerrainParticles.h:240
agxModel
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:36
agx::Vector
Templated vector class.
Definition: Vector.h:52
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
agxStream::Serializable
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
export.h
agxData::getType
AGXCORE_EXPORT Type * getType(const agx::String &name)
agxModel::RealSizeTPairVector
agx::Vector< std::pair< agx::Real, size_t > > RealSizeTPairVector
Definition: TerrainParticles.h:43
ParticleSystem.h
AGXSTREAM_DECLARE_SERIALIZABLE
#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
agx::VectorPOD< Vec3 >
agx::observer_ptr
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Definition: observer_ptr.h:60
agxModel::ConvexSoil::ConvexSoil
ConvexSoil()
Definition: TerrainParticles.h:257
agxModel::ParticleAttributes::PARTICLE_SYSTEM_PARTICLE
@ PARTICLE_SYSTEM_PARTICLE
Definition: TerrainParticles.h:63
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agxModel::ParticleAttributes::PARTICLE
@ PARTICLE
Definition: TerrainParticles.h:62
agxModel::SoilParticle
When converting Terrain to particles, we create SoilParticles.
Definition: TerrainParticles.h:174
agxCollide.h
agxModel::SoilParticle::m_type
ParticleAttributes::SoilType m_type
Definition: TerrainParticles.h:231
agxModel::Vec2iHeightDataPairVector
agx::Vector< std::pair< agx::Vec2i, ParticleCoordinateHeightData > > Vec2iHeightDataPairVector
Definition: TerrainParticles.h:41
agxModel::SoilParticlePtrVector
agx::Vector< SoilParticle * > SoilParticlePtrVector
Definition: TerrainParticles.h:269
agxModel::ParticleAttributes::SoilType
SoilType
Enum for type of soil.
Definition: TerrainParticles.h:61
agxModel::ConvexSoil
Definition: TerrainParticles.h:242
Contacts.h
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agxModel::Terrain
Definition: agxModel/Terrain.h:83
agx::Vec3T< Real >
agx::UInt32
uint32_t UInt32
Definition: Integer.h:40
agx::HashVector< size_t, agx::Real >
agxModel::SoilParticleObsVector
agx::Vector< SoilParticleObs > SoilParticleObsVector
Definition: TerrainParticles.h:267
agxModel::ParticleAttributes
Definition: TerrainParticles.h:53
agxModel::ParticleCoordinateHeightData
agx::Vec3 ParticleCoordinateHeightData
Definition: TerrainParticles.h:37
Material.h
agxModel::SizeTRealHashVector
agx::HashVector< size_t, agx::Real > SizeTRealHashVector
Definition: TerrainParticles.h:47
agxModel::SoilParticleRefVector
agx::Vector< SoilParticleRef > SoilParticleRefVector
Definition: TerrainParticles.h:268