Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
mesh_material.h
Go to the documentation of this file.
1
26#ifndef TESSERACT_GEOMETRY_MESH_MATERIAL_H
27#define TESSERACT_GEOMETRY_MESH_MATERIAL_H
28
32#include <Eigen/Geometry>
33#include <memory>
35
38
39namespace tesseract_geometry
40{
61{
62public:
63 using Ptr = std::shared_ptr<MeshMaterial>;
64 using ConstPtr = std::shared_ptr<const MeshMaterial>;
65
74 MeshMaterial(Eigen::Vector4d baseColorFactor,
75 double metallicFactor,
76 double roughnessFactor,
77 Eigen::Vector4d emissiveFactor)
78 : base_color_factor_(std::move(baseColorFactor))
79 , metallic_factor_(metallicFactor)
80 , roughness_factor_(roughnessFactor)
81 , emissive_factor_(std::move(emissiveFactor))
82 {
83 }
84 MeshMaterial() = default;
85
91 Eigen::Vector4d getBaseColorFactor() const { return base_color_factor_; }
92
98 double getMetallicFactor() const { return metallic_factor_; }
99
105 double getRoughnessFactor() const { return roughness_factor_; }
106
115 Eigen::Vector4d getEmissiveFactor() const { return emissive_factor_; }
116
117private:
118 // Mesh material based on simplified glTF 2.0 pbrMetallicRoughness parameters
119 Eigen::Vector4d base_color_factor_;
121 double roughness_factor_ = 0.5;
122 Eigen::Vector4d emissive_factor_;
123};
124
139{
140public:
141 using Ptr = std::shared_ptr<MeshTexture>;
142 using ConstPtr = std::shared_ptr<const MeshTexture>;
143
151 std::shared_ptr<const tesseract_common::VectorVector2d> uvs)
152 : uvs_(std::move(uvs)), texture_image_(std::move(texture_image))
153 {
154 }
155
164
170 const std::shared_ptr<const tesseract_common::VectorVector2d>& getUVs() { return uvs_; }
171
172private:
173 std::shared_ptr<const tesseract_common::VectorVector2d> uvs_;
174
175 // texture_image shall be jpg or png
177};
178} // namespace tesseract_geometry
179
180#endif
std::shared_ptr< Resource > Ptr
Definition: resource_locator.h:101
Represents material information extracted from a mesh file.
Definition: mesh_material.h:61
double roughness_factor_
Definition: mesh_material.h:121
std::shared_ptr< const MeshMaterial > ConstPtr
Definition: mesh_material.h:64
Eigen::Vector4d getBaseColorFactor() const
Get the base color of the mesh.
Definition: mesh_material.h:91
double getRoughnessFactor() const
Get the Roughness Factor of the mesh (PBR parameter)
Definition: mesh_material.h:105
double metallic_factor_
Definition: mesh_material.h:120
Eigen::Vector4d base_color_factor_
Definition: mesh_material.h:119
MeshMaterial(Eigen::Vector4d baseColorFactor, double metallicFactor, double roughnessFactor, Eigen::Vector4d emissiveFactor)
Construct a new MeshMaterial.
Definition: mesh_material.h:74
Eigen::Vector4d getEmissiveFactor() const
Get the emissive factor of the mesh.
Definition: mesh_material.h:115
double getMetallicFactor() const
Get the Metallic Factor of the mesh (PBR parameter)
Definition: mesh_material.h:98
std::shared_ptr< MeshMaterial > Ptr
Definition: mesh_material.h:63
Eigen::Vector4d emissive_factor_
Definition: mesh_material.h:122
Represents a texture and UV coordinates extracted from a mesh file.
Definition: mesh_material.h:139
const std::shared_ptr< const tesseract_common::VectorVector2d > & getUVs()
Get the texture UV coordinates.
Definition: mesh_material.h:170
MeshTexture(tesseract_common::Resource::Ptr texture_image, std::shared_ptr< const tesseract_common::VectorVector2d > uvs)
Construct a new MeshTexture.
Definition: mesh_material.h:150
tesseract_common::Resource::Ptr getTextureImage() const
Get the texture image.
Definition: mesh_material.h:163
std::shared_ptr< MeshTexture > Ptr
Definition: mesh_material.h:141
tesseract_common::Resource::Ptr texture_image_
Definition: mesh_material.h:176
std::shared_ptr< const tesseract_common::VectorVector2d > uvs_
Definition: mesh_material.h:173
std::shared_ptr< const MeshTexture > ConstPtr
Definition: mesh_material.h:142
Common Tesseract Macros.
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
Definition: geometry.h:39
Locate and retrieve resource data.
Common Tesseract Types.
Tesseract Geometries.