Unravel Engine C++ Reference
Loading...
Searching...
No Matches
triangle_mesh.hpp
Go to the documentation of this file.
1#ifndef GENERATOR_TRIANGLEMESH_HPP
2#define GENERATOR_TRIANGLEMESH_HPP
3
4#include "math.hpp"
5
6#include "mesh_vertex.hpp"
7#include "triangle.hpp"
8
9namespace generator
10{
11
15{
16public:
18 {
19 public:
20 bool done() const noexcept;
21 triangle_t generate() const;
22 void next();
23
24 private:
25 const triangle_mesh_t* mesh_;
26 int row_;
27 int col_;
28 int i_;
29
30 explicit triangles_t(const triangle_mesh_t& mesh);
31
32 friend class triangle_mesh_t;
33 };
34
36 {
37 public:
38 bool done() const noexcept;
39 mesh_vertex_t generate() const;
40 void next();
41
42 private:
43 const triangle_mesh_t* mesh_;
44 int row_;
45 int col_;
46
47 explicit vertices_t(const triangle_mesh_t& mesh);
48
49 friend class triangle_mesh_t;
50 };
51
55 explicit triangle_mesh_t(double radius = 1.0, int segments = 4);
56
59 triangle_mesh_t(const gml::dvec3& v0, const gml::dvec3& v1, const gml::dvec3& v2, int segments = 4);
60
61 triangles_t triangles() const noexcept;
62
63 vertices_t vertices() const noexcept;
64
65private:
66 gml::dvec3 v0_, v1_, v2_;
67
68 gml::dvec3 normal_;
69
70 int segments_;
71};
72} // namespace generator
73
74#endif
vertices_t vertices() const noexcept
triangle_mesh_t(double radius=1.0, int segments=4)
triangles_t triangles() const noexcept
Definition math.hpp:13
const segment_list * segments