-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConstruct.hpp
94 lines (90 loc) · 4.32 KB
/
Construct.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#pragma once
#include <vector>
#include <cstdint>
#include "internal/GeneratorSetting.hpp"
#include "internal/Mesh.hpp"
namespace Construct
{
/// <summary>
/// Generates a Quad mesh facing the +z direction
/// </summary>
/// <param name="settings">Setting that affect how the mesh is generated</param>
/// <returns>Mesh data for the Quad</returns>
Mesh Quad(const GeneratorSetting& settings = GeneratorSetting());
/// <summary>
/// Generates a Plane mesh facing the +y direction
/// </summary>
/// <param name="widthTiles">Number of tiles along the width</param>
/// <param name="heightTiles">Number of tiles along the height</param>
/// <param name="settings">Setting that affect how the mesh is generated</param>
/// <returns>Mesh data for the Plane</returns>
Mesh Plane(std::uint32_t widthTiles, std::uint32_t heightTiles, const GeneratorSetting& settings = GeneratorSetting());
/// <summary>
/// Generates a Polygon mesh facing the +z direction.
/// High side counts can be used to generate circles
/// </summary>
/// <param name="sides">Number of sides for the polygon</param>
/// <param name="settings">Setting that affect how the mesh is generated</param>
/// <returns>Mesh data for the Polygon</returns>
Mesh Polygon(std::uint32_t sides, const GeneratorSetting& settings = GeneratorSetting());
/// <summary>
/// Generates a Cube mesh
/// Uses a 6x1 texture layout with the texture being in the order:
/// Left, Front, Right, Back, Top, Bottom
/// (-x, +z, +x, -x, +y, -y)
/// </summary>
/// <param name="settings">Settings that affect how the mesh is generated</param>
/// <returns>Mesh data for the Cube</returns>
Mesh Cube(const GeneratorSetting& settings = GeneratorSetting());
/// <summary>
/// Generates a UV Sphere mesh
/// Uses an equirectangular texture layout
/// </summary>
/// <param name="rings">Number of longitude lines</param>
/// <param name="segments">Number of latitude lines</param>
/// <param name="settings">Settings that affect how the mesh is generated</param>
/// <returns>Mesh data for a UVSphere</returns>
Mesh UVSphere(std::uint32_t rings, std::uint32_t segments, const GeneratorSetting& settings = GeneratorSetting());
/// <summary>
/// Generates an Icosphere mesh
/// TODO Select texture layout for Cylinder
/// </summary>
/// <param name="subdivisions">Number of subdivisions, leave 0 for base case (icosahedron)</param>
/// <param name="settings">Settings that affect how the mesh is generated</param>
/// <returns>Mesh data for an Icosphere</returns>
Mesh Icosphere(std::uint32_t subdivisions, const GeneratorSetting& settings = GeneratorSetting());
/// <summary>
/// Generates a Cylinder mesh
/// TODO Select texture layout for Cylinder
/// </summary>
/// <param name="sides">Number of sides the cylinder mesh has</param>
/// <param name="settings">Settings that affect how the mesh is generated</param>
/// <returns>Mesh data for a Cylinder</returns>
Mesh Cylinder(std::uint32_t sides, const GeneratorSetting& settings = GeneratorSetting());
/// <summary>
/// Generates a Capsule mesh
/// TODO Select texture layout for capsule
/// </summary>
/// <param name="sides">Number of sides in the capsule mesh, this also affects the number of rings in the hemispheres</param>
/// <param name="settings">Settings that affect how the mesh is generated</param>
/// <returns>Mesh data for a Capsule</returns>
Mesh Capsule(std::uint32_t sides, const GeneratorSetting& settings = GeneratorSetting());
/// <summary>
/// Generates a Skybox Cube
/// Uses a 6x1 texture layout with the texture being in the order:
/// Left, Front, Right, Back, Top, Bottom
/// (-x, +z, +x, -x, +y, -y)
/// </summary>
/// <param name="settings">Settings that affect how the mesh is generated</param>
/// <returns>Mesh data for a Skybox Cube</returns>
Mesh SkyboxCube(const GeneratorSetting& settings = GeneratorSetting(WindingOrder::CW));
/// <summary>
/// Generates a Skybox Sphere
/// Uses an equirectangular texture layout
/// </summary>
/// <param name="rings">Number of longitude lines</param>
/// <param name="segments">Number of latitude lines</param>
/// <param name="settings">Settings that affect how the mesh is generated</param>
/// <returns>Mesh data for a Skybox Sphere</returns>
Mesh SkyboxSphere(std::uint32_t rings, std::uint32_t segments, const GeneratorSetting& settings = GeneratorSetting(WindingOrder::CW));
}