AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agxTerrain::TerrainMaterialLibrary Class Reference

Class that is used for interfacing with different TerrainMaterial presets with calibrated bulk and contact properties of different archetypes of soil, such as dirt, gravel and sand. More...

#include <TerrainMaterialLibrary.h>

Static Public Member Functions

static agx::StringVector getAvailableLibraryMaterials (const agx::String &libraryFolder=DEFAULT_TERRAIN_MATERIAL_LIBRARY_FOLDER)
 Get the available TerrainMaterial presets from the existing.json files in the specified material library folder.
 
static bool loadMaterialProfile (const agx::String &materialName, agxTerrain::TerrainMaterial *terrainMaterial, const agx::String &libraryFolder=DEFAULT_TERRAIN_MATERIAL_LIBRARY_FOLDER)
 Configure a agxTerrain::TerrainMaterial object from one of the existing library presets, derived from the .json files in the specified library folder.
 

Detailed Description

Class that is used for interfacing with different TerrainMaterial presets with calibrated bulk and contact properties of different archetypes of soil, such as dirt, gravel and sand.

It parses the available preset files that exists in a specified direction, validates them, and provides easy interfacing for constructing terrain materials. The default location if a folder containing the default material preset files of AGX Dynamics. The files contain TerrainMaterial specifications in JSON format. The user is not limited to using these preset files but can also load custom material files through the Terrain class.

Definition at line 36 of file TerrainMaterialLibrary.h.

Member Function Documentation

◆ getAvailableLibraryMaterials()

static agx::StringVector agxTerrain::TerrainMaterialLibrary::getAvailableLibraryMaterials ( const agx::String &  libraryFolder = DEFAULT_TERRAIN_MATERIAL_LIBRARY_FOLDER)
static

Get the available TerrainMaterial presets from the existing.json files in the specified material library folder.

The default location of the preset folder contains the default material preset of AGX Dynamics.

Parameters
libraryFolder- The path to the folder containing all the terrain material preset files.
Returns
a vector containing the available TerrainMaterial presets from the existing .json files in the specified material library folder.

◆ loadMaterialProfile()

static bool agxTerrain::TerrainMaterialLibrary::loadMaterialProfile ( const agx::String &  materialName,
agxTerrain::TerrainMaterial *  terrainMaterial,
const agx::String &  libraryFolder = DEFAULT_TERRAIN_MATERIAL_LIBRARY_FOLDER 
)
static

Configure a agxTerrain::TerrainMaterial object from one of the existing library presets, derived from the .json files in the specified library folder.

The default location of the preset folder contains the default material preset of AGX Dynamics. Note - Existing library materials can be extracted via the getAvailableLibraryMaterials() method:

Parameters
materialName- the name of the material preset to load.
terrainMaterial- Pointer to the terrain material that should be modified
libraryFolder- The path to the folder containing all the terrain material preset files.
Returns
a TerrainMaterial object created from the specified material preset or nullptr if the creation failed.

The documentation for this class was generated from the following file: