Unravel Engine C++ Reference
Loading...
Searching...
No Matches
axis_swap_shape.hpp
Go to the documentation of this file.
1#ifndef GENERATOR_AXISSWAPSHAPE_HPP
2#define GENERATOR_AXISSWAPSHAPE_HPP
3
4#include "transform_shape.hpp"
5
6namespace generator
7{
8
10template<typename shape_t>
12{
13private:
15 impl_t transform_shape_;
16
17public:
19 axis_swap_shape_t(shape_t shape)
20 : transform_shape_{std::move(shape),
21 [](shape_vertex_t& vertex)
22 {
23 std::swap(vertex.position[0u], vertex.position[1u]);
24 std::swap(vertex.tangent[0u], vertex.tangent[1u]);
25 }}
26 {
27 }
28
29 using edges_t = typename impl_t::edges_t;
30
31 edges_t edges() const noexcept
32 {
33 return transform_shape_.edges();
34 }
35
37
38 vertices_t vertices() const noexcept
39 {
40 return transform_shape_.vertices();
41 }
42};
43
44template<typename shape_t>
46{
47 return axis_swap_shape_t<shape_t>{std::move(shape)};
48}
49} // namespace generator
50
51#endif
Swaps the x and y axis.
typename impl_t::edges_t edges_t
edges_t edges() const noexcept
typename impl_t::vertices_t vertices_t
vertices_t vertices() const noexcept
Apply a mutator function to each vertex.
typename impl_t::edges_t edges_t
axis_swap_shape_t< shape_t > axis_swap_shape(shape_t shape)