AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TerrainProperties.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. 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 #pragma once
18 
20 #include <agxTerrain/export.h>
21 #include <agx/Referenced.h>
22 #include <agx/BitState.h>
23 #include <array>
24 
25 namespace agxTerrain
26 {
32  {
33  public:
34 
38  agx::Real getSoilMergeSpeedThreshold() const;
39 
44  bool getEnableLockedBorders() const;
45 
49  bool getEnableSoilCompaction() const;
50 
54  bool getEnableAvalanching() const;
55 
59  bool getDeleteSoilParticlesOutsideBounds() const;
60 
64  agx::Real getSoilParticleLifeTime() const;
65 
70  agx::Real getPenetrationForceVelocityScaling() const;
71 
75  agx::Real getAvalancheMaxHeightGrowth() const;
76 
81  agx::Real getAvalancheDecayFraction() const;
82 
87  agx::Real getAvalancheErrorThreshold() const;
88 
98  agx::Real getSoilAggregateLockCompliance(agx::Int dof) const;
99 
103  bool getCreateParticles() const;
104 
108  agx::Real getMaximumParticleActivationVolume() const;
109 
114  agx::Real getDeformerActivationSpeed() const;
115 
119  agx::Real getSoilParticleGrowthRate() const;
120 
126  bool getEnableCreateDynamicMass() const;
127 
133  void setSoilMergeSpeedThreshold(agx::Real speedThreshold);
134 
141  void setSoilParticleMergeRate( agx::Real mergeRate );
142 
147  agx::Real getSoilParticleMergeRate() const;
148 
156  void setSoilParticleMergeThreshold( agx::Real radiusFraction );
157 
162  agx::Real getSoilParticleMergeThreshold() const;
163 
169  void setSoilParticleLifeTime(agx::Real lifeTime);
170 
177  void setAvalancheDecayFraction(agx::Real decayFraction);
178 
183  void setAvalancheMaxHeightGrowth(agx::Real maxHeightGrowth);
184 
190  void setAvalancheErrorThreshold( agx::Real errorThreshold );
191 
196  void setCreateParticles(bool enable);
197 
202  void setEnableSoilCompaction(bool enable);
203 
208  void setDeleteSoilParticlesOutsideBounds(bool enable);
209 
215  void setEnableLockedBorders(bool enable);
216 
221  void setEnableAvalanching(bool enable);
222 
227  void setSoilParticleGrowthRate( agx::Real growthRateFactor );
228 
239  void setSoilAggregateLockCompliance(agx::Real compliance, agx::Int dof);
240 
247  void setPenetrationForceVelocityScaling(agx::Real penetrationForceVelocityScaling);
248 
253  void setMaximumParticleActivationVolume(agx::Real volume);
254 
260  void setEnableCreateDynamicMass( bool enable );
261 
268  void setDeformerActivationSpeed( agx::Real activationSpeed );
269 
273  float getSoilParticleSizeScaling();
274 
281  void setSoilParticleSizeScaling(float scalingFactor);
282 
286  bool isDirty() const;
287 
292  void setDirty(bool isDirty);
293 
295 
296 
300 
302 
304  protected:
305  virtual ~TerrainProperties();
306 
308  {
309  LOCKED_BORDERS = 1 << 0,
310  CREATE_PATICLES = 1 << 1,
311  DELETE_PARTICLES_OUTSIDE_BOUNDS = 1 << 2,
312  ENABLE_SOIL_COMPACTION = 1 << 3,
313  ENABLE_AVALANCHING = 1 << 4,
314  ENABLE_DYNAMIC_MASS = 1 << 5,
315  };
316  using Flags = agx::BitState<StateFlags, agx::UInt32>;
317 
318  private:
319  Flags m_flags;
320  agx::Real m_avalancheDecayFraction;
321  agx::Real m_avalancheMaxHeightGrowth;
322  agx::Real m_penetrationForceVelocityScaling;
323  agx::Real m_soilMergeSpeedThreshold;
324  agx::Real m_maximumActivationVolume;
325  agx::Real m_soilParticleLifeTime;
326  agx::Real m_avalancheErrorThreshold;
327  std::array<agx::Real, 6> m_soilAggregateCompliance;
328  agx::Real m_deformerActivationSpeed;
329  agx::Real m_particleGrowthRateFactor;
330  agx::Real m_soilParticleMergeRate;
331  agx::Real m_soilParticleMergeThreshold;
332  float m_particleSizeScaling;
333  bool m_isDirty;
334  };
335 
336 
337 
338 
340  {
341  return m_flags.Is(StateFlags::LOCKED_BORDERS);
342  }
343 
344 
345 
347  {
348  return m_avalancheMaxHeightGrowth;
349  }
350 
351 
352 
354  {
355  return m_avalancheDecayFraction;
356  }
357 
358 
359 
361  {
362  return m_flags.Is(StateFlags::DELETE_PARTICLES_OUTSIDE_BOUNDS);
363  }
364 
365 
366 
368  {
369  return m_penetrationForceVelocityScaling;
370  }
371 
372 
373 
375  {
376  return m_maximumActivationVolume;
377  }
378 
379 
380 
382  {
383  return m_soilAggregateCompliance[dof];
384  }
385 
386 
387 
389  {
390  return m_flags.Is( StateFlags::ENABLE_DYNAMIC_MASS );
391  }
392 
393 
394 }
395 
#define AGXTERRAIN_STORE_RESTORE_INTERFACE
agx::Real getAvalancheMaxHeightGrowth() const
Get the maximum allowed height transfer per time step due to avalanching.
Class for containing and managing the different agxTerrain::Terrain settings.
int32_t Int
Definition: Integer.h:35
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
Base class providing referencing counted objects.
Definition: Referenced.h:113
bool getDeleteSoilParticlesOutsideBounds() const
#define AGXTERRAIN_EXPORT
agx::Real getSoilAggregateLockCompliance(agx::Int dof) const
Set the compliance of the soil aggregate lock joint the local constraint dimensions to relax or incre...
agx::Real getAvalancheDecayFraction() const
agx::Real getPenetrationForceVelocityScaling() const
double Real
Definition: Real.h:42
agx::Real getMaximumParticleActivationVolume() const
uint32_t UInt32
Definition: Integer.h:40
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:101
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:100
agx::BitState< StateFlags, agx::UInt32 > Flags