-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconf.hpp
82 lines (68 loc) · 1.64 KB
/
conf.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
#ifndef CONF_H
#define CONF_H
#include <glm/glm.hpp>
#include <util.hpp>
#include <vector>
#include <string>
#include <iostream>
#ifndef PI
#define PI 3.14169265358979f
#endif
struct NodeConf {
NodeConf();
glm::vec3 scale, tx, rot, ctr;
std::string name, parentName, shape, objFile, texName, matName;
};
struct TextureConf {
std::string fName;
std::string name;
};
struct CameraConf {
CameraConf();
glm::vec3 pos, fwd, up;
float yFov;
int width, height;
unsigned int density;
std::string outFile;
glm::vec3 ambient;
unsigned int rayIter, lSamp, mcIter;
};
struct LightConf {
LightConf();
glm::vec3 pos, color, dir;
float angle;
float radius;
int samp;
};
struct ShaderConf {
std::string vertFile;
std::string fragFile;
std::string name;
};
struct MatConf {
MatConf();
glm::vec3 diffCol, specCol;
float specExp, ior, mirr, trans, lEmit;
std::string name;
};
struct Config {
public:
Config();
Config(std::istream& inFile);
~Config();
std::vector<NodeConf> nodes;
std::vector<LightConf> lights;
std::vector<ShaderConf> shaders;
std::vector<TextureConf> textures;
std::vector<MatConf> materials;
CameraConf camera;
void config(std::istream& inFile);
private:
std::string config(std::istream& inFile, LightConf& conf);
std::string config(std::istream& inFile, CameraConf& conf);
std::string config(std::istream& inFile, NodeConf& conf);
std::string config(std::istream& inFile, ShaderConf& conf);
std::string config(std::istream& inFile, TextureConf& conf);
std::string config(std::istream& inFile, MatConf& conf);
};
#endif /* CONF_H */