-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstd_data.h
More file actions
107 lines (91 loc) · 2.1 KB
/
std_data.h
File metadata and controls
107 lines (91 loc) · 2.1 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
104
105
106
#ifndef STANDARD_DATA_STRUCTURES_H
#define STANDARD_DATA_STRUCTURES_H
#include<iostream>
#include<glad/glad.h>
#include<GLFW/glfw3.h>
#include<vector>
#include<glm/glm.hpp>
#include<glm/gtc/matrix_transform.hpp>
#include<glm/gtc/type_ptr.hpp>
namespace eng {
typedef struct transform {
transform* parent = NULL;
glm::vec3 position = glm::vec3(0.0f);
glm::vec3 rotation = glm::vec3(0.0f);
glm::vec3 scale = glm::vec3(1.0f);
};
typedef struct camera_radians {
glm::vec3 position;
glm::vec3 rotation;
float fov;
float near_plane;
float far_plane;
bool isometric;
struct {
glm::vec3 target_position;
glm::vec3 target_rotation;
} data;
};
typedef struct camera_locked {
glm::vec3 position;
glm::vec3 look_target;
float fov;
float near_plane;
float far_plane;
bool isometric;
struct {
glm::vec3 target_position;
} data;
};
typedef struct mesh {
std::vector<GLfloat> positions;
std::vector<GLuint> indices;
std::vector<GLfloat> uvs;
std::vector<GLfloat> normals;
};
typedef struct model {
GLuint vao, texture, shader;
transform transform;
mesh mesh;
float texture_scale;
};
typedef struct debug_element {
GLuint vao, shader;
transform transform;
mesh mesh;
struct {
bool wireframe;
glm::vec3 draw_color;
} config;
};
typedef struct skybox {
GLuint vao, cubemap, shader;
mesh mesh;
};
typedef struct framebuffer_rgb {
GLuint id, vao, output, shader;
bool rasturized = false;
uint16_t width, height;
};
typedef struct directional_light {
glm::vec3 direction = glm::vec3(0.5f);
glm::vec3 color = glm::vec3(1.0f);
float power = 1.0f;
struct {
uint16_t _register = -1;
} registry;
};
typedef struct point_light {
glm::vec3 position = glm::vec3(0.0f);
glm::vec3 color = glm::vec3(1.0f);
float power = 1.0f;
float range = 1.0f;
struct {
uint16_t _register = -1;
} registry;
};
glm::vec2 vec2_lerp(glm::vec2 start_value, glm::vec2 end_value, float t);
glm::vec3 vec3_lerp(glm::vec3 start_value, glm::vec3 end_value, float t);
float perlin(float x, float y);
}
#endif // !STANDARD_DATA_STRUCTURES_H