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 |
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.
using tesseract_geometry::MeshMaterial::ConstPtr = std::shared_ptr<const MeshMaterial> |
Definition at line 68 of file mesh_material.h.
using tesseract_geometry::MeshMaterial::Ptr = std::shared_ptr<MeshMaterial> |
Definition at line 67 of file mesh_material.h.
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.
base_color_factor | The base color of the mesh |
metallic_factor | The metallic factor parameter (PBR parameter) |
roughness_factor | The roughness factor parameter (PBR parameter) |
emissive_factor | The emissivity of the mesh |
Definition at line 32 of file mesh_material.cpp.
|
default |
Eigen::Vector4d tesseract_geometry::MeshMaterial::getBaseColorFactor | ( | ) | const |
Get the base color of the mesh.
Definition at line 43 of file mesh_material.cpp.
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.
Definition at line 49 of file mesh_material.cpp.
double tesseract_geometry::MeshMaterial::getMetallicFactor | ( | ) | const |
Get the Metallic Factor of the mesh (PBR parameter)
Definition at line 45 of file mesh_material.cpp.
double tesseract_geometry::MeshMaterial::getRoughnessFactor | ( | ) | const |
Get the Roughness Factor of the mesh (PBR parameter)
Definition at line 47 of file mesh_material.cpp.
|
private |
Definition at line 118 of file mesh_material.h.
|
private |
Definition at line 121 of file mesh_material.h.
|
private |
Definition at line 119 of file mesh_material.h.
|
private |
Definition at line 120 of file mesh_material.h.