CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
IcosahedronMesh.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 "MeshVertex.hpp"
11#include "Triangle.hpp"
12#include "TriangleMesh.hpp"
13#include "Utility.hpp"
14
16
17#include <array>
18
20
24 public:
25 class Triangles {
26 public:
29 void next();
30
31 private:
33
34 int i_;
35
36 // Needs be a shared_ptr in order to make copy/move not to mess up the
37 // internal pointer in mTriangles.
39
41
43
45 };
46
48 public:
51 void next();
52
53 private:
55
56 int i_;
57
58 // Needs be a shared_ptr in order to make copy/move not to mess up the
59 // internal pointer in mTriangles.
61
63
65
67 };
68
69 private:
70 double mRadius;
73
74 public:
77 IcosahedronMesh(double radius = 1.0, int segments = 1);
78
81 };
82
83} // namespace CeresEngine::MeshGenerator
TriangleGeneratorType< TriangleMesh >::Type mTriangles
Definition IcosahedronMesh.hpp:40
SPtr< const TriangleMesh > mTriangleMesh
Definition IcosahedronMesh.hpp:38
int i_
Definition IcosahedronMesh.hpp:34
const IcosahedronMesh * mMesh
Definition IcosahedronMesh.hpp:32
Regular icosahedron centered at origin with given radius.
Definition IcosahedronMesh.hpp:23
Triangles triangles() const noexcept
int faceVertexCount_
Definition IcosahedronMesh.hpp:72
double mRadius
Definition IcosahedronMesh.hpp:70
int mSegments
Definition IcosahedronMesh.hpp:71
Definition MeshVertex.hpp:14
Will have a type named "Type" that has same type as value returned by method triangles() for type Pri...
Definition Utility.hpp:30
Definition Triangle.hpp:14
A triangular mesh on the xy -plane.
Definition TriangleMesh.hpp:18
Will have a type named "Type" that has same type as value returned by method vertices() for type Prim...
Definition Utility.hpp:37
Represents a reflected C++ type. Can be used to get metadata from a C++ type.
Definition Type.hpp:32
Definition AnyGenerator.hpp:12
std::shared_ptr< T > SPtr
SPtr is a smart pointer that retains shared ownership of an object through a pointer.
Definition SmartPtr.hpp:37
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25