Unravel Engine C++ Reference
Loading...
Searching...
No Matches
uv_swap_mesh.hpp
Go to the documentation of this file.
1#ifndef GENERATOR_UVSWAPMESH_HPP
2#define GENERATOR_UVSWAPMESH_HPP
3
4#include "transform_mesh.hpp"
5
6namespace generator
7{
8
10template<typename mesh_t>
12{
13private:
15 impl_t transform_mesh_;
16
17public:
19 uv_swap_mesh_t(mesh_t mesh)
20 : transform_mesh_{std::move(mesh),
21 [](mesh_vertex_t& vertex)
22 {
23 std::swap(vertex.tex_coord[0], vertex.tex_coord[1]);
24 }}
25 {
26 }
27
29
30 triangles_t triangles() const noexcept
31 {
32 return transform_mesh_.triangles();
33 }
34
36
37 vertices_t vertices() const noexcept
38 {
39 return transform_mesh_.vertices();
40 }
41};
42
43template<typename mesh_t>
45{
46 return uv_swap_mesh_t<mesh_t>{std::move(mesh)};
47}
48} // namespace generator
49
50#endif
Apply a mutator function to each vertex.
typename impl_t::triangles_t triangles_t
Swaps the texture coordinates axis u and v.
typename impl_t::triangles_t triangles_t
typename impl_t::vertices_t vertices_t
triangles_t triangles() const noexcept
vertices_t vertices() const noexcept
uv_swap_mesh_t< mesh_t > uv_swap_mesh(mesh_t mesh)