Unravel Engine C++ Reference
Loading...
Searching...
No Matches
dodecahedron_mesh.hpp
Go to the documentation of this file.
1#ifndef GENERATOR_DODECAHEDRON_HPP
2#define GENERATOR_DODECAHEDRON_HPP
3
4#include <array>
5#include <memory>
6
8#include "mesh_vertex.hpp"
9#include "triangle.hpp"
10#include "utils.hpp"
11
12namespace generator
13{
14
19{
20public:
22 {
23 public:
24 bool done() const noexcept;
25 triangle_t generate() const;
26 void next();
27
28 private:
29 const dodecahedron_mesh_t* mesh_;
30
31 int face_index_;
32
33 // Needs be a shared_ptr in order to make copy/move not to mess up the
34 // internal pointer in triangles_.
35 std::shared_ptr<const convex_polygon_mesh_t> face_mesh_;
36
38
39 explicit triangles_t(const dodecahedron_mesh_t& mesh) noexcept;
40
41 friend class dodecahedron_mesh_t;
42 };
43
45 {
46 public:
47 bool done() const noexcept;
48 mesh_vertex_t generate() const;
49 void next();
50
51 private:
52 const dodecahedron_mesh_t* mesh_;
53
54 int face_index_;
55
56 // Needs be a shared_ptr in order to make copy/move not to mess up the
57 // internal pointer in triangles_.
58 std::shared_ptr<const convex_polygon_mesh_t> face_mesh_;
59
61
62 explicit vertices_t(const dodecahedron_mesh_t& mesh) noexcept;
63
64 friend class dodecahedron_mesh_t;
65 };
66
67private:
68 double radius_;
69
70 int segments_;
71
72 int rings_;
73
74 int face_vertex_count_;
75
76public:
82 explicit dodecahedron_mesh_t(double radius = 1.0, int segments = 1, int rings = 1) noexcept;
83
84 triangles_t triangles() const noexcept;
85
86 vertices_t vertices() const noexcept;
87};
88} // namespace generator
89
90#endif
triangles_t triangles() const noexcept
vertices_t vertices() const noexcept
dodecahedron_mesh_t(double radius=1.0, int segments=1, int rings=1) noexcept
const segment_list * segments