AGX Dynamics
2.38.0.2
TerrainToolCollection.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 <
agxTerrain/Shovel.h
>
20
#include <
agxTerrain/AggregateContactGenerator.h
>
21
#include <
agxTerrain/ShovelAggregateContactUtils.h
>
22
#include <
agxTerrain/TerrainFrictionModels.h
>
23
#include <
agxTerrain/DeformController.h
>
24
25
#include <
agxStream/Serializable.h
>
26
27
namespace
agxTerrain
28
{
29
AGX_DECLARE_POINTER_TYPES
(
TerrainToolCollection
);
30
AGX_DECLARE_VECTOR_TYPES
(
TerrainToolCollection
);
31
36
class
AGXTERRAIN_EXPORT
TerrainToolCollection
:
public
agx::Referenced
,
public
agxStream::Serializable
37
{
38
public
:
44
TerrainToolCollection
(
Terrain
* terrain,
Shovel
* shovel );
45
49
Terrain
* getTerrain()
const
;
50
54
Shovel
* getShovel()
const
;
55
59
PrimaryActiveZone
* getActiveZone()
const
;
60
65
void
setActiveZone(
PrimaryActiveZone
* activeZone );
66
70
SoilParticleAggregate
* getSoilParticleAggregate()
const
;
71
76
void
setSoilParticleAggregate(
SoilParticleAggregate
* soilParticleAggregate );
77
81
AggregateContactGenerator
* getAggregateContactGenerator()
const
;
82
87
void
setAggregateContactGenerator(
AggregateContactGenerator
* aggregateContactGenerator);
88
92
DeformController
* getDeformController()
const
;
93
98
void
setDeformController(
DeformController
* deformController);
99
103
SoilPenetrationResistance
* getPenetrationResistance()
const
;
104
109
void
setPenetrationResistance(
SoilPenetrationResistance
* penetrationResistance);
110
114
const
agxCollide::GeometryRefVector
& getVoxelCollisionGeometries()
const
;
115
120
void
setVoxelCollisionGeometries(
const
agxCollide::GeometryRefVector
& geometries );
121
126
ShovelAggregateContactMaterialContainer
* getShovelTerrainContactMaterialContainer();
127
128
132
agx::Frame
* getParentFrame()
const
;
133
137
agx::Bool
initialized()
const
;
138
142
agx::Bool
shouldUpdate();
143
148
void
setEnableShovelTerrainGeometryContacts(
bool
enable);
149
155
void
setZeroAggregateVelocity(
bool
enable );
156
160
agx::Bool
getSetZeroAggregateVelocity()
const
;
161
162
public
:
170
virtual
agx::Bool
initialize(
agxSDK::Simulation
* simulation );
171
179
virtual
void
uninitialize(
agxSDK::Simulation
* simulation );
180
184
virtual
void
onPreCollide();
185
189
virtual
void
onPre();
190
194
virtual
void
onPost();
195
199
bool
collisionGeometriesAreInsideTerrain()
const
;
200
204
void
handleEnableChange();
205
209
void
enable(
bool
enabled);
210
214
bool
getEnable();
215
219
bool
shovelEnableHasChanged()
const
;
220
224
void
clearActiveZoneWedges()
const
;
225
229
const
agx::RigidBody
* getWedgeAggregate(
Shovel::ExcavationMode
excavationMode)
const
;
230
234
agx::Real
getAggregateTerrainContactDepth(
Shovel::ExcavationMode
excavationMode)
const
;
235
239
void
recomputeInnerShape();
240
241
/*
242
Set whenever custom friction models should be used in the
243
shovel <-> aggregate contacts.
244
\param enable - True if custom friction models should be used. (Default: true)
245
*/
246
void
setUseCustomFrictionModel(
bool
enable);
247
251
bool
getUseCustomFricionModel()
const
;
252
253
DOXYGEN_START_INTERNAL_BLOCK
()
254
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxTerrain::TerrainToolCollection
);
255
256
virtual
void
onPostRestore(
Terrain
* terrain );
257
DOXYGEN_END_INTERNAL_BLOCK
()
258
259
protected
:
263
TerrainToolCollection
();
264
268
virtual
~
TerrainToolCollection
();
269
270
enum
StateFlags
:
agx::UInt32
271
{
272
ENABLED = 1 << 0,
273
SHOVEL_ENABLED = 1 << 1,
274
SET_ZERO_AGGREGATE_VELOCITY = 1 << 2
275
};
276
using
Flags
= agx::BitState<StateFlags, agx::UInt32>;
277
278
bool
getShovelEnabled()
const
;
279
280
void
setShovelEnabled(
bool
enabled );
281
282
void
setEnable(
bool
enabled );
283
284
private
:
285
Terrain
* m_terrain;
286
ShovelRef
m_shovel;
287
PrimaryActiveZoneRef
m_activeZone;
288
SoilParticleAggregateRef
m_soilParticleAggregate;
289
AggregateContactGeneratorRef
m_aggregateContactGenerator;
290
DeformControllerRef
m_deformController;
291
ShovelAggregateContactMaterialContainerRef
m_shovelAggregateCMContainer;
292
SoilPenetrationResistanceRef
m_penetrationResistance;
293
Flags
m_flags;
294
295
bool
m_enableCustomFrictionModels;
296
297
agx::FrameRef
m_parentFrame;
298
agxCollide::GeometryRefVector
m_voxelCollisionGeometries;
299
};
300
}
agxTerrain::Terrain
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Definition:
Terrain.h:85
agx::Real
double Real
Definition:
Real.h:42
agx::Vector< agx::ref_ptr< Geometry > >
agxTerrain
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition:
Geometry.h:58
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition:
RigidBody.h:51
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
DeformController.h
AggregateContactGenerator.h
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition:
macros.h:97
agxTerrain::Shovel
Definition:
Shovel.h:50
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition:
macros.h:96
agxTerrain::Shovel::ExcavationMode
ExcavationMode
Enum for describing the different excavation modes of a shovel: PRIMARY - The primary mode of excavat...
Definition:
Shovel.h:91
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
agxTerrain::AggregateContactGenerator
Definition:
AggregateContactGenerator.h:42
agxTerrain::PrimaryActiveZone
Definition:
PrimaryActiveZone.h:30
Shovel.h
AGX_DECLARE_VECTOR_TYPES
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition:
Vector.h:34
agx::ref_ptr< Shovel >
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition:
Simulation.h:125
agxTerrain::DeformController
Definition:
DeformController.h:29
agxTerrain::SoilPenetrationResistance
Definition:
SoilPenetrationResistance.h:31
Serializable.h
ShovelAggregateContactUtils.h
agxTerrain::TerrainToolCollection::StateFlags
StateFlags
Definition:
TerrainToolCollection.h:270
agx::Referenced
Base class providing referencing counted objects.
Definition:
Referenced.h:119
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition:
Referenced.h:254
AGXTERRAIN_EXPORT
#define AGXTERRAIN_EXPORT
Definition:
agxTerrain/export.h:41
TerrainFrictionModels.h
agx::Bool
bool Bool
Definition:
Integer.h:40
agxTerrain::TerrainToolCollection
Collection of terrain tool (currently Shovel) related objects which are terrain instance specific.
Definition:
TerrainToolCollection.h:36
agxTerrain::SoilParticleAggregate
Definition:
SoilParticleAggregate.h:39
agxTerrain::ShovelAggregateContactMaterialContainer
Simple container class for storing and handling explicit contact material for shovel-aggregate contac...
Definition:
ShovelAggregateContactUtils.h:108
agx::UInt32
uint32_t UInt32
Definition:
Integer.h:32
agx::Frame
The object defining a frame of reference and providing transformations operations.
Definition:
Frame.h:67
agxTerrain::TerrainToolCollection::Flags
agx::BitState< StateFlags, agx::UInt32 > Flags
Definition:
TerrainToolCollection.h:276
include
agxTerrain
TerrainToolCollection.h
Generated on Sun Sep 1 2024 11:18:58 for AGX Dynamics by
1.8.17