CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
AxisSwapShape.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 "TransformShape.hpp"
11
13
15 template<typename Shape> class AxisSwapShape {
16 private:
19
20 public:
23 : mTransformShape{std::move(shape), [](ShapeVertex& vertex) {
24 std::swap(vertex.position[0u], vertex.position[1u]);
25 std::swap(vertex.tangent[0u], vertex.tangent[1u]);
26 }} {}
27
28 using Edges = typename Impl::Edges;
29 [[nodiscard]] Edges edges() const noexcept { return mTransformShape.edges(); }
30
31 using Vertices = typename Impl::Vertices;
32 [[nodiscard]] Vertices vertices() const noexcept { return mTransformShape.vertices(); }
33 };
34
35 template<typename Shape> AxisSwapShape<Shape> axisSwapShape(Shape shape) { return AxisSwapShape<Shape>{std::move(shape)}; }
36
37} // namespace CeresEngine::MeshGenerator
Swaps the x and y axis.
Definition AxisSwapShape.hpp:15
typename Impl::Edges Edges
Definition AxisSwapShape.hpp:28
AxisSwapShape(Shape shape)
Definition AxisSwapShape.hpp:22
typename Impl::Vertices Vertices
Definition AxisSwapShape.hpp:31
Vertices vertices() const noexcept
Definition AxisSwapShape.hpp:32
Impl mTransformShape
Definition AxisSwapShape.hpp:18
Edges edges() const noexcept
Definition AxisSwapShape.hpp:29
A point on a path.
Definition ShapeVertex.hpp:16
Apply a mutator function to each vertex.
Definition TransformShape.hpp:18
typename Impl::Edges Edges
Definition TransformShape.hpp:50
A type that describes a conjunction of shapes that can be filled and stroked.
Definition Shape.hpp:198
Definition AnyGenerator.hpp:12
AxisSwapShape< Shape > axisSwapShape(Shape shape)
Definition AxisSwapShape.hpp:35
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