|
AGX Dynamics 2.42.3.0
|
Interface class for accessing and manipulating the underlying 3D grid data in the terrain using terrain index (x,y) as well as depth index (z). More...
#include <TerrainGridControl.h>
Inheritance diagram for agxTerrain::TerrainGridControl:Public Member Functions | |
| TerrainGridControl () | |
| TerrainGridControl (Terrain *terrain) | |
| Construct given terrain instance. | |
| float | addSolidOccupancyInColumn (const agx::Vec2i &terrainIndex, float mass, float compaction, bool shouldAvalanche=true) |
| Add solid occupancy in the specified terrain coordinate on the surface with given compaction. | |
| void | addSolidOccupancyInColumns (agx::HashTable< agx::Vec2i, std::pair< float, float > > table, bool shouldAvalanche=true) |
| Add solid occupancy in several terrain coordinates on the surface with given compaction. | |
| float | addSolidOccupancyInColumnToHeight (const agx::Vec2i &terrainIndex, agx::Real height, float compaction, bool shouldAvalanche=true) |
| Add solid occupancy in the specified terrain coordinate on the surface with given compaction up to a specific height. | |
| float | addSolidOccupancyLayerInColum (const agx::Vec2i &terrainIndex, agx::Real layerHeight, float compaction, bool shouldAvalanche=true) |
| Add solid occupancy layer with specific height and compaction on the terrain surface in the specified terrain coordinate. | |
| bool | applySurfaceForce (const agx::Vec2i &terrainIndex, agx::Real surfaceForce, agx::Real contactTime=-1) |
| Apply a surface force (N) at the specified surface index in order to compact the soil. | |
| bool | applySurfaceStress (const agx::Vec2i &terrainIndex, agx::Real surfaceStress, agx::Real contactTime=-1) |
| Apply a surface stress (Pa) at the specified surface index in order to compact the soil. | |
| agx::Real | captureAuthoredAvalancheSlopes (const agx::Vec2iVector &terrainIndices, agx::Real decayFactor=1.0) |
| Capture the currently authored height slopes and use them as a setup-time lower bound for avalanche stability without changing terrain material state. | |
| void | clearAuthoredAvalancheSlopes () |
| Clear all captured authored avalanche slopes. | |
| void | clearAuthoredAvalancheSlopes (const agx::Vec2iVector &terrainIndices) |
| Clear captured authored avalanche slopes in selected columns. | |
| agx::Real | convertFluidMassKgToOccupancy (float mass) const |
| Utility method used to convert mass (kg) to occupancy. | |
| agx::Real | convertOccupancyToMassKg (float occupancy) const |
| Utility method used to convert solid occupancy to SI(Kg) units. | |
| void | decayAuthoredAvalancheSlopes (const agx::Vec2iVector &terrainIndices) |
| Manually apply the configured decay factor to captured authored avalanche slopes. | |
| int | findIndexFromSurfaceDepth (const agx::Vec2i &terrainIndex, agx::Real depth) const |
| Find the depth index under the surface at terrain index x,y coordinates and depth distance. | |
| int | findSurfaceIndex (const agx::Vec2i &terrainIndex) const |
| Find surface depth index given the terrain index x,y coordinates. | |
| float | getCompaction (const agx::Vec2i &terrainIndex, int z) const |
| Get compaction at the specified surface index coordinate with a depth index. | |
| float | getCompaction (const agx::Vec3i &terrainIndex) const |
| Get compaction the specified 3D index coordinate. | |
| agx::Real | getCurrentStressInTerrainIndex (const agx::Vec3i &terrainIndex) const |
| Get the current stress in a 3D index that resulted from active TerrainContacts this time-step. | |
| agx::Vec3 | getGridElementPositionWorld (const agx::Vec3i &terrainIndex) const |
| Get the world center position of a terrain grid element given a specified 3D index. | |
| agx::Real | getLocalAngleOfRepose (const agx::Vec3i &voxelIndex) const |
| Get local angle of repose in the specified 3D index. | |
| agx::Real | getLocalHardnessMultiplier (const agx::Vec3i &voxelIndex) const |
| Get the local hardness multiplier, derived from hardness rate and local compaction, that is used to scale the local contact point Young's modulus in a voxel given a specified surface index. | |
| agx::Real | getLocalPreconsolidationStress (const agx::Vec3i &terrainIndex) const |
| Get the local pre-consolidation stress in the terrain grid element specified by a 3D terrain index. | |
| int | getLowestAllowableDepthIndex () const |
| Get the lowest allowable depth index in the terrain. | |
| float | getMass (const agx::Vec2i &terrainIndex, int z) const |
| Get solid mass in SI units at the specified surface index with a depth index. | |
| float | getMass (const agx::Vec3i &voxelIndex) const |
| Get the solid mass in SI units at the specified 3D index coordinate. | |
| float | getOccupancy (const agx::Vec2i &terrainIndex, int z) const |
| Get solid occupancy at the specified surface index with a depth index. | |
| float | getOccupancy (const agx::Vec3i &voxelIndex) const |
| Get the solid occupancy at the specified 3D index coordinate. | |
| agx::Real | getSurfaceAngleOfRepose (const agx::Vec2i &terrainIndex) const |
| Get surface angle of repose in the 2D terrain index. | |
| float | getSurfaceCompaction (const agx::Vec2i &terrainIndex) const |
| Get compaction at the surface element given a specified surface index. | |
| agx::Real | getSurfaceHardnessMultiplier (const agx::Vec2i &terrainIndex) const |
| Get the surface hardness multiplier, derived from hardness rate and local compaction, that is used to scale the local contact point Young's modulus in a voxel given a specified surface index. | |
| float | getSurfaceOccupancy (const agx::Vec2i &terrainIndex) const |
| Get solid occupancy at the surface grid element given a surface index. | |
| agx::Real | getSurfacePreconsolidationStress (const agx::Vec2i &terrainIndex) const |
| Get the surface pre-consolidation stress in the terrain grid element specified by a 3D terrain index. | |
| float | getTotalMass (const agx::Vec3i &voxelIndex) const |
| Get the total mass (solid + fluid) in SI units at the specified 3D index coordinate. | |
| bool | isIndexValid (const agx::Vec3i &voxelIndex) const |
| Check is the given 3D index coordinate is within terrain bounds. | |
| float | removeFluidOccupancy (const agx::Vec3i &terrainIndex, float fluidOccupancy) |
| Remove fluid occupancy in the specified 3D grid coordinate, if any exists. | |
| float | removeSolidOccupancyInColumn (const agx::Vec2i &terrainIndex, float occupancy, bool shouldAvalanche=true) |
| Remove solid occupancy in the specified surface coordinate. | |
| void | setCompaction (const agx::Vec2i &terrainIndex, int z, float compaction, bool compressOccupancy=false) |
| Set the compaction at an element given a specified surface index with a depth index. | |
| void | setCompaction (const agx::Vec3i &terrainIndex, float compaction, bool compressOccupancy=false) |
| Set the compaction at an element given a specified 3D index where x,y are the regular terrain coordinates while z is the depth index. | |
| agx::Real | setCompactionFromCurrentHeights (const agx::Vec2iVector &terrainIndices, agx::Real compactionMultiplier=1.0, size_t compactionDepth=3, bool useTaperedProfile=true) |
| Compute and apply the compaction required for the selected surface columns to preserve their current tangent slopes during avalanching. | |
| void | setSurfaceCompaction (const agx::Vec2i &terrainIndex, float compaction, bool compressOccupancy=false, bool compressToBottom=false) |
| Set the compaction at the surface element given a specified surface index. | |
| void | setSurfaceCompactionToDepth (const agx::Vec2i &terrainIndex, float compaction, float depth) |
| Set the compaction at the surface element given a specified surface index. | |
| void | setTerrainMaterial (const agx::Vec2i &terrainIndex, int z, TerrainMaterial *terrainMaterial) |
| Set the terrainMaterial at an element given a specified surface index with a depth index. | |
| void | setTerrainMaterial (const agx::Vec3i &terrainIndex, TerrainMaterial *terrainMaterial) |
| Set the terrainMaterial at an element given a specified 3D index where x,y are the regular terrain coordinates while z is the depth index. | |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Protected Member Functions | |
| virtual | ~TerrainGridControl () |
| agx::Vec3i | convertSurfaceTerrainIndex (const agx::Vec2i &terrainIndex) const |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Additional Inherited Members | |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Interface class for accessing and manipulating the underlying 3D grid data in the terrain using terrain index (x,y) as well as depth index (z).
This is the primary user-interface by which to access the underlying grid data, such as solid occupancy and compaction, in the terrain structure.
The basic element in the terrain grid is a uniform 3D voxel with the dimension of getElementSize() given by the terrain object. These grid elements contains the solid occupancy in the Terrain which is bounded by the surface height field. The solid occupancy can be compacted by stress generated by external contacts or by applying external forces via the interface class. Compacted solid occupancy occupy less space in a voxel element and thus voxels with compaction can carry more solid occupancy. Soil compaction affects physical parameters such as angle of repose, stiffness and local soil density. The maximum compaction of an element is given by the maximum density in the BulkMaterial instance.
The solid occupancy of a grid element is the unit used when interacting with the terrain interface methods is , i.e given nominal compaction 1.0, a solid occupancy of 1.0 is enough to occupy a whole voxel element in the Terrain. A solid occupancy of 1.0 with compaction 2.0 occupy half the space is a voxel. Utility methods exists to convert occupancy to mass in SI units.
Definition at line 46 of file TerrainGridControl.h.
| agxTerrain::TerrainGridControl::TerrainGridControl | ( | Terrain * | terrain | ) |
Construct given terrain instance.
| terrain | - terrain instance |
| agxTerrain::TerrainGridControl::TerrainGridControl | ( | ) |
|
protectedvirtual |
| float agxTerrain::TerrainGridControl::addSolidOccupancyInColumn | ( | const agx::Vec2i & | terrainIndex, |
| float | mass, | ||
| float | compaction, | ||
| bool | shouldAvalanche = true |
||
| ) |
Add solid occupancy in the specified terrain coordinate on the surface with given compaction.
The solid occupancy is added on the surface of the terrain, successively filling up grid elements column wise.
| terrainIndex | - The specified terrain index. |
| mass | - The solid mass that should be added at the surface index. |
| compaction | - The compaction of the occupancy that should be added to the column. |
| shouldAvalanche | - True if the terrainIndex should be queried for avalanching. |
| void agxTerrain::TerrainGridControl::addSolidOccupancyInColumns | ( | agx::HashTable< agx::Vec2i, std::pair< float, float > > | table, |
| bool | shouldAvalanche = true |
||
| ) |
Add solid occupancy in several terrain coordinates on the surface with given compaction.
The solid occupancy is added on the surface of the terrain, successively filling up grid elements column wise.
| table | - Hashtable containing all terrain coordinates and data to add occupancy. The elements of the table contains terrain coordinate, occupancy and compaction, respectively. |
| shouldAvalanche | - True if the terrainIndex should be queried for avalanching. |
| float agxTerrain::TerrainGridControl::addSolidOccupancyInColumnToHeight | ( | const agx::Vec2i & | terrainIndex, |
| agx::Real | height, | ||
| float | compaction, | ||
| bool | shouldAvalanche = true |
||
| ) |
Add solid occupancy in the specified terrain coordinate on the surface with given compaction up to a specific height.
The solid occupancy is added on the surface of the terrain, successively filling up grid elements column wise until the specified height in the terrain is reached.
| terrainIndex | - The specified terrain index. |
| height | - The specified height that solid occupancy is added at the surface index to reach. |
| compaction | - The compaction of the occupancy that should be added to the column. |
| shouldAvalanche | - True if the terrainIndex should be queried for avalanching. |
| float agxTerrain::TerrainGridControl::addSolidOccupancyLayerInColum | ( | const agx::Vec2i & | terrainIndex, |
| agx::Real | layerHeight, | ||
| float | compaction, | ||
| bool | shouldAvalanche = true |
||
| ) |
Add solid occupancy layer with specific height and compaction on the terrain surface in the specified terrain coordinate.
The solid occupancy is added on top of the surface of the terrain, successively filling up grid elements column wise up to layer height.
| terrainIndex | - The specified terrain index. |
| layerHeight- | The specified height of the solid occupancy layer to be added at the surface index. |
| compaction | - The compaction of the occupancy that should be added to the column. |
| shouldAvalanche | - True if the terrainIndex should be queried for avalanching. |
| bool agxTerrain::TerrainGridControl::applySurfaceForce | ( | const agx::Vec2i & | terrainIndex, |
| agx::Real | surfaceForce, | ||
| agx::Real | contactTime = -1 |
||
| ) |
Apply a surface force (N) at the specified surface index in order to compact the soil.
The surface force will be converted to a surface stress of the grid element area.
| terrainIndex | - The specified surface index. |
| surfaceForce | - The specified surface force (N) to be applied. |
| contactTime | - The time that the force is active, which is used to calculate the time relaxation of the compaction. The longer the contact time, the more compaction will occur. See BulkMaterial for the compaction relaxation constant. |
| bool agxTerrain::TerrainGridControl::applySurfaceStress | ( | const agx::Vec2i & | terrainIndex, |
| agx::Real | surfaceStress, | ||
| agx::Real | contactTime = -1 |
||
| ) |
Apply a surface stress (Pa) at the specified surface index in order to compact the soil.
| terrainIndex | - The specified surface index. |
| surfaceStress | - The specified surface stress (Pa) to be applied. |
| contactTime | - The time that the force is active, which is used calculate the time relaxation of the compaction. The longer the contact time, the more compaction will occur. See BulkMaterial for the compaction relaxation constant. |
| agx::Real agxTerrain::TerrainGridControl::captureAuthoredAvalancheSlopes | ( | const agx::Vec2iVector & | terrainIndices, |
| agx::Real | decayFactor = 1.0 |
||
| ) |
Capture the currently authored height slopes and use them as a setup-time lower bound for avalanche stability without changing terrain material state.
The captured value is the maximum tangent slope from each selected column to its lower neighboring columns. During avalanching the effective local tangent of repose becomes max(material/compaction tangent of repose, captured authored tangent slope).
| terrainIndices | - The selected surface columns. |
| decayFactor | - Multiplier applied to the captured tangent slope when the column is modified. Range [0, 1]. A value of 1 keeps the authored slope indefinitely. A value of 0 clears it on first modification. |
| void agxTerrain::TerrainGridControl::clearAuthoredAvalancheSlopes | ( | ) |
Clear all captured authored avalanche slopes.
| void agxTerrain::TerrainGridControl::clearAuthoredAvalancheSlopes | ( | const agx::Vec2iVector & | terrainIndices | ) |
Clear captured authored avalanche slopes in selected columns.
| agx::Real agxTerrain::TerrainGridControl::convertFluidMassKgToOccupancy | ( | float | mass | ) | const |
Utility method used to convert mass (kg) to occupancy.
| agx::Real agxTerrain::TerrainGridControl::convertOccupancyToMassKg | ( | float | occupancy | ) | const |
Utility method used to convert solid occupancy to SI(Kg) units.
|
protected |
| void agxTerrain::TerrainGridControl::decayAuthoredAvalancheSlopes | ( | const agx::Vec2iVector & | terrainIndices | ) |
Manually apply the configured decay factor to captured authored avalanche slopes.
| int agxTerrain::TerrainGridControl::findIndexFromSurfaceDepth | ( | const agx::Vec2i & | terrainIndex, |
| agx::Real | depth | ||
| ) | const |
Find the depth index under the surface at terrain index x,y coordinates and depth distance.
| terrainIndex | - The specified terrainIndex. |
| depth | - depth distance |
| int agxTerrain::TerrainGridControl::findSurfaceIndex | ( | const agx::Vec2i & | terrainIndex | ) | const |
Find surface depth index given the terrain index x,y coordinates.
| terrainIndex | - The specified terrainIndex. |
| float agxTerrain::TerrainGridControl::getCompaction | ( | const agx::Vec2i & | terrainIndex, |
| int | z | ||
| ) | const |
Get compaction at the specified surface index coordinate with a depth index.
| terrainIndex | - The specified terrain surface index. |
| z | - The specified depth index. |
| float agxTerrain::TerrainGridControl::getCompaction | ( | const agx::Vec3i & | terrainIndex | ) | const |
Get compaction the specified 3D index coordinate.
x,y are the regular terrain coordinate while z is the depth index.
| terrainIndex | - The specified 3D index, containing surface coordinates and depth index. |
| agx::Real agxTerrain::TerrainGridControl::getCurrentStressInTerrainIndex | ( | const agx::Vec3i & | terrainIndex | ) | const |
Get the current stress in a 3D index that resulted from active TerrainContacts this time-step.
| terrainIndex | - The specified 3D index. |
| agx::Vec3 agxTerrain::TerrainGridControl::getGridElementPositionWorld | ( | const agx::Vec3i & | terrainIndex | ) | const |
Get the world center position of a terrain grid element given a specified 3D index.
| terrainIndex | - the specified 3D terrain grid element index |
| agx::Real agxTerrain::TerrainGridControl::getLocalAngleOfRepose | ( | const agx::Vec3i & | voxelIndex | ) | const |
Get local angle of repose in the specified 3D index.
| voxelIndex | - The specified 3D index. |
| agx::Real agxTerrain::TerrainGridControl::getLocalHardnessMultiplier | ( | const agx::Vec3i & | voxelIndex | ) | const |
Get the local hardness multiplier, derived from hardness rate and local compaction, that is used to scale the local contact point Young's modulus in a voxel given a specified surface index.
The hardness multiplier is a function of the bulk material hardening rate and the voxel compaction.
| voxelIndex | - the specified 3D terrain grid element index for the voxel. |
| agx::Real agxTerrain::TerrainGridControl::getLocalPreconsolidationStress | ( | const agx::Vec3i & | terrainIndex | ) | const |
Get the local pre-consolidation stress in the terrain grid element specified by a 3D terrain index.
The pre-consolidation stress is the most recent stress that has been used to compress the solid occupancy in the grid element, which is either given by the BulkMaterial when the grid element is in nominal compaction, by the compaction stress generated from the terrain contacts or by the user via the grid interface. In order to compress the terrain further, the stress applied has to exceed the pre-consolidation stress.
| terrainIndex | - The specified 3D terrain index. |
| int agxTerrain::TerrainGridControl::getLowestAllowableDepthIndex | ( | ) | const |
Get the lowest allowable depth index in the terrain.
This is dependent on the terrain depth and the element size.
| float agxTerrain::TerrainGridControl::getMass | ( | const agx::Vec2i & | terrainIndex, |
| int | z | ||
| ) | const |
Get solid mass in SI units at the specified surface index with a depth index.
| terrainIndex | - The specified x,y terrain coordinate. |
| z | - The specified depth index. |
| float agxTerrain::TerrainGridControl::getMass | ( | const agx::Vec3i & | voxelIndex | ) | const |
Get the solid mass in SI units at the specified 3D index coordinate.
(x,y) are the regular terrain surface coordinates while z is the depth index.
| voxelIndex | - The specified 3D index, containing surface coordinates and depth index. |
| float agxTerrain::TerrainGridControl::getOccupancy | ( | const agx::Vec2i & | terrainIndex, |
| int | z | ||
| ) | const |
Get solid occupancy at the specified surface index with a depth index.
| terrainIndex | - The specified x,y terrain coordinate. |
| z | - The specified depth index. |
| float agxTerrain::TerrainGridControl::getOccupancy | ( | const agx::Vec3i & | voxelIndex | ) | const |
Get the solid occupancy at the specified 3D index coordinate.
(x,y) are the regular terrain surface coordinates while z is the depth index.
| voxelIndex | - The specified 3D index, containing surface coordinates and depth index. |
| agx::Real agxTerrain::TerrainGridControl::getSurfaceAngleOfRepose | ( | const agx::Vec2i & | terrainIndex | ) | const |
Get surface angle of repose in the 2D terrain index.
| terrainIndex | - The specified surface index. |
| float agxTerrain::TerrainGridControl::getSurfaceCompaction | ( | const agx::Vec2i & | terrainIndex | ) | const |
Get compaction at the surface element given a specified surface index.
| terrainIndex | - The specified terrain index. |
| agx::Real agxTerrain::TerrainGridControl::getSurfaceHardnessMultiplier | ( | const agx::Vec2i & | terrainIndex | ) | const |
Get the surface hardness multiplier, derived from hardness rate and local compaction, that is used to scale the local contact point Young's modulus in a voxel given a specified surface index.
The hardness multiplier is a function of the bulk material hardening rate and the voxel compaction.
| terrainIndex | - the specified 2D surface index |
| float agxTerrain::TerrainGridControl::getSurfaceOccupancy | ( | const agx::Vec2i & | terrainIndex | ) | const |
Get solid occupancy at the surface grid element given a surface index.
| terrainIndex | - The specified terrain index. |
| agx::Real agxTerrain::TerrainGridControl::getSurfacePreconsolidationStress | ( | const agx::Vec2i & | terrainIndex | ) | const |
Get the surface pre-consolidation stress in the terrain grid element specified by a 3D terrain index.
The pre-consolidation stress is the most recent stress that has been used to compress the solid occupancy in the grid element, which is either given by the BulkMaterial when the grid element is in nominal compaction, by the compaction stress generated from the terrain contacts or by the user via the grid interface. In order to compress the terrain further, the stress applied has to exceed the pre-consolidation stress.
| terrainIndex | - The specified surface index. |
| float agxTerrain::TerrainGridControl::getTotalMass | ( | const agx::Vec3i & | voxelIndex | ) | const |
Get the total mass (solid + fluid) in SI units at the specified 3D index coordinate.
(x,y) are the regular terrain surface coordinates while z is the depth index.
| voxelIndex | - The specified 3D index, containing surface coordinates and depth index. |
| bool agxTerrain::TerrainGridControl::isIndexValid | ( | const agx::Vec3i & | voxelIndex | ) | const |
Check is the given 3D index coordinate is within terrain bounds.
| voxelIndex | - The specified 3D index. |
| float agxTerrain::TerrainGridControl::removeFluidOccupancy | ( | const agx::Vec3i & | terrainIndex, |
| float | fluidOccupancy | ||
| ) |
Remove fluid occupancy in the specified 3D grid coordinate, if any exists.
| terrainIndex | - The specified 3D index, containing surface coordinates and depth index. |
| fluidOccupancy | - The fluid occupancy that should be removed in the grid point. |
| float agxTerrain::TerrainGridControl::removeSolidOccupancyInColumn | ( | const agx::Vec2i & | terrainIndex, |
| float | occupancy, | ||
| bool | shouldAvalanche = true |
||
| ) |
Remove solid occupancy in the specified surface coordinate.
The occupancy is removed from the surface of the terrain, successively removing occupancy from grid elements column wise.
| terrainIndex | - The specified surface index. |
| occupancy | - The solid occupancy that should be removed in the column. |
| shouldAvalanche | - True if the terrainIndex should be queried for avalanching. |
| void agxTerrain::TerrainGridControl::setCompaction | ( | const agx::Vec2i & | terrainIndex, |
| int | z, | ||
| float | compaction, | ||
| bool | compressOccupancy = false |
||
| ) |
Set the compaction at an element given a specified surface index with a depth index.
| terrainIndex | - The specified terrain index. |
| z | - Index of the cell in the z-coord. |
| compaction | - The specified compaction. |
| compressOccupancy | - Set to True if the solid occupancy of the grid element should be compressed. This will keep the amount of solid occupancy in the voxel but will change the surface profile of the terrain as occupancy is lowered. |
| void agxTerrain::TerrainGridControl::setCompaction | ( | const agx::Vec3i & | terrainIndex, |
| float | compaction, | ||
| bool | compressOccupancy = false |
||
| ) |
Set the compaction at an element given a specified 3D index where x,y are the regular terrain coordinates while z is the depth index.
| terrainIndex | - The specified 3D index, containing surface coordinates and depth index. |
| compaction | - The specified compaction. |
| compressOccupancy | - Set to True if the solid occupancy of the grid element should be compressed. |
| agx::Real agxTerrain::TerrainGridControl::setCompactionFromCurrentHeights | ( | const agx::Vec2iVector & | terrainIndices, |
| agx::Real | compactionMultiplier = 1.0, |
||
| size_t | compactionDepth = 3, |
||
| bool | useTaperedProfile = true |
||
| ) |
Compute and apply the compaction required for the selected surface columns to preserve their current tangent slopes during avalanching.
The required compaction for preserving the current tangent slopes is computed from the current height difference to lower neighboring columns and the material's uncompressed repose angle. The resulting surface compaction is multiplied by compactionMultiplier and applied down into the column. By default the compaction profile is tapered, with max value at the surface and lower values beneath the ground. The tapered profile can be disabled if a constructed volume should be compacted fully through the given depth.
| terrainIndices | - The selected surface columns. |
| compactionMultiplier | - Multiplier applied to the minimum required compaction. Must be > 0. |
| compactionDepth | - Number of voxels, including the surface voxel, receiving authored compaction. |
| useTaperedProfile | - If true, gradually reduces the authored compaction with depth. If false, applies the same authored compaction through the selected depth. |
| void agxTerrain::TerrainGridControl::setSurfaceCompaction | ( | const agx::Vec2i & | terrainIndex, |
| float | compaction, | ||
| bool | compressOccupancy = false, |
||
| bool | compressToBottom = false |
||
| ) |
Set the compaction at the surface element given a specified surface index.
| terrainIndex | - The specified surface index. |
| compaction | - The specified compaction. |
| compressOccupancy | - Set to True if the solid occupancy of the surface grid element should be compressed. This will keep the amount of solid occupancy in the voxel but will change the surface profile of the terrain as occupancy is lowered. |
| compressToBottom | - Set to True if the compression value should be set to each soild grid element down to maximum terrain depth. |
| void agxTerrain::TerrainGridControl::setSurfaceCompactionToDepth | ( | const agx::Vec2i & | terrainIndex, |
| float | compaction, | ||
| float | depth | ||
| ) |
Set the compaction at the surface element given a specified surface index.
| terrainIndex | - The specified surface index. |
| compaction | - The specified compaction. |
| depth | - The depth that the compression should be set under the surface |
| void agxTerrain::TerrainGridControl::setTerrainMaterial | ( | const agx::Vec2i & | terrainIndex, |
| int | z, | ||
| TerrainMaterial * | terrainMaterial | ||
| ) |
Set the terrainMaterial at an element given a specified surface index with a depth index.
| terrainIndex | - The specified terrain index. |
| z | - Index of the cell in the z-coord. |
| terrainMaterial | - the specified TerrainMaterial. |
| void agxTerrain::TerrainGridControl::setTerrainMaterial | ( | const agx::Vec3i & | terrainIndex, |
| TerrainMaterial * | terrainMaterial | ||
| ) |
Set the terrainMaterial at an element given a specified 3D index where x,y are the regular terrain coordinates while z is the depth index.
| terrainIndex | - The specified 3D index, containing surface coordinates and depth index. |
| terrainMaterial | - the specified TerrainMaterial. |