AGXDynamics  2.35.0.2
TerrainUtils.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_UTILS_H
18 #define AGXMODEL_TERRAIN_UTILS_H
19 
20 #include <agxModel/export.h>
21 
22 
24 #include <agxCollide/Geometry.h>
25 #include <agxCollide/HeightField.h>
26 #include <agxCollide/Contacts.h>
27 #include <agx/Material.h>
28 
29 #include <agx/FrictionModel.h>
30 
31 #include <agxSDK/Simulation.h>
32 
33 
37 
38 namespace agxModel
39 {
40 
41  class ImpactVolumeData;
42 
49  {
50  public:
52  : m_localHeightUpdate(false), m_lockBorders(false), m_avalancheMassLoss(true), m_heightField(heightField)
53  {}
55  : m_localHeightUpdate(false), m_lockBorders(false), m_avalancheMassLoss(true), m_heightField(nullptr)
56  {}
57  void setEnableLockedBorders( bool lock, bool avalancheMassLoss = true ) {
58  m_lockBorders = lock;
59  m_avalancheMassLoss = avalancheMassLoss;
60  }
62  return m_avalancheMassLoss;
63  }
64  bool getEnabledLockedBorders() const {
65  return m_lockBorders;
66  }
68  m_heightField->calculateMassProperties();
69  }
70  void setHeight( size_t x, size_t y, agx::Real height );
71  AGX_FORCE_INLINE size_t getLocalX( size_t globalX ) {
72  return std::max(globalX, m_minX) - m_minX;
73  }
74  AGX_FORCE_INLINE size_t getLocalY( size_t globalY ) {
75  return std::max(globalY, m_minY) - m_minY;
76  }
77  AGX_FORCE_INLINE size_t getLocalVectorIndex( size_t globalX, size_t globalY ) {
78  return (m_maxX - m_minX + 1) * getLocalY(globalY) + getLocalX(globalX);
79  }
80  agx::Real getHeight( size_t x, size_t y ) const;
81  void startLocalHeightUpdate( size_t minX = 0, size_t maxX = 0, size_t minY = 0, size_t maxY = 0);
82  void endLocalHeightUpdate();
83 
85  return m_localHeightUpdate;
86  }
88  return m_heightField;
89  }
90 
92 
93  protected:
94 
95  private:
96  bool m_localHeightUpdate;
97  bool m_lockBorders;
98  bool m_avalancheMassLoss;
99  agxCollide::HeightFieldRef m_heightField;
100  agx::RealVector m_tempHeights;
101  size_t m_minX;
102  size_t m_maxX;
103  size_t m_minY;
104  size_t m_maxY;
105  };
107 
109  {
110  public:
112  void render( agxRender::RenderManager* mgr );
113 
114  protected:
115  virtual ~TerrainDebugRenderer();
116 
120  };
121 
127  {
128  public:
129 
131  : m_particleResolutionX(1), m_particleResolutionY(1), m_scale(1), m_heightFieldToParticleCoordinateMultiplier(1)
132  {}
133 
137  void updateResolution( const agx::Real& particleRadius, const size_t& heightFieldResolutionX, const size_t& heightFieldResolutionY, const agx::Real& scale );
138 
140  //middle vertex,--------- the four below-------ccw--------------,-----the four on same height as vertex----ccw---,----the four above------ccw----------------------
141 
145  agx::Real findFccHeight( agx::Real heightAtVertexPos, agx::Real dX, agx::Real dY, DirectionFCC fccLocalPos );
146 
150  agx::Real findParticleCoordinateHeight(const size_t pcsX, const size_t pcsY, Terrain* terrain );
151 
152 
157  agx::Vec3 getHeightFieldPositionFromFCCIndex( size_t fccIndex, const agx::Real minZ, size_t& pcsX, size_t& pcsY );
158 
163  void getParentHeightFieldVertex( const size_t& pcsX, const size_t& pcsY, size_t& hfX, size_t& hfY );
164 
169  void collectCloseParticleCoordinates( const size_t& hfX, const size_t& hfY, agx::Vec2iVector& particleCoordinates );
170 
176  void collectCloseParticleLowerXYCoordinatesWithHeight( const agxCollide::HeightField* hf, const size_t& hfX, const size_t& hfY,
177  Vec2iHeightDataPairVector& particleCoordinatesWithHeight, Terrain* terrain);
178 
183  size_t indexForFCCLattice( size_t pcsX, size_t pcsY, size_t pcsZ, DirectionFCC dir );
184 
188  agx::Real scaleDepth( const agx::Real& depth, const size_t pcsX, const size_t pcsY, const agx::Vec2& hf2Dpos );
189 
194  agx::Vec2 getHeightFieldPosition( const size_t pcsX, const size_t pcsY, const size_t dX = 0, const size_t dY = 0 );
195 
196  private:
197  size_t m_particleResolutionX;
198  size_t m_particleResolutionY;
199 
200  agx::Real m_scale;
201 
202  agx::Real m_heightFieldToParticleCoordinateMultiplier;
203  };
204 
207  {
208  public:
211  }
212 
213  void post(const agx::TimeStamp& ) {
214  m_localContacts.clear(agx::Container::MAINTAIN_BUFFER);
215  }
216 
217  void pre( const agx::TimeStamp& /*t*/ ) {
218  this->getSimulation()->getSpace()->addGeometryContacts(m_localContacts);
219  }
220 
221  bool createGeometryContact(agxCollide::Geometry* g1, agxCollide::Geometry* g2, agx::Vec3Vector points, agx::Vec3Vector normals, agx::RealVector depths, agx::Real pointArea, agx::ContactMaterial* cm = nullptr);
222 
223 
224  private:
226 
227  };
228 
230 
232 
234 
237  {
238  public:
248 
259  virtual void calculateTangentPlane(const agxCollide::Geometry* geometry1, const agxCollide::Geometry* geometry2, const agx::Vec3& point, const agx::Vec3& normal, const agx::Real depth, agx::Vec3& ret_u, agx::Vec3& ret_v) const override;
260 
261  void addBody(agx::RigidBody* body, const agx::Vec3& localFrictionDir);
262 
264 
265  protected:
266 
269  };
270 
271 
274  {
275  public:
277 
280  }
281 
283  return m_contactGenerator;
284  }
285 
286  void setParticleRadius( agx::Real radius ) {
287  m_particleRadius = radius;
288  }
289 
291  return m_particleRadius;
292  }
293 
295  return m_uniqueParticleId;
296  }
297 
298  protected:
304  };
305 
307 
308 
314  {
315  public:
317  : m_geometryContact(gc), m_index(index) {
318  m_geometry1 = gc->geometry(0);
319  m_geometry2 = gc->geometry(1);
320  }
321 
322  bool isValid() const {
323  return m_geometry1->getEnable() && m_geometry2->getEnable() && (m_geometry1->getRigidBody() == nullptr || m_geometry1->getRigidBody()->getEnable() ) && (m_geometry2->getRigidBody() == nullptr || m_geometry2->getRigidBody()->getEnable());
324  }
325 
326  void add( ImpactVolumeData* ivd ) {
327  m_impactVolumeDataVector.push_back(ivd);
328  }
329 
330  const agxCollide::Geometry* getGeometry1() const { return m_geometry1; }
331  agxCollide::Geometry* getGeometry1() { return m_geometry1; }
332  const agxCollide::Geometry* getGeometry2() const { return m_geometry2; }
333  agxCollide::Geometry* getGeometry2() { return m_geometry2; }
334 
335  size_t getIndex() {
336  return m_index;
337  }
338 
339  void clear() {
340  m_impactVolumeDataVector.clear();
341  }
342 
344  return m_geometryContact;
345  }
347  return m_impactVolumeDataVector;
348  }
349  protected:
350  virtual ~GeometryContactInfo( ) {
351  clear();
352  }
353 
354  private:
355  ImpactVolumeDataPtrVector m_impactVolumeDataVector;
356  agxCollide::GeometryContact* m_geometryContact;
357  agxCollide::GeometryRef m_geometry1;
358  agxCollide::GeometryRef m_geometry2;
359  size_t m_index;
360 
361  };
362 
365 
367  {
368  if ( m_heightField == nullptr )
369  return agx::Real(0);
370  size_t vectorIndex = m_heightField->getResolutionX() * y + x;
371  agxAssert( !getLocalHeightUpdate() || m_tempHeights.size() > vectorIndex);
372 
373  if ( getLocalHeightUpdate() && m_tempHeights[vectorIndex] != -agx::Infinity )
374  return m_tempHeights[vectorIndex];
375 
376  return m_heightField->getHeight(x, y);
377  }
378 
379  AGX_FORCE_INLINE void HeightController::setHeight( size_t x, size_t y, agx::Real height )
380  {
381  if ( m_heightField == nullptr )
382  return;
383 
384  if ( m_lockBorders && ( x == 0 || y == 0 || x + 1 >= m_heightField->getResolutionX() || y + 1 >= m_heightField->getResolutionY() ) )
385  return;
386  if ( getLocalHeightUpdate() )
387  m_tempHeights[getLocalVectorIndex(x, y)] = height;
388  else
389  m_heightField->setHeight(x, y, height);
390  }
391 
393  {
394  public:
396 
398  size_t idx;
399  size_t x;
400  size_t y;
403 
404  private:
405  void initialize(Terrain* terrain);
406 
407 
408  };
409 
411  {
412  public:
413 
415 
416  void extractGeometryProperties(Terrain* terrain);
417 
418  //Values found before analyzing contact points
431 
432  // values updated during contact point analysis
442 
443  };
444 
445  class VolumeOverlap : public agx::Vec3
446  {
447  public:
448  VolumeOverlap();
449  enum Type
450  {
451  TOTAL = 0,
454  };
455 
456  };
457 
458 }
459 
460 #endif
agxModel::ParticleCoordinateSystem::NEG_X_NEG_Y
@ NEG_X_NEG_Y
Definition: TerrainUtils.h:139
agxModel::ContactPointData::x
size_t x
Definition: TerrainUtils.h:399
HeightField.h
agxModel::DeformingGeometryContactProperties::maxAdhesion
agx::Real maxAdhesion
Definition: TerrainUtils.h:434
agxModel::DeformingGeometryContactProperties::collidedGeometry
agx::observer_ptr< agxCollide::Geometry > collidedGeometry
Definition: TerrainUtils.h:419
agxModel::HeightController::getHeightField
const agxCollide::HeightField * getHeightField() const
Definition: TerrainUtils.h:87
agxModel::ParticleCoordinateSystem
Definition: TerrainUtils.h:126
agxModel::HeightController::getLocalY
size_t getLocalY(size_t globalY)
Definition: TerrainUtils.h:74
agxModel::ParticleCoordinateSystem::findParticleCoordinateHeight
agx::Real findParticleCoordinateHeight(const size_t pcsX, const size_t pcsY, Terrain *terrain)
Calculate the height of a particle position.
agxModel::DynamicHeightFieldSimulationRef
agx::ref_ptr< DynamicHeightFieldSimulation > DynamicHeightFieldSimulationRef
Definition: TerrainUtils.h:306
agxModel::DynamicHeightFieldSimulation::getParticleCoordinateSystem
ParticleCoordinateSystem & getParticleCoordinateSystem()
Definition: TerrainUtils.h:278
agx::Real
double Real
Definition: Real.h:42
agxModel::ParticleCoordinateSystem::indexForFCCLattice
size_t indexForFCCLattice(size_t pcsX, size_t pcsY, size_t pcsZ, DirectionFCC dir)
hfX, hfY are index in height field.
agxModel
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:36
agxModel::GeometryContactInfo::GeometryContactInfo
GeometryContactInfo(agxCollide::GeometryContact *gc, size_t index)
Definition: TerrainUtils.h:316
agxSDK::StepEventListener
Derive from this class to implement a listener for simulation step events.
Definition: StepEventListener.h:37
agxModel::DynamicHeightFieldSimulation::DynamicHeightFieldSimulation
DynamicHeightFieldSimulation()
agxModel::ParticleCoordinateSystem::POS_Y_POS_Z
@ POS_Y_POS_Z
Definition: TerrainUtils.h:139
agxModel::DeformingGeometryContactProperties::isShovelMovingForward
agx::Bool isShovelMovingForward
Definition: TerrainUtils.h:426
agx::Vector
Templated vector class.
Definition: Vector.h:52
agxModel::HeightController::getHeight
agx::Real getHeight(size_t x, size_t y) const
Definition: TerrainUtils.h:366
agx::Container::size
size_t size() const
Definition: Container.h:134
Simulation.h
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
agxModel::ContactGeneratorRef
agx::ref_ptr< ContactGenerator > ContactGeneratorRef
Definition: TerrainUtils.h:229
agx::IterativeProjectedConeFriction
Iterative Projected Cone Friction (IPC friction) model.
Definition: FrictionModel.h:269
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
agxModel::VolumeOverlap::TOTAL
@ TOTAL
Definition: TerrainUtils.h:451
agxModel::DeformingGeometryContactProperties
Definition: TerrainUtils.h:410
agxModel::ParticleCoordinateSystem::getHeightFieldPositionFromFCCIndex
agx::Vec3 getHeightFieldPositionFromFCCIndex(size_t fccIndex, const agx::Real minZ, size_t &pcsX, size_t &pcsY)
Translates a position in the imaginary FCC 3 dimensional grid to a world position Returns positions i...
agxRender::RenderManager
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc.
Definition: RenderManager.h:106
agxModel::DeformingGeometryContactProperties::totalYoungsModulus
agx::Real totalYoungsModulus
Definition: TerrainUtils.h:437
agxModel::DeformingGeometryContactProperties::gPos
agx::Vec3 gPos
Definition: TerrainUtils.h:430
export.h
agxModel::VolumeOverlap::COMPRESSED
@ COMPRESSED
Definition: TerrainUtils.h:452
agxModel::GeometryContactInfoRef
agx::ref_ptr< GeometryContactInfo > GeometryContactInfoRef
Definition: TerrainUtils.h:363
agxModel::DynamicHeightFieldSimulation::m_particleRadius
agx::Real m_particleRadius
Definition: TerrainUtils.h:302
Geometry.h
agxModel::ParticleCoordinateSystem::POS_Y_NEG_Z
@ POS_Y_NEG_Z
Definition: TerrainUtils.h:139
TerrainParticles.h
agxModel::HeightController::getEnabledAvalancheMassLoss
bool getEnabledAvalancheMassLoss() const
Definition: TerrainUtils.h:61
agxCollide::HeightField
A HeightField is a collision shape that can be created from a grid structure, like an image.
Definition: agxCollide/HeightField.h:51
agxAssert
#define agxAssert(expr)
Definition: debug.h:143
agxModel::DeformingGeometryContactProperties::maxDeformabiliy
agx::Real maxDeformabiliy
Definition: TerrainUtils.h:435
agxModel::GeometryContactInfo::getGeometry2
agxCollide::Geometry * getGeometry2()
Definition: TerrainUtils.h:333
agxModel::ContactPointData::terrainMat
const agx::Material * terrainMat
Definition: TerrainUtils.h:401
agxModel::GeometryContactInfoRefVector
agx::Vector< GeometryContactInfoRef > GeometryContactInfoRefVector
Definition: TerrainUtils.h:364
agxModel::GeometryContactInfo::getIndex
size_t getIndex()
Definition: TerrainUtils.h:335
StepEventListener.h
agxModel::TerrainDebugRenderer::m_proxy
agx::observer_ptr< agxRender::HeightFieldProxy > m_proxy
Definition: TerrainUtils.h:118
agxModel::HeightController::setHeight
void setHeight(size_t x, size_t y, agx::Real height)
Definition: TerrainUtils.h:379
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< Real >
agxModel::GeometryContactInfo::getGeometry1
agxCollide::Geometry * getGeometry1()
Definition: TerrainUtils.h:331
agxModel::TerrainDebugRenderer::TerrainDebugRenderer
TerrainDebugRenderer(agxModel::Terrain *terrain)
agxModel::ParticleCoordinateSystem::DirectionFCC
DirectionFCC
Definition: TerrainUtils.h:139
agxModel::ParticleCoordinateSystem::NEG_Y_NEG_Z
@ NEG_Y_NEG_Z
Definition: TerrainUtils.h:139
agxModel::ContactPointData::ContactPointData
ContactPointData(ImpactVolumeData *vd, Terrain *terrain)
agxModel::DynamicHeightFieldSimulation::m_contactGenerator
ContactGeneratorRef m_contactGenerator
Definition: TerrainUtils.h:301
agxModel::VolumeOverlap::Type
Type
Definition: TerrainUtils.h:449
agx::observer_ptr< agxRender::HeightFieldProxy >
agxModel::DeformingGeometryContactProperties::shovelLength
agx::Real shovelLength
Definition: TerrainUtils.h:422
agxModel::DeformingGeometryContactProperties::meanContactPositionW
agx::Vec3 meanContactPositionW
Definition: TerrainUtils.h:436
agxModel::GeometryContactInfo
Definition: TerrainUtils.h:313
agxModel::ParticleCoordinateSystem::NEG_Y_POS_Z
@ NEG_Y_POS_Z
Definition: TerrainUtils.h:139
agx::FrictionModel::SolveType
SolveType
Definition: FrictionModel.h:55
agxModel::ParticleCoordinateSystem::getParentHeightFieldVertex
void getParentHeightFieldVertex(const size_t &pcsX, const size_t &pcsY, size_t &hfX, size_t &hfY)
To find what hf vertex position For example needed when we need to know which material a particle sho...
agxModel::TerrainDebugRenderer::m_terrain
Terrain * m_terrain
Definition: TerrainUtils.h:117
agxModel::GeometryContactInfo::~GeometryContactInfo
virtual ~GeometryContactInfo()
Definition: TerrainUtils.h:350
agxModel::ParticleCoordinateSystem::updateResolution
void updateResolution(const agx::Real &particleRadius, const size_t &heightFieldResolutionX, const size_t &heightFieldResolutionY, const agx::Real &scale)
If the particle radius is changed, we must update our resolution for the particle coordinate system.
agxModel::ParticleCoordinateSystem::ParticleCoordinateSystem
ParticleCoordinateSystem()
Definition: TerrainUtils.h:130
agxModel::ContactGenerator::ContactGenerator
ContactGenerator()
Definition: TerrainUtils.h:209
agxModel::GeometryContactInfo::clear
void clear()
Definition: TerrainUtils.h:339
agx::Vector::clear
void clear(ClearPolicy policy=SHRINK_BUFFER_AVERAGED)
Remove all elements, optionally with maintained buffer allocation.
Definition: Vector.h:491
agxModel::TerrainIterativeProjectedConeFrictionModel::m_bodiesAndDir
RigidBodyObserverVec3PairVector m_bodiesAndDir
Definition: TerrainUtils.h:263
agxModel::DeformingGeometryContactProperties::shovelExtraContactPosition
agx::Vec3 shovelExtraContactPosition
Definition: TerrainUtils.h:427
agx::ref_ptr< HeightField >
agxModel::DeformingGeometryContactProperties::maxYoungs
agx::Real maxYoungs
Definition: TerrainUtils.h:438
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
agxModel::TerrainDebugRenderer
Definition: TerrainUtils.h:108
agxModel::ContactGenerator::post
void post(const agx::TimeStamp &)
Called after a step is taken in the simulation Implement this method in the derived class to get call...
Definition: TerrainUtils.h:213
agx::Infinity
const AGXCORE_EXPORT Real Infinity
agxModel::DynamicHeightFieldSimulation::m_dynamicHeightFieldParticleCoordinateSystem
ParticleCoordinateSystem m_dynamicHeightFieldParticleCoordinateSystem
Definition: TerrainUtils.h:300
agxSDK::StepEventListener::PRE_STEP
@ PRE_STEP
Triggered just BEFORE a Dynamics stepForward step is taken.
Definition: StepEventListener.h:45
agxModel::HeightControllerRef
agx::ref_ptr< HeightController > HeightControllerRef
Definition: TerrainUtils.h:106
agxModel::ParticleCoordinateSystem::POS_X_POS_Y
@ POS_X_POS_Y
Definition: TerrainUtils.h:139
agxModel::DynamicHeightFieldSimulation::setParticleRadius
void setParticleRadius(agx::Real radius)
Definition: TerrainUtils.h:286
agxModel::ParticleCoordinateSystem::NEG_X_POS_Y
@ NEG_X_POS_Y
Definition: TerrainUtils.h:139
FrictionModel.h
agxModel::DeformingGeometryContactProperties::useGravityDepth
agx::Bool useGravityDepth
Definition: TerrainUtils.h:424
agxModel::VolumeOverlap
Definition: TerrainUtils.h:445
agxModel::DeformingGeometryContactProperties::maxDepth
agx::Real maxDepth
Definition: TerrainUtils.h:433
agxModel::DeformingGeometryContactProperties::extractGeometryProperties
void extractGeometryProperties(Terrain *terrain)
agxModel::GeometryContactInfo::getImpactVolumeDataVector
const ImpactVolumeDataPtrVector & getImpactVolumeDataVector()
Definition: TerrainUtils.h:346
agxModel::DeformingGeometryContactProperties::minLengthContactToShovelTip
agx::Real minLengthContactToShovelTip
Definition: TerrainUtils.h:440
agxCollide::Geometry
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
agxModel::ParticleCoordinateSystem::NEG_X_NEG_Z
@ NEG_X_NEG_Z
Definition: TerrainUtils.h:139
agxModel::HeightController::setEnableLockedBorders
void setEnableLockedBorders(bool lock, bool avalancheMassLoss=true)
Definition: TerrainUtils.h:57
agxModel::GeometryContactInfo::getGeometry1
const agxCollide::Geometry * getGeometry1() const
Definition: TerrainUtils.h:330
agx::Vec2T
Definition: Vec2Template.h:30
agxModel::GeometryContactInfo::add
void add(ImpactVolumeData *ivd)
Definition: TerrainUtils.h:326
agxModel::DeformingGeometryContactProperties::minYoungsModulusTerrain
agx::Real minYoungsModulusTerrain
Definition: TerrainUtils.h:441
agx::ContactMaterial
This class store the combine material properties between two agx::Material's.
Definition: Material.h:527
agxModel::HeightController::calculateMassProperties
void calculateMassProperties()
Definition: TerrainUtils.h:67
RenderManager.h
agxModel::HeightController::getLocalX
size_t getLocalX(size_t globalX)
Definition: TerrainUtils.h:71
agxModel::ContactPointData::ivd
ImpactVolumeData * ivd
Definition: TerrainUtils.h:397
agxSDK::StepEventListener::POST_STEP
@ POST_STEP
Triggered just AFTER a Dynamics stepForward step is taken.
Definition: StepEventListener.h:46
agxCollide::GeometryContact::geometry
agxCollide::Geometry * geometry(size_t ith)
Definition: Contacts.h:636
agxModel::DynamicHeightFieldSimulation::getContactGenerator
ContactGenerator * getContactGenerator()
Definition: TerrainUtils.h:282
agxModel::ContactPointData::particleMat
const agx::Material * particleMat
Definition: TerrainUtils.h:402
agxModel::DeformingGeometryContactProperties::shovelForwardW
agx::Vec3 shovelForwardW
Definition: TerrainUtils.h:421
agxModel::ParticleCoordinateSystem::POS_X_NEG_Z
@ POS_X_NEG_Z
Definition: TerrainUtils.h:139
agxModel::ParticleCoordinateSystem::NEG_X_POS_Z
@ NEG_X_POS_Z
Definition: TerrainUtils.h:139
agxModel::TerrainDebugRenderer::m_heights
agx::RealVector m_heights
Definition: TerrainUtils.h:119
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:113
agxModel::DeformingGeometryContactProperties::isShovel
agx::Bool isShovel
Definition: TerrainUtils.h:425
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agxModel::TerrainDebugRenderer::~TerrainDebugRenderer
virtual ~TerrainDebugRenderer()
agxModel::DynamicHeightFieldSimulation::m_useDistanceJoint
bool m_useDistanceJoint
Definition: TerrainUtils.h:303
agxModel::DeformingGeometryContactProperties::isDeformer
agx::Bool isDeformer
Definition: TerrainUtils.h:423
agxModel::GeometryContactInfo::getGeometry2
const agxCollide::Geometry * getGeometry2() const
Definition: TerrainUtils.h:332
agx::Bool
bool Bool
Definition: Integer.h:48
agxCollide::GeometryContact
A contact between two geometries.
Definition: Contacts.h:269
agxModel::ParticleCoordinateSystem::findFccHeight
agx::Real findFccHeight(agx::Real heightAtVertexPos, agx::Real dX, agx::Real dY, DirectionFCC fccLocalPos)
Calculate height of height field fcc position, given x and y derivatives and the height of the middle...
agxModel::GeometryContactInfo::getGeometryContact
agxCollide::GeometryContact * getGeometryContact()
Definition: TerrainUtils.h:343
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
agxModel::ContactGenerator
Definition: TerrainUtils.h:206
agxModel::GeometryContactInfo::isValid
bool isValid() const
Definition: TerrainUtils.h:322
Contacts.h
agxModel::DynamicHeightFieldSimulation::getParticleRadius
agx::Real getParticleRadius()
Definition: TerrainUtils.h:290
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agxModel::VolumeOverlap::MOVED
@ MOVED
Definition: TerrainUtils.h:453
agxModel::HeightController::getLocalHeightUpdate
bool getLocalHeightUpdate() const
Definition: TerrainUtils.h:84
agxRender::Renderable
Inherit from this class and implement the render() method to make it it self during debug rendering.
Definition: Renderable.h:38
agxModel::TerrainDebugRenderer::render
void render(agxRender::RenderManager *mgr)
Pure virtual method that should implemented to render a derived class during debug rendering.
agxModel::DeformingGeometryContactProperties::shovelNormalLength
agx::Real shovelNormalLength
Definition: TerrainUtils.h:429
agxModel::DynamicHeightFieldSimulation
Definition: TerrainUtils.h:273
agxModel::HeightController::getEnabledLockedBorders
bool getEnabledLockedBorders() const
Definition: TerrainUtils.h:64
agxModel::ParticleCoordinateSystem::getHeightFieldPosition
agx::Vec2 getHeightFieldPosition(const size_t pcsX, const size_t pcsY, const size_t dX=0, const size_t dY=0)
Get 2D position on the height field in length units.
agxModel::ImpactVolumeData
Definition: TerrainDataInterface.h:50
agxModel::DeformingGeometryContactProperties::maxDepthForward
agx::Real maxDepthForward
Definition: TerrainUtils.h:420
agxModel::ParticleCoordinateSystem::POS_X_POS_Z
@ POS_X_POS_Z
Definition: TerrainUtils.h:139
agxModel::ParticleCoordinateSystem::VERTEX_POS
@ VERTEX_POS
Definition: TerrainUtils.h:139
agxModel::ContactPointData::idx
size_t idx
Definition: TerrainUtils.h:398
agxModel::RigidBodyObserverVec3PairVector
agx::Vector< std::pair< agx::RigidBodyObserver, agx::Vec3 > > RigidBodyObserverVec3PairVector
Definition: TerrainUtils.h:233
agxModel::DeformingGeometryContactProperties::shovelNormalW
agx::Vec3 shovelNormalW
Definition: TerrainUtils.h:428
agxModel::VolumeOverlap::VolumeOverlap
VolumeOverlap()
agxModel::HeightController::HeightController
HeightController(agxCollide::HeightField *heightField)
Definition: TerrainUtils.h:51
agxModel::Terrain
Definition: agxModel/Terrain.h:83
agx::Material
Main material class which acts as a holder of a Surface Material and a Bulk material.
Definition: Material.h:387
agx::Vec3T< Real >
agxModel::ParticleCoordinateSystem::POS_X_NEG_Y
@ POS_X_NEG_Y
Definition: TerrainUtils.h:139
agx::Container::MAINTAIN_BUFFER
@ MAINTAIN_BUFFER
Buffer is maintained (normal stl behavior).
Definition: Container.h:46
agxModel::ParticleCoordinateSystem::collectCloseParticleLowerXYCoordinatesWithHeight
void collectCloseParticleLowerXYCoordinatesWithHeight(const agxCollide::HeightField *hf, const size_t &hfX, const size_t &hfY, Vec2iHeightDataPairVector &particleCoordinatesWithHeight, Terrain *terrain)
Given one vertex in the height field (that has changed height for example) we get all surrounding par...
agxModel::DeformingGeometryContactProperties::shovelContactLength
agx::Real shovelContactLength
Definition: TerrainUtils.h:439
agxModel::HeightController::getLocalVectorIndex
size_t getLocalVectorIndex(size_t globalX, size_t globalY)
Definition: TerrainUtils.h:77
agx::max
Vec3T< T > max(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
Definition: Vec3Template.h:874
agx::UInt32
uint32_t UInt32
Definition: Integer.h:40
agx::FrictionModel::SPLIT
@ SPLIT
First Normal equation is calculated in the DIRECT solver, then in a second pass the normal and the fr...
Definition: FrictionModel.h:60
agxModel::ContactPointData
Definition: TerrainUtils.h:392
agxModel::HeightController
Definition: TerrainUtils.h:48
agxModel::DynamicHeightFieldSimulation::getParticleUniqueId
agx::UInt32 getParticleUniqueId() const
Definition: TerrainUtils.h:294
agxModel::ParticleCoordinateSystem::scaleDepth
agx::Real scaleDepth(const agx::Real &depth, const size_t pcsX, const size_t pcsY, const agx::Vec2 &hf2Dpos)
Given the changed height (depth) of a height field vertex, we get the height change at the particle c...
agxModel::ContactPointData::y
size_t y
Definition: TerrainUtils.h:400
agxModel::DeformingGeometryContactProperties::DeformingGeometryContactProperties
DeformingGeometryContactProperties(agxCollide::Geometry *otherGeometry)
agxModel::DynamicHeightFieldSimulation::m_uniqueParticleId
agx::UInt32 m_uniqueParticleId
Definition: TerrainUtils.h:299
agxModel::ParticleCoordinateSystem::collectCloseParticleCoordinates
void collectCloseParticleCoordinates(const size_t &hfX, const size_t &hfY, agx::Vec2iVector &particleCoordinates)
Given one vertex in the height field (that has changed height for example) we get all surrounding par...
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58
Material.h
agxModel::ContactGenerator::pre
void pre(const agx::TimeStamp &)
Called before a step is taken in the simulation Implement this method in the derived class to get cal...
Definition: TerrainUtils.h:217
TerrainDataInterface.h
agxModel::TerrainIterativeProjectedConeFrictionModel
Definition: TerrainUtils.h:236
agxModel::HeightController::HeightController
HeightController()
Definition: TerrainUtils.h:54
agx::Vector::push_back
void push_back(const T2 &value)
Definition: Vector.h:715