Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
tesseract_geometry::MeshMaterial Class Reference

Represents material information extracted from a mesh file. More...

#include <mesh_material.h>

Public Types

using Ptr = std::shared_ptr< MeshMaterial >
 
using ConstPtr = std::shared_ptr< const MeshMaterial >
 

Public Member Functions

 MeshMaterial (Eigen::Vector4d baseColorFactor, double metallicFactor, double roughnessFactor, Eigen::Vector4d emissiveFactor)
 Construct a new MeshMaterial. More...
 
 MeshMaterial ()=default
 
Eigen::Vector4d getBaseColorFactor () const
 Get the base color of the mesh. More...
 
double getMetallicFactor () const
 Get the Metallic Factor of the mesh (PBR parameter) More...
 
double getRoughnessFactor () const
 Get the Roughness Factor of the mesh (PBR parameter) More...
 
Eigen::Vector4d getEmissiveFactor () const
 Get the emissive factor of the mesh. More...
 

Private Attributes

Eigen::Vector4d base_color_factor_
 
double metallic_factor_ = 0
 
double roughness_factor_ = 0.5
 
Eigen::Vector4d emissive_factor_
 

Detailed Description

Represents material information extracted from a mesh file.

Mesh files contain material information. The mesh parser will extract the material information and store it in a MeshMaterial instance. The MeshMaterial class uses a subset PBR Metallic workflow, as specified in the glTF 2.0 file format standard. The four parameters supported are baseColorFactor, metallicFactor, roughnessFactor, and emmisiveFactor. (The MeshTexture class stores diffuse textures that can be used for decals and fiducial marks, and is stored separately from MeshMaterial.) These four parameters and MeshTexture should be enough to display "CAD quality" renderings in visualizers. The full mesh file should be used when higher quality rendering is required.

The MeshMaterial favors PBR materials extracted from glTF 2.0 files. COLLADA does not support PBR. Only "Diffuse" and "Emissive" are read. "Specular" and "Ambient" are ignored.

Member Typedef Documentation

◆ ConstPtr

◆ Ptr

Constructor & Destructor Documentation

◆ MeshMaterial() [1/2]

tesseract_geometry::MeshMaterial::MeshMaterial ( Eigen::Vector4d  baseColorFactor,
double  metallicFactor,
double  roughnessFactor,
Eigen::Vector4d  emissiveFactor 
)
inline

Construct a new MeshMaterial.

Parameters
baseColorFactorThe base color of the mesh
metallicFactorThe metallic factor parameter (PBR parameter)
roughnessFactorThe roughness factor parameter (PBR parameter)
emissiveFactorThe emissivity of the mesh

◆ MeshMaterial() [2/2]

tesseract_geometry::MeshMaterial::MeshMaterial ( )
default

Member Function Documentation

◆ getBaseColorFactor()

Eigen::Vector4d tesseract_geometry::MeshMaterial::getBaseColorFactor ( ) const
inline

Get the base color of the mesh.

Returns
The base color in RGBA

◆ getEmissiveFactor()

Eigen::Vector4d tesseract_geometry::MeshMaterial::getEmissiveFactor ( ) const
inline

Get the emissive factor of the mesh.

"Emissive factor" is used to make the mesh "glow". How this is interpreted depends on the rendering engine.

Returns
The emissive factor in RGBA

◆ getMetallicFactor()

double tesseract_geometry::MeshMaterial::getMetallicFactor ( ) const
inline

Get the Metallic Factor of the mesh (PBR parameter)

Returns
The metallic factor, between 0 and 1

◆ getRoughnessFactor()

double tesseract_geometry::MeshMaterial::getRoughnessFactor ( ) const
inline

Get the Roughness Factor of the mesh (PBR parameter)

Returns
The roughness factor, between 0 and 1

Member Data Documentation

◆ base_color_factor_

Eigen::Vector4d tesseract_geometry::MeshMaterial::base_color_factor_
private

◆ emissive_factor_

Eigen::Vector4d tesseract_geometry::MeshMaterial::emissive_factor_
private

◆ metallic_factor_

double tesseract_geometry::MeshMaterial::metallic_factor_ = 0
private

◆ roughness_factor_

double tesseract_geometry::MeshMaterial::roughness_factor_ = 0.5
private

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