AGX Dynamics 2.42.2.1
Loading...
Searching...
No Matches
GroundCollapseController.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16#pragma once
17
18#include <agxCollide/Geometry.h>
19
24
25#include <agxTerrain/export.h>
26
27
28namespace agxTerrain
29{
30 namespace GroundCollapse
31 {
33
47 {
48
49 public:
50 /*
51 Add a zone where the ground collapse algorithm should be run.
52 \param zone - a geometry designating the zone where to run ground collapse algorithm. Must be overlapping the corresponding terrain.
53 */
55
56 /*
57 Remove all the added collapse zones. This effectively disables ground collapse functionality.
58 */
60
61 /*
62 Get the geometry designating the zone where ground collapse algorithm is run every timestep.
63 */
65
70
71 /*
72 Get the terrain contacts inside the given geometry.
73 */
75
76 /*
77 Get the settings for the ground collapse algorithm.
78 */
79 inline GroundCollapse::CollapseSettings* getSettings() const { return m_settings; };
80
81 /*
82 Set the settings for the ground collapse algorithm.
83 \param settings - the settings to use.
84 */
86
87 /*
88 Get the render settings for the ground collapse algorithm.
89 */
90 inline GroundCollapse::CollapseRenderSettings* getRenderSettings() const { return m_renderSettings; };
91
92 /*
93 Set the render settings for the ground collapse algorithm.
94 \param renderSettings - the render settings to use.
95 */
97
98 /*
99 Get the settings for the slope detection algorithm.
100 */
101 inline GroundCollapse::SlopeDetectionSettings* getSlopeSettings() const { return m_slopeSettings; };
102
103 /*
104 Set the settings for the slope detection algorithm.
105 \param settings - the settings to use.
106 */
107 inline void setSlopeSettings(GroundCollapse::SlopeDetectionSettings* slopeSettings) { m_slopeSettings = slopeSettings; };
108
109 /*
110 Get the results of the ground collapse algorithm in this timestep.
111 Should always be set in the users simulation post-step.
112 See GroundCollapse::GroundCollapseResult for more information.
113 */
115
116 /*
117 Add a user designated FailureSurface to the ground collapse simulations.
118 Will remain in the simulation until removed by the user.
119 \param customSurface - A custom failure surface provided by the user.
120 \return true if the customSurface could be added, false if the surface is
121 not valid and therfore could not be added.
122 */
124
125 /*
126 \return a vector of all the added custom failure surfaces.
127 */
129
130 /*
131 Remove all user designated custom failure surfaces.
132 */
134
136
137 // Internal methods:
138 public:
139 /*
140 Construct controller for a specific terrain.
141 */
143
144 /*
145 For serialization
146 */
148
149 /*
150 Start the ground collapse algorithm inside the added collapse zone.
151 Sets the GroundCollapseResult which can be fetched via getCollapseResult().
152 Must be run after the terrain has run it's post step.
153 */
154 void onPost();
155
156 Terrain* getTerrain() const { return m_terrain; };
157
158 int findLargestFailedSurface( const FailureSurfaceResultVector& results );
159
161
162 protected:
164
165 private:
166 Terrain* m_terrain;
167 CollapseSettingsRef m_settings;
168 CollapseRenderSettingsRef m_renderSettings;
169 SlopeDetectionSettingsRef m_slopeSettings;
170 GroundCollapseCalculatorRef m_calculator;
173 FailureSurfaceRefVector m_customSurfaces;
175
176 };
177
178 }
179}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXTERRAIN_STORE_RESTORE_INTERFACE
#define AGXTERRAIN_EXPORT
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
Control ground collapse functionality in the terrain.
GroundCollapse::GroundCollapseResult * getCollapseResult() const
TerrainContactPtrVector getCollapseContacts()
Get the terrain contacts that will be used in ground collpase calculations.
TerrainContactPtrVector getContactsInGroundCollapseZone()
bool addCustomFailureSurface(FailureSurface *customSurface)
GroundCollapse::CollapseSettings * getSettings() const
GroundCollapse::CollapseRenderSettings * getRenderSettings() const
void addGroundCollapseZone(agxCollide::Geometry *zone)
FailureSurfacePtrVector getCustomFailureSurfaces() const
void setSlopeSettings(GroundCollapse::SlopeDetectionSettings *slopeSettings)
void setSettings(GroundCollapse::CollapseSettings *settings)
agxCollide::GeometryPtrVector getGroundCollapseZones()
GroundCollapse::SlopeDetectionSettings * getSlopeSettings() const
void setRenderSettings(GroundCollapse::CollapseRenderSettings *renderSettings)
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Definition: Terrain.h:92
Base class providing referencing counted objects.
Definition: Referenced.h:120
Vector containing 'raw' data.
Definition: agx/Vector.h:246
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition: Geometry.h:59