![]() |
Tesseract 0.28.4
|
Represents a texture and UV coordinates extracted from a mesh file. More...
#include <mesh_material.h>
Public Types | |
| using | Ptr = std::shared_ptr<MeshTexture> |
| using | ConstPtr = std::shared_ptr<const MeshTexture> |
Public Member Functions | |
| MeshTexture (std::shared_ptr< tesseract::common::Resource > texture_image, std::shared_ptr< const tesseract::common::VectorVector2d > uvs, MeshTextureType type=MeshTextureType::BASE_COLOR, unsigned uv_channel=0) | |
| Construct a new MeshTexture. | |
| std::shared_ptr< tesseract::common::Resource > | getTextureImage () const |
| Get the texture image. | |
| const std::shared_ptr< const tesseract::common::VectorVector2d > & | getUVs () const |
| Get the texture UV coordinates. | |
| MeshTextureType | getType () const |
| Get the material slot the texture is applied to. | |
| unsigned | getUVChannel () const |
| Get the index of the UV channel the UV coordinates were read from. | |
| MeshTextureWrapMode | getWrapU () const |
| Get the wrap mode along U (S). | |
| MeshTextureWrapMode | getWrapV () const |
| Get the wrap mode along V (T). | |
| MeshTextureFilter | getMagFilter () const |
| Get the magnification filter. | |
| MeshTextureFilter | getMinFilter () const |
| Get the minification filter. | |
| void | setWrap (MeshTextureWrapMode wrap_u, MeshTextureWrapMode wrap_v) |
| Set the wrap modes along U (S) and V (T). | |
| void | setFilters (MeshTextureFilter mag_filter, MeshTextureFilter min_filter) |
| Set the magnification and minification filters. | |
| bool | operator== (const MeshTexture &rhs) const |
| Equality compares the texture settings, the UV values and the image resource contents. | |
| bool | operator!= (const MeshTexture &rhs) const |
Friends | |
| template<class Archive> | |
| friend | void::tesseract::geometry::serialize (Archive &ar, MeshTexture &obj) |
Represents a texture and UV coordinates extracted from a mesh file.
Mesh files contain (or reference) image files that form textures on the surface of the mesh. UV coordinates specify how the image is applied to the mesh. The MeshTexture structure contains a resource to the image, the UV coordinates, the material slot the texture is applied to, and the sampler settings. Currently only jpg and png image formats are supported.
UV coordinates specify the location of each vertex in the mesh on the texture. Each (u,v) coordinate is normalized to be between 0 and 1. Textures that use the same UV channel share the same UV vector.
| tesseract::geometry::MeshTexture::MeshTexture | ( | std::shared_ptr< tesseract::common::Resource > | texture_image, |
| std::shared_ptr< const tesseract::common::VectorVector2d > | uvs, | ||
| MeshTextureType | type = MeshTextureType::BASE_COLOR, | ||
| unsigned | uv_channel = 0 ) |
Construct a new MeshTexture.
| texture_image | Resource representing the texture image (jpg or png) |
| uvs | UV coordinates for texture on mesh |
| type | The material slot the texture is applied to |
| uv_channel | The index of the UV channel in the source mesh that uvs were read from |
| std::shared_ptr< tesseract::common::Resource > tesseract::geometry::MeshTexture::getTextureImage | ( | ) | const |
Get the texture image.
Must be jpg or png
| const std::shared_ptr< const tesseract::common::VectorVector2d > & tesseract::geometry::MeshTexture::getUVs | ( | ) | const |
Get the texture UV coordinates.