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 ConstPtr = std::shared_ptr< const MeshMaterial >
 
using Ptr = std::shared_ptr< MeshMaterial >
 

Public Member Functions

Eigen::Vector4d getBaseColorFactor () const
 Get the base color of the mesh. More...
 
Eigen::Vector4d getEmissiveFactor () const
 Get the emissive factor 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...
 
 MeshMaterial ()=default
 
 MeshMaterial (const Eigen::Vector4d &base_color_factor, double metallic_factor, double roughness_factor, const Eigen::Vector4d &emissive_factor)
 Construct a new MeshMaterial. More...
 

Private Attributes

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

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.

Definition at line 60 of file mesh_material.h.

Member Typedef Documentation

◆ ConstPtr

Definition at line 68 of file mesh_material.h.

◆ Ptr

Definition at line 67 of file mesh_material.h.

Constructor & Destructor Documentation

◆ MeshMaterial() [1/2]

tesseract_geometry::MeshMaterial::MeshMaterial ( const Eigen::Vector4d &  base_color_factor,
double  metallic_factor,
double  roughness_factor,
const Eigen::Vector4d &  emissive_factor 
)

Construct a new MeshMaterial.

Parameters
base_color_factorThe base color of the mesh
metallic_factorThe metallic factor parameter (PBR parameter)
roughness_factorThe roughness factor parameter (PBR parameter)
emissive_factorThe emissivity of the mesh

Definition at line 32 of file mesh_material.cpp.

◆ MeshMaterial() [2/2]

tesseract_geometry::MeshMaterial::MeshMaterial ( )
default

Member Function Documentation

◆ getBaseColorFactor()

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

Get the base color of the mesh.

Returns
The base color in RGBA

Definition at line 43 of file mesh_material.cpp.

◆ getEmissiveFactor()

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

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

Definition at line 49 of file mesh_material.cpp.

◆ getMetallicFactor()

double tesseract_geometry::MeshMaterial::getMetallicFactor ( ) const

Get the Metallic Factor of the mesh (PBR parameter)

Returns
The metallic factor, between 0 and 1

Definition at line 45 of file mesh_material.cpp.

◆ getRoughnessFactor()

double tesseract_geometry::MeshMaterial::getRoughnessFactor ( ) const

Get the Roughness Factor of the mesh (PBR parameter)

Returns
The roughness factor, between 0 and 1

Definition at line 47 of file mesh_material.cpp.

Member Data Documentation

◆ base_color_factor_

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

Definition at line 118 of file mesh_material.h.

◆ emissive_factor_

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

Definition at line 121 of file mesh_material.h.

◆ metallic_factor_

double tesseract_geometry::MeshMaterial::metallic_factor_ = 0
private

Definition at line 119 of file mesh_material.h.

◆ roughness_factor_

double tesseract_geometry::MeshMaterial::roughness_factor_ = 0.5
private

Definition at line 120 of file mesh_material.h.


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


tesseract_geometry
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:46