VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtSurfaceToVxMaterialMapper Class Reference

Detailed Description

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)
 
VortexSurfaceInfogetSurfaceInfo (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
 

Constructor & Destructor Documentation

◆ DtSurfaceToVxMaterialMapper()

makVre::DtSurfaceToVxMaterialMapper::DtSurfaceToVxMaterialMapper ( )

Default constructor.

Initializes an empty material mapper with no default material.

◆ ~DtSurfaceToVxMaterialMapper()

virtual makVre::DtSurfaceToVxMaterialMapper::~DtSurfaceToVxMaterialMapper ( )
virtual

Destructor.

Cleans up all allocated surface info objects in the mapping tables.

Member Function Documentation

◆ init()

virtual void makVre::DtSurfaceToVxMaterialMapper::init ( const Vx::VxMaterialTable * val)
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.

Parameters
valPointer to the Vortex material table containing available materials

◆ getVortexMaterial()

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.

Parameters
surfThe terrain surface to get the material for
Returns
Pointer to the corresponding Vortex material

◆ getDefaultVortexMaterial()

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.

Returns
Pointer to the default Vortex material

◆ isFiltered()

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.

Parameters
surfThe terrain surface to check
Returns
True if the surface should be filtered out, false otherwise

◆ getSurfaceInfo()

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).

Parameters
surfThe terrain surface to get the info for
Returns
Pointer to the corresponding VortexSurfaceInfo

Member Data Documentation

◆ myDefaultMaterial

Vx::VxMaterial* makVre::DtSurfaceToVxMaterialMapper::myDefaultMaterial
protected

The default Vortex material to use when no specific mapping is found.

◆ mySoilTypeToMaterialMap

std::vector<VortexSurfaceInfo*> makVre::DtSurfaceToVxMaterialMapper::mySoilTypeToMaterialMap
protected

Mapping from soil types to Vortex materials.

◆ myBodyOfWaterTypeToMaterialMap

std::vector<VortexSurfaceInfo*> makVre::DtSurfaceToVxMaterialMapper::myBodyOfWaterTypeToMaterialMap
protected

Mapping from body of water types to Vortex materials.

◆ myCulturalFeatureTypeToMaterialMap

std::vector<VortexSurfaceInfo*> makVre::DtSurfaceToVxMaterialMapper::myCulturalFeatureTypeToMaterialMap
protected

Mapping from cultural feature types to Vortex materials.

◆ myRoughnessSoilTypeToMaterialMap

std::vector<VortexSurfaceInfo*> makVre::DtSurfaceToVxMaterialMapper::myRoughnessSoilTypeToMaterialMap
protected

Mapping from roughness soil types to Vortex materials.


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