-
Notifications
You must be signed in to change notification settings - Fork 0
/
geometry.h
63 lines (60 loc) · 2.41 KB
/
geometry.h
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
#pragma once
#include <utility>
#include <vector>
#include "glm/glm.hpp"
struct Vertex {
// position
glm::vec3 Position;
// normal
glm::vec3 Normal;
// texCoords
glm::vec2 TexCoords;
// tangent
glm::vec3 Tangent;
// bitangent
glm::vec3 Bitangent;
};
void ComputeTangentBasis(std::vector<Vertex> &vertices, std::vector<unsigned int> &indices);
void ComputeBox(std::vector<Vertex> &vertices,
std::vector<unsigned int> &indices,
glm::vec3 size,
bool rhcoords,
bool invertn) ;
void ComputeSphere(std::vector<Vertex> &vertices,
std::vector<unsigned int> &indices,
float diameter,
size_t tessellation,
bool rhcoords,
bool invertn);
void ComputeGeoSphere(std::vector<Vertex> &vertices,
std::vector<unsigned int> &indices,
float diameter,
size_t tessellation,
bool rhcoords);
void ComputeCylinder(std::vector<Vertex> &vertices,
std::vector<unsigned int> &indices,
float height,
float diameter,
size_t tessellation,
bool rhcoords);
void ComputeCone(std::vector<Vertex> &vertices,
std::vector<unsigned int> &indices,
float diameter,
float height,
size_t tessellation,
bool rhcoords);
void ComputeTorus(std::vector<Vertex> &vertices,
std::vector<unsigned int> &indices,
float diameter,
float thickness,
size_t tessellation,
bool rhcoords);
void ComputeTetrahedron(std::vector<Vertex> &vertices, std::vector<unsigned int> &indices, float size, bool rhcoords);
void ComputeOctahedron(std::vector<Vertex> &vertices, std::vector<unsigned int> &indices, float size, bool rhcoords);
void ComputeDodecahedron(std::vector<Vertex> &vertices, std::vector<unsigned int> &indices, float size, bool rhcoords);
void ComputeIcosahedron(std::vector<Vertex> &vertices, std::vector<unsigned int> &indices, float size, bool rhcoords);
void ComputeTeapot(std::vector<Vertex> &vertices,
std::vector<unsigned int> &indices,
float size,
size_t tessellation,
bool rhcoords);