CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
RoundedBoxMesh.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 "AxisFlipMesh.hpp"
11#include "BoxMesh.hpp"
12#include "CylinderMesh.hpp"
13#include "MergeMesh.hpp"
14#include "MirrorMesh.hpp"
15#include "PlaneMesh.hpp"
16#include "RotateMesh.hpp"
18#include "TranslateMesh.hpp"
19
21
22 namespace detail {
23
24 class BoxEdge {
25 private:
28
29 public:
30 BoxEdge(const Vector2& position, double radius, double size, int slices, int segments);
31
32 using Triangles = typename Impl::Triangles;
33
35
36 using Vertices = typename Impl::Vertices;
37
39 };
40
41 class BoxEdges {
42 private:
45
46 public:
47 BoxEdges(const Vector3& size, double radius, int slices, int segments);
48
49 using Triangles = typename Impl::Triangles;
50
52
53 using Vertices = typename Impl::Vertices;
54
56 };
57
58 class BoxCorner {
59 private:
62
63 public:
64 BoxCorner(const Vector3& position, double radius, int slices);
65
66 using Triangles = typename Impl::Triangles;
67
69
70 using Vertices = typename Impl::Vertices;
71
73 };
74
75 class BoxCorners {
76 private:
79
80 public:
81 BoxCorners(const Vector3& size, double radius, int slices);
82
83 using Triangles = typename Impl::Triangles;
84
86
87 using Vertices = typename Impl::Vertices;
88
90 };
91
92 } // namespace detail
93
98 private:
102
103 public:
109 RoundedBoxMesh(double radius = 0.25, const Vector3& size = {0.75, 0.75, 0.75}, int slices = 4, const Vector3i& segments = {8, 8, 8});
110
111 using Triangles = typename Impl::Triangles;
112
113 [[nodiscard]] Triangles triangles() const noexcept { return mMergeMesh.triangles(); }
114
115 using Vertices = typename Impl::Vertices;
116
117 [[nodiscard]] Vertices vertices() const noexcept { return mMergeMesh.vertices(); }
118 };
119
120} // namespace CeresEngine::MeshGenerator
Swaps any number of axis in the mesh.
Definition AxisSwapMesh.hpp:17
typename Impl::Vertices Vertices
Definition MirrorMesh.hpp:30
Triangles triangles() const noexcept
Definition MirrorMesh.hpp:28
Vertices vertices() const noexcept
Definition MirrorMesh.hpp:31
typename Impl::Triangles Triangles
Definition MirrorMesh.hpp:27
Rectangular box with rounded edges centered at origin aligned along the x, y and z axis.
Definition RoundedBoxMesh.hpp:97
typename Impl::Triangles Triangles
Definition RoundedBoxMesh.hpp:111
typename Impl::Vertices Vertices
Definition RoundedBoxMesh.hpp:115
Vertices vertices() const noexcept
Definition RoundedBoxMesh.hpp:117
Impl mMergeMesh
Definition RoundedBoxMesh.hpp:101
Triangles triangles() const noexcept
Definition RoundedBoxMesh.hpp:113
RoundedBoxMesh(double radius=0.25, const Vector3 &size={0.75, 0.75, 0.75}, int slices=4, const Vector3i &segments={8, 8, 8})
Triangles triangles() const noexcept
Definition TranslateMesh.hpp:30
Vertices vertices() const noexcept
Definition TranslateMesh.hpp:34
typename Impl::Vertices Vertices
Definition TranslateMesh.hpp:32
typename Impl::Triangles Triangles
Definition TranslateMesh.hpp:28
Flips texture coordinate axis directions.
Definition UvFlipMesh.hpp:15
Definition RoundedBoxMesh.hpp:58
Triangles triangles() const noexcept
Definition RoundedBoxMesh.hpp:68
typename Impl::Triangles Triangles
Definition RoundedBoxMesh.hpp:66
Impl mTranslateMesh
Definition RoundedBoxMesh.hpp:61
typename Impl::Vertices Vertices
Definition RoundedBoxMesh.hpp:70
BoxCorner(const Vector3 &position, double radius, int slices)
Vertices vertices() const noexcept
Definition RoundedBoxMesh.hpp:72
Definition RoundedBoxMesh.hpp:75
BoxCorners(const Vector3 &size, double radius, int slices)
typename Impl::Triangles Triangles
Definition RoundedBoxMesh.hpp:83
Vertices vertices() const noexcept
Definition RoundedBoxMesh.hpp:89
Impl mMirrorMesh
Definition RoundedBoxMesh.hpp:78
Triangles triangles() const noexcept
Definition RoundedBoxMesh.hpp:85
typename Impl::Vertices Vertices
Definition RoundedBoxMesh.hpp:87
Definition RoundedBoxMesh.hpp:24
Impl mTranslateMesh
Definition RoundedBoxMesh.hpp:27
typename Impl::Triangles Triangles
Definition RoundedBoxMesh.hpp:32
BoxEdge(const Vector2 &position, double radius, double size, int slices, int segments)
Vertices vertices() const noexcept
Definition RoundedBoxMesh.hpp:38
typename Impl::Vertices Vertices
Definition RoundedBoxMesh.hpp:36
Triangles triangles() const noexcept
Definition RoundedBoxMesh.hpp:34
Definition RoundedBoxMesh.hpp:41
Impl mMirrorMesh
Definition RoundedBoxMesh.hpp:44
typename Impl::Triangles Triangles
Definition RoundedBoxMesh.hpp:49
BoxEdges(const Vector3 &size, double radius, int slices, int segments)
typename Impl::Vertices Vertices
Definition RoundedBoxMesh.hpp:53
Triangles triangles() const noexcept
Definition RoundedBoxMesh.hpp:51
Vertices vertices() const noexcept
Definition RoundedBoxMesh.hpp:55
Definition AnyGenerator.hpp:12
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25