|
VR-Engage
2.2
|
This class provides the functionality to translate between VR-Forces terrain surface types (soil, water, cultural features, etc.) and Vortex physics materials. It maintains lookup tables for different surface type categories and provides methods to retrieve the appropriate Vortex material for a given surface.
#include <surfaceToVxMaterialMapper.h>
Public Member Functions | |
| DtSurfaceToVxMaterialMapper () | |
| virtual | ~DtSurfaceToVxMaterialMapper () |
| virtual void | init (const Vx::VxMaterialTable *val) |
| Vx::VxMaterial * | getVortexMaterial (const DtSurface &surf) |
| Vx::VxMaterial * | getDefaultVortexMaterial () |
| bool | isFiltered (const DtSurface &surf) |
| VortexSurfaceInfo * | getSurfaceInfo (const DtSurface &surf) const |
Protected Attributes | |
| Vx::VxMaterial * | myDefaultMaterial |
| std::vector< VortexSurfaceInfo * > | mySoilTypeToMaterialMap |
| std::vector< VortexSurfaceInfo * > | myBodyOfWaterTypeToMaterialMap |
| std::vector< VortexSurfaceInfo * > | myCulturalFeatureTypeToMaterialMap |
| std::vector< VortexSurfaceInfo * > | myRoughnessSoilTypeToMaterialMap |
| makVre::DtSurfaceToVxMaterialMapper::DtSurfaceToVxMaterialMapper | ( | ) |
Default constructor.
Initializes an empty material mapper with no default material.
|
virtual |
Destructor.
Cleans up all allocated surface info objects in the mapping tables.
|
virtual |
Initialize the material mapper with a Vortex material table.
Sets up the mapping between VR-Forces surface types and Vortex materials based on configuration settings in vortexConfig.lua. This includes setting up the default material, material mapping tables, and filter lists.
| val | Pointer to the Vortex material table containing available materials |
| Vx::VxMaterial * makVre::DtSurfaceToVxMaterialMapper::getVortexMaterial | ( | const DtSurface & | surf | ) |
Get the Vortex material for a specific terrain surface.
Determines the appropriate Vortex material based on the surface type. For water surfaces, it uses the body of water type mapping. For cultural features, it uses the cultural feature type mapping. For ground or flimsy surfaces, it uses the soil type mapping. Otherwise, it uses the roughness soil type mapping.
| surf | The terrain surface to get the material for |
| Vx::VxMaterial * makVre::DtSurfaceToVxMaterialMapper::getDefaultVortexMaterial | ( | ) |
Get the default Vortex material.
Returns the default material that is used when a specific mapping is not found or when explicitly configured to use the default.
| bool makVre::DtSurfaceToVxMaterialMapper::isFiltered | ( | const DtSurface & | surf | ) |
Check if a surface should be filtered out.
Determines if a given surface should be excluded from triangle generation based on configuration settings.
| surf | The terrain surface to check |
| VortexSurfaceInfo * makVre::DtSurfaceToVxMaterialMapper::getSurfaceInfo | ( | const DtSurface & | surf | ) | const |
Get the surface info for a specific terrain surface.
Retrieves the VortexSurfaceInfo object containing material and flags for the given terrain surface. The appropriate info is selected based on the surface type (water, cultural feature, ground, or roughness).
| surf | The terrain surface to get the info for |
|
protected |
The default Vortex material to use when no specific mapping is found.
|
protected |
Mapping from soil types to Vortex materials.
|
protected |
Mapping from body of water types to Vortex materials.
|
protected |
Mapping from cultural feature types to Vortex materials.
|
protected |
Mapping from roughness soil types to Vortex materials.