Unravel Engine C++ Reference
Loading...
Searching...
No Matches
translate_path.hpp
Go to the documentation of this file.
1#ifndef GENERATOR_TRANSLATEPATH_HPP
2#define GENERATOR_TRANSLATEPATH_HPP
3
4#include "math.hpp"
5
6#include "transform_path.hpp"
7
8namespace generator
9{
10
12template<typename path_t>
14{
15private:
17 impl_t transform_path_;
18
19public:
22 translate_path_t(path_t path, const gml::dvec3& delta)
23 : transform_path_{std::move(path),
24 [delta](path_vertex_t& value)
25 {
26 value.position += delta;
27 }}
28 {
29 }
30
31 using edges_t = typename impl_t::edges_t;
32
33 edges_t edges() const noexcept
34 {
35 return transform_path_.edges();
36 }
37
39
40 vertices_t vertices() const noexcept
41 {
42 return transform_path_.vertices();
43 }
44};
45
46template<typename path_t>
47translate_path_t<path_t> translate_path(path_t path, const gml::dvec3& delta)
48{
49 return translate_path_t<path_t>{std::move(path), delta};
50}
51} // namespace generator
52
53#endif
Apply a mutator function to each vertex.
typename impl_t::edges_t edges_t
Translates the position of each vertex by given amount.
translate_path_t(path_t path, const gml::dvec3 &delta)
typename impl_t::vertices_t vertices_t
typename impl_t::edges_t edges_t
edges_t edges() const noexcept
vertices_t vertices() const noexcept
translate_path_t< path_t > translate_path(path_t path, const gml::dvec3 &delta)