CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
TranslatePath.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "TransformPath.hpp"
12
14
16 template<typename Path> class TranslatePath {
17 private:
20
21 public:
24 TranslatePath(Path path, const Vector3& delta)
25 : mTransformPath{std::move(path), [delta](PathVertex& value) {
26 value.position += delta;
27 }} {}
28
29 using Edges = typename Impl::Edges;
30
31 [[nodiscard]] Edges edges() const noexcept { return mTransformPath.edges(); }
32
33 using Vertices = typename Impl::Vertices;
34
35 [[nodiscard]] Vertices vertices() const noexcept { return mTransformPath.vertices(); }
36 };
37
38 template<typename Path> TranslatePath<Path> translatePath(Path path, const Vector3& delta) { return TranslatePath<Path>{std::move(path), delta}; }
39
40} // namespace CeresEngine::MeshGenerator
Definition PathVertex.hpp:14
Apply a mutator function to each vertex.
Definition TransformPath.hpp:18
typename Impl::Edges Edges
Definition TransformPath.hpp:52
Translates the position of each vertex by given amount.
Definition TranslatePath.hpp:16
TranslatePath(Path path, const Vector3 &delta)
Definition TranslatePath.hpp:24
Edges edges() const noexcept
Definition TranslatePath.hpp:31
typename Impl::Vertices Vertices
Definition TranslatePath.hpp:33
typename Impl::Edges Edges
Definition TranslatePath.hpp:29
Impl mTransformPath
Definition TranslatePath.hpp:19
Vertices vertices() const noexcept
Definition TranslatePath.hpp:35
Definition AnyGenerator.hpp:12
TranslatePath< Path > translatePath(Path path, const Vector3 &delta)
Definition TranslatePath.hpp:38
auto move(Vector3 position)
Moves a entity to the given position.
Definition Helpers.hpp:22
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition Span.hpp:668