Unravel Engine C++ Reference
Loading...
Searching...
No Matches
axis_swap_path.hpp
Go to the documentation of this file.
1#ifndef GENERATOR_AXISSWAPPATH_HPP
2#define GENERATOR_AXISSWAPPATH_HPP
3
4#include "axis.hpp"
5#include "transform_path.hpp"
6
7namespace generator
8{
9
11template<typename path_t>
13{
14private:
16 impl_t transform_path_;
17
18public:
24 : transform_path_{std::move(path),
25 [x, y, z](path_vertex_t& vertex)
26 {
27 vertex.position = gml::dvec3{vertex.position[static_cast<int>(x)],
28 vertex.position[static_cast<int>(y)],
29 vertex.position[static_cast<int>(z)]};
30 vertex.tangent = gml::dvec3{vertex.tangent[static_cast<int>(x)],
31 vertex.tangent[static_cast<int>(y)],
32 vertex.tangent[static_cast<int>(z)]};
33 vertex.normal = gml::dvec3{vertex.normal[static_cast<int>(x)],
34 vertex.normal[static_cast<int>(y)],
35 vertex.normal[static_cast<int>(z)]};
36 }}
37 {
38 }
39
40 using edges_t = typename impl_t::edges_t;
41
42 edges_t edges() const noexcept
43 {
44 return transform_path_.edges();
45 }
46
48
49 vertices_t vertices() const noexcept
50 {
51 return transform_path_.vertices();
52 }
53};
54
55template<typename path_t>
57{
58 return axis_swap_path_t<path_t>{std::move(path), x, y, z};
59}
60} // namespace generator
61
62#endif
edges_t edges() const noexcept
axis_swap_path_t(path_t path, axis_t x, axis_t y, axis_t z)
typename impl_t::vertices_t vertices_t
vertices_t vertices() const noexcept
typename impl_t::edges_t edges_t
Apply a mutator function to each vertex.
typename impl_t::edges_t edges_t
axis_swap_path_t< path_t > axis_swap_path(path_t path, axis_t x, axis_t y, axis_t z)
float y
float x
float z