AGX Dynamics  2.37.3.2
TerrainProperties.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 
19 #include <agx/config/AGX_USE_AGXTERRAIN.h>
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 getActivationSpeed() const;
115 
119  agx::Real getSoilParticleGrowthRate() const;
120 
126  bool getEnableCreateDynamicMass() const;
127 
132  bool getEnableDeformation() const;
133 
139  void setSoilMergeSpeedThreshold(agx::Real speedThreshold);
140 
147  void setSoilParticleMergeRate( agx::Real mergeRate );
148 
153  agx::Real getSoilParticleMergeRate() const;
154 
162  void setSoilParticleMergeThreshold( agx::Real radiusFraction );
163 
168  agx::Real getSoilParticleMergeThreshold() const;
169 
175  void setSoilParticleLifeTime(agx::Real lifeTime);
176 
183  void setAvalancheDecayFraction(agx::Real decayFraction);
184 
189  void setAvalancheMaxHeightGrowth(agx::Real maxHeightGrowth);
190 
196  void setAvalancheErrorThreshold( agx::Real errorThreshold );
197 
202  void setCreateParticles(bool enable);
203 
208  void setEnableSoilCompaction(bool enable);
209 
214  void setDeleteSoilParticlesOutsideBounds(bool enable);
215 
221  void setEnableLockedBorders(bool enable);
222 
227  void setEnableAvalanching(bool enable);
228 
233  void setSoilParticleGrowthRate( agx::Real growthRateFactor );
234 
245  void setSoilAggregateLockCompliance(agx::Real compliance, agx::Int dof);
246 
253  void setPenetrationForceVelocityScaling(agx::Real penetrationForceVelocityScaling);
254 
259  void setMaximumParticleActivationVolume(agx::Real volume);
260 
266  void setEnableCreateDynamicMass( bool enable );
267 
268 
274  void setEnableDeformation( bool enable );
275 
282  void setActivationSpeed( agx::Real activationSpeed );
283 
287  float getSoilParticleSizeScaling();
288 
295  void setSoilParticleSizeScaling(float scalingFactor);
296 
300  bool isDirty() const;
301 
306  void setDirty(bool isDirty);
307 
309 
310 
314 
316 
318  protected:
319  virtual ~TerrainProperties();
320 
322  {
323  LOCKED_BORDERS = 1 << 0,
324  CREATE_PATICLES = 1 << 1,
325  DELETE_PARTICLES_OUTSIDE_BOUNDS = 1 << 2,
326  ENABLE_SOIL_COMPACTION = 1 << 3,
327  ENABLE_AVALANCHING = 1 << 4,
328  ENABLE_DYNAMIC_MASS = 1 << 5,
329  ENABLE_DEFORMATION = 1 << 6,
330  };
331  using Flags = agx::BitState<StateFlags, agx::UInt32>;
332 
333  private:
334  Flags m_flags;
335  agx::Real m_avalancheDecayFraction;
336  agx::Real m_avalancheMaxHeightGrowth;
337  agx::Real m_penetrationForceVelocityScaling;
338  agx::Real m_soilMergeSpeedThreshold;
339  agx::Real m_maximumActivationVolume;
340  agx::Real m_soilParticleLifeTime;
341  agx::Real m_avalancheErrorThreshold;
342  std::array<agx::Real, 6> m_soilAggregateCompliance;
343  agx::Real m_activationSpeed;
344  agx::Real m_particleGrowthRateFactor;
345  agx::Real m_soilParticleMergeRate;
346  agx::Real m_soilParticleMergeThreshold;
347  float m_particleSizeScaling;
348  bool m_isDirty;
349  };
350 
351 
353  {
354  return m_flags.Is( StateFlags::ENABLE_DEFORMATION );
355  }
356 
358  {
359  return m_flags.Is(StateFlags::LOCKED_BORDERS);
360  }
361 
362 
363 
365  {
366  return m_avalancheMaxHeightGrowth;
367  }
368 
369 
370 
372  {
373  return m_avalancheDecayFraction;
374  }
375 
376 
377 
379  {
380  return m_flags.Is(StateFlags::DELETE_PARTICLES_OUTSIDE_BOUNDS);
381  }
382 
383 
384 
386  {
387  return m_penetrationForceVelocityScaling;
388  }
389 
390 
391 
393  {
394  return m_maximumActivationVolume;
395  }
396 
397 
398 
400  {
401  return m_soilAggregateCompliance[dof];
402  }
403 
404 
405 
407  {
408  return m_flags.Is( StateFlags::ENABLE_DYNAMIC_MASS );
409  }
410 
411 
412 }
413 
#define AGXTERRAIN_STORE_RESTORE_INTERFACE
agx::Real getMaximumParticleActivationVolume() const
Class for containing and managing the different agxTerrain::Terrain settings.
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes...
Definition: Geometry.h:59
int32_t Int
Definition: Integer.h:35
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Base class providing referencing counted objects.
Definition: Referenced.h:119
agx::Real getAvalancheDecayFraction() const
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 getPenetrationForceVelocityScaling() const
#define AGXTERRAIN_EXPORT
double Real
Definition: Real.h:42
bool getDeleteSoilParticlesOutsideBounds() const
uint32_t UInt32
Definition: Integer.h:40
agx::Real getAvalancheMaxHeightGrowth() const
Get the maximum allowed height transfer per time step due to avalanching.
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
agx::BitState< StateFlags, agx::UInt32 > Flags