Unravel Engine C++ Reference
Loading...
Searching...
No Matches
mirror_mesh.hpp
Go to the documentation of this file.
1#ifndef GENERATOR_MIRRORMESH_HPP
2#define GENERATOR_MIRRORMESH_HPP
3
4#include "axis.hpp"
5#include "axis_flip_mesh.hpp"
6#include "merge_mesh.hpp"
7
8namespace generator
9{
10
12template<typename Mesh>
14{
15private:
17 impl_t merge_mesh_;
18
19public:
22 mirror_mesh_t(Mesh mesh, axis_t axis)
23 : merge_mesh_{mesh, {mesh, axis == axis_t::X, axis == axis_t::Y, axis == axis_t::Z}}
24 {
25 }
26
27 using triangles_t = typename impl_t::triangles_t;
28
29 triangles_t triangles() const noexcept
30 {
31 return merge_mesh_.triangles();
32 }
33
34 using vertices_t = typename impl_t::vertices_t;
35
36 vertices_t vertices() const noexcept
37 {
38 return merge_mesh_.vertices();
39 }
40};
41
42template<typename Mesh>
44{
45 return mirror_mesh_t<Mesh>{std::move(mesh)};
46}
47} // namespace generator
48
49#endif
Duplicates the mesh by mirrorring it along an axis.
typename impl_t::vertices_t vertices_t
triangles_t triangles() const noexcept
mirror_mesh_t(Mesh mesh, axis_t axis)
typename impl_t::triangles_t triangles_t
vertices_t vertices() const noexcept
mirror_mesh_t< Mesh > mirror_mesh(Mesh mesh)