-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconvenience.hpp
More file actions
105 lines (82 loc) · 2.05 KB
/
convenience.hpp
File metadata and controls
105 lines (82 loc) · 2.05 KB
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
95
96
97
98
99
100
101
102
103
#ifndef CON
#define CON
#endif
#ifndef DOBJ
#define DOBJ
#include "D_Object.hpp"
#endif
#ifndef SHADE
#define SHADE
#include "Shader.hpp"
#endif
#include <stdio.h>
#include <string.h>
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <iostream>
#include <glm/gtc/quaternion.hpp>
using namespace glm;
using namespace std;
using std::vector;
bool ReadFile(const char* file, string& out);
GLuint loadBMP_custom(const char * imagepath);
bool loadOBJ( const char* path,
vector<vec3> & out_verts,
vector<vec2> & out_uvs,
vector<vec3> & out_norms );
GLuint loadDDS(const char * path);
bool is_near(float v1, float v2);
// D_Object
bool getSimilarVertexIndex(
vec3 & in_vertex,
vec2 & in_uv,
vec3 & in_normal,
vector<vec3> & out_vertices,
vector<vec2> & out_uvs,
vector<vec3> & out_normals,
unsigned short & result
);
// D_Object
void indexVBO_slow(
vector<vec3> & in_vertices,
vector<vec2> & in_uvs,
vector<vec3> & in_normals,
vector<unsigned short> & out_indices,
vector<vec3> & out_vertices,
vector<vec2> & out_uvs,
vector<vec3> & out_normals);
// Text
void initText2D(const char * texPath);
void printText(const char * text, int x, int y, int size);
void cleanupText2D();
void compute_tangents( // Shader
vector<vec3> verts,
vector<vec2> uvs,
vector<vec3> norms,
vector<vec3> &tans,
vector<vec3> &bitans
);
void indexVBO_TBN( // Shader
vector<vec3> & in_vertices,
vector<vec2> & in_uvs,
vector<vec3> & in_normals,
vector<vec3> & in_tangents,
vector<vec3> & in_bitangents,
vector<unsigned short> & out_indices,
vector<vec3> & out_vertices,
vector<vec2> & out_uvs,
vector<vec3> & out_normals,
vector<vec3> & out_tangents,
vector<vec3> & out_bitangents
);
// D_Object
quat RotationBetweenVectors(vec3 start, vec3 dest);
quat RotateTowards(quat q1, quat q2, float maxAngle);
quat LookAt(vec3 direction, vec3 desiredUp);
bool loadModels(const char* path, std::vector<Model>& out_models);
bool getNextLine(FILE* file, char* line);