-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewParameters.h
57 lines (53 loc) · 1.7 KB
/
ViewParameters.h
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
//
// Created by Maxwell James Omdal on 2/10/20.
//
#include <vector>
#include "GFX/Vector3D.h"
#include "GFX/Color.h"
#include "GFX/Point3D.h"
#include "GFX/Material.h"
#include "GFX/Scene/SceneObject.h"
#include "GFX/Scene/Light.h"
#include "GFX/Scene/Primitives/Primitive.h"
#include "GFX/PixelData.h"
#ifndef RAYCASTER_VIEWPARAMETERS_H
#define RAYCASTER_VIEWPARAMETERS_H
struct ViewParameters {
Point3D eye;
Vector3D viewDir;
Vector3D upDir;
float hFOV;
int widthPixels;
int heightPixels;
Color bkgColor;
Material mtlColor;
std::vector<PixelData> textureMaps;
std::vector<Primitive*> objects = std::vector<Primitive*>();
std::vector<Light*> lights = std::vector<Light*>();
Color I_dc = Color::Black();
float alpha_max = 1;
float alpha_min = 1;
float distance_max = 1000;
float distance_min = 1000;
float viewDist = -1;
bool textureEnabled = false;
std::vector<Point3D> vertexBuffer;
std::vector<Vector3D> indexBuffer;
std::vector<Material> polygonMaterialBuffer;
std::vector<Vector3D> vertexNormals;
std::vector<Point3D> textureCoordinates;
std::vector<int> smoothShadedTriangleIndexBuffer; // Index of the face in indexBuffer of a given triangle
std::vector<Vector3D> smoothShadedTriangleNormalIndexBuffer; // Normals indices for each vertex in a triangle. Corresponds to vertexNormals
std::vector<int> textureIndexBuffer;
std::vector<Vector3D> textureCoordinatesIndexBuffer;
std::vector<int> textureIndices;
~ViewParameters() {
for(auto & light : lights) {
delete light;
}
for(auto & shape : objects) {
delete shape;
}
}
};
#endif //RAYCASTER_VIEWPARAMETERS_H