Unravel Engine C++ Reference
Loading...
Searching...
No Matches
spherical_triangle_mesh.hpp
Go to the documentation of this file.
1#ifndef GENERATOR_SPHERICALTRIANGLEMESH_HPP
2#define GENERATOR_SPHERICALTRIANGLEMESH_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
22 triangle_t generate() const;
23
24 void next();
25
26 private:
27 const spherical_triangle_mesh_t* mesh_;
28 int row_;
29 int col_;
30 int i_;
31
32 explicit triangles_t(const spherical_triangle_mesh_t& mesh);
33
35 };
36
38 {
39 public:
40 bool done() const noexcept;
41
42 mesh_vertex_t generate() const;
43
44 void next();
45
46 private:
47 const spherical_triangle_mesh_t* mesh_;
48 int row_;
49 int col_;
50
51 explicit vertices_t(const spherical_triangle_mesh_t& mesh);
52
54 };
55
58 spherical_triangle_mesh_t(double radius = 1.0, int segments = 4);
59
61 spherical_triangle_mesh_t(const gml::dvec3& v0, const gml::dvec3& v1, const gml::dvec3& v2, int segments = 4);
62
63 triangles_t triangles() const noexcept;
64
65 vertices_t vertices() const noexcept;
66
67private:
68 gml::dvec3 v0_, v1_, v2_;
69
70 gml::dvec3 normal_;
71
72 int segments_;
73};
74} // namespace generator
75
76#endif
spherical_triangle_mesh_t(double radius=1.0, int segments=4)
Definition math.hpp:13
const segment_list * segments