-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParser.h
More file actions
50 lines (39 loc) · 1.14 KB
/
Copy pathParser.h
File metadata and controls
50 lines (39 loc) · 1.14 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
#ifndef PARSER__H_
#define PARSER__H_
#include <sstream>
#include <stack>
#include "Mat4.h"
#include "Scene.h"
// class Parser
// responsible for parsing scene description language from scene file
// and building a scene based on commands therein
// friend of Scene class to allow it to construct scenes
typedef class Parser
{
public:
Parser();
void buildSceneFromFile(Scene &scene, const std::string &filename);
private:
bool readvals(std::stringstream &s, float *dest, const int numvals);
void rightmult(const Mat4 &m, std::stack<Mat4> &t);
private:
float params[10]; //file read variables
std::stack<Mat4> transforms; //stack to store heirarchical transforms
std::vector<Vec3> verts;
unsigned int vertindex;
Mat4 global_inverse_translation; //inverse of global camera translation
Mat4 translation; //transformation matrices for primitives
Mat4 rotation;
Mat4 scale;
Mat4 inverse_translation;
Mat4 inverse_rotation;
Mat4 inverse_scale;
Vec3 attenuation; //attenuation for lights
Vec3 ambient; //material properties for primitives
Vec3 diffuse;
Vec3 specular;
Vec3 emission;
float shininess;
float roughness;
} Parser;
#endif