-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscene.hpp
55 lines (42 loc) · 930 Bytes
/
scene.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
#ifndef TRAYCER_SCENE_HPP
#define TRAYCER_SCENE_HPP
#include <glm/glm/vec3.hpp>
#include "status.hpp"
#include "types.hpp"
#define MAX_LIGHT_COUNT 128
#define MAX_SPHERE_COUNT 128
#define MAX_TRIANGLE_COUNT 32768
struct Sphere {
glm::vec3 position;
glm::vec3 color_diffuse;
glm::vec3 color_specular;
float shininess;
float radius;
};
struct Vertex {
glm::vec3 position;
glm::vec3 color_diffuse;
glm::vec3 color_specular;
glm::vec3 normal;
float shininess;
};
struct Triangle {
Vertex vertices[3];
glm::vec3 normal;
float area;
};
struct Light {
glm::vec3 position;
glm::vec3 color;
};
struct Scene {
glm::vec3 ambient_light;
Light lights[MAX_LIGHT_COUNT];
uint light_count;
Sphere spheres[MAX_SPHERE_COUNT];
uint sphere_count;
Triangle triangles[MAX_TRIANGLE_COUNT];
uint triangle_count;
};
Status LoadScene(const char* filepath, Scene* scene);
#endif // TRAYCER_SCENE_HPP